Download as pdf or txt
Download as pdf or txt
You are on page 1of 96

1 CN(18EC71)

COMPUTER COMMUNICATION NETWORK (VTU) – 18EC71

MODULE - 1
Introduction: Data Communications: Components, Representations, Data Flow, Networks: Physical
Structures, Network Types: LAN, WAN, Switching, 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, Categories of link, Sublayers, Link Layer
addressing: Types of addresses, ARP. Data Link Control (DLC) services: Framing, Flow and Error Control,
Data Link Layer Protocols: Simple Protocol, Stop and Wait protocol, Piggybacking.

TEXT BOOKS:
1. Data Communication and Networking, B Forouzan, 5th Ed, TMH 2006.
2. Computer Networks, James F. Kurose, Keith W. Ross: Pearson education, 2nd Edition, 2003.
3. Introduction to Data communication and Networking, Wayne Tomasi: Pearson education 2007.

Quotes:

 Change is hard at first, messy in the middle and gorgeous at the last.
 Forget what hurt you, but never forget what it taught you.
 People change, love hurts, friends leave, things go wrong. But just remember that life goes on.
 Effort is important but where to make an effort makes all the difference.
 All my life I thought air was free, until I bought a bag of chips.
 People won’t remember days but they remember the moments with you.
2 CN(18EC71)

Introduction:
 History:
 We have migrated from industrial revolution (18th century) to age of steam engine
(19th century), and to information gathering, processing and distribution (20th
century).
 In computer era, we have migrated from a single computer serving all organizations
to computer networks.
 The word data refers to information presented in whatever form is agreed upon by the
parties creating and using the data.
 Definition: Data communications is the exchange of data between two devices via some
form of transmission medium such as a wire cable.
 Data communications and networking are changing the way we live.
 Computer Communication Network (CCN) deals with four major concepts. They are
1. Data communications
2. Networking
3. Protocols and standards
4. Networking models.
 Networks exist so that data may be sent from one place to another which is the basic
concept of data communications.
 Data communications between remote parties can be achieved through a process called
networking.
 Protocols and standards are vital to the implementation of data communications and
networking.
 Protocol:
 Protocols refer to the set of rules and regulations that govern data communications.
 The key elements of a protocol are:
 Syntax:
 It refers to the structure/format of the data, i.e., the order in which the data
must be presented.
 Ex.: A simple protocol may expect the first 8 bits of data to be the address
of the sender, the second 8 bits to be the address of the receiver, and the rest
of the stream to be the message/date.

3 CN(18EC71)

 Semantics:
 Semantics refers to the meaning of each section of bits. It specifies how a
particular bit pattern to be interpreted, and what action to be taken based on
the interpretation.
 Ex.: does an address identify the route to be taken or is the final destination
of the message.
 Timing:
 Timing refers to two characteristics:
 When the data should be sent and
 How fast the data can be sent.
 Ex.: if a sender produces a data at a rate of 1Mbps and the receiver can
process the date at a rate of only 0.5 Mbps, then the transmission will
overload the receiver and same data will be lost.
 Standard:
 A standard is a protocol that has been adopted by vendors and manufacturers.
 There are 2 types Data Communication standards:
 de facto:
 Standards that have not been approved by an organized body but
have been adopted as standard through widespread use.
 These are originally established by manufacturer who seeks to
define the functionality of new product/technology.
 de jure:
 Standards that have been legislated by an officially recognized
body.
 Network models serve to organize, unify, and control the hardware and software
components of data communications and networking.
 Network:
 Definition: A network is a set of devices (computers, printers, mobile etc)
connected by media links.
 It is a combination of hardware and software that sends data from one location to
another.
 The hardware consists of the physical equipment that carries signals from one point
of the network to another.
4 CN(18EC71)

 The software consists of instruction sets that make possible the services that we
expect from a network.
 Computer networks are very complex object; hence it is partitioned into vertical set
of levels, each level called layer.
 Perspective:
 Network users: services that their applications need e.g., guarantee that each
message it sends will be delivered without error within a certain amount of time
 Network designers: cost-effective design e.g., that network resources are
efficiently utilized and fairly allocated to different users
 Network providers: system that is easy to administer and manage e.g., that faults
can be easily isolated and it is easy to account for usage.
 Advantages of Networking:
 Resources Sharing like File Sharing, Peripheral Sharing, Software Sharing with
multi-user licenses.
 Shared Internet Access
 Calculations Distribution

Data Communications:
 Definition: “Data communications are the exchange of data between two devices via some
form of transmission medium such as a wire cable”.
 To realize data communications to occur, the communicating devices must be part of a
communication system made up of a combination of hardware and software.
 The effectiveness of a data communications system depends on four fundamental
characteristics:
1. Delivery:
 The system must deliver data to the correct destination.
 Data must be received by the intended device/user and only by that
device/user.
2. Accuracy:
 The system must deliver the data accurately.
 Data that have been altered in transmission and left uncorrected are
unusable.
5 CN(18EC71)

3. Timeliness:
 The system must deliver data in a timely manner. Data delivered late are
useless.
 In the case of video and audio, timely delivery means delivering data as they
are produced maintaining the order, and without significant delay and is
called real-time transmission.
4. Jitter:
 Jitter refers to the variation in the packet arrival time.
 It is the uneven delay in the delivery of audio or video packets.
 Scenario: video packets are sent every 30 ms. If some of the packets arrive
with 30 ms delay and others with 40 ms delay, quality of the video gets
distracted.

Components:
 A data communications system has five components

Figure: Five components of data communication

 Message:
 The message is the information/data to be communicated.
 Basic forms of information include text, numbers, pictures, audio, and video.
 Sender:
 The sender is the device that sends the data message.
 It can be a computer, workstation, telephone handset, video camera, and so on.
 Receiver:
 The receiver is the device that receives the message.
 It can be a computer, workstation, telephone handset, television, and so on.
6 CN(18EC71)

 Transmission medium:
 The transmission medium is the physical path by which a message travels from
sender to receiver.
 Ex: twisted-pair wire, coaxial cable, fiber-optic cable, and radio waves.
 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.

Data Representation:
 All types of multimedia information are process and store within the computer in a digital
form.
1. Text:
 Text contains strings of characters entered through keyboard.
 Characters are represented as a bit pattern, a sequence of bits (0s or 1s).
 Different sets of bit patterns have been designed to represent text symbols.
 Codeword: each character represented by a unique combination of fixed number of bits.
Complete text hence, can be represented by strings of codewords.
 Ex:
 Unicode uses 32 bits to represent a symbol or character used in any language
in the world.
 American Standard Code for Information Interchange (ASCII), developed
by United States, constitutes the first 127 characters in Unicode and is also
referred to as Basic Latin.

2. Numbers:
 Numbers are also represented by bit patterns.
 The number are directly converted to a binary representation to simplify mathematical
operations.
 There are various types of numbering systems like decimal, hexadecimal, octal etc.
7 CN(18EC71)

3. Images:
 Definition: “An image is an artifact that depicts or records visual perception”.
 Images are also represented by bit patterns.
 In its simplest form, an image is composed of a matrix of pixels (picture elements),
where each pixel is a small dot.
 The size of the image depends on the resolution and pixel depth.
 Ex: an image can be divided into 1000 pixels or 10,000 pixels.
 In the second case, there is a better representation of the image (better resolution), but
more memory is needed to store the image.
 After an image is divided into pixels, each pixel is assigned a bit pattern. The size and
the value of the pattern depend on the pixel depth (number bits per pixel).
 For an image made of only black-and-white dots (e.g., a chessboard), a 1-bit pattern is
enough to represent a pixel.
 If an image is not made of pure white and pure black pixels, we can increase the size of
the bit pattern to include gray scale.
 Ex: to show four levels of gray scale, we can use 2-bit patterns. A black pixel can be
represented by 00, a dark gray pixel by 01, a light gray pixel by 10, and a white pixel by
11.
 There are several methods to represent color images.
 RGB:
 So called because each color is made of a combination of three primary colors:
red, green, and blue.
 The intensity of each color is measured, and a bit pattern is assigned to it.
 Black is produced when all three primary colors Red (R), Green (G), and Blue
(B) are zero particularly useful for producing a color image on a black surface,
as is the case in display application.
 This type of color representation is also called as additive color mixing.
 YCM:
 In this type a color is made of a combination of three other primary colors:
yellow, cyan, and magenta.
8 CN(18EC71)

 White is produced, when the 3 chosen primary colors cyan (C), Magenta (M),
and Yellow (Y) are all zero these colors are particularly useful for producing a
color image on a white surface as in, printing applications.
 This type of color representation is also called as subtractive color mixing.
4. Audio:
 Definition1: sound within the range of human hearing.
 Definition2: Audio is sound within the acoustic range available to humans.
 Audio refers to the recording or broadcasting of sound or music.
 It is continuous, not discrete.
 We use a microphone to change voice or music to an electric signal, creates a continuous
signal.

5. Video:
 Definition: Correlated sequence of images with respect to time.
 Video refers to the recording or broadcasting of a picture or movie. Video can either be
produced as a continuous entity (e.g., by a TV camera), or it can be a combination of
images, each a discrete entity, arranged to convey the idea of motion.

Data Flow:
 Transfer of information streams or communication between two systems associated with
an application can be in 5 modes:
1. Simplex
2. Half-duplex (Two-way alternate)
3. Duplex (Two-way simultaneous)
4. Broadcast
5. Multicast
1. Simplex:
9 CN(18EC71)

 Information associated with the application flows in one direction only.


 Only one of the two devices on a link can transmit; the other can only receive.
 Exs.:
1. Keyboards and traditional monitors are examples of simplex devices. The key-
board can only introduce input; the monitor can only accept output.
2. Transmission of photographic images from a deep-space probe at predetermined
times Involves unidirectional flow of information from the probe to an earth station.
 The simplex mode can use the entire capacity of the channel to send data in one direction.

2. Half-duplex (Two-way alternate):

 Information flows in both directions but, alternatively.


 each station can both transmit and receive, but not at the same time.
 Ex.:
1. Walkie-talkies and CB (citizens band) radios
2. User making a request for some information form a remote server, which returns
the requested information.
 The half-duplex mode is used in cases where there is no need for communication in both
directions at the same time; the entire capacity of the channel can be utilized for each
direction.

3. Full Duplex (Two-way simultaneous):


10 CN(18EC71)

 Also called duplex where both stations can transmit and receive simultaneously.
 In full-duplex mode, signals going in one direction share the capacity of the link with
signals going in the other direction.
 This sharing can occur in two ways:
 the link must contain two physically separate transmission paths, one for sending and the
other for receiving
 The capacity of the channel is divided between signals traveling in both directions.
 Ex.:
1. Telephone network.
2. Two-way flow of the digitized speech and video associated with a video telephony
application.
 The full-duplex mode is used when communication in both directions is required all the
time.
 The capacity of the channel, however, must be divided between the two directions.

4. Broadcast:
11 CN(18EC71)

 Information output by a single source node is received by all the other nodes, computers,
and others which are connected to the same network.
 Ex.: broadcast of a television program over a cable network as all the television receivers
that are connected to the network receive the same set of programs.

5. Multicast:

 Similar to broadcast except, information output by the source is received by only a specific
subset of the nodes that are connected to the network (multicast group).
 Ex.: video conferencing involving a predefined group of terminals/computers connected to
a network exchanging integrated speech and video streams.

 In half-duplex and duplex communications the bit rate associated with the flow of
information in each direction can be same or different.
1. Rate associated, with the flow of information in each direction is equal then is called
as Symmetric.
12 CN(18EC71)

2. Rate associated, with the flow of information in each direction is unequal then is
called as Asymmetric.
 Ex.: Video telephone call: involves exchange of integrated digitized speech and video
stream both direction simultaneously so, symmetric duplex communications channel is
required.
 Application involving browser (program) and a web server:
1. Low bit rate channel from the browser to the web server is required for request and
control purposes.
2. High bit rate channel from the server to the subscriber for the transfer of, say, and
requested file so, asymmetric half-duplex communications channel is required.

Networks:
 Definition: A network is the interconnection of a set of devices capable of communication.
 Here a device can be two types:
 Type 1: Host/end system  large computer, desktop, laptop, workstation, cellular
phone, or security system.
 Type 2: connecting device 
 Router: connects a network to other networks.
 Switch: connects devices together.
 Modem (modulator-demodulator): This changes the form of data.
 Transmission media can be wired or wireless to connect devices to create a network.
 A link is a communications pathway that transfers data from one device to another.

Network Criteria:

1. Performance:
 Performance of the network can be measured in many ways, including transit time
and response time.
 Transit time: It is the amount of time required for a message to travel from
one device to another.
 Response time: It is the elapsed time between an inquiry and a response.
 Throughput: It is the rate of successful message delivery over a
communication channel.
13 CN(18EC71)

 Delay: The delay of a network specifies how long it takes for a bit of data
to travel across the network from one node or endpoint to another.
 It is often need more throughput and less delay. But, these two criteria are often
contradictory.
 If we try to send more data to the network, we may increase throughput but we
increase the delay because of traffic congestion in the network.

2. 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.

3. 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.
Physical Structures:
 Type of Connection:
 There are two possible types of connections:

1. Point-to-Point:

Figure: point-to-point connection

 A point-to-point connection provides a dedicated link between two devices.


 The entire capacity of the link is reserved for transmission between those two devices.
 Most of the point-to-point connections use an actual length of wire or cable to connect
the two ends, but other options, such as microwave or satellite links, are also used.
14 CN(18EC71)

 Changing television channels by infrared remote control, which establishes a point-to-


point connection between the remote control and the television’s control system.

2. Multipoint:

Figure: multipoint connection

 Multipoint Configuration also known as Multidrop line configuration/connection.


 A multipoint connection is one in which more than two specific devices share a single
link as shown in figure above.
 More than two devices share the Link that is the capacity of the channel is shared now.
 With shared capacity, there can be two possibilities in a Multipoint Line Config:
Spatial Sharing: If several devices can share the link simultaneously, its called
Spatially shared line configuration
Temporal (Time) Sharing: If users must take turns using the link , then its
called Temporally shared or Time Shared Line Configuration

Topology:
 Definition: The term topology describes the appearance of the network.
 Classification: Two types of topology
1. Physical topology: The term physical topology refers to the way in which a
network is laid out physically.
2. Logical (or signal) topology: Logical (or signal) topology refers to the nature
of the paths the signals follow from node to node.
15 CN(18EC71)

 In many instances, the logical topology is the same as the physical topology. But this
is not always the case.
 For example, some networks are physically laid out in a star configuration, but they
operate logically as bus or ring networks.

Physical Topology:
 Definition: The term physical topology refers to the way in which a network is laid out
physically.
 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.
 Various physical topologies are:

1. Mesh Topology:

Figure: Mesh Topology

 In a mesh topology, every device has a dedicated point-to-point link to every other
device.
 To find the number of physical links in a fully connected mesh network with n nodes,
we first consider that each node must be connected to every other node.
16 CN(18EC71)

 the value of fully meshed networks is proportional to the exponent of the number of
subscribers, assuming that communicating groups of any two endpoints, up to and
including all the endpoints, is approximated by Reed's Law.
 The number of connections in a full mesh is (n x (n - 1) ) / 2 duplex links where n is
number of nodes.
 To accommodate that 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 as shown in the
figure.
 Advantages:
 Use of dedicated links guarantees that each connection can carry its own data
load, eliminating the traffic problems that can occur when links must be shared
by multiple devices.
 A mesh topology is robust. If one link becomes unusable, it does not
incapacitate the entire system.
 There is the advantage of privacy or security. When every message travels along
a dedicated line, only the intended recipient sees it. Physical boundaries prevent
other users from gaining access to messages.
 A point-to-point links make fault identification and fault isolation easy. 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 and solution.
 Disadvantages:
 Costlier as the amount of cabling and the number of I/O ports required.
 As every device must be connected to every other device, installation and
reconnection are difficult.
 The sheer bulk of the wiring can be greater than the available space (in walls,
ceilings, or floors) can accommodate.
 The hardware required to connect each link (I/O ports and cable) can be
prohibitively expensive.
 For these reasons a mesh topology is usually implemented in a limited fashion, for
example, as a backbone connecting the main computers of a hybrid network that can
include several other topologies.
17 CN(18EC71)

 Implementation of a mesh topology: connection of telephone regional offices in


which each regional office needs to be connected to every other regional office.

2. Star Topology:

Figure: 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 as
shown in figure above.
 Advantages:
 A star topology is less expensive 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. This factor
also makes it easy to install and reconfigure.
 Far less cabling needs to be housed, and additions, moves, and deletions involve
only one connection: between that device and the hub.
 Star topology is robust. If one link fails, only that link is affected. All other links
remain active. This factor also lends itself to easy fault identification and fault
isolation. As long as the hub is working, it can be used to monitor link problems
and bypass defective links.
18 CN(18EC71)

 Disadvantage:
 Dependency of the whole topology on one single point, the hub. If the hub goes
down, the whole system is dead.
 Requires more cable length than a linear topology such as ring or bus.
 More expensive than linear bus topologies because of the cost of the hubs, etc.
 Application: The star topology is used in local-area networks (LANs), High-speed
LANs often use a star topology with a central hub.

3. Bus Topology:
 A bus topology is a multipoint topology.
 One long cable acts as a backbone to link all the devices in a network as shown in figure
below

Figure: Bus Topology

 Construction Mechanism:
 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.
19 CN(18EC71)

 As a signal travels along the backbone, some of its energy is transformed into heat.
Therefore, it becomes weaker and weaker as it travels farther and farther. For this
reason there is a limit on the number of taps a bus can support and on the distance
between those taps.
 Advantages:
 Ease of installation. Backbone cable can be laid along the most efficient path, then
connected to the nodes by drop lines of various lengths.
 It is cheaper as bus topology uses less cabling than mesh or star topologies.
 Disadvantages:
 Entire network shuts down if there is a break in the main cable
 Slow speed as only on system can transmit at a time.
 Terminators are required at both ends of the backbone cable
 Difficult to identify the problem if the entire network shuts down
 Not meant to be used as a stand-alone solution in a large building
 Application: Traditional Ethernet LANs can use a bus topology, but they are less popular
now.
4. Tree or Expanded Star:

Figure: Tree or Expanded Star


20 CN(18EC71)

 A tree topology combines characteristics of linear bus and star topologies.


 It consists of groups of star-configured workstations connected to a linear bus backbone
cable as shown in figure.
 Tree topologies allow for the expansion of an existing network, and enable schools to
configure a network to meet their needs.
 Advantages:
 Point-to-point wiring for individual segments.
 Supported by several hardware and software venders.
 Disadvantages:
 Overall length of each segment is limited by the type of cabling used.
 If the backbone line breaks, the entire segment goes down.
 More difficult to configure and wire than other topologies.

5. Ring Topology:

Figure: Ring Topology

 A ring topology is a multipoint topology.


21 CN(18EC71)

 Definition: Ring topology, also known as Ring network, is a type of network


topology where each node is exactly connected to two other nodes, forward and backward,
thus forming a single continuous path for signal transmission.
 A signal is passed along the ring in one direction, from device to device, until it reaches its
destination.
 Token passing is an important mechanism in ring topology where, a token contains a piece
of information which is sent along with data by the source computer.
 Basically, a token is a permission packet which allows a particular node the permission to
release information over the network.
 The nodes with token are the ones only allowed to send data. Other nodes have to wait for
an empty token to reach them.
 A token is regularly passed from one node to another. And if a node has some information
to pass on the network, the node releases the information. If the node does not have any
data to release on the network, then it transfers the token to the next node.
 Each device in the ring has a repeater. When the devices receive the signal intended for the
other node, it just regenerates the bits and passes them along as shown in figure.
 Advantages:
 A ring is relatively easy to install and reconfigure. Each device is linked to only its
immediate neighbors (either physically or logically). To add or delete a device
requires changing only two connections.
 Fault isolation is simplified. Generally, in a ring a signal is circulating at all times.
If one device does not receive a signal within a specified period, it can issue an
alarm. The alarm alerts the network operator to the problem and its location.
 Reduced chances of data collision as each node release a data packet after receiving
the token.
 Token passing makes ring topology perform better than bus topology under heavy
traffic
 No need of server to control connectivity among the nodes
 Equal access to the resources
 Disadvantages:
 In a simple ring, a break in the ring (such as a disabled station) can disable the entire
network. This weakness can be solved by using a dual ring or a switch capable of
closing off the break.
22 CN(18EC71)

 Single point of failure, that means if a node goes down entire network goes down.

Considerations When Choosing a Topology:


 Money: A linear bus network may be the least expensive way to install a network; you do
not have to purchase concentrators.
 Length of cable needed: The linear bus network uses shorter lengths of cable.
 Future growth:. With a star topology, expanding a network is easily done by adding
another concentrator.
 Cable type: The most common cable in schools is unshielded twisted pair, which is most
often used with star topologies.
Network Types:
 One way to categorize the different types of computer network designs is by their scope or
scale.
 For historical reasons, the networking industry refers to nearly every type of design as some
kind of area network.
 Common examples of area network types are:
1. LAN - Local Area Network
2. WLAN - Wireless Local Area Network
3. WAN - Wide Area Network
4. MAN - Metropolitan Area Network

1. Local Area Network:

Figure: An Isolated LAN in the past and today


23 CN(18EC71)

 A LAN connects network devices over a relatively short distance.


 A networked office building, school, or home usually contains a single LAN, though
sometimes one building will contain a few small LANs (perhaps one per room), and
occasionally a LAN will span a group of nearby buildings.
 LAN’s are also typically owned, controlled, and managed by a single person or
organization. They also tend to use certain connectivity technologies, primarily Ethernet
and Token Ring.
 Each host in a LAN has an identifier, an address, that uniquely defines the host in the LAN.
 A packet sent by a host to another host carries both the source host’s and the destination
host’s addresses.
 LAN does not define the minimum or maximum number of hosts in a LAN.
 Figure below shows a LAN using either a common cable or a switch
 When LANs were used in isolation (which is rare today), they were designed to allow
resources to be shared between the hosts.
 LANs today are connected to each other and to WANs to create communication at a wider
level.

2. Wide Area Network:


 A WAN (wide area network) is a communications network that spans a large geographic
area such as across cities, states, or countries.
 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.
 Examples of WANs:
1. point-to-point WANs
2. Switched WANs.
3.
1. Point-to-Point WAN:
24 CN(18EC71)

Figure: A point-to-point WAN

 A point-to-point WAN is a network that connects two communicating devices through a


transmission media (cable or air).

Switched WAN:

Figure: A switched WAN

 A switched WAN is a network with more than two ends.


 A switched WAN is used in the backbone of global communication today. We can say
that a switched WAN is a combination of several point-to-point WANs that are connected
by switches.
Internetwork:
25 CN(18EC71)

Figure: An internetwork made of two LANs and one point-to-point WAN

 It is rarely seen a LAN or a WAN in isolation; they are connected to one another.
 When two or more networks are connected, they make an internetwork, or internet.
 Scenario: 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 connects the two LANs.
 Now the company has an internetwork, or a private internet communication between
offices is now possible. Figure above shows this internet.
 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.
 When a host on the west coast sends a message to a host on the east coast, router R1 routes
the packet to router R2, and the packet reaches the destination.
 Figure below shows another internet with several LANs and WANs connected. One of the
WANs is a switched WAN with four switches.
26 CN(18EC71)

Figure: A heterogeneous network made of four WANs and three LANs

Switching:
 An internet is a switched network in which a switch connects at least two links together.
 A switch needs to forward data from a network to another network when required.
 The two most common types of switched networks are:
1. Circuit-switched network
2. Packet-switched networks

Circuit-Switched Network:
 In circuit switching network dedicated channel called circuit has to be established before
the call/data transfer is made between two end systems.
 The channel is reserved between the users till the connection is active.
 Application: It is mainly used for voice communication requiring real time services
without any much delay.
 Figure below shows a very simple switched network that connects four telephones to each
end.
27 CN(18EC71)

Figure: A circuit-switched network

 Network: In above figure, the four telephones at each side are connected to a switch. The
switch connects a telephone set at one side to 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.
 Scenario 1: Here, all telephone sets are busy; four people at one site are talking with four
people at the other site; the capacity of the thick line is fully used.
 Scenario 2: Here, only one telephone set at one side is connected to a telephone set at the
other side; only one-fourth of the capacity of the thick line is used.
 Inference: a circuit-switched network is efficient only when it is working at its full
capacity; most of the time, it is inefficient because it is working at partial capacity. The
reason that we need to make the capacity of the thick line four times the capacity of each
voice line is that we do not want communication to fail when all telephone sets at one side
want to be connected with all telephone sets at the other side.

Packet-Switched Network:
28 CN(18EC71)

Figure: A packet-switched network

 A packet switched network (PSN) is a type of computer communications network that


groups and sends data in the form of small packets.
 It enables the sending of data or network packets between a source and destination node
over a network channel that is shared between multiple users and/or applications.
 A packet switched is also known as a connectionless network, as it does not create a
permanent connection between a source and destination node.
 A packet switched network is one of the most commonly used computer networks. It is
widely implemented on local networks and the Internet.
 Network: Figure above shows a small packet-switched network that connects four
computers at one site to four computers at the other site.
 A router in a packet-switched network has a queue that can store and forward the packet.
 Scenario 1: Assume the capacity of the thick line is only twice the capacity of the data line
connecting the computers to the routers. If only two computers (one at each site) need to
communicate with each other, there is no waiting for the packets.
 Scenario 2: 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 scenario show that a packet-switched network is more efficient than a circuit
switched network, but the packets may encounter some delays.

The Internet:
 Definition: A global computer network providing a variety of information and
communication facilities, consisting of interconnected homogeneous/heterogeneous
networks using standardized communication protocols.
 An electronic communications network that connects computer networks and
organizational computer facilities around the world. It includes several high-
bandwidth data lines that comprise the Internet backbone. These lines are connected to
major Internet hubs that distribute data to other locations, such as web servers and ISPs.
 Figure below shows a conceptual view of the Internet.
29 CN(18EC71)

Figure: conceptual view of the Internet

 The figure shows the Internet as several backbones, provider networks, and customer
networks.
 At The Top Level: the backbones are large networks owned by some\ communication
companies such as Sprint, Verizon (MCI), AT&T, and NTT. The backbone networks are
connected through some complex switching systems, called peering points.
 At The 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.
 At The Lower Level: The customer networks are networks at the edge of the Internet that
actually use the services provided by the Internet. They pay fees to provider networks for
receiving services.
 Backbones and provider networks are also called Internet Service Providers (ISPs). The
backbones are often referred to as international ISPs; the provider networks are often
referred to as national or regional ISPs.
 Accessing Internet:
1. Using Telephone Networks:
 Since most telephone networks have already connected themselves to the
Internet, one option for residences and small businesses to connect to the
30 CN(18EC71)

Internet is to change the voice line between the residence or business and
the telephone center to a point-to-point WAN. This can be done in two
ways:
 Dial-up service: The first solution is to add to the telephone line a
modem that converts data to voice. The software installed on the
computer dials the ISP and imitates making a telephone connection.
 DSL Service: Since the advent of the Internet, some telephone
companies have upgraded their telephone lines to provide higher
speed Internet services to residences or small businesses. The DSL
service also allows the line to be used simultaneously for voice and
data communication.
2. Using Cable Networks:
 Now a days residents have begun using cable TV services instead of
antennas to receive TV broadcasting.
 The cable companies have been upgrading their cable networks and
connecting to the Internet.
 A residence or a small business can be connected to the Internet by using
this service.
 It provides a higher speed connection, but the speed varies depending on the
number of neighbors that use the same cable.
3. Using Wireless Network:
 Wireless connectivity has recently become increasingly popular.
 A household or a small business can use a combination of wireless and
wired connections to access the Internet.
 With the growing wireless WAN access, a household or a small business
can be connected to the Internet through a wireless WAN.
4. Direct Connection to the Internet:
 A large organization or a large corporation can itself become a local ISP
and be connected to the Internet.
 This can be done if the organization or the corporation leases a high-speed
WAN from a carrier provider and connects itself to a regional ISP.
 A large university with several campuses can create an internetwork and
then connect the internetwork to the Internet.
31 CN(18EC71)

Protocol Layering:
 In data communication and 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.
 When communication is simple, a single simple protocol is sufficient
 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.

Scenarios:
First Scenario:
 Communication is simple which can occur in only one layer. Assume Mira and Tara are
neighbors with a lot of common ideas.
 Communication between Mira and Tara takes place in one layer, face to face, in the same
language, as shown in figure below

Figure: A single-layer protocol

 In simple scenario, a set of rules needs to be followed.


1. First, Mira and Tara know that they should greet each other when they meet.
2. Second, they know that they should confine their vocabulary to the level of their
friendship.
3. Third, each party knows that she should refrain from speaking when the other party
is speaking.
4. Fourth, each party knows that the conversation should be a dialog, not a monolog:
both should have the opportunity to talk about the issue.
5. Fifth, they should exchange some nice words when they leave.
 We can see that the protocol used by Mira and Tara is different from the communication
between a professor and the students in a lecture hall.
32 CN(18EC71)

 The communication in the second case is mostly monolog; the professor talks most of the
time unless a student has a question, a situation in which the protocol dictates that she
should raise her hand and wait for permission to speak.
 In this case, the communication is normally very formal and limited to the subject being
taught.
Second Scenario:

Figure: A three-layer protocol

 Assume that Tara is offered a higher-level position in her company, but needs to move to
another branch located in a city very far from Mira. 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.
However, they do not want their ideas to be revealed by other people if the letters are
intercepted.
 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.
33 CN(18EC71)

 Now we can say that the communication between Mira and Tara takes place in three layers,
as shown in figure above. We assume that Tara and Mira each have three machines (or
robots) that can perform the task at each layer.
 Protocol layering enables us to divide a complex task into several smaller and simpler tasks.
 In figure above, they could have used only one machine to do the job of all three machines.
 However, if Mira and Tara decide that the encryption/decryption done by the machine is
not enough to protect their secrecy, they would have to change the whole machine.
 In the present situation, they need to change only the second layer machine; the other two
can remain the same. This is referred to as modularity. Modularity in this case means
independent layers.
 A layer (module) can be defined as a black box with inputs and outputs, without concern
about how inputs are changed to outputs.
 If two machines provide the same outputs when given the same inputs, they can replace
each other.
 E.x:, Tara and Miura can buy the second layer machine from two different manufacturers.
As long as the two machines create the same cipher text from the same plaintext and vice
versa.
 Advantages:
1. Protocol layering 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.
2. Communication does not always use only two end systems; there are intermediate
ystems that need only some layers, but not all layers. If we did not use protocol
layering, we would have to make each intermediate system as complex as the end
systems, which makes the whole system more expensive.

Principles of Protocol Layering:


 First Principle: 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.
 Ex:
 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.
34 CN(18EC71)

 Second Principle: 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.
 Ex:
 The object under layer 3 at both sites should be a plaintext letter.
 The object under layer 2 at both sites should be a cipher text letter.
 The object under layer 1 at both sites should be a piece of mail.

Logical Connections:
 Figure illustrates logical connection between each layer as shown in figure below.

Figure: Logical connection between peer layers

 Here we have layer-to-layer communication. Mira and Tara can think that there is a logical
(imaginary) connection at each layer through which they can send the object created from
that layer.
Layered Tasks:
We use the concept of layers in our daily life.
Scenario: let us consider two friends who communicate through postal mail. The figure below
shows the steps in this task.
35 CN(18EC71)

Figure: Tasks involved in sending a letter

 The process of sending a letter to a friend would be complex if there were no services
available from the post office.
 The task includes a sender, a receiver, and a carrier that transports the letter.
 There is a hierarchy of tasks:
1. Higher Layer
2. Middle Layer and
3. Lower Layer.
 Activities that take place at each layer at each side is described below:
 At the Sender Site:
 Higher Layer: the sender writes the letter, inserts the letter in an envelope, writes
the sender and receiver addresses, finally drops the letter in a mailbox.
 Middle Layer: the letter is picked up by a letter carrier and delivered to the post
office.
 Lower layer: the letter is sorted at the post office; a carrier transports the letter.
 On the Way:
 The letter is then on its way to the recipient.
 On the way to the recipient’s local post office, the letter may actually go through a
central office.
 In addition, it may be transported by trunk, train, airplane, boat, and/or a
combination of these.
 At the Receiver Site:
 Lower Layer: The carrier transports the letter to the post office.
 Middle Layer: The letter is sorted and delivered to the recipient’s mailbox.
36 CN(18EC71)

 Higher Layer: the receiver picks up the letter, opens the envelope, and reads it.
 Each layer performs specific tasks and uses the services of the layer immediately
below it.
 Layered networking model is advantageous because
1. Divides networking into less complex components
2. Enables programmers to specialize in a particular level
3. Allows upgrades to a specific layer without effecting other layers
4. Encourages interoperability
5. Allows for standardized interfaces

Definition:

Open System: It is a set of protocols that allows any two different systems to communicate
regardless of their underlying architecture.

The OSI Reference Models:


 It was first introduced in the late 1970s.
 It is expanded as Open Systems Interconnection model.
 It was developed by International Standards Organization (ISO).
 The Open Systems Interconnection (OSI) model is an ISO standard that covers all aspects
of network communications.
 The purpose of the OSI model:
 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 is a layered framework for the design of network systems that
allows communication between all types of computer systems.
 Advantages of Reference Models:
 It divides the network communication process into smaller and simpler
components, thus aiding component development, design, and troubleshooting.
 It allows multiple-vendor development through standardization of network
components.
 It encourages industry standardization by defining what functions occur at each
layer of the model.
 It allows various types of network hardware and software to communicate.
 It prevents changes in one layer from affecting other layers, so it does not hamper
development.
 The OSI model is composed of seven layers:
37 CN(18EC71)

1. Physical Layer
2. Data link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer and
7. Application Layer
 The structure of seven layers in OSI model as shows figure below

Figure: Seven layers of the OSI model

Layered Architecture:
 Layers are designed based on identifying which networking functions had related uses and
collected those functions into discrete groups that became the layers.
 The OSI model allows complete interoperability between networks.
 The Each layer uses the services of the layer immediately below it.

Peer-to-Peer Processes:
 Definition: Process in Layer x on one machine communicates with Process in layer x on
another machine called Peer-to-Peer Processes.
 This communication is governed by an agreed-upon series of rules and conventions called
protocols.
38 CN(18EC71)

 Communication between machines is therefore a peer-to-peer process using the protocols


appropriate to a given layer, which is shown in figure below

Figure: The interaction between layers in the OSI model

Interfaces Between Layers:


 Interface defines the information and services a layer must provide for the layer above it.
 The passing of the data and network information down through the layers of the sending
device and backup through the layers of the receiving device is made possible by an
interface between each pair of adjacent layers.
 Well defined interfaces and layer function provide modularity to a network.

Organizations of the layers (subgroup):


 The seven layers can be thought of as belonging to three subgroups. They are:
 Network support layers:
 Includes Physical (layer1), Data link (layer2), Network (layer3).
39 CN(18EC71)

These layers deal with the physical aspects of moving data from one device
to another which includes electrical specifications, physical connections,
physical addressing, transport timing and reliability.
 User support layers:
 Includes Session (layer5), Presentation (layer6), Application (layer7)
 These layers support interoperability among unrelated software systems.
 Transport layer (Layer 4):
 Links the above two layers subgroups.
 This layer ensures that what the lower layers have transmitted is in a form
which can be used by the upper layers.
 The upper OSI layers are almost always implemented in software.
 The lower layers are combination of hardware and software, except for physical layer
which is mostly hardware.

Data flow mechanism in OSI model:


 The figure below gives a view of data flow mechanism in OSI layers.

Figure: An exchange using the OSI model

 The process starts at layer 7 then moves from layer to layer in descending, sequential order.
 At each layer, a header, or possibly a trailer, can be added to the data unit. Commonly, the
trailer is added only at layer 2.
 When the formatted data unit passes through the physical layer (layer 1), it is changed into
a digital form i.e., electromagnetic signal and transported along a physical link.
 The reverse process occurs in the receiver side and the message is again in a form
appropriate to the application and is made available to the recipient.
40 CN(18EC71)

Encapsulation:
 Encapsulation is a process where the data portion of a packet at level N-1 carries the whole
packet from level N.
 Ex.: A packet including header and data at layer 7 is encapsulated in the packet at level 6
and the process continues in the layer below.

Layers in the OSI Model:

1. Physical Layer:
 The physical layer is concerned with transmitting raw bits over a communication channel.
 It deals with the mechanical, electrical, timing interfaces of the primary connections like
cable, connectors etc. and the physical transmission medium, which lies below the
physical layer.

Figure: Physical layer

 Physical layer is concerned with the following:


 Physical characteristics of interfaces and medium:
 This layer defines the characteristics of interfaces and transmission medium.
 This layer also defines the type of transmission medium like Cable/wire, Radio
waves, Infrared, Fiber/glass.
 Representation of bits:
 Bits must be encoded into signals may be electrical, optical.
 Specifies the type of encoding (binary encoding as voltages like Manchester
encoding method)
 Data Rate:
 Defines transmission rate i.e., number of bits transmitted per second.
 Defines the bit duration.
41 CN(18EC71)

 Synchronization of bits:
 Transmitter and receiver clocks may synchronized.
 Line configuration:
 Deals with connection of device to the medium like point to point or multi-point
configuration.
 Physical Topology:
 Defines how device are connected to form network.
 Ex.: Ring, Bus, Mesh, star Topology.
 Transmission mode:
 Defines the direction of transmission between two devices.
 Ex.: Simplex, half duplex, duplex.

2. Data link layer:


 It transforms the physical layer, a raw transmission facility to a reliable link. It makes the
physical layer appear error-free to the upper layer i.e., network layer.
42 CN(18EC71)

Figure: Data link layer

 Major responsibilities of data link layer are:


 Framing: Divides the stream of bits received from network layer into manageable
data units called frames.
 Physical addressing: Adds a header to the frame to define the sender and/or
receiver of the frame.
 Flow Control: If the receiver is slower than the transmitter data link imposes a
flow control mechanism to avoid overwhelming the receiver.
 Error Control: Retransmission of damaged frames, recognition of duplicate
frames. Error control is performed by adding a trailer to the end of the frame.
 Access Control: Specifies which device has to get control over the link at any given
time when two or more devices connected to the same link.

Figure: Network Interface card

Note: Type ipconfig/all at command prompt to check your system’s Mac address.

 Various Types of NIC Cards


43 CN(18EC71)

Figure: Types of Network Interface card


44 CN(18EC71)

Hop-to-hop delivery:
Figure below hop-to-hop (node-to-node) delivery by the data link layer

Figure: Hop-to-Hop deliveries

 As the figure above shows, communication at the Data Link layer occurs between two
adjacent nodes. To send data from A to F, three partial deliveries are made.
 First, the DLL at A sends a frame to the DLL at B (a router). Second, the data link layer
at B sends a new frame to the data link layer at E. Finally, the DLL at E sends a new
frame to the DLL at F.
 Here the frames that are exchanged between the three nodes have different values in the
headers. The frame from A to B has B as the destination address and A as the source
address. The frame from B to E has E as the destination address and B as the source
address. The frame from E to F has F as the destination address and E as the source
address.
45 CN(18EC71)

3. Network Layer:
 This layer is responsible for source to destination delivery of individual packet may be
across multiple networks/links.

Figure: Network layer

 Other responsibilities of network layer include:


 Logical addressing:
 Physical address used in data link layer handles addressing locally i.e., within the
network.
 If the packet moves out of the network then network layer adds the header to the
packet coming from upper layer which specifies the address of the sender and the
receiver which are present on the different network.
 Routing:
 Various independent networks/links are interconnected to form a large
network/internetwork; packets are delivered to the destination through different
network using routers/switches. This is one of the basic functions of the network
layer.
 Figure below shows the source to destination delivery by the network layer.

Figure: Source-to-destination delivery


46 CN(18EC71)

 A typical router looks like

Figure: Router

4. Transport Layer:
 Responsible for process-to-process delivery of the entire message.
 A process is an application program running on a host.
 Transport layer ensures the whole message arrives intact and in order, overseeing both error
control and flow control at the source-to-destination level.
 Figure below shows the relationship of the transport layer to the network and session layers.

Figure: Transport layer

 Some of the responsibilities of the transport layer include:


 Service-point addressing:
 Computers often run several programs at the same time.
 The transport layer header includes a type of address called a service-point
address (or port address).
 The network layer gets each packet to the correct computer; the transport
layer gets the entire message to the correct process on that computer.
47 CN(18EC71)

 Segmentation and reassembly:


 A message is divided into transmittable segments, with each segment
containing a sequence number.
 These numbers enable the transport layer to reassemble the message
correctly upon arriving at the destination and to identify and replace packets
that were lost in transmission.
 Connection control:
 The transport layer can be either connectionless or connection oriented.
 A connectionless transport layer treats each segment as an independent
packet and delivers it to the transport layer at the destination machine.
 A connection oriented transport layer makes a connection with the transport
layer at the destination machine first before delivering the packets. After all
the data are transferred, the connection is terminated.
 Flow control:
 Here flow control at this layer is performed end to end rather than across a
single link.
 Error control:
 Error control at this layer is performed process-to-process rather than across
a single link.
 The sending transport layer makes sure that the entire message arrives at the
receiving transport layer without error (damage, loss, or duplication).
 Error correction is usually achieved through retransmission.
 Figure below illustrates process-to-process delivery by the transport layer.

Figure: Reliable process-to-process delivery of a message


48 CN(18EC71)

5. Session Layer:
 The session layer is responsible for dialog control and synchronization.
 Specific responsibilities of the session layer include:
 Dialog control:
 The session layer allows two systems to enter into a dialog.
 It allows the communication between two processes to take place in either
half-duplex full-duplex mode.
 Synchronization:
 The session layer allows a process to add checkpoints, or synchronization
points, to a stream of data.
 Figure below shows the relationship between the presentation layer and the application and
session layers.

Figure: Session layer

6. Presentation Layer:
 The presentation layer is concerned with the syntax and semantics of the information
exchanged between two systems.
 Specific responsibilities of the presentation layer are:
 Translation:
 Different computers use different encoding systems, presentation layer is
responsible for interoperability between these different encoding methods.
 The presentation layer at the sender changes the information from its
sender-dependent format into a common format. The presentation layer at
the receiving machine changes the common format into its receiver-
dependent format.
 Encryption:
 It ensures privacy for carry sensitive information by sending the information
in other form.
 Compression:
49 CN(18EC71)

 Data compression reduces the number of bits contained in the information.


 It becomes particularly important in the transmission of multimedia such as
text, audio, and video.
 Figure below shows the relationship between the presentation layer and the application and
session layers

Figure: Presentation layer

Figure: Encoding Format

7. Application Layer:
 The application layer enables the user, whether human or software, to access the network.
 It provides user interfaces and support for services such as electronic mail, remote file
access and transfer, shared database management, and other types of distributed
information services.
50 CN(18EC71)

 Figure below shows the relationship of the application layer to the user and the presentation
layer.

Figure: Application layer

 The major duties of the application:


 Network virtual terminal: Enable to user for remote login
 File transfer, access, and management
 Mail services
 Directory services

TCP/IP PROTOCOL SUITE:


 The TCPIIP protocol suite was developed prior to the OSI model.
 Layers in the TCP/IP protocol suite do not exactly match those in the OSI model.
 The original TCP/IP protocol suite was defined as having four layers
1. Host-to-network
2. Internet
3. Transport
4. Application
 Comparison of TCP/IP is compared to OSI is shown below
51 CN(18EC71)

Figure: TCP/IP and OSI model Comparison


 We can say that the host-to-network layer is equivalent to the combination of the physical
and data link layers.
 The internet layer is equivalent to the network layer.
 The application layer is roughly doing the job of the session, presentation, and application
layers with the transport layer in TCP/IP taking care of part of the duties of the session
layer.
 Thus, we assume that the TCP/IP protocol suite is made of five layers: physical, data link,
network, transport, and application.
 The first four layers provide physical standards, network interfaces, internetworking, and
transport functions that correspond to the first four layers of the OSI model.
 The three topmost layers in the OSI model, however, are represented in TCP/IP by a single
layer called the application layer.

TCP / IP PROTOCOL layers description:

Figure: TCP/IP Protocol Suit


1. Host-to-network:
52 CN(18EC71)

 Describes physical interface between PC/workstation and a transmission medium/network.


 At the physical and data link layers, TCP/IP does not define any specific protocol. It
supports all the standard and proprietary protocols.
 A network in a TCP/IP internetwork can be a local-area network or a wide-area network.

2. Internet/network/IP layer:
 Concerned with access to and routing data across a network for two end systems attached
to a network.
 At the network layer TCP/IP supports the Internetworking Protocol.
 Internetworking Protocol (IP): It is an unreliable and connectionless protocol-a best-
effort delivery service.
 IP transports data in packets called datagram, each of which is transported separately.
 Datagram’s can travel along different routes and can arrive out of sequence or be
duplicated.
 IP does not keep track of the routes and has no facility for reordering datagram once they
arrive at their destination.
 IP, in turn, uses four supporting protocols:
1. Address Resolution Protocol (ARP):
 It is used to associate a logical address with a physical address.
 ARP is used to find the physical address of the node when its Internet
address is known.
2. Reverse Address Resolution Protocol (RARP):
 It allows a host to discover its Internet address when it knows only its
physical address.
 It is used when a computer is connected to a network for the first time or
when a diskless computer is booted.
3. Internet Control Message Protocol (ICMP):
 It is a mechanism used by hosts and gateways to send notification of
datagram problems back to the sender.
 ICMP sends query and error reporting messages.
4. Internet Group Message Protocol (IGMP):
 It is used to facilitate the simultaneous transmission of a message to a group
of recipients.

3. Transport Layer:
 This layer was represented in TCP/IP by two protocols, TCP and UDP.
 These protocols are responsible for delivery of a message from a process to another
process.
 User Datagram Protocol (UDP):
53 CN(18EC71)

 It is a process-to-process protocol that adds only port addresses, checksum error


control, and length information to the data from the upper layer.
 Transmission Control Protocol (TCP):
 It provides full transport-layer services to applications. It is a reliable stream
transport protocol. It gives connection-oriented: A connection must be established
between both ends services.
 SCTP (Stream Control Transmission Protocol):
 It provides support for newer applications such as voice over the Internet.
 It is a transport layer protocol that combines the best features of UDP and TCP.

4. Application Layer:
 The application layer in TCP/IP is equivalent to the combined session, presentation, and
application layers in the OSI model.
 Contains the logic needed to support the various user applications.
 Separate modules are required for each application.
 Many protocols are defined at this layer, some of them are:
1. Hypertext Transfer Protocol (HTTP): enables the connection between a web
server and a client
2. Simple Mail Transfer Protocol (SMTP): An electronic mail (e-mail) allows users
to send mails across an internet.
3. File Transfer Protocol (FTP): Is a standard way to transfer files between different
machines. Needs FTP client program on computer.
4. Domain Naming System (DNS): Provides meaningful names like
achilles.mycorp.com for computers to replace numerical addresses like
123.45.67.89.
5. TELNET: A remote terminal emulation protocol that enables clients to log on to
remote hosts on the network.
6. Simple Network Management Protocol (SNMP): Used to remotely manage
network devices.

Comparison between OSI and TCP/IP Model:

Sl No OSI Model TCP/IP MODEL


1 Contains 7 Layers Contains 5 Layers
Uses Strict Layering resulting in vertical Uses Loose Layering resulting in horizontal
2
layers. layers.
Supports both connectionless & Supports only connectionless communication in
3 connection-oriented communication in the Network layer, but both connectionless &
the Network layer, but only connection-
54 CN(18EC71)

oriented communication in Transport connection-oriented communication in


Layer. Transport Layer.
It distinguishes between Service, Interface Does not clearly distinguish between Service,
4
and Protocol. Interface and Protocol.
Protocols are better hidden and can be Protocols are not hidden and thus cannot be
5 replaced relatively easily as technology replaced easily.
changes.
OSI reference model was devised before The protocols came first and the model was a
6 the corresponding protocols were description of the existing protocols.
designed.
Encapsulation and Decapsulation:
Encapsulation:
 In networking, “encapsulation” is the process of taking data from one protocol and
translating it into another protocol, so the data can continue across a network.
 The term “encapsulation” is used to describe a process of adding headers and trailers the
data to be transmitted from one layer to the other and across the network.
 This process happens on a computer that is sending data.
 E.g.: TCP/IP packet contained within an ATM frame is a form of encapsulation.
 Scenario:
 When an email is sent using one of the favorite email program (like Outlook or
Thunderbird) that email is sent from the Application layer to the Transport layer.
 The Transport layer encapsulates the data and adds its own header (with its own
information, such as which port will be used) and passes the data to the Internet
layer,
 Internet layer again encapsulates the received data and adds its own header, usually
with information about the source and destination IP addresses. The Internet layer
then passes the data to the Network Access layer.
 This layer is the only layer that adds both a header and a trailer. The data is then
sent through a physical network link.

Decapsulation:
 The term “decapsulation” refers to the process of removing headers and trailers as data
passes from lower to upper layers. This process happens on a computer that is receiving
data.
55 CN(18EC71)

 In the figure below the concept of encapsulation/decapsulation for the small internet is
shown at the source and destination hosts
 It is not shown the layers for the link-layer switches (at the router) because no
encapsulation/decapsulation occurs in this device.

Figure: Encapsulation/Decapsulation

Encapsulation at the Source Host:


 At the source, we have only encapsulation.
1. At the application layer, the data to be exchanged is referred to as a message. A
message normally does not contain any header or trailer, but if it does, we refer to
the whole as the message. The message is passed to the transport layer.
2. The transport layer takes the message from the application layer 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 that want to communicate plus some more information that is
needed for the end-to end delivery of the message, such as information needed for
flow, error control, or congestion control. The result is the transport-layer packet,
which is called the segment (in TCP) and the user datagram (in UDP). The transport
layer then passes the packet to the network layer.
3. The network layer takes the transport-layer packet as data or payload and adds its
own header to 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.
56 CN(18EC71)

4. The data-link layer takes the network-layer packet as data or payload and adds its
own header, 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, we have both decapsulation and encapsulation because the router is
connected to two or more links.
 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.
 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.
 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 that decapsulation in the host involves error checking.

Addressing:
 Four levels of addresses are used in an internet employing the TCP/IP protocols:
1. Physical Addressing
2. Logical Addressing
3. Port Addressing
4. Specific Addressing
57 CN(18EC71)

 Each address is related to a specific layer in the TCP/IP architecture, as shown in the figure
below

Figure: Layers and Associated Address

1. Physical Address:
 It is the lowest-level address.
 The physical address, also known as the link/MAC address, is the address of a node as
defined by its LAN or WAN. It is included in the frame used by the data link layer.
 A network adapter has a unique and permanent physical address.
 The physical addresses have authority over the network (LAN or WAN).
58 CN(18EC71)

 The size and format of these addresses vary depending on the network.
 Ex., Ethernet uses a 6-byte (48-bit) physical address that is imprinted on the network
interface card (NIC). LocalTalk (Apple), however, has a 1-byte dynamic address that
changes each time the station comes up.
 Scenario: In Figure a node with physical address 10 sends a frame to a node with physical
address 87, The two nodes are connected by a link (bus topology LAN). At the data link
layer, this frame contains physical (link) addresses in the header. These are the only
addresses needed. The rest of the header contains other information needed at this level.
The trailer usually contains extra bits needed for error detection. As the figure shows, the
computer with physical address 10 is the sender, and the computer with physical address
87 is the receiver. The data link layer at the sender receives data from an upper layer. It
encapsulates the data in a frame, adding a header and a trailer. The header, among other
pieces of information, carries the receiver and the sender physical (link) addresses. Note
that in most data link protocols, the destination address, 87 in this case, comes before the
source address (10 in this case).

Figure: Physical addresses

 Most local-area networks use a 48-bit (6-byte) physical address written as 12


hexadecimal digits; every byte (2 hexadecimal digits) is separated by a colon, as shown
below:
07:01:02:01:2C:4B
59 CN(18EC71)

 In order to find the physical/link/MAC address of your system go to command prompt and
type ipconfig/all, the following information will be displayed as shown below

Figure: ipconfig/all

2. Logical Addresses:
 Logical addresses are necessary for universal communications that are independent of
underlying physical networks.
 Physical addresses are not adequate in an internetwork environment where different
networks can have different address formats.
 A universal addressing system is needed in which host can be identified uniquely;
regardless of the underlying physical network hence we use logical addressing.
 The logical addresses are designed for this purpose. A logical address in the Internet is
currently a 32-bit address that can uniquely define a host connected to the Internet.
 No two publicly addressed and visible host on the Internet can have the same IP address.
60 CN(18EC71)

 This works in Layer-3 of OSI Model.


 This would be generally referred as the IP address.
 Scenario: Figure below shows a part of an internet with two routers connecting three LANs.
 Each device has a pair of addresses (logical and physical) for each connection. In this case,
each Computer is connected to only one link and therefore has only one pair of addresses.
Each router, however, is connected to three networks (only two are shown in the figure).
So each router has three pairs of addresses, one for each connection. The physical addresses
will change from hop to hop, but the logical addresses usually remain the same.

Figure: IP addresses

 In order to find the logical/IP address of your system go to command prompt and type
ipconfig/all, the following information will be displayed as shown below
61 CN(18EC71)

Figure: ipconfig/all

3. Port Addresses:
 Port address is transport layer ID (similar to IP in Network Layer) which identify the
application on the host.
 The IP address and the physical address are necessary for a quantity of data to travel from
a source machine to the destination machine/host.
 However, arrival at the destination host is not the final objective of data communications
on the Internet. A system that sends nothing but data from one computer to another is not
complete.
 Today, computers are devices that can run multiple processes at the same time.
 The end objective of Internet communication is a process communicating with another
process.
 Ex: computer A can communicate with computer C by using TELNET. At the same time,
computer A communicates with computer B by using the File Transfer Protocol (FTP).
 Thus, for these above processes to receive data simultaneously, we need a method to label
the different processes. In other words, they need addresses.
 In the TCP/IP architecture, the label assigned to a process is called a port address.
 A port address in TCP/IP is 16 bits in length represented by one decimal number like
753.
62 CN(18EC71)

 Scenario: Figure below shows two computers communicating via the Internet. The
sending computer is running three processes at this time with port addresses A, B, and c.
The receiving computer is running two processes at this time with port addresses j and K.
Process A in the sending computer needs to communicate with process J in the receiving
computer.
 Note: although physical addresses change from hop to hop, logical and port addresses
remain the same from the source to destination.

Figure: Port addresses

 The port numbers are divided into three ranges:


1. Well-known ports.
2. Registered ports.
3. Dynamic/private ports.
 In your machine Port number is seen as below

Figure: Port number in a machine


63 CN(18EC71)

4. Specific Addresses:
 Some applications have user-friendly addresses that are designed for that specific address.
 Ex.:
1. e-mail address : raghudatesh@gmit.ac.in and
2. The Universal Resource Locator (URL) : www.gmit.info.
 The first defines the recipient of an e-mail; the second is used to find a document on the
World Wide Web.
 These addresses, however, get changed to the corresponding port and logical addresses by
the sending computer.

Multiplexing and Demultiplexing:


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).
 Since the TCP/IP protocol suite uses several protocols at some layers, multiplexing is at
the source and demultiplexing at the destination.
 Figure below shows the concept of multiplexing and demultiplexing at the three upper
layers.

Figure: Multiplexing and demultiplexing


64 CN(18EC71)

Multiplexing and Demultiplexing at The Three Upper Layers:


 To be able to multiplex and demultiplex, a protocol needs to have a field in its header to
identify to which protocol the encapsulated packets belong.
 At the transport layer, either UDP or TCP can accept a message from several application-
layer 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 frame may carry the payload coming from IP or other protocols
such as ARP
65 CN(18EC71)

Introduction To Data Link Layer:


 Communication at the data-link layer is node-to-node i.e from one hop to another hop.
 The two main functions of the data link layer are:
1. Data link control: Deals with the design and procedures for communication between
two adjacent nodes i.e., node-to-node communication.
2. Media access control: Deals with media access control, or how to share the link.
 Data link control functions include:
1. Framing
2. Flow
3. Error control
 All the above functions are software implemented protocols that provide smooth and
reliable transmission of frames between nodes.

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.
 Hosts and routers (all devices) are called nodes and the networks in between are referred
as links.

Figure: Nodes and Links


66 CN(18EC71)

Services:
 Services are provided for the layers above a particular layer and they are received from the
layer below it.
 Ex.: The data-link layer is located between the physical and the network layer. The data
link layer provides services to the network layer; it receives services from the physical
layer.
 In data link layer, the delivery of a packet is from one node to the very next node.
 Figure below shows the encapsulation and decapsulation Service at the data-link layer.

Figure: A communication with only three nodes

 Scenario: For simplicity, we have assumed that we have only one router between the
source and destination.
 The datagram received by the data-link layer of the source host is encapsulated in a frame.
The frame is logically transported from the source host to the router.
 The frame is decapsulated at the data-link layer of the router and encapsulated at another
frame. The new frame is logically transported from the router to the destination host.
 Note that, although we have shown only two data-link layers at the router, the router
actually has three data-link layers because it is connected to three physical links.
 Some of the services provided by the data link layer as:
67 CN(18EC71)

 Framing:
 A packet at the data-link layer is normally called a frame.
 eneapsulation of data received from the network layer at the data-link layer
is normally called as a framing.
 The data-link layer at each node needs to encapsulate the datagram in a
frame before sending it to the next node.
 The node also needs to decapsulate the datagram from the frame received
on the logical channel.
 Flow Control:
 It is a technique for speed matching of transmitter and receiver.
 It ensures that a transmitting station does not overflow a receiving station
with data.
 Flow Control refers to a set of procedures used to restrict the amount of data
that the sender can send before waiting for acknowledgment.

 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
processed.
 As it is impossible to have an unlimited buffer size at the receiving side.
There are two ways to mitigate the problem:
1. Allow the receiving data-link layer drop the frames if its buffer is
full.
2. Allow the receiving data-link layer send a feedback to the sending
data-link layer to ask it to stop or slow down.
 Different data-link-layer protocols use different strategies for flow control.
 Error Control:
 When data-frame is transmitted, there is a probability that data-frame may
be lost in the transit or it is received corrupted.
 In both cases, the receiver does not receive the correct data-frame and
sender does not know anything about any loss.
68 CN(18EC71)

 In such case, both sender and receiver are equipped with some protocols
which helps them to detect transit errors such as loss of data-frame.
 Hence, either the sender retransmits the data-frame or the receiver may
request to resend the previous data-frame.
 Congestion Control:
 Congestion control modulates traffic entry into a telecommunications
network in order to avoid congestive collapse resulting from
oversubscription. This is typically accomplished by reducing the rate of
packets and it should not be confused with flow control, which prevents the
sender from overwhelming the receiver.
 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.
 A state occurring in network layer when the message traffic is so heavy that
it slows down network response time.
 Effects of Congestion:
 As delay increases, performance decreases.
 If delay increases, retransmission occurs, making situation worse

Categories of Link:
 Two types of links are present:
 Point to point link:
 Here data-link layer that uses the whole capacity of the medium
 Link is dedicated to the two devices.
 Eg. two users connected by traditional homephones
 Broadcast link:
 Here data-link layer that uses only part of the capacity of the link
 Link shared between several pair of devices.
 Eg. two friends use their cellular phones, they are using a broadcast link (the air is
shared among many cell phone users).
69 CN(18EC71)

Two Sublayers:

Figure: Two Sublayers of data link layer


 The data link layer is divided into two sublayers:
 Data link control(DLC):
 Deals with the design and procedures for communication between two
adjacent nodes i.e., node-to-node communication.
 The data link control sublayer deals with all issues common to both point-
to-point and broadcast links.
 Media Access Control(MAC):
 Deals with media access control, or how to share the link.
 The media access control sub-layer deals only with issues specific to
broadcast links.

Link Layer Addressing:


 As the data is transmitted over the internet through internetwork, it is not sufficient if we
use the IP addresses given to the packet as the source and destination addresses as they
define two ends but cannot define the links through which the datagram has to pass through.
 IP addresses in the data gram should not be changed, i.e., source and destination addresses
due to several reasons because of which we define link layer addresses.
 A link-layer address is sometimes called a link address, sometimes a physical address, and
some- times a MAC address.
 Link is controlled by the data link layer and hence the address belongs to the data link
layer.
 IP addresses and link layer addresses are not in the same order:
 IP addresses, the source address comes before the destination address
 Link layer addresses, the destination address comes before the source.
70 CN(18EC71)

 Source and destination addresses are attached to a frame in a header part and both are
changed every time the frame moves from one link to another. This is illustrated in the
figure below.

Figure: IP addresses and link-layer addresses in a small internet

 The datagrams and frames are designed in this way described in the figure above, and all
internet users follow the design.
 several questions can raised looking into the above diagram like:
 If the IP address of a router does not appear in any datagram sent from a source to a
destination, why do we need to assign IP addresses to routers?
 The answer is that in some protocols a router may act as a sender or receiver of a
datagram.
 Why do we need more than one IP address in a router, one for each interface?
 The answer is that an interface is a connection of a router to a link. An IP address
defines a point in the Internet at which a device is connected. A router with n
interfaces is connected to the Internet at n points. This is the situation of a house at
the corner of a street with two gates; each gate has the address related to the
corresponding street.
 How are the source and destination IP addresses in a packet determined?
 The answer is that the host would know its own IP address, which becomes the
source IP address in the packet.
71 CN(18EC71)

 How are the source and destination link-layer addresses determined for each link?
 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.
 What is the size of link-layer addresses?
 The answer is that it depends on the protocol used by the link. Although we have
only one IP protocol for the whole Internet, we may be using different data-link
protocols in different links.

Types of Addresses:
 Link-layer protocols define three types of addresses:
1. Unicast Address:
 Each host or each interface of a router is assigned a unicast address.
 Unicasting means one-to-one communication.
 A frame with a unicast address destination is destined only for one entity in
the link.
 Ex.: The unicast link-layer addresses in the most common LAN, Ether- net,
are 48 bits (six bytes) that are presented as 12 hexadecimal digits separated
by colons:
A3:34:45:11:92:F1
2. Multicast Address:
 Multicasting means one-to-many communication.
 Ex.: The multicast link-layer addresses in the most common LAN, Ethernet,
are 48 bits (six bytes) that are presented as 12 hexadecimal digits separated
by colons. The second digit, however, needs to be an even number in
hexadecimal. The following shows a multicast address:
A2:34:45:11:92:F1
3. Broadcast Address:
 Broadcasting means one-to-all communication.
 A frame with a destination broadcast address is sent to all entities in the
link.
72 CN(18EC71)

 Ex.: the broadcast link-layer addresses in the most common LAN, Ethernet,
are 48 bits, all 1s, that are presented as 12 hexadecimal digits separated by
colons. The following shows a broadcast address:
FF:FF:FF:FF:FF:FF

Address Resolution Protocol:


 The ARP protocol is one of the auxiliary protocols defined in the network layer.
 Here this is considered because it maps an IP address to a logical link address.
 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.

Figure: Position of ARP in TCP/IP protocol suite

 ARP operation is defined in terms of


1. ARP request:
 Anytime a host or a router needs to find the link-layer address of another host
or router 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.
2. ARP reply:
73 CN(18EC71)

 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.

Figure: ARP Operation

 Scenario: In Figure, the system on the left (A) has a packet that needs to be delivered to
another system (B) with IP address N2. In doing so:
 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. 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
 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:
 Definition: A cache (pronounced CASH) is a place to store something temporarily
in a computing environment.
74 CN(18EC71)

 When ARP is used to find out the recipient address to which the frame has to be
sent in a network, it broadcasts it instead of repeatedly performing the same task
when the frame has to be sent to the same destination in the network, it stores the
link layer address in its cache memory which can be easily accessed.
 This saves the time and the processing of frames by intermediate routers.
 packet format:

Figure: ARP packet

 The above figure shows the format of ARP packet:


 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
defining the link-layer and network-layer addresses of the sender.
 The destination hardware address and destination protocol address fields define the
receiver link-layer and network-layer addresses.
 Ex.: A host with IP address N1 and MAC address L1 has a packet to send to another
host with IP address N2 and physical address L2 (which is unknown to the first
host). The two hosts are on the same network. Figure below shows the ARP request
and response messages.
75 CN(18EC71)

Figure: Example of ARP

DLC Services:
 The data link control (DLC) deals with procedures for communication between two
adjacent nodes - node-to-node communication, no matter whether the link is dedicated or
broadcast.
 Data link control functions include:
 Framing
 Flow
 Error control
 All the above functions are software implemented protocols that provide smooth and
reliable transmission of frames between nodes.
 Figure below Shows the data link layer functionality.
76 CN(18EC71)

Figure: Data Link Layer

Framing:
 Divide the bit stream in to group of bits and attach checksum called Framing.
 The data link layer, pack bits into frames, so that each frame is distinguishable from
another.
 Framing in the DLL separates a message from one source to a destination , by adding a
sender address and destination address.
 The destination address defines where the packet is to go; the sender address helps the
recipient acknowledge the receipt.
 The whole message could be packed in one frame that is not normally done.
1. A frame can be very large, making flow and error control very inefficient. When a
message is carried in one very large frame, even a single-bit error would require the
retransmission of the whole message.
2. When a message is divided into smaller frames, a single-bit error affects only that
small frame.

Frame Size:
 Frames can be of two types:
1. Fixed in size:
 Size of the frame is fixed.
77 CN(18EC71)

 No need for defining the boundaries of the frames; the size itself can be used as
a delimiter.
 Ex: ATM wide-area network, which uses frames of fixed size called cells.
2. Variable in Size:
 Size of the frame is not fixed.
 Need to define the start and end of the frame and the beginning of the next.
 It is used in local area networks.
 Two approaches were used for this purpose:
1. Character-oriented approach
2. Bit-oriented approach

1. Character-Oriented Framing Approach:


 Here data to be carried are 8-bit characters from a coding system such as ASCII.
 The header carries the source and destination addresses and other control information.
 Trailer carries error detection or error correction redundant bits, are also multiples of 8 bits.
 To separate one frame from the next, an 8-bit (1-byte) flag is added at the beginning and
the end of a frame.
 The flag composed of protocol-dependent special characters, signals at the start or end of
a frame, which shown in figure below

Figure: Frame Format in a character-oriented protocol


 Advantage:
1. Simple framing method.
2. Character-oriented framing was popular when only text was exchanged by the data
link layers.
3. The flag could be selected to be any character not used for text communication.
 Problem With Character-Oriented Framing Approach:
78 CN(18EC71)

1. Say we send information other than text such as graphs, audio, and video. Any
pattern used for the flag could also be part of the information.
2. If this happens, the receiver, when it encounters this pattern in the middle of the
data, thinks it has reached the end of the frame.
3. To fix this problem, a byte-stuffing strategy was added to character-oriented
framing.

2. Byte Stuffing:
 In byte stuffing (or character stuffing), a special byte is added to the data section of the
frame when there is a character with the same pattern as the flag.
 The data section is stuffed with an extra byte. This byte is usually called the escape
character (ESC), which has a predefined bit pattern.
 Whenever the receiver encounters the ESC character, it removes it from the data section
and treats the next character as data, not a delimiting flag.
 Figure below describes the scenario

Figure: Frame Format in a character-oriented protocol

 Limitation of byte stuffing:


 Fixed character size of 8 bits can’t handle heterogeneous environment.
 Ex., Unicode, have 16-bit and 32-bit characters that conflict with 8-bit characters.
3. Bit-oriented Framing Approach:
79 CN(18EC71)

 In a bit-oriented protocol, the data section of a frame is a sequence of bits to be interpreted


by the upper layer as text, graphic, audio, video, and so on.
 However, in addition to headers (and possible trailers), we still need a delimiter to separate
one frame from the other.
 Most protocols use a special 8-bit pattern flag 01111110 as the delimiter to define the
beginning and the end of the frame, as shown in figure below

Figure: A Frame in a Bit-Oriented Protocol

 This flag can create the same type of problem we saw in the byte-oriented protocols. That
is, if the flag pattern appears in the data, we need to somehow inform the receiver that this
is not the end of the frame.
 It is done by stuffing 1 single bit (instead of 1 byte) to prevent the pattern from looking like
a flag. The strategy is called bit stuffing.
 Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0 in
the data, so that the receiver does not mistake the pattern 0111110 for a flag.
 Scenario:
 Figure below shows bit stuffing at the sender and bit removal at the receiver.
80 CN(18EC71)

Figure: Bit stuffing and unstuffing

 Note that even if we have a 0 after five 1s, we still stuff a 0. The 0 will be removed by the
receiver.
 This means that if the flag like pattern 01111110 appears in the data, it will change to
011111010 (stuffed) and is not mistaken as a flag by the receiver.
 The real flag 01111110 is not stuffed by the sender and is recognized by the receiver.

Flow and Error Control:


 The most important responsibilities of the data link layer are flow control and error control.
 Collectively, these functions are known as data link control.
 Flow Control:
 It is a technique for speed matching of transmitter and receiver.
 It ensures that a transmitting station does not overflow a receiving station with data.
 Flow Control refers to a set of procedures used to restrict the amount of data that the
sender can send before waiting for acknowledgment.
 Flow control is the regulation of the sender’s data rate so that the receiver buffer does
not become overwhelmed.
 Two types of flow control:
1. Feedback based
2. Rate based flow control
81 CN(18EC71)

 Error Control:
 In the data link layer, the term error control refers primarily to methods of error
detection and retransmission.
 It allows the receiver to inform the sender of any frames lost or damaged in
transmission and coordinates the retransmission of those frames by the sender.
 Error control in the data link layer is often implemented simply: Any time an error is
detected in an exchange, specified frames are retransmitted.
 There are two methods of error control:
1. In the first method, if the frame is corrupted, it is silently discarded; if it is not
corrupted, the packet is delivered to the network layer. This method is used mostly
in wired LANs such as Ethernet.
2. In the second method, if the frame is corrupted, it is silently discarded; if it is not
corrupted, an acknowledgment is sent (for the purpose of both flow and error
control) to the sender.

Data Link Protocols:


 The data link protocols are normally implemented in software by using one of the common
programming languages.
 Figure below shows Taxonomy of protocols are used in data link layer
82 CN(18EC71)

Figure: Taxonomy of protocols are used in data link layer


 For the sake of discussion we consider all data link protocols are unidirectional but in actual
implementation they are bi-directional.
 The behavior of a data-link-layer protocol can be better shown as a finite state machine
(FSM).
 An FSM is thought of as a machine with a finite number of states.
 The machine is always in one of the states until an event occurs. Each event is associated
with two reactions: defining the list (possibly empty) of actions to be performed and
determining the next state (which can be the same as the current state).
 One of the states must be defined as the initial state, the state in which the machine starts
when it turns on.
 The figure below shows a machine with three states. There are only three possible events
and three possible actions.
 SATE I: The machine starts in state I. If event 1 occurs, the machine performs actions 1
and 2 and moves to state II.
 STATE II: When the machine is in state II, two events may occur. If event 2 occurs, the
machine performs action 3 and remains in the same state, state II. If event 3 occurs, the
machine performs no action, but move to state I.

Figure: FSM
83 CN(18EC71)

Noiseless Channels:
 Protocols assume an ideal channel in which no frames are lost, duplicated, or corrupted.
 Noiseless channels are error-free but they cannot be used in real life, but they serve as a
basis for understanding the protocols of noisy channels
 Two types:
1. Simplest
2. Stop and Wait

Simplest Protocol:
 Some of the assumption has been made for developing the algorithm for simplex protocol:
1. The channel is a perfect noiseless channel (error free). Hence no frames are lost,
duplicated, or corrupted.
2. No flow control and error control used.
3. It is a unidirectional protocol in which data frames are traveling in only one direction.
4. Both transmitting and receiving network layer are always ready.
5. Processing time that is small enough to be negligible.
6. Infinite buffer space is available in the transmitter and receiver.
 Protocol Design: Figure below shows the design of the simplest protocol with no flow or
error control.

Figure Stop-and-Wait protocol (4 ed)


84 CN(18EC71)

Figure Stop-and-Wait protocol (5 ed)

 The data-link layer at the sender gets a packet from its network layer, makes a frame out
of it, and sends the frame.
 The data-link layer at the receiver receives a frame from the link, extracts the packet from
the frame, and delivers the packet to its network layer.
 The data-link layers of the sender and receiver provide transmission services for their
network layers.

Finite State Machine For Simple Protocol (FSM):

Figure: FSM for Simple Protocol

 In the above figure for simple protocol, the states and processes are shown through FSM
for both sending and receiving node.
 Each FSM has only one state, the ready state. The sending machine remains in the ready
state until a request comes from the process in the network layer.
85 CN(18EC71)

 When a event occurs, the sending machine encapsulates the message in a frame and sends
it to the receiving machine.
 The receiving machine remains in the ready state until a frame arrives from the sending
machine.
 When this event occurs, the receiving machine decapsulates the message out of the frame
and delivers it to the process at the network layer.
 Algorithms for Simplest Protocol:
 Below algorithm shows the procedure at the sender and receiver sites

Algorithm: Sender-site algorithm for the simplest protocol

Algorithm: Receiver-site algorithm for the simplest protocol

Figure below shows an example of communication using this protocol. It is very simple.
The sender sends a sequence of frames without even thinking about the receiver.
To send three frames, three events occur at the sender site and three events at the receiver site.
86 CN(18EC71)

Figure: Flow Diagram

Stop-and-Wait Protocol:
 The Stop-and-Wait protocol, uses both flow and error control.
 In this protocol, the sender sends one frame at a time and waits for an acknowledgment
before sending the next one.
 To detect corrupted frames, a CRC is needed to add for each data frame. When a frame
arrives at the receiver site, it is checked. If its CRC is incorrect, the frame is corrupted and
silently discarded.
 The silence of the receiver is a signal for the sender that a frame was either corrupted or
lost.
 Every time the sender sends a frame, it starts a timer. If an acknowledgment arrives before
the timer expires, the timer is stopped and the sender sends the next frame (if it has one to
send).
 If the timer expires, the sender resends the previous frame, assuming that the frame was
either lost or corrupted.
 This means that the sender needs to keep a copy of the frame until its acknowledgment
arrives. When the corresponding acknowledgment arrives, the sender discards the copy and
sends the next frame if it is ready.
 Figure below shows the outline for the Stop-and-Wait protocol. Note that only one frame
and one acknowledgment can be in the channels at any time.
87 CN(18EC71)

Figure: Stop-and-Wait protocol

 Figure below shows the FSMs for our primitive Stop-and-Wait protocol

Figure: FSM for Stop-and-Wait protocol

 At Sender Node:
 Sender States:
 The sender is initially in the ready state, but it can move between the ready and
blocking state.
 Ready State:
88 CN(18EC71)

 When the sender is in this state, it is only waiting for a packet from the network
layer.
 If a packet comes from the network layer, the sender creates a frame, saves a
copy of the frame, starts the only timer and sends the frame.
 The sender then moves to the blocking state.
 Blocking State:
 When the sender is in this state, three events can occur:
a. If a time-out occurs, the sender resends the saved copy of the frame and
restarts the timer.
b. If a corrupted ACK arrives, it is discarded.
c. If an error-free ACK arrives, the sender stops the timer and discards the
saved copy of the frame. It then moves to the ready state.
 Receiver:
 The receiver is always in the ready state. Two events may occur:
a. If an error-free frame arrives, the message in the frame is delivered to the
network layer and an ACK is sent.
b. If a corrupted frame arrives, the frame is discarded.
 Scenario 1:
 The first frame is sent and acknowledged. The second frame is sent, but lost. After
time-out, it is resent. The third frame is sent and acknowledged, but the
acknowledgment is lost. The frame is resent.
89 CN(18EC71)

Figure: Flow diagram for Stop-and-Wait protocol

 Problem with this scheme: The network layer at the receiver site receives two
copies of the third packet, which is not right.
 Solution: we can correct this problem using sequence numbers and
acknowledgment numbers.
 Sequence and acknowledgment numbers:
 Sequence number:
 Define the current number of the frame that is being transmitted.
 The sequence numbers start with 0.
 Binary in nature.
 Acknowledgment number:
 Defines the sequence number of the next frame to receive.
 The acknowledgment numbers start with 1.
 Binary in nature.
 Scenario 2:
 Figure below shows how adding sequence numbers and acknowledgment numbers
can prevent duplicates. The first frame is sent and acknowledged. The second frame
is sent, but lost. After time-out, it is resent. The third frame is sent and
acknowledged, but the acknowledgment is lost. The frame is resent.
90 CN(18EC71)

Figure: Flow diagram for Stop-and-Wait protocol with Sequence and acknowledgment numbers

Piggybacking:
 In two-way communication, whenever a data frame is received, the receiver waits and does
not send the control frame (acknowledgement or ACK) back to the sender immediately.
 The receiver waits until its network layer passes in the next data packet. The delayed
acknowledgement is then attached to this outgoing data frame.
 Definition: The technique of temporarily delaying the acknowledgement so that it can be
hooked with next outgoing data frame is known as piggybacking.
 Working Principle:
 In the data frame itself, we incorporate one additional field for acknowledgment
(called ACK).
 Whenever party A wants to send data to party B, it will send the data along with
this ACK field. Considering the sliding window here of size 8 bits, if A has send
frames up to 5 correctly (from B), and wants to send frames starting from frame 6,
it will send ACK6 with the data.
 Three rules govern the piggybacking data transfer.
 If station A wants to send both data and an acknowledgment, it keeps both
fields there.
91 CN(18EC71)

 If station A wants to send just the acknowledgment, then a separate ACK


frame is sent.
 If station A wants to send just the data, then the last acknowledgment field
is sent along with the data. Station B simply ignores this duplicate ACK
frame upon receiving.
 Advantages:
 Better use of available channel bandwidth.
 The disadvantages of piggybacking are:
 Additional complexity.
 If the data link layer waits too long before transmitting the acknowledgement, then
retransmission of frame would take place.

Problems:

1. Match the following to one or more layers of the OSI model:


a. Route determination – Network Layer
b. Flow control- Data Link Layer, Transport Layer
c. Interface to transmission media- Physical Layer
d. Provides access for the end user- Application layer

2. Match the following to one or more layers of the OSI model:


a. Reliable process-to-process message delivery – Transport Layer
b. Route selection - Network Layer
c. Defines frames - Data Link Layer
d. Provides user services such as e-mail and file transfer- Application layer
e. Transmission of bit stream across physical medium - Physical Layer

3. Match the following to one or more layers of the OSl model:


a. Communicates directly with user's application program- Transport Layer
b. Error correction and retransmission - Transport Layer
c. Mechanical, electrical, and functional interface - Physical Layer
d. Responsibility for carrying frames between adjacent nodes - Data Link Layer

4. Match the following to one or more layers of the OSI model:


a. Format and code conversion services - Presentation Layer
b. Establishes, manages, and terminates sessions – session layer
c. Ensures reliable transmission of data - Data link and transport layers
92 CN(18EC71)

d. Log-in and log-out procedures - session layer


e. Provides independence from differences in data representation - Presentation Layer

5. If the data link layer can detect errors between hops, why do you think we need another
checking mechanism at the transport layer?
Solution:
The errors between the nodes can be detected by the data link layer control, but the error
at the node (between input port and output port) of the node cannot be detected by the data link
layer

Question Bank:

1. Identify the five components of a data communications system.


2. What are the three criteria necessary for an effective and efficient network?
3. What are the advantages of a multipoint connection over a point-to-point one?
4. What are the two types of line configuration?
5. Categorize the four basic topologies in terms of line configuration.
6. What is the difference between half-duplex and full-duplex transmission modes?
7. Name the four basic network topologies, and cite an advantage of each type.
8. For n devices in a network, what is the number of cable links required for a mesh, ring,
bus, and star topology?
9. What are some of the factors that determine whether a communication system is a LAN or
WAN?
10. What is an internet? What is the Internet?
11. Why are protocols needed?
12. In a LAN with a link-layer switch, Host 1 wants to send a message to Host 3. Since
communication is through the link-layer switch, does the switch need to have an address?
Explain.

13. How many point-to-point WANs are needed to connect n LANs if each LAN should be
able to directly communicate with any other LAN?
14. When we use local telephones to talk to a friend, are we using a circuit switched network
or a packet-switched network?
15. When a resident uses a dial-up or DLS service to connect to the Internet, what is the role
of the telephone company?
93 CN(18EC71)

16. What is the first principle we discussed in this chapter for protocol layering that needs to
be followed to make the communication bidirectional?
17. Explain the difference between an Internet draft and a proposed standard.
18. Explain the difference between a required RFC and a recommended RFC.
19. Explain the difference between the duties of the IETF and IRTF.
20. What is the maximum number of characters or symbols that can be represented by
Unicode?
21. A color image uses 16 bits to represent a pixel. What is the maximum number of different
colors that can be represented?
22. Assume six devices are arranged in a mesh topology. How many cables are needed? How
many ports are needed for each device?
23. For each of the following four networks, discuss the consequences if a connection fails.
a. Five devices arranged in a mesh topology
b. Five devices arranged in a star topology (not counting the hub)
c. Five devices arranged in a bus topology
d. Five devices arranged in a ring topology
24. We have two computers connected by an Ethernet hub at home. Is this a LAN or a WAN?
Explain the reason.
25. In the ring topology, what happens if one of the stations is unplugged?
26. In the bus topology, what happens if one of the stations is unplugged?
27. Performance is inversely related to delay. When we use the Internet, which of the following
applications are more sensitive to delay?
a. Sending an e-mail
b. Copying a file
c. Surfing the Internet
28. List the layers of the Internet model.
29. Which layers in the Internet model are the network support layers?
30. Which layer in the Internet model is the user support layer?
31. What is the difference between network layer delivery and transport layer delivery?
32. What is a peer-to-peer process?
33. How does information get passed from one layer to the next in the Internet model?
34. What are headers and trailers, and how do they get added and removed?
35. What are the concerns of the physical layer in the Internet model?
36. What are the responsibilities of the data link layer in the Internet model?
37. What are the responsibilities of the network layer in the Internet model?
38. What are the responsibilities of the transport layer in the Internet model?
39. What is the difference between a port address, a logical address, and a physical address?
40. Name some services provided by the application layer in the Internet model.
41. How do the layers of the Internet model correlate to the layers of the OSI model?
42. How are OSI and ISO related to each other?
94 CN(18EC71)

43. Match the following to one or more layers of the OSI model:
44. What are the three major components of a telephone network?
45. Give some hierarchical switching levels of a telephone network.
46. What is LATA? What are intra-LATA and inter-LATA services?
47. Describe the SS7 service and its relation to the telephone network.
48. What are the two major services provided by telephone companies in the United States?
49. What is dial-up modem technology? List some of the common modem standards and their
data rates.
50. What is DSL technology? What are the services provided by the telephone companies using
DSL? Distinguish between a DSL modem and a DSLAM.
51. Compare and contrast a traditional cable network with a hybrid fiber-coaxial network.
52. How data transfer is achieved using CATV channels?
53. Distinguish between CM and CMTS.
54. Why circuit-switching was chosen for telephone networks?
55. Define end-to-end addressing in a telephone network when two parties communicate.
56. When we have an overseas telephone conversation, we sometimes experience a delay. Give
the reason?
57. Draw a bar chart to compare the different downloading data rates of common modems.
58. Draw a bar chart to compare the different downloading data rates of common DSL
technology implementations (use minimum data rates).
59. Calculate the minimum time required to download one million bytes of information using
each of the following technologies:
a. V32 modem
b. V32bis modem
c. V90 modem
60. Repeat Exercise 17 using different DSL implementations (consider the minimum rates).
61. Repeat Exercise 17 using a cable modem (consider the minimum rates).
62. What type of topology is used when customers in an area use DSL modems for data transfer
purpose?

VTU Question:

1. Show the layer representation in the TCP/IP model and the OSI model and explain. (Jan
2010, 10 M)
2. Give a brief overview of SS7 signaling. (Jan 2010, 10 M)
3. Match the following functions to the appropriate layers in the OSI model.
a. Dividing the transmitted bit stream into frames
b. Determining the route to be used through the subnet
c. Reliable process to process message delivery
95 CN(18EC71)

d. Format and code conversion services


e. Accessing the World Wide Web (Jan 2010, 10 M)
4. Explain OSI model, with a neat diagram. Consider a source, destination machine and some
intermediate nodes for discussion. (June 2010, 10 M)
5. How addresses employed (used) in internet employing TCP/IP protocol can be classified?
6. (June 2010, 02 M)
7. What is DSL technology? List different DSL’s available. Discuss salient feature of ASDL.
(June 2010, 08 M)
8. What are the levels of addresses that are used in internet, employing the TCP/IP protocols?
(December 2010, 10 M)
9. What are different types of services provided by telephone networks? (December 2010,
10 M)
10. Name the major components of a telephone network. (December 2010 04 M, January
2016 04 M)
11. With a neat diagram, explain the TCP/IP reference model, giving a brief description of the
protocols in each layer (July 2011, 10 M)
12. Differentiate between CM and CMTS. (July 2011, 04 M)
13. Explain the operation of ADSL using discreet multi one modulations indicating the
different channels, with a neat diagram. (July 2011, 06 M)
14. Explain the difference between OSI reference model and TCP/IP reference model
(December 2011, 05 M)
15. Match the following to one or more layers in OSI model:
a. Route determination
b. Flow control
c. Interface to transmission media
d. Provides access for end user
e. Format and code conversion services (December 2011, 05 M)
16. What is DSL technology? What are the services provided by the telephone companies using
DSL? Distinguish between DSL and DSLAM (December 2011, 10 M)
17. Describe the ISO OSI reference model of a computer network. Discuss the function of each
layer. (December 2012, 10 M)
18. Describe the SS7 service and its relation to the telephone network. (December 2012, 05
M)
19. Distinguish between a DSL modem and a DSLAM. (December 2012, 05 M)
20. Explain briefly with relevant examples, the 4 levels of address that are used in an internet
employing the TCP/IP Protocols. (July 2013, 10 M)
21. Briefly describe the function of physical layer and data link layer. (July 2013, 06 M)
22. Explain the operation of ADSL using Discrete Multitone Technique indicating the different
channels with diagram. (July 2013, 04 M)
96 CN(18EC71)

23. With a neat diagram explain TCP/IP reference model. How do the layers of TCP/IP model
correlate to the OSI model?(January 2014 08M , January 2016 10M)
24. Explain about IxCs with a schematic. What are point of presence?( January 2014, 06M)
25. How ADSL could achieve higher data rate over existing local loops? Explain DSLAM. (
January 2014,06M)
26. What is ADSL? Explain the operation of ADSL using discrete multitone modulation with
a neat diagram. (January 2016 10M)
27. Explain usage of existing loops, adaptive technology and discrete multitone technique in
ADSL. (July 2015, 10 M)
28. Mention the layers of TCP/IP protocol suite and give brief explanation of protocols used
in the suite. (July 2015, 10 M)

You might also like