0% found this document useful (0 votes)
5 views25 pages

Computer Networks and Protocols Overview

The document provides an overview of computer networks and protocols, detailing components of data communication, types of networks (LAN and WAN), and network topologies (mesh, star, bus, and ring). It discusses data flow modes (simplex, half-duplex, full-duplex) and performance criteria such as reliability and security. Additionally, it explains the TCP/IP protocol suite and the OSI model, emphasizing the importance of protocols in facilitating communication between devices.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views25 pages

Computer Networks and Protocols Overview

The document provides an overview of computer networks and protocols, detailing components of data communication, types of networks (LAN and WAN), and network topologies (mesh, star, bus, and ring). It discusses data flow modes (simplex, half-duplex, full-duplex) and performance criteria such as reliability and security. Additionally, it explains the TCP/IP protocol suite and the OSI model, emphasizing the importance of protocols in facilitating communication between devices.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

BEC702_Computer Networks and Protocols Module 1

MODULE1
Computer Networks and Protocols – BEC702
-----------------------------------------------------------------------------------------------------------------------------------
Introduction: Data communication: Components, Data representation, Data flow, Networks:
Network criteria, Physical Structures, Network types: LAN, WAN, Switching, The Internet.
Network Models:Protocol Layering: Scenarios, Principles, Logical Connections, TCP/IP Protocol
Suite: Layered Architecture, Layers in TCP/IP suite, Description of layers, Encapsulation and
Decapsulation, Addressing, Multiplexing and Demultiplexing, The OSI Model: OSI Versus
TCP/IP, Data-Link Layer: Introduction: Nodes and Links, Services, Two Categories’ of link, Sublayers, Link
Layer addressing:Types of addresses, ARP(1.1,1.2, 1.3.1to 1.3.4,2.2, 2.3 ,9.1, 9.2.1, 9.2.2 )
------------------------------------------------------------------------------------------------------------------------------
Data communication is the exchange of data between two devices via some form of transmission
medium such as a wire cable.

Explain in detail the five components of data communication system with neat diagram.

.IN
C
N
SY

1. Message. The message is the information (data) to be communicated. Popular forms of


information include text, numbers, pictures, audio, and video.

2. Sender. The sender is the device that sends the data message. It can be a computer,
U

workstation, telephone handset, video camera, and so on.


3. Receiver. The receiver is the device that receives the message. It can be a computer,
VT

workstation, telephone handset, television, and so on.


4. Transmission medium. The transmission medium is the physical path by which a
message travels from sender to receiver. Some examples of transmission media include
twisted-pair wire, coaxial cable, fiber-optic cable, and radio waves.
5. Protocol. A protocol is a set of rules that govern data communications. It represents an
agreement between the communicating devices. Without a protocol, two devices may be
connected but not communicating, just as a person speaking French cannot be understood
by a person who speaks only Japanese.

Explain the Communication between two devices with dataflow diagram.

Communication between two devices can be simplex,half-duplex,orfull-duplex.

Simplex
In simplex mode, the communication is unidirectional, as on a one-way street. Only one of the two
devices on a link can transmit; the other can only receive (see Figure 1.2a). Keyboards and traditional
monitors are examples of simplex devices.

[Link], Dept. of ECE, SCE, Bangalore Page1


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

Half-Duplex
In half-duplex mode, each station can both transmit and receive, but not at the same time. When one
device is sending, the other can only receive, and vice [Link]-talkies and CB (citizens band)

.IN
radios are both half-duplex systems.

Full-duplex
In full-duplex mode (also called duplex), both stations can transmit and receive simultaneously. In
C
full-duplex mode, signals going in one direction share the capacity of the link with signals going inthe
other direction. One common example of full-duplex communication is the telephone network. When
N
two people are communicating by a telephone line, both can talk and listen at the same time.
SY

NETWORKS

A network is the interconnection of a set of devices capable of communication.A device can be a


host or a connecting Device. A host can be large computer, desktop, laptop, workstation, cellular
U

phone, or security system. A connecting device can be a router, which connects the network to other
networks, a switch, which connects devices together, a modem (modulator-demodulator), which
VT

changes the form of data, and so on. In a network these devices are connected usingwired or wireless
transmission media such as cable or air.
Listtheperformancecriteriaofthe network.
A network must be able to meet a certain number of criteria. The most important of these are
performance, reliability, and security.
Performance:
The performance of a network depends on a number of factors, including the number of users, thetype
of transmission medium, the capabilities of the connected hardware, and the efficiency of the
software.

[Link], Dept. of ECE, SCE, Bangalore Page2


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

Performance can be measured in many ways, including transit time and response time. Transit time is
the amount of time required for a message to travel from one device to another. Response time is the
elapsed time between an inquiry and a response.
Performance is often evaluated by two networking metrics: throughput and delay. An efficient
network needs more throughput and less delay
Reliability:
Network reliability is measured by the frequency of failure, the time it takes a link to recover from a
failure, and the network’s robustness in a catastrophe.
Security:
Network security issues include protecting data from unauthorized access, protecting data from
damage and development, and implementing policies and procedures for recovery from breaches and
data losses.
TypesofNetworkConnection:
Anetwork is two or more devices connected through links. A link is a communications pathway that
transfers data from one device to another. There are two possible types of connections: point-to-point
and multipoint.

.IN
Point-to-Point:
Apoint-to-point connection provides a dedicated link between two devices. The entire capacity of the
link is reserved for transmission between those two devices. Point-to-point connections use an actual
length of wire or cable to connect the two ends or wireless links such as microwave or satellite links.
C
Eg. A point-to-point connection between the remote control and television’s control system.
Multipoint:
N
A multipoint connection is one in which more than two specific devices share a single link. In a
multipoint environment, the capacity of the channel is shared, either spatially or temporally (time
SY

shaerd) by several devices simultaneously.


U
VT

[Link], Dept. of ECE, SCE, Bangalore Page3


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

Network Physical Structures:


The term physical topology refers to the way in which a network is laid out physically. Two or more
devices connect to a link; two or more links form a topology. The topology of a network is the
geometric representation of the relationship of all the links and linking devices (usually called nodes)
to one another. There are four basic topologies possible: mesh, star, bus, and ring.
Mesh Topology:
In a mesh topology, every device has a dedicated point-to-point link to every other device. The term
dedicated means that the link carries traffic only between the two devices it connects. A fully
connected mesh topology network with n nodes require n(n-1) simplex links and n(n-1)/2 duplex
physical links. To accommodate these many links, every device on the network must have n–1
input/output (I/O) ports to be connected to the other n–1 stations.
Advantages:
(i) Eliminates traffic problem.
The use of dedicated links guarantees that each connection can carry its own data load,
thus eliminating the traffic problems that can occur when links must be shared bymultiple
devices.

.IN
(ii) A mesh topology is robust.
If one link becomes unusable, it does not incapacitate the entire system.
(iii) Mesh topology supports privacy or security.
When every message travels along a dedicated line, only the intended recipient sees it.
C
Physical boundaries prevent other users from gaining access to messages.
(iv) Finally, point-to-point links make fault identification and fault isolation easy.
N
Traffic can be routed to avoid links with suspected problems. This facility enables the
network manager to discover the precise location of the fault and aids in finding its cause
SY

and solution.
Disadvantages:
U
VT

The main disadvantages of a mesh are related to the amount of cabling and the number of I/O
ports required.

[Link], Dept. of ECE, SCE, Bangalore Page4


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

(i) Installation and reconnection are difficult, because every device must be connected to
every other device.
(ii) The sheer bulk of the wiring can be greater than the available space (in walls, ceilings, or
floors) can accommodate.
(iii) The hardware required to connect each link (I/Oports and cable)can be prohibitively
expensive.
One practical example of a mesh topology is the connection of telephone regional offices in which
each regional office needs to be connected to every other regional office.
Star Topology:
In a star topology, each device has a dedicated point-to-point link only to a central controller, usually
called a hub. The devices are not directly linked to one another. Unlike a mesh topology, a star
topology does not allow direct traffic between devices. The controller acts as an exchange: If one
device wants to send data to another, it sends the data to the controller, which then relays the data to
the other connected device (see Figure 1.5)
Advantages:

.IN
C
N
SY

(i) A star topology is less expensive and easy to install and reconfigure than a mesh
topology.
In a star, each device needs only one link and one I/O port to connect it to any number of
others. Far less cabling needs to be housed and additions, moves, and deletions involve
U

only one connection: between that device and the hub.


(ii) A star topology network is more robust and supports easy fault identification and fault
VT

isolation.
If one link fails, only that link is affected. All other links remain active. As long as thehub
is working, it can be used to monitor link problems and bypass defective links.
Disadvantages:
(i) One big disadvantage of a star topology is the dependency of the whole topology on one
single point, the hub. If the hub goes down, the whole system is dead.
(ii) Although a star requires far less cable than a mesh, each node must be linked to a central
hub. For this reason, often more cabling is required in a star than in some other topologies
(such as ring or bus).

[Link], Dept. of ECE, SCE, Bangalore Page5


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

[Link] star topology is used in local-area networks (LANs)and High-speed LANs.


Bus Topology:
A bus topology is a multipoint network. One long cable acts as a backbone to link all the devices in a
network (see Figure 1.6).
Nodes are connected to the bus cable by drop lines and taps. A drop line is a connection running

between the device and the main cable. A tap is a connector that either splices into the main cable or
punctures the sheathing of a cable to create a contact with the metallic core.
Advantages:
(i) Ease of installation.

.IN
(ii) Bus topology uses less cabling than mesh or star topologies.
Disadvantages:
(i) Difficult reconnection and fault isolation.
(ii) Difficult to add new devices.
(iii)
C
Signal reflection at the taps can cause degradation in quality.
(iv) Limits the number of devices and spacing of devices connected to a given length of cable.
N
(v) A fault or break in the bus cable stops all transmission, even between devices on the same
side of the problem.
SY

Ring Topology:
In a ring topology, each device has a dedicated point-to-point connection with only the two devices
on either side of it. A signal is passed along the ring in one direction, from device to device, until it
reaches its destination. Each device in the ring incorporates a repeater. When a device receives a
U

signal intended for another device, its repeater regenerates the bits and passes them along. Ring
topology was prevalent when IBM introduced its local-area network, Token Ring. Today, the need for
VT

higher-speed LANs has made this topology less popular.

[Link], Dept. of ECE, SCE, Bangalore Page6


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

Advantages:
(i) A ring is relatively easy to install and reconfigure.
(ii) To add or delete a device requires changing only two connections.
(iii) Fault isolation is simplified.
Disadvantages:
(i) Unidirectional traffic in the network.
(ii) In a simple ring, a break in the ring(such as a disabled station) can disable the entire
network.
NETWORKTYPES:
Networks are classified into two types as LAN (Local Area Network) and WAN (Wide Area
Network) on the basis of a few criteria such as size, geographical coverage, and ownership.
Local Area Network (LAN):
A local area network (LAN) is usually privately owned and connects some hosts in a single office,
building, or campus. Depending on the needs of an organization, a LAN can be as simple as two PCs
and a printer in someone’s home office, or it can extend throughout a company and include audio and
video devices.

.IN
Each host in a LAN has an identifier, an address, that uniquely defines the host in the LAN. Apacket
sent by a host to another host carries both the source host’s and the destination host’s addresses.
In the past, all hosts in a network were connected through a common cable, which meant that a
packet sent from one host to another was received by all hosts. The intended recipient keeps the
packet; the others drop the packet.
C
Today, most LANs use a smart connecting switch, which is able to recognize the destination address
N
of the packet and guide the packet to its destination without sending it to all other hosts. Figure 1.8
shows a LAN using either a common cable or a switch.
SY
U
VT

[Link], Dept. of ECE, SCE, Bangalore Page7


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

Wide Area Network (WAN):


A wide area network (WAN) is also an interconnection of devices capable of communication. AWAN
has a wider geographical span, spanning a town, a state, a country, or even the world. A LAN
interconnects hosts; a WAN interconnects connecting devices such as switches, routers, or modems.A
LAN is normally privately owned by the organization that uses it; a WAN is normally created and run
by communication companies and leased by an organization that uses it. There are two kinds of
WANs point-to-point WANs and switched WANs.
Point-to-Point WAN:
A point-to-point WAN is a network that connects two communicating devices through a transmission
media (cable or air). Figure 1.9 shows an example of a point-to-point WAN.
Switched WAN:

.IN
C
N
SY

A switched WAN is a network with more than two ends. A switched WAN is used in the backbone of
global communication today. A switched WAN is a combination of several point-to-point WANs that
U

are connected by switches. Figure 1.10 shows an example of a switched WAN.


Internetwork:
VT

When two or more networks are connected, they make an internetwork, or internet. As an example,
assume that an organization has two offices, one on the east coast and the other on the west coast.
Each office has a LAN that allows all employees in the office to communicate with each other. To
make the communication between employees at different offices possible, the management leases a
point-to-point dedicated WAN from a service provider, such as a telephone company, and connectsthe
two LANs. Now the company has an internetwork, or a private internet (with lowercase i).
Communication between offices is now possible. Figure 1.11 shows this internet.

[Link], Dept. of ECE, SCE, Bangalore Page8


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

When a host in the west coast office sends a message to another host in the same office, the router
blocks the message, but the switch directs the message to the destination. On the other hand, when a
host on the west coast sends a message to a host on the east coast, router R1 routes the packet torouter
R2, and the packet reaches the destination.
Switching:
An internet is a switched network in which a switch connects at least two links together. A switch

.IN
needs to forward data from a network to another network when required. The two most common types
of switched networks are circuit-switched and packet-switched networks.
Circuit-Switched Network:
In a circuit-switched network, a dedicated connection, called a circuit, is always available betweenthe
C
two end systems; the switch can only make it active or inactive. Figure 1.13 shows a very simple
switched network that connects four telephones to each end instead of computers as an end system
N
because circuit switching was very common in telephone networks in the [Link] Figure 1.13, the
fourtelephones at each side areconnected to aswitch. The switch connectsa telephone set atone side to
SY

a telephone set at the other side. The thick line connecting two switches is a high-capacity
communication line that can handle four voice communications at the same time; the capacity can be
shared between all pairs of telephone sets.
Packet-Switched Network:
U

In a computer network, the communication between the two ends is done in blocks of data called
VT

packets. The exchange of individual data packets between the two computers allows switches to
function for both storing and forwarding, because a packet is an independent entity that can be stored
and sent later.Figure1.14 shows a small packet-switched network that connects four computers at

[Link], Dept. of ECE, SCE, Bangalore Page9


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

onsite to four computers at the other site.A router in a packet-switched network has a queue that can
store and forward the packet.

If only two computers (one at each site) need to communicate with each other, there is no waiting for
the packets. However, if packets arrive at one router when the thick line is already working at its full
capacity, the packets should be stored and forwarded in the order they arrived. The two simple

.IN
examples show that a packet-switched network is more efficient than a circuit switched network, but
the packets may encounter some
The Internet:
Internet (uppercase I ), is composed of thousands of interconnected networks. Figure 1.15 shows a
C
conceptual (not geographical) view of the Internet. The figure shows the Internet as severalbackbones,
provider networks, and customer networks. At the top level, the backbones are large networks owned
N
by some communication companies such as Sprint, Verizon (MCI), AT&T, andNTT. The backbone
networks are connected through some complex switching systems, called peering points. At the
SY

second level, there are smaller networks, called provider networks, that use the services of the
backbones for a fee. The provider networks are connected to backbones and sometimes to other
provider networks. The customer networks are
PROTOCOLLAYERING:
U

Protocol:
In data communication and networking, a protocol defines the rules that both the sender and receiver
VT

and all intermediate devices need to follow to be able to communicate effectively.


Protocol Layering and its Advantages:
Protocol layering enables to divide a complex task into several smaller and simpler tasks. One of the
advantages of 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 and no need to care about how the layer is implemented. In Internet communication
happens not only with two end systems but also with much intermediate systems. Protocol layering
allows the intermediate systems to be simple with fewer layers.

[Link], Dept. of ECE, SCE, Bangalore Page10


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

Principles of Protocol Layering:


First Principle: In bidirectional communication, each layer should be able to perform two opposite
tasks, one in each direction.
Second Principle: The two objects under each layer at both sites should be identical.
TCP/IP PROTOCOL SUITE:
TCP/IP is a protocol suite (a set of protocols organized in different layers) used in the Internet today.
It is a hierarchical protocol made up of interactive modules, each of which provides a specific
functionality. The term hierarchical means that each upper level protocol is supported by the services
provided by one or more lower level protocols. The original TCP/IP protocol suite was defined as four
software layers built upon the hardware. Today, however, TCP/IP is thought of as a five-layer model.
Figure 2.4 shows both configurations.
Layered Architecture: Assume a small internet made up of three LANs (links), each with a link-layer
switch and the links are connected by one router, as shown in Figure 2.5. To show how the layers in
the TCP/IP protocol suite are involved in communication between two hosts

.IN
C
N
SY
U

Computer A communicates with computer B. As the figure shows, we have five communicating
devices in this communication: source host (computer A), the link-layer switch in link 1, the router,
VT

the link-layer switch in link 2, and the destination host (computer B). Each device is involved with a
set of layers depending on the role of the device in the internet. The two hosts are involved in all five
layers; the source host needs to create a message in theapplication layer and send it down the layers so
that it is physically sent to the destination host. The destination host needs to receive the
communication at the physical layer and then deliver it through the other layers to the application
layer.

[Link], Dept. of ECE, SCE, Bangalore Page11


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

.IN
The router is involved in only three layers; there is no transport or application layer in a router as long
as the router is used only for routing. Although a router is always involved in one network layer, it is
C
involved in n combinations of link and physical layers in which n is the number of links the router is
connected to. The reason is that each link may use its own data-link or physical protocol. Forexample,
N
in the above figure, the router is involved in three links, but the message sent from source A to
destination B is involved in two links. Each link may be using different link-layer and physical- layer
SY

protocols; the router needs to receive a packet from link 1 based on one pair of protocols and deliver it
to link 2 based on another pair of protocols.
Layers of TCP/IP Protocol Suite
Physical Layer:
U

Physical layer is responsible for carrying individual bits in a frame across the link. Physical layer is
the lowest layer in the TCP/IP protocol suite. The communication between two devices at the physical
VT

layer is still a logical communication because there is another, hidden layer, the transmission media,
under the physical layer. Two devices are connected by a transmission medium (cable or air). The
transmission medium does not carry bits; it carries electrical or optical signals. So the bits received in
a frame from the data-link layer are transformed and sent through the transmission media, but the
logical unit between two physical layers in two devices is a bit. There are several protocols that
transform a bit to a signal.
Data-linkLayer:
The data-link layer is responsible for taking the datagram and moving it across the link. The link can
be a wired LAN with a link-layer switch, a wireless LAN, a wired WAN, or a wireless WAN. Ineach
case, the data-link layer is responsible for moving the packet through the link. TCP/IP does not define
any specific protocol for the data-link layer. It supports all the standard and proprietary protocols. Any

[Link], Dept. of ECE, SCE, Bangalore Page12


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

protocol that can take the datagram and carry it through the link suffices for the network layer. The
major services of the protocols in data link layer are framing, error control and flow control. The data-
link layer takes a datagram and encapsulates it in a packet called a frame. Each link-layer protocol
may provide a different service. Some link-layer protocols provide complete error detection and
correction, some provide only error correction.
Network Layer:
The network layer is responsible for creating a connection between the source computer and the
destination computer. The communication at the network layer is host-to-host. However, since there
can be several routers from the source to the destination, the routers in the path are responsible for
choosing the best route for each packet. The network layer is responsible for host-to-host
communication and routing the packet through possible routes.
The network layer in the Internet includes the main protocol, Internet Protocol (IP), that defines the
format of the packet, called a datagram at the network layer. IP also defines the format and the
structure of addresses used in this layer. IP is also responsible for routing a packet from its source to
itsdestination, whichisachieved byeach routerforwarding thedatagram to thenextrouterinitspath. IP is a
connectionless protocol that provides no flow control, no error control, and no congestion control

.IN
services. The network layer also includes unicast (one-to-one) and multicast (one-to-many) routing
protocols. A routing protocol does not take part in routing (it is the responsibility of IP), but it creates
forwarding tables for routers to help them in the routing process. The network layer also has some
auxiliary protocols that help IP in its delivery and routing tasks. The Internet Control Message
C
Protocol (ICMP) helps IP to report some problems when routing a packet. The Internet Group
Management Protocol (IGMP) is another protocol that helps IP in multitasking. The Dynamic Host
N
Configuration Protocol (DHCP) helps IP to get the network-layer address for a host. The Address
Resolution Protocol (ARP) is a protocol that helps IP to find the link-layer address of a host or arouter
SY

when its network-layer address is given.


Transport Layer:
The logical connection at the transport layer is also end-to-end. The transport layer at the source host
gets the message from the application layer, encapsulates it in a transport layer packet (called a
U

segment (inTCP) or a user datagram (in UDP) in different protocols) and sends it, through the logical
(imaginary) connection, to the transport layer at the destination host. In other words, the transport
VT

layer is responsible for giving services to the application layer: to get a message from an application
program running on the source host and deliver it to the corresponding application program on the
destination host. There are a few transport-layer protocols like TCP, UDP and SCTP in the Internet,
each designed for some specific task.
Transmission Control Protocol (TCP), is a connection-oriented protocol that first establishes a logical
[Link]

[Link], Dept. of ECE, SCE, Bangalore Page13


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

between two TCPs for transferring a stream of bytes. TCP provides flow control (matching the
sending data rate of the source host with the receiving data rate of the destination host to prevent
overwhelming of data packets at the destination), error control (to guarantee that the segments arriveat
the destination without error and resending the corrupted ones), and congestion control to reducethe
loss of segments due to congestion in the network.
User Datagram Protocol (UDP), is a connectionless protocol that transmits user datagrams without
first creating a logical connection. In UDP, each user datagram is an independent entity without being
related to the previous or the next one (the meaning of the term connectionless). UDP is a simple
protocol that does not provide flow, error, or congestion control. Its simplicity, which means small
overhead, is attractive to an application program that needs to send short messages and cannot afford
the retransmission of the packets involved in TCP, when a packet is corrupted or lost.
Stream Control Transmission Protocol (SCTP) is designed to respond to new applications that are
emerging in the multimedia.
Application Layer:
The two application layers exchange messages between each other as though there were a bridge
between the two layers. Communication at the application layer is between two processes (two

.IN
programs running at this layer). To communicate, a process sends a request to the other process and
receives a response. Process-to-process communication is the duty of the application layer. The
application layer in the Internet includes many predefined protocols, but a user can also create a pairof
processes to be run at the two hosts. The Hypertext Transfer Protocol (HTTP) is a vehicle for
C
accessing the World Wide Web (WWW). The Simple Mail Transfer Protocol (SMTP) is the main
protocol used in electronic mail (e-mail) service. The File Transfer Protocol (FTP) is used for
N
transferring files from one host to [Link] Terminal Network (TELNET) and Secure Shell (SSH)
are used for accessing a site remotely. The Simple Network Management Protocol(SNMP) is used by
SY

an administrator to manage the Internet at global and local levels. The Domain Name System (DNS)is
used by other protocols to find the network-layer address of a computer. The Internet Group
Management Protocol (IGMP) is used to collect membership in a group.
Encapsulation and Decapsulation:
U

One of the important concepts in protocol layering in the Internet is encapsulation/decapsulation. The
process of encapsulation and decapsulation in a small internet is shown in Figure
VT

[Link], Dept. of ECE, SCE, Bangalore Page14


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

.IN
Encapsulation is the process of adding header to the message or payload that is received from itsupper
layer. Decapsulation is the process of removing header from the message or payload that is received
from its lower layer. In the source host the process of encapsulation alone happens, in the destination
host the process of Decapsulation only happens, and in the router the process of both encapsulation
C
and Decapsulation happens.
Encapsulation at the Source Host
N
At the source, only encapsulation happens
1. At the application layer, the data to be exchanged is referred to as a message. A message normally
SY

does not contain any header or trailer. The message is passed to the transport layer.
2. The transport layer takes the message as the payload, the load that the transport layer should take
care of. It adds the transport layer header to the payload, which contains the identifiers of the source
and destination application programs. The result is the transport-layer packet, which is called the
U

segment (in TCP) and the user datagram (in UDP). The transport layer then passes the packet to the
network layer.
VT

3. Thenetworklayertakesthetransport-layer packetasdataorpayload and addsitsown headerto the


payload. The header contains the addresses of the source and destination hosts and some more
information used for error checking of the header, fragmentation information, and so on. The result is
the network-layer packet, called a datagram. The network layer then passes the packet to the data-link
layer.
4. Thedata-linklayertakesthenetwork-layerpacketasdataorpayloadandaddsitsownheader, which
contains the link-layer addresses of the host or the next hop (the router). The result is the link- layer
packet, which is called a frame. The frame is passed to the physical layer for transmission.
Decapsulation and Encapsulation at the Router:
At the router, both decapsulation and encapsulation happens because the router is connected to two or
more links.

[Link], Dept. of ECE, SCE, Bangalore Page15


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

1. After the set of bits are delivered to the data-link layer, this layer decapsulates the datagram from
the frame and passes it to the network layer.
2. The network layer only inspects the source and destination addresses in the datagram header and
consults its forwarding table to find the next hop to which the datagram is to be delivered. The
contents of the datagram should not be changed by the network layer in the router unless there is a
need to fragment the datagram if it is too big to be passed through the next link. The datagram is then
passed to the data-link layer of the next link.
3. The data-link layer of the next link encapsulates the datagram in a frame and passes it to the
physical layer for transmission.
Decapsulation at the Destination Host:
At the destination host, each layer only decapsulates the packet received, removes the payload, and
delivers the payload to the next-higher layer protocol until the message reaches the application layer.
It is necessary to say that decapsulation in the host involves error checking.
Addressing:
Any communication that involves two parties needs two addresses: source address and destination
address. Figure shows the addressing at each layer. As the figure shows, there is a relationship

.IN
between the layer, the address used in that layer, and the packet name at that layer.
At the application layer, names are normally used to define the site that provides services, such as
[Link], or the e-mail address, such as somebody@[Link].
At the transport layer, addresses are called port numbers, and these define the application-layer
C
programs at the source and destination. Port numbers are local addresses that distinguish between
several programs running at the same time.
N
At the network-layer, the addresses are global(32 bit IP Address), with the whole Internet as the
scope. A network-layer address uniquely defines the connection of a device to the Internet.
SY

At the Data link Layer, the link-layer addresses, sometimes called MAC addresses(48 bit), are
locally defined addresses, each of which defines a specific host or router in a network (LAN orWAN).
U
VT

[Link], Dept. of ECE, SCE, Bangalore Page16


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1

Multiplexingand Demultiplexing
TCP/IP protocol suite uses several protocols at some layers, so it needs multiplexing at the source and
demultiplexing at the destination. Multiplexing in this case means that a protocol at a layer can
encapsulate a packet from several next-higher layer protocols (one at a time); demultiplexing means
that a protocol can decapsulate and deliver a packet to several next-higher layer protocols (one at a
time). Figure shows the concept of multiplexing and demultiplexing at the three upper layers.

.IN
Multiplexing at the source host:
At the transport layer, either UDP or TCP can accept a message from several application-layer
C
protocols. At the network layer, IP can accept a segment from TCP or a user datagram from UDP. IP
can also accept a packet from other protocols such as ICMP, IGMP, and so on. At the data-link layer,a
N
frame may carry the payload coming from IP or other protocols such as ARP.
Demultiplexing at the destination host:
SY

At the network layer, IP can decapsulate an IP datagram from a frame of data link layer and deliver a
segment to TCP or a user datagram to UDP. IP can also deliver a packet to other protocols such as
ICMP, IGMP, and so on. At the transport layer, either UDP or TCP can decapsulate a datagram or
segment and delivers a message to several application-layer protocols.
U

THE OSI MODEL


 An ISO standard that covers all aspects of network communications is the Open Systems
VT

Interconnection (OSI) model. It was first introduced in the late 1970s.


 An open system is a set of protocols that allows any two different systems to communicate
regardless of their underlying architecture.
 The purpose of the OSI model is to show how to facilitate communication between different
systems without requiring changes to the logic of the underlying hardware and software.
 The OSI model is not a protocol; it is a model for understanding and designing a network
architecture that is flexible, robust, and interoperable.
 The OSI model was intended to be the basis for the creation of the protocols in the OSI stack.
The OSI model is a layered frame work for the design of network systems that allows

[Link], Dept. of ECE, SCE, Bangalore Page17


Studied smart, not hard — thanks to [Link]
BEC702_Computer Networks and Protocols Module 1
Communication between all types of computer systems.
 It consists of seven separate but related layers, each of which defines a part of the process of
moving information across a network
OSI VS TCP/IP

 OSI model has 2 extra layers session and presentation layer

.IN
 These two layers were not added to TCP/IP protocol suite after the publication of
OSI model
 The application layer in TCP/IP is considered as a combination of 3 layers in OSI
model
C
 The 2 reasons for removing these layers in TCP/IP are:
1. TCP/IP has more than one transport layer protocols. Some of the functionalities
N
of session layer are available in some of the transport layer protocols
2. Many applications can be developed and added into the application layer. If some
SY

of the functionalities mentioned in session and presentation layers areneeded, then


they can be included in the application layer.
LACK OF OSI MODELS SUCCESS
U

 OSI model appeared after TCP/IP protocol suite


 Most experts felt this model would replace TCP/IP protocol
VT

 Butit did not happen due to 3 reasons:


1. OSI was completed when TCP/IP was fully in place and lot of time and money had
been spent on the suite ; changing it would cost a lot
2. Some layers in OSI model were never fully defined Eg: although services in
presentation and session layers were listed in the document, actual protocols for
these 2 layers were not fully defined and corresponding software were not fully
developed.
3. When OSI was implemented by an organization in a different application, it didnot
show high enough level of performance to entice the internet authority to switch
from TCP/IP protocol suite.

[Link], [Link], SCE, Bangalore Page 23

Studied smart, not hard — thanks to [Link]


BEC702_Computer Networks and Protocols Module 1

Data-Link Layer: INTRODUCTION


 The Internet is a combination of networks glued together by connecting devices (routers or

.IN
switches).
 If a packet is to travel from a host to another host, it needs to pass through these networks.
 Communication at the data-link layer is made up of five separate logical connections between the
data-link layers in the path.
C
 The data-link layer at Alice’s computer communicates with the data-link layer atrouter R2.
 The data-link layer at router R2 communicates with the data-link layer at router R4, and so on.
N
 Finally, the data-link layer at router R7 communicates with the data-link layer at Bob’s computer.
 Only one data-link layer is involved at the source or the destination, but two data-link
SY

layers are involved at each router.


 The reason is that Alice’s and Bob’s computers are each connected to a single network, but each
router takes input from one network and sends output to another network.
U

 For the sake of simplicity, although switches are also involved in the data-link-layer
communication, it is not shown in the figure.
VT

Nodes and Links


 Communication at the data-link layer is node-to-node. A data unit from one point in the
Internet needs to pass through many networks (LANs and WANs)to reach another point.

[Link], [Link], SCE, Bangalore Page 23

Studied smart, not hard — thanks to [Link]


BEC702_Computer Networks and Protocols Module 1

 These LANs and WANs are connected by routers. It is customary to refer to the two
End hosts and the routers as nodes and the networks in between as links.
 Figure 9.2 is a simple representation of links and nodes when the path of the data unit is only
six nodes.

.IN
 The first node is the source host; the last node is the destination host.
 The other four nodes are four routers.
 The first, the third, and the fifth links represent the three LANs; the second and the fourth
links represent the two WANs.
C
Services provided by data link layer are listed below
N
1. Framing
SY

 The first service provided by the data-link layer is framing.


 A packet at the data-link layer is normally called a frame.
 The data-link layer at each node needs to encapsulate the datagram (packet received from the
network layer) in a frame before sending it to the next node.
U

 The node also needs to de-capsulate the datagram from the frame received on the logical
channel.
VT

 A frame may have both a header and a trailer.


 Different data-link layers have different formats for framing.
2. Flow Control
 If the producer (sending host) produces items that cannot be consumed, accumulation of items
occurs.
 The sending data-link layer at the end of a link is a producer of frames; the receiving data-
link layer at the other end of a link is a consumer.
 If the rate of produced frames is higher than the rate of consumed frames, frames at the
receiving end need to be buffered while waiting to be consumed (processed).
 Definitely, we cannot have an unlimited buffer size at the receiving side.
 We have two choices.
o The first choice is to let the receiving data-link layer drop the frames if its buffer is
full.
o The second choice is to let the receiving data-link layer send a feedback to the
sending data-link layer to ask it to stop or slow down.
o Different data-link-layer protocols use different strategies for flow control.
3. Error Control
 At the sending node, a frame in a data-link layer needs to be changed to bits, transformed to
[Link], [Link], SCE, Bangalore Page 23

Studied smart, not hard — thanks to [Link]


BEC702_Computer Networks and Protocols Module 1
electromagnetic signals, and transmitted through the transmission media.
 At the receiving node, electromagnetic signals are received, transformed to bits, and put
together to create a frame.
 Since electromagnetic signals are susceptible to error, a frame is susceptible to error.
 The error needs first to be detected. After detection, it needs to be either corrected at the
receiver node or discarded and retransmitted by the sending node.
4. Congestion Control
 Although a link may be congested with frames, which may result in frame loss, most data-
link-layer protocols do not directly use a congestion control to alleviate congestion, although
some wide-area networks do.
 In general, congestion control is considered an issue in the network layer or the transport
layer because of its end-to-end nature.

LINK-LAYERADDRESSING

 IP addresses are the identifiers at the network layer that define the exact points in the Internet where the

.IN
source and destination hosts are connected.
 The source and destination IPaddresses define the two ends but cannot define which links the datagram
should pass through.
 The IP addresses in a datagram should not be changed. If the destination IP address in a datagram changes,
C
the packet never reaches its destination; if the source IP address in a datagram changes, the destination host
or a router can never communicate with the source if a response needs to be sent back or an error needs to be
N
reported back to the source
 The above discussion shows that there is a need for another addressing mechanism (i.e) link-layer
SY

addresses of the two nodes.


 A link-layer address is sometimes called a linkaddress or a physical address or a MAC address.
 Since a link is controlled at the data-link layer, the addreses need to be long to the data-link layer.
 When a datagram passes from the network layer to the data-link layer, the datagram will be encapsulated in a
U

frame and two data-link addresses are added to the frame header.
 These two addresses are changed every time the frame moves from one link to another.
VT

Consider an internet with three links and two routers as shown in figure. only two hosts: Alice (source) and Bob
(destination) have been shown
 For each host, there are two addresses, the IPaddresses (N) and the link-layer addresses (L).
 Note: a router has as many pairs of addresses as the number of links the router is connected
to.
 Three frames have been shown, one in each link.
 Each frame carries the same datagram with the same source and destination addresses (N1 and
N8), but the link-layer addresses of the frame change from link to link.
 In link1,the link-layer addresses are L1 and L2.
 In link2, they are L4 and L5.
 In link3, they are L7 and L8.
 Note that the IP addresses and the link-layer addresses are not in the same order. For
IPaddresses, the source address comes before the destination address; for link-layer
addresses,the destination address comes before the source

[Link], [Link], SCE, Bangalore Page 23

Studied smart, not hard — thanks to [Link]


BEC702_Computer Networks and Protocols Module 1

.IN
C
N
SY

Q1: How are the source and destination link-layer addresses determined for each link?
Answer: Again, each hop(router or host) should know its own link-layer address. The destination
link-layer address is determined by using the Address Resolution Protocol.
Three Types of addresses
U

Some link-layer protocols define three types of addresses: unicast, multicast, and broadcast.
Unicast Address
 Each host or each interface of a router is assigned a unicast address. Unicasting means
VT

one-to-one communication. A frame with a unicast address destination is destined only


for one entity in the link.
 The unicast link-layer addresses in the most common LAN, Ethernet, are 48 bits (six bytes)
that are presented as 12 hexadecimal digits separated by colons;
 For example, the following is a link-layer address of a computer.
A3:34:45:11:92:F1
Multicast Address
 Some link-layer protocols define multicast addresses. Multicasting means one-to-many
communication. However, the jurisdiction is local (inside the link).
 Multicast link-layer addresses in the most common LAN, Ethernet, are 48bits (sixbytes) that
are presented as 12 hexadecimal digits separated by colons.

[Link],[Link],SCE,Bangalore Page 24

Studied smart, not hard — thanks to [Link]


BEC702_Computer Networks and Protocols Module 1

 The second digit, however, needs to be an even number in hexadecimal.


 The following shows a multicast address:
A2:34:45:11:92:F1
Broadcast Address
 Some link-layer protocols define a broadcast address. Broadcasting means one-to-all
communication. A frame with a destination broadcast address is sent to all entities in the
link.
 Broadcast link-layer addresses in the most common LAN, Ethernet, are 48bits, all1s,
That are presented as12 hexadecimal digits separated by colons.
 The following shows a broadcast address:
FF:FF:FF:FF:FF:FF
Address Resolution Protocol(ARP)
 Any time a node has an IP datagram to send to another node in a link, it has the IPaddress of
the receiving node.
 The source host knows the IP address of the default router.

.IN
 Each router except the last one in the path gets the IP address of the next router by using
its forwarding table.
 The last router knows the IP address of the destination host.
 The IP address of the next node is not helpful in moving a frame through a link; it needs the
link-layer address of the next node.
C
 This is the time when the Address Resolution Protocol(ARP) becomes helpful
N
 The ARP protocol is one of the auxiliary protocols defined in the network layer to map an IP
address to a logical-link address.
SY

 ARP accepts an IP address from the IP protocol, maps the address to the
corresponding link-layer address, and passes it to the data-link layer
U
VT

 Anytime a host or a router needs to find the link-layer address of another host or routern in its
network, it sends an ARP request packet.
 The packet includes the link-layer and IP addresses of the sender and the IP address of
the receiver.
 Because the sender does not know the link-layer address of the receiver, the query is
Broadcast over the link using the link-layer broadcast address.
 Every host or router on the network receives and processes the ARP request packet, but only
the intended recipient recognizes its IP address and sends back an ARP response packet.
 The response packet contains the recipient’s IP and link-layer addresses.
 The packet is unicast directly to the node that sent the request packet.

[Link], [Link], SCE, Bangalore Page 28

Studied smart, not hard — thanks to [Link]


BEC702_Computer Networks and Protocols Module 1

.IN
C
N
SY

 In Figure 9.7a, the system on the left (A) has a packet that needs to be delivered to another
system (B) with IP address N2.
U

 System A needs to pass the packet to its data-link layer for the actual delivery, but it does
not know the physical address of the recipient.
VT

 It uses the services of ARP by asking the ARP protocol to send a broadcast ARP request
packet to ask for the physical address of a system with an IP address of N2.
 This packet is received by every system on the physical network, but only system B will
Answer it, as shown in Figure 9.7b.
 System B sends an ARP reply packet that includes its physical address.
 Now system A can send all the packets it has for this destination using the physical address
it received.
Caching
A question that is often asked is this: If system A can broadcast a frame to find the link
layer address of system B, why can’t system A send the datagram for system Busing a
broadcast frame?
 In other words, instead of sending one broadcast frame (ARP request), one unicast frame
(ARP response), and another unicast frame (for sending the datagram), system A can
encapsulate the datagram and send it to the network.
 System B receives it and keep it; other systems discard it.
 To answer the question, we need to think about the efficiency.
 It is probable that system A has more than one datagram to send to system B in a short
period of time.
 For example, if system B is supposed to receive a long e-mail or a long file, the data do
[Link],not fit in one datagram.
[Link], SCE, Bangalore Page 28

Studied smart, not hard — thanks to [Link]


BEC702_Computer Networks and Protocols Module 1

 Let us assume that there are 20 systems connected to the network (link): system A,
system B, and 18 other systems.
 We also assume that system A has 10 datagrams to send to system B in one second.
a. Without using ARP, system A needs to send 10 broadcast frames. Each of the 18 other
systems need to receive the frames, decapsulate the frames, remove the datagram and pass
it to their network-layer to find out the datagrams do not belong to them. This means
processing and discarding 180 broadcast frames.
b. Using ARP, system A needs to send only one broadcast frame. Each of the 18 other
systems need to receive the frames, decapsulate the frames, remove the ARP message and
pass the message to their ARP protocol to find that the frame must be discarded. This
means processing and discarding only 18 (instead of 180) broadcast frames. After system B
responds with its own data-link address, system A can store the link- layer address in its
cache memory. The rest of the nine frames are only unicast. Since processing broadcast
frames is expensive (time consuming), the first method is preferable.
ARP Packet Format
 Figure9.8 shows the format of an ARP packet.

.IN
 The names of the fields are self explanatory. The hardware type field defines the type
of the link-layer protocol. Ethernet is given the type 1.
 The protocol type field defines the network-layer protocol: IPv4 protocol is (0800)16.
 The source hardware and source protocol addresses are variable-length fields
C
defining the link-layer and network-layer addresses of the sender.
 The destination hardware address and destination protocol address fields define the
N
receiver link-layer and network-layer addresses.
 An ARP packet is encapsulated directly into a data-link frame.
SY

 The frame needs to have a field to show that the payload belongs to the ARP and not
to the network-layer datagram.
U
VT

[Link], [Link], SCE, Bangalore Page 28

Studied smart, not hard — thanks to [Link]

You might also like