Unit I
Unit I
COMPUTER NETWORKS
UNIT I INTRODUCTION AND APPLICATION LAYER
• The way in which data is transmitted from one device to another device is
known as transmission mode.
• The transmission mode is also known as the communication mode.
• Each communication channel has a direction associated with it, and
transmission media provide the direction.
• Therefore, the transmission mode is also known as a directional mode.
Simplex
• In Simplex mode, the communication is unidirectional, i.e., the data flow in one direction.
• A device can only send the data but cannot receive it or it can receive the data but cannot send
the data.
• This transmission mode is not very popular as mainly communications require the two-way
exchange of data.
• The simplex mode is used in the business field as in sales that do not require any corresponding
reply.
• Keyboard and Monitor are the examples of the simplex mode as a keyboard can only accept the
data from the user and monitor can only be used to display the data on the screen.
HALF-DUPLEX MODE
• In Full duplex mode, the communication is bi-directional, i.e., the data flow
in both the directions.
• Both the stations can send and receive the message simultaneously.
• The most common example of the full-duplex mode is a Telephone network.
When two people are communicating with each other by a telephone line,
both can talk and listen at the same time.
Figure 1.2 Data flow (simplex, half-duplex, and full-duplex)
NETWORK TOPOLOGY
• Topology is defined as
• (1) The way in which a network is laid out physically.
• (2) The geometric representation of the relationship of all the
links and nodes to one-another.
TYPES OF NETWORK TOPOLOGY
1. Point to Point Topology
2. Mesh Topology
3. Star Topology
4. Bus Topology
5. Ring Topology
6. Tree Topology
7. Hybrid Topology
Point to Point Topology
• Low-cost cable:
In bus topology, nodes are directly connected to the cable without passing
through a hub. Therefore, the initial cost of installation is low.
• Familiar technology:
Bus topology is a familiar technology as the installation and troubleshooting
techniques are well known, and hardware components are easily available.
• Limited failure:
A failure in one node will not have any effect on other nodes.
• Disadvantages of Bus topology:
• Star
topology is an arrangement of the network in which
every node is connected to the central hub, switch or a
central computer.
• The central computer is known as a server, and the
peripheral devices attached to the server are known
as clients.
• Coaxialcable or RJ-45 cables are used to connect the
computers.
• Hubsor Switches are mainly used as connection devices in
a physical star topology.
• Startopology is the most popular topology in network
implementation.
Advantages of Star topology
• Efficient troubleshooting: Troubleshooting is quite efficient
in a star topology as compared to bus topology.
• In a bus topology, the manager has to inspect the kilometers
of cable. In a star topology, all the stations are connected
to the centralized network.
• Therefore, the network administrator has to go to the
single station to troubleshoot the problem.
•Wired Personal Area Network: A wired personal area network is constructed using
• Advantages of PAN
• Disadvantages of PAN
• Low network coverage area/range.
• Limited to relatively low data rates.
• Devices are not compatible with each other.
2. Local Area Network (LAN)
• High Speed: LAN offers a much higher speed(around 100 mbps) and
data transfer rate comparatively to WAN.
• Disadvantages of LAN
• Advantages of MAN
MAN offers high-speed connectivity in which the speed ranges from
10-100 Mbps.
The security level in MAN is high and strict as compared to
WAN.
• Disadvantages of MAN
The architecture of MAN is quite complicated hence, it is hard to
design and maintain.
5. Wide Area Network (WAN)
• Disadvantages of WAN
• Traffic congestion in Wide Area Network is very high.
• Noise and error are present in large amount due to multiple
connection point.
PROTOCOL LAYERING
• In networking, a protocol defines the rules that both the sender and
receiver and all intermediate devices need to follow to be able to
communicate effectively.
• A protocol provides a communication service that the process use to
exchange messages.
• When communication is simple, we may need only one simple
protocol.
• When the communication is complex, we may need to divide the
task between different layers, in which case we need a protocol at
each layer, or protocol layering.
• Protocol layering is that it allows us to separate the services from
the implementation.
• A layer needs to be able to receive a set of services from the
lower layer and to give the services to the upper layer.
• Any modification in one layer will not affect the other layers.
First Scenario
• Let us consider two simple scenarios to better understand the need
for protocol layering
• First Scenario:
• In the first scenario, communication is so simple that it can
occur in only one layer.
• Assume Maria and Ann are neighbors with a lot of common ideas.
• Communication between Maria and Ann takes place in one layer,
face to face, in the same language, as shown in Figure 2.1.
• Even in this simple scenario, we can see that a set of rules
needs to be followed.
• First, Maria and Ann know that they should greet each other
when they meet.
• Second, they know that they should confine their vocabulary
to the level of their friendship.
• Third, each party knows that she should refrain from
speaking when the other party is speaking.
• Fourth, each party knows that the conversation should be a
dialog, not a monolog: both should have the opportunity to
talk about the issue.
• Fifth, they should exchange some nice words when they leave
Second scenario
• In the second scenario, we assume that Ann is offered a
higher-level position in her company, but needs to move to
another branch located in a city very far from Maria.
• The two friends still want to continue their communication
and exchange ideas because they have come up with an
innovative project to start a new business when they
both retire.
• They decide to continue their conversation using regular
mail through the post office.
• they do not want their ideas to be revealed by other people.
• They agree on an encryption/decryption technique.
• The sender of the letter encrypts it to make it unreadable
by an intruder; the receiver of the letter decrypts it to get
the original letter.
• Assume that Maria and Ann use one technique that makes it
hard to decrypt the letter if one does not have the key for
doing so. Now we can say that the communication between
Maria and Ann takes place in three layers, as shown in
Figure 2.2.
• We assume that Ann and Maria each have three machines (or
robots) that can perform the task at each layer.
• The third layer machine listens to what Maria says and
creates the plaintext (a letter in English), which is passed
by the second layer machine.
• The second layer machine takes the plaintext, encrypts it,
and creates the ciphertext, which is passed by the first
layer machine.
• The first layer machine puts it in an envelope, adds the
sender and receiver addresses, and mails it.
• Protocol layering enables us to divide a complex task into
several smaller and simpler tasks.
• Basic Elements of Layered Architecture
• Service: It is a set of actions that a layer provides to the
higher layer.
• Protocol: It defines a set of rules that a layer uses to
exchange the information with peer entity. These rules mainly
concern about both the contents and order of the messages
used.
• Interface: It is a way through which the message is
transferred from one layer to another layer.
• Features of Protocol Layering
• 1. It decomposes the problem of building a network
into more manageable components.
• 2. It provides a more modular design.
Principles of Protocol Layering
• 1. The first principle dictates that if we want bidirectional communication,
we need to make each layer so that it is able to perform two opposite tasks,
one in each direction.
• For example, the third layer task is to listen (in one
direction) and talk (in the other direction). The second layer
needs to be able to encrypt and decrypt. The first layer
needs to send and receive mail.
• 2. The second principle that we need to follow in protocol layering is that the
two objects under each layer at both sites should be identical.
• For example, the object under layer 3 at both sites should be
a plaintext letter. The object under layer 2 at both sites
should be a ciphertext letter. The object under layer 1 at
both sites should be a piece of mail.
Logical Connection
1. PHYSICAL LAYER
• The physical layer is responsible for carrying individual bits in a frame
across the link.
• Although the physical layer is the lowest level in the tcp/ip protocol
suite.
• The physical layer coordinates the functions required to transmit a bit
stream over a physical medium.
• This layer is responsible for the delivery of packets from source to destination.
• It determines the best path to move data from source to the destination based on
the network conditions, the priority of service, and other factors.
• The other responsibilities of this layer are
• Logical addressing - If a packet passes the network boundary, we need
another addressing system for source and destination called logical address. This
addressing is used to identify the device on the internet.
• Routing – Routing is the major component of the network layer, and it
determines the best optimal path out of the multiple paths from source to the
destination.
4. TRANSPORT LAYER
• This layer enables the user to access the network. It handles issues such as
network transparency, resource allocation, etc. This allows the user to log on
to remote user.
• The other responsibilities of this layer are
• FTAM (File Transfer, Access, Management) - Allows user to access files
in a remote host.
• Mail services - Provides email forwarding and storage.
• Directory services - Provides database sources to access information about
various sources and objects.
Introduction to Sockets
https://www.geeksforgeeks.org/url-full-form
https://www.geeksforgeeks:80/filename
Web Documents
• The documents in the WWW can be grouped into three broad
categories: static, dynamic, and active.
Static Documents
• Static documents are fixed-content documents that are
created and stored in a server.
• The client can get a copy of the document only.
• The contents in the server can be changed, but the user
cannot change them. When a client accesses the document,
a copy of the document is sent.
• Static documents are prepared using one of several
languages:
• HyperText Markup Language (HTML), Extensible Markup
Language (XML), Extensible Style Language (XSL), and
Extensible Hypertext Markup Language (XHTML).
Dynamic Documents
• A dynamic web document does not exist in a predefined form.
• When a request arrives the web server runs an application
program that creates the document.
• The server returns the output of the program as a response
to the browser that requested the document.
• Because a fresh document is created for each request,
the contents of a dynamic document may vary from
one request to another.
• Scripting languages such as Java Server Pages (JSP), which
uses the Java language for scripting, or Active Server Pages
(ASP), a Microsoft product that uses Visual Basic language for
scripting,
Active Documents
• For many applications, we need a program or a script to
be run at the client site. These are called active
documents.
• For example, suppose we want to run a program that
creates animated graphics on the screen or a program
that interacts with the user.
• The program definitely needs to be run at the client site
where the animation or interaction takes place.
• When a browser requests an active document, the server
sends a copy of the document or a script.
• The document is then run at the client (browser) site.
HyperText Transfer Protocol (HTTP)
• Connectionless protocol:
• HTTP is a connectionless protocol. HTTP client initiates a
request and waits for a response from the server.
• When the server receives the request, the server processes
the request and sends back the response to the HTTP client
after which the client disconnects the connection.
• The connection between client and server exist only
during the current request and response time only.
• Stateless:
• HTTP is a stateless protocol as both the client and server
know each other only during the current request.
• Due to this nature of the protocol, both the client and
server do not retain the information between various
requests of the web pages.
• HTTP Connections
1.Non-Persistent
2.Persistent
Nonpersistent versus Persistent Connections
• FTP OBJECTIVES
• It provides the sharing of files.
• It is used to encourage the use of remote computers.
• It transfers the data more reliably and efficiently.
• The above figure shows the basic model of the FTP.
• The FTP client has three components:
• user interface, control process, and data transfer process.
• The server has two components:
• server control process and server data transfer process.
• The FTP protocol was designed when security was not a big
issue.
• Although FTP requires a password, the password is sent in
plaintext (unencrypted), which means it can be intercepted
and used by an attacker.
• The data transfer connection also transfers data in plaintext,
which is insecure.
• To be secure, one can add a Secure Socket Layer between
the FTP application layer and the TCP layer. In this case FTP is
called SSL-FTP.
ELECTRONIC MAIL
• Features of MIME –
1.It is able to send multiple attachments with a single message.
2.Unlimited message length.
3.Binary attachments (executables, images, audio, or video files)
may be divided if needed.
4.MIME provided support for varying content types and multi-part
messages.
• MIME transforms non-ASCII data at the sender site to ASCII
data and delivers it to the client MTA to be sent through the
Internet.
• The message at the receiving site is transformed back to
the original data.
• We can think of MIME as a set of software functions that
transforms non-ASCII data to ASCII data and vice versa, as
shown in Figure 26.18.
Domain Name System (DNS)
• TCP/IP protocols use the IP address, which uniquely
identifies the connection of a host to the Internet.
However, people prefer to use names instead of numeric
addresses.
• Therefore, the Internet needs to have a directory system that
can map a name to an address.
• Domain Name System (DNS) is a hostname used for IP
address translation services.
• DNS is a distributed database implemented in a hierarchy of
name servers.
• It is an application layer protocol for message exchange
between clients and servers.
• It is required for the functioning of the Internet.
• What is the Need for DNS?
• Every host is identified by the IP address but remembering
numbers is very difficult for people also the IP addresses
are not static therefore a mapping is required to change the
domain name to the IP address.
• SoDNS is used to convert the domain name of the
websites to their numerical IP address.
A user wants to use a file transfer client to access the corresponding file transfer server
running on a remote host
The TCP/IP suite needs the IP address of the file transfer server to make the connection.
The following six steps map the host name to an IP address:
1. The user passes the host name to the file transfer client.
2. The file transfer client passes the host name to the DNS client.
3. The DNS client sends a message to a DNS server with a query that gives the file transfer
server name using the known IP address of the DNS server.
4. The DNS server responds with the IP address of the desired file transfer server.
5. The DNS server passes the IP address to the file transfer client.
6. The file transfer client now uses the received IP address to access the file transfer server.
• Types of Domain
• There are various kinds of domains:
• Generic
Domains: .com(commercial), .edu(educational), .mil(military)
, .org(nonprofit organization), .net(similar to commercial) all
these are generic domains.
• Country Domain: .in (India) .us .uk
• Inverse Domain: if we want to know what is the domain
name of the website. IP to domain name mapping. (eg:-
165.21.168.192.in-addr.arpa.)
Namespace/DNS Namespace
• A namespace is a context within which the names of all objects
must be unambiguously resolvable.
• Domain namespace refers to the hierarchical structure used for
organizing and identifying domain names on the Internet.
• It allows unique names to be assigned to websites and
resources.
• The domain namespace is composed of different levels, including
i.root
ii.top-level domains (TLDs)
iii. second-level domains
iv. subdomains.
Security of DNS
• Limitation of SNMP
• It is too simple and does not scale well.