Vous êtes sur la page 1sur 43

CS6551 COMPUTER NETWORKS

UNIT 1

UNIT I FUNDAMENTALS & LINK LAYER

Computer Network

Computer network is a collection of computers and networking devices connected by


communication channels, that facilitate communications among users and allows users to share
resources with other users.

Purpose of Networking,
Computer networks can be used for a variety of purposes,

1. Sharing hardware
In a networked environment, each computer on a network may access and use hardware
resources on the network, such as printing a document on a shared network printer.
2. Sharing files, data, and information
In a network environment, authorized user may access data and information stored on
other computers on the network. The capability of providing access to data and information on
shared storage devices is an important feature of many networks.
3. Sharing software
Users connected to a network may run application programs on remote computers.
4. Facilitating communications
Using a network, people can communicate efficiently and easily via email, instant
messaging, chat rooms, telephone, video telephone calls, and video conferencing.
5. Security
Protecting the data from unauthorized access and viruses.

Data Communications

Data communications is the exchange of data between two devices via some form of
transmission medium such as a wire cable or Wireless.
Fundamental Characteristics:
 Delivery.
 Accuracy.
 Timeliness.
 Jitter.
DeliveryThe system must deliver data to the correct destination.
AccuracyThe system must deliver the data without any change.
TimelinessThe system must deliver data in a timely manner.
JitterJitter refers to the variation in the packet arrival time.

ComponentsA data communications system has five components:

1
CS6551 COMPUTER NETWORKS
UNIT 1

1. Message
 The message is the information (data) to be communicated. It can be text, numbers,
pictures, audio, and video.
2. Sender
 The sender is the device that sends the data message.
 It can be a computer, workstation, telephone handset, video camera, and so on.
3. Receiver
 The receiver is the device that receives the message.
 It can be a computer, workstation, telephone handset, television, and so on.
4. Transmission medium
 The transmission medium is the physical path by which a message passes from sender to
receiver.
 Examples of transmission media include twisted-pair wire, coaxial cable, fiber optic
cable, and radio waves.
5. Protocol
 A protocol is a set of rules that governs data communications.
 It represents an agreement between the communicating devices.

Requirements for Network Design

Users

Application Programmer
 List the services that user application needs.
 Example: A guarantee that each message it sends will be delivered without error within a
certain amount of time.
Network Designer
 List the properties of a cost-effective design.
 Example: The network resources are efficiently utilized and fairly allocated to different
users.
Network Provider
 List the characteristics of a system that is easy to administer and manage.
 Example: Faults can be easily isolated and it is easy to account for usage.
Connectivity
A network must provide connectivity among a set of computers.

Nodes

2
CS6551 COMPUTER NETWORKS
UNIT 1
The links are connected to the devices (computers and all devices) named as nodes.
Links
A network consists of two or more devices directly connected by some physical medium,
such as a coaxial cable or an optical fiber. Such a physical medium is called as links.
Types of Links or Connections
 A network is two or more devices connected through links.
 A link is a communications pathway that transfers data from one device to another.
 There are two possible types of connections:
 Point-to-Point
 Multipoint
Point-to-Point
 A point-to-point connection provides a dedicated link between two devices.
 The link capacity is shared between the two nodes.
 The link can be a cable or microwave link.
 Typical example is TV and its remote control.

Multipoint
 A multipoint connection is one in which more than two devices/nodes share a common
link.
 In a multipoint environment, the capacity of the channel is shared, either spatially or
temporally.
 If several devices can use the link simultaneously, it is a spatially shared connection. If
users must take turns, it is a timeshared connection.

Direction of Data Flow


Transmission of data is done by any one of the transmission modes like simplex, half-
duplex, or full-duplex.
Simplex
 In simplex mode of communication, data can flow in one direction only (unidirectional).
 One device can transmit data and the other can only receive.
 The simplex mode can use the entire capacity of the channel to send data in one direction.
 The keyboard can only introduce input; the monitor can only accept output.

3
CS6551 COMPUTER NETWORKS
UNIT 1

Half-Duplex
 In half-duplex mode of communication each station can both transmit and receive, but not
at the same time.
 When one device is sending, the other can only receive, and vice versa.
 The entire capacity of a channel is used by any device transmitting at the time.
 Walkie-talkies are the example for half-duplex systems.

Full-Duplex
 In full-duplex mode both stations can transmit and receive simultaneously.
 The capacity of the channel is divided between the two directions.
 Example is telephone communication system, when two people are communicating by a
telephone line, both can talk and listen at the same time.

Data Representation

Information’s are in different forms such as text, numbers, images, audio, and video.
Text
Text is represented as a bit pattern, a sequence of bits (0’s or 1’s). Different sets of bit
patterns have been designed to represent text symbols.
Examples: Upper Case letters (A, B, C… Z), Lower Case letters (a, b, c…z), Numeric
Characters (0, 1, 2, 3…9) and Punctuation Symbols (.,?,:,;,!, …)
Numbers
Numbers are also represented by bit patterns.
Images
Images are also represented by bit patterns. In is composed of a matrix of pixels (picture
elements) where each pixel is a small dot. The size of the pixel depends on the resolution.
Audio
Audio refers to the recording or broadcasting of sound or music.

4
CS6551 COMPUTER NETWORKS
UNIT 1
Video
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.
Communication Modes
Unicast The communication is from a single host to another single host. There is one device
transmitting a message destined for one receiver.

Broadcast A single host can transmit a message to all other hosts in a network. This scenario
is said to be broadcast.

MulticastMulticast enables a single host to communicate with a specific set of hosts in a


network.

Network Criteria
 A network must be able to meet a certain number of criteria.
 The most important of these are performance, reliability, and security.
1. Performance
Performance can be measured by
 Transit time
 Response time.
Transit time is the amount of time required for a message to travel from one device to another.
Response time is the time between a request and a response (Speed of operation).
 The performance of a network depends on
 The number of users
 The type of transmission medium
 The capabilities of the connected hardware
 The efficiency of the software.
 Performance is often evaluated by two networking metrics
 Throughput
 Delay.
 We need more throughput and less delay.

2. Reliability
5
CS6551 COMPUTER NETWORKS
UNIT 1
 Network reliability is measured by accuracy, failure rate, establishment time and
robustness.
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 data losses.

Protocol
Set of rules that governs the data communication is called protocol. The Key elements are,
i) Syntax Structure or format of the data.
ii) SemanticsIt gives the meaning of each section of bits. How is a particular pattern
to be interpreted, and what action is to be taken based on that interpretation?
iii) TimingIt indicates the two characteristics: when the data should be sent and how
fast the data can be sent.

Categories of Network

The three primary categories of network are:


1. Local Area Network (LAN)
2. Metropolitan Area Network (MAN)
3. Wide Area Network (WAN)
1. Local Area Network (LAN)

 LAN is usually privately owned and links the devices in a single office, building or campus
of up to few kilometers in size.
 These are used to share resources (may be hardware or software resources) and to exchange
information.
 LANs are distinguished from other kinds of networks by three categories: their size,
transmission technology and topology.
 This is more reliable as compared to MAN and WAN.
 It also simplifies network management.
 LAN typically used transmission technology consisting of single cable to which all machines
are connected.
 Traditional LAN’s run at speeds of 10 to 100 Mbps (but now much higher speeds can be
achieved).
 The most common LAN topologies are bus, ring and star.

6
CS6551 COMPUTER NETWORKS
UNIT 1

2. Metropolitan Area Network (MAN)

 MAN is designed to extend over the entire city.


 It means of connecting a number of LANs into a larger network so that resources may be
shared LAN-to-LAN as well as device-to-device.
 MAN is wholly owned and operated by a private company or may be a service provided by a
public company.
3. Wide Area Network (WAN)

 WAN provides long-distance transmission of data, voice, image and information over large
geographical areas that may comprise a country, continent or even the whole world.
 WAN is not self dependent and so it uses public leased or private communication equipment.
 A WAN that is wholly owned and used by a single company is often referred to as enterprise
network.
7
CS6551 COMPUTER NETWORKS
UNIT 1

Network Topologies

The term physical topology refers to the way in which a network is physically interconnected.
The network topology is the geometric representation of the relationship of all the links
(medium) and linking devices (nodes) to one another.
 There are six types of topologies: Bus, Star, Mesh, Ring, Tree and Hybrid.
1. Bus Topology
 In a bus topology one long cable acts as a backbone to link all the devices in a network.

 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 splices the main cable to create a contact with the metallic core.
Advantages:
1. Easy to installation
2. Needs fewer connectivity devices.
3. Low cost.
4. Bus topology uses less cabling.
Disadvantages:
1. It is difficult to add new devices.
2. Signal reflection at the taps can cause degradation in quality.
3. Difficult reconnection and fault isolation.
4. A break in the bus cable stops all transmission.

2. Star Topology
 In a star topology, each device has a dedicated point-to-point link only to a central controller
called a hub.
 In star topology does not allow direct traffic between devices.
 The controller acts as an exchange: If one device wants to send data to another device, it
sends the data to the controller, then controller forward the data to the other connected
device.

8
CS6551 COMPUTER NETWORKS
UNIT 1

Advantages:
1. Less expensive than a mesh topology.
2. Easy to install and reconfigure - Each device needs only one link and one I/O port to
connect.
3. Robustness - If one link fails, only that link is affected.
4. Easy fault identification and fault isolation – If one link fails that device only does not
work in the network all other links are remain active. This is easy fault identification and
fault isolation.
Disadvantages:
1. If the hub goes down, the whole network is down.
2. Each device requires own cabling segment from a central hub.
3. Cabling more than bus and ring topology but less than mess topology.

3. Mesh Topology

 In a mesh topology, every device has a dedicated point-to-point link to every other device.
 The term dedicated means that the link carries traffic only between the two devices it
connects.
 A fully connected mesh networks has n (n-1)/2 physical channels to link ‘n’ devices.
 Node 1 must be connected to ‘n – 1’ nodes, node 2 must be connected to ‘n – 1’ nodes, and
finally node ‘n’ must be connected to ‘n – 1’ nodes. So we need totally n (n - 1) physical
links.
Advantages:
1. Dedicated links - Each connection can carry its own data load, thus eliminating the traffic
problems that can occur when links must be shared by multiple devices.
2. Robust - If one link becomes unusable, it does not affect the entire network.
3. 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.
4. Easy fault identification and fault isolation - Point-to-point links between the nodes, so
fault identification and fault isolation easy.

9
CS6551 COMPUTER NETWORKS
UNIT 1
Disadvantages:
1. Difficulty in installation and reconfiguration - Every device must be connected to every
other device so installation and reconnection are difficult.
2. More Expensive - The hardware required to connect each link (I/O ports and cable) can be
prohibitively expensive.
4. Ring Topology

 In a ring topology, each device has a dedicated point-to-point connection with only the two
devices on either side of it.
 A signal is passed along the ring in one direction, from device to device, until it reaches its
destination.
 Each device in the ring incorporates a repeater. When a device receives a signal intended for
another device, its repeater regenerates the bits and passes them along.
Advantages:
1. Easy to install and reconfigure.
2. Fault isolation is easy.
3. To add or delete a device requires changing only two connections.
Disadvantages:
1. Maximum ring length and number of devices is limited.
2. Unidirectional traffic.
3. A break in the ring can be affect entire network.
4. Adding or removing the node disrupts the network.

5. Tree Topology

 The majority of the devices are connected to a secondary hub that in turn connected with
central hub.
 The central hub is an active hub. An active hub contains a repeater, which regenerate the
received bit pattern before sending.
 The secondary hub may be active or passive. A passive hub means it just precedes a physical
connection only.
10
CS6551 COMPUTER NETWORKS
UNIT 1
Advantages:
1. It allows more devices to be connected to a single central hub and can therefore increase the
distance; a signal can travel between devices.
2. It allows the network to isolate and prioritize communications.
Disadvantages:
1. If the hub goes down, the whole network is down.
2. Cabling more than bus and ring topology but less than mess topology.
6. Hybrid Topology

 Hybrid topology is combination of any two different basic network topologies.

Network Architecture

 A computer network must provide general, cost effective, fair and robust connectivity
among a large number of computers.
 Designing a network to meet this requirement is not a small task.
 To deal with this complexity, network designers have developed general blue prints – usually
called network architectures.
 It guides the design and implementation of networks.
Layering and Protocols
Layering (Figure: Layered Network System)

 The services provided at the high layers are implemented in terms of the services provided by
the low layers.
 Host-to-host connectivity – abstracting away the fact that there may be an arbitrarily complex
network topology between any two hosts.
 Process-to-process channels – abstracting away the fact that the network occasionally loses
messages.
Features of Layering,

11
CS6551 COMPUTER NETWORKS
UNIT 1
1. It decomposes the problem of building a network into more manageable components.
2. It provides a more modular design.
Protocols
 The abstract objects that make up the layers of a network system are called protocols.
 A protocol provides a communication service that higher-level objects use to exchange
messages.
(Figure: Services and Peer interface)

Each protocol defines two different interfaces,


1. Service interface – defines the operations that local objects can perform on the protocol.
2. Peer interface – form and meaning of messages exchanged between protocol peers to
implement the communication service.

Uses of Protocol,
1. Protocol is used to refer to the abstract interfaces.
2. Protocol refers to the module, which implements the two interfaces.
(Figure: Protocol Graph)

 Protocols RRP (Request / Reply Protocol) and MSP (Message Stream Protocol) implement
two different types of process-to-process channels and both depend on HHP (Host – Host
Protocol) which provides a host-to-host connectivity service.
Encapsulation
 A packet (header and data) at level 7 is encapsulated in a packet at level 6.
 The whole packet at level 6 is encapsulated in a packet at level 5, and so on.
 The data portion of a packet at level N - 1 carries the whole packet (data and header and
maybe trailer) from level N. The concept is called encapsulation;
 Level N - 1 is not aware of which part of the encapsulated packet is data and which part is the
header or trailer.
 Level N - 1, the whole packet coming from level N is treated as one integral unit.

12
CS6551 COMPUTER NETWORKS
UNIT 1
Multiplexing and De-Multiplexing
 Sender side multiple flows of data over a single physical link is called multiplex.
 This can be achieved by adding identifier to the header message. It is known as
demultiplexing or demux key. It gives address to which it has to communicate. The messages
are de-multiplexed at the destination side.

Standards

 Standard provides a model for development of a product, which going to develop.


 Data communication products are fall into two categories. They are,
1. De facto
2. De jure
1. De facto
They are further classified into Proprietary and Non proprietary.
Proprietary They are originally invented by a commercial organization as a basis for the
operation of its product. They are wholly owned by the company, which invented them. They are
closed standards.
Nonproprietary Groups or committees that have passed them into public domain develop
them. They are open standards.
2. De jure
They have been legislated by an officially recognized body.

Standards Organization

Standards are developed by,


1. Standards creation committee.
2. Forums.
3. Regularity agencies.
1. Standards creation committees
1. International Standards Organization (ISO).
2. International Telecommunications Union – Telecommunications Standards Section (ITU-
T).
3. Consultative Committee for International Telegraphy and Telephony (CCITT).
4. The American National Standards Institute (ANSI).
5. The Institute of Electrical and Electronics Engineers (IEEE).
6. The Electronic Industries Association (EIA).
2. Forums
1. Frame Relay Forum.
2. ATM Forum & ATM consortium.
3. Internet Society (ISOC) & Internet Engineering Task Force (IETF).
3. Regularity Agencies
1. Federal Communication commission.

There are two most widely referenced architectures are,


1. OSI Architecture. (ISO/OSI Reference Model)

13
CS6551 COMPUTER NETWORKS
UNIT 1
2. Internet Architecture. (TCP/IP Reference Model)

OSI Architecture (ISO/OSI Reference Model Or The 7 Layer Model)

 ISO refers International Standards Organization was established in 1947.


 OSI refers to Open System Interconnection that covers all aspects of network
communication.
 OSI model is for understanding and designing a network architecture that is flexible,
robust and interoperable.
 The architecture of OSI model has seven layers are
1. Physical layer (Bits)
2. Data link layer (Frames)
3. Network layer (Packets)
4. Transport layer (Segment)
5. Session layer (Dialog Units)
6. Presentation layer (Raw Data)
7. Application layer (Text, Numbers).
Organization of Layers
The seven layers are arranged by three sub groups.
1. Network Support Layers.
2. User Support Layers.
3. Intermediate Layer.
Network Support Layers
 Physical, Data link and Network layers are Network Support Layers.
 They deal with the physical aspects of the data such as electrical specifications, physical
connections, physical addressing, and transport timing and reliability.
User Support Layers
 Session, Presentation and Application layers are User Support Layers.
 They deal with the interoperability between the software systems.
Intermediate Layer
 The transport layer is the intermediate layer between the network support and the user
support layers.

Architecture

14
CS6551 COMPUTER NETWORKS
UNIT 1

1. Physical Layer
 The physical layer coordinates the functions required to transmit a bit stream over a physical
medium.
 It also defines the procedures and functions that physical devices and interfaces have to
perform for transmission to occur.
Functions of physical layer
1. Physical characteristics of interfaces and medium
It defines the characteristics of the interface between the devices and the transmission
medium. It also defines the type of transmission medium.
2. Representation of bits
Physical layer encodes the bit stream data must be encoded into electrical or optical signal.
3. Data rate
Transmission rate-the number of bits sent each second is defined by the physical layer.
4. Synchronization of bits
Transmission rate and receiving rate must be same. This is done by synchronizing clocks at
sender and receiver.
5. Line configuration
The physical layer is concerned with the connection of devices to the media. Various line
configurations are point-to-point or multipoint.
6. Physical topology
The physical topology defines how devices are connected to make a network. Various
topologies are mesh, star, ring, bus, or hybrid topology.
7. Transmission mode

15
CS6551 COMPUTER NETWORKS
UNIT 1
The physical layer also defines the direction of transmission between two devices: simplex,
half-duplex, or full-duplex.

2. Data Link Layer


 It groups raw bits (zeros and ones) into frames.
 The data link layer responsible for transmitting frames from one node to another node.
 It makes the physical layer appear error-free to the upper layer.
Functions of data link layer
1. Framing
The frame received from network layer is divided into manageable data units called frames.
2. Physical addressing
If frames are to be send to different systems on the network, the data link layer adds a header
to the frame to define the sender and/or receiver of the frame.
The physical addressing handles the addressing problem locally.
3. Flow control
When the rate of the data transmitted and rate of data received by the receiver is not same,
some data may be lost. The data link layer imposes a flow control mechanism to avoid
overwhelming the receiver.
4. Error control
The data link layer uses this mechanism to detect and retransmit damaged or lost frames.
Error control is normally achieved through a trailer added to the end of the frame (Frame
Check Sequence).
5. Access control
When two or more devices are connected to the same link, data link layer protocols are
necessary to determine which device has control over the link at any given time.

3. Network Layer
 The network layer is responsible for the delivery of packets from source to destination,
possibly across multiple networks (links).
 The network layer is responsible for the delivery of individual packets from the source host
to the destination host.
Functions of network layer
1. Logical addressing
If a packet passes the network boundary, we need another addressing system to help
distinguish the source and destination.
The network layer adds a header to the packet coming from the upper layer includes the
logical addresses of the sender and receiver.
2. Routing
Network layer route or switch the packets to their final destination.

4. Transport Layer
 The transport layer is responsible for delivery of the entire message from one process to
another process.
 It treats each one independently, as though each piece belonged to a separate message.
Functions of transport layer

16
CS6551 COMPUTER NETWORKS
UNIT 1
1. Service-point addressing (Port addressing)
 Computer performs several operations at the same time.
 Source-to-destination delivery means delivery not only from one computer to the next but
also from a specific process (running program) on one computer to a specific process
(running program) on the other.
 The transport layer header must therefore include a type of address called a service-point
address (or port address).
2. 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.
3. 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.
4. Flow control
It performs end to end flow control while data link layer performs it across the link.
5. 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.
5. Session Layer
 It allows different machines to establish sessions between them.
 The session layer is the network dialog controller.
 It establishes, maintains, and synchronizes the interaction between communicating systems.
Functions of Session layer
1. Dialog control
The session layer allows two systems to enter into a dialog.
Communication between two processes to take place in either half duplex or full-duplex
mode.
2. Synchronization
The session layer allows a process to add checkpoints, or synchronization points, to a stream
of data.

6. Presentation Layer
 The presentation layer is concerned with the syntax and semantics of the information
exchanged between two systems.

Functions of presentation layer


1. Translation
 The information must be changed to bit streams before being transmitted.

17
CS6551 COMPUTER NETWORKS
UNIT 1
 Because different computers use different encoding systems, the presentation layer is
responsible for interoperability between these different encoding methods.
2. Encryption
 To carry sensitive information, a system must be able to ensure privacy.
 Encryption means that the sender transforms the original information to another form and
sends the resulting message out over the network.
 Decryption reverses the original process to transform the message back to its original
form.
3. Compression
 Data compression reduces the number of bits contained in the information.
 Data compression becomes particularly important in the transmission of multimedia such
as text, audio, and video.

7. Application Layer
 The application layer enables the user 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.
 The application layer is responsible for providing services to the user.

Functions of Application layer

1. Network virtual terminal


 A network virtual terminal is a software version of a physical terminal, and it allows a
user to log on to a remote host.
 The remote host believes it is communicating with one of its own terminals and allows
the user to log on.
2. File Transfer, Access and Management (FTAM)
This application allows a user to access files in a remote host (to make changes or read data),
to retrieve files from a remote computer for use in the local computer, and to manage or
control files in a remote computer locally.
3. Mail services
This application provides the basis for e-mail forwarding and storage.
4. Directory services
Directory services include access for global information and distributed database.

TCP/IP reference model Or Internet Architecture


 TCP/IP stands for Transmission Control Protocol/ Internet Protocol.
 TCP/IP reference model is a set of protocols that allow communication across multiple
networks.

18
CS6551 COMPUTER NETWORKS
UNIT 1

Figure: TCP/IP reference model

Figure: Protocols and networks in the TCP/IP model initially

Host-to-Network Layer
 This layer is same as physical and data link layer of OSI model.
 This layer also called network interface layer.
 Host to Network layer cannot define any protocol.
Internet Layer
 Internet layer is to permit hosts to send packets into any network and have them travel
independently to the destination (potentially on a different network).
 They may even arrive in a different order than they were sent, in which case it is the job of
higher layers to rearrange them, if in-order delivery is desired.
 The internet layer defines a packet format and protocol called IP (Internet Protocol).
 The job of the internet layer is to deliver IP packets where they are supposed to go. Packet
routing is clearly the major issue here, as is avoiding congestion.
Transport Layer
 Transport layer is designed to allow peer entities on the source and destination hosts to carry
on a conversation.
 Two end-to-end transport protocols are TCP and UDP.
 TCP (Transmission Control Protocol) is a reliable connection-oriented protocol that allows a
byte stream originating on one machine to be delivered without error on any other machine in
the internet. It fragments the incoming byte stream into discrete messages and passes each
one on to the internet layer. At the destination, the receiving TCP process reassembles the
received messages into the output stream. TCP also handles flow control to make sure a fast
sender cannot flood a slow receiver with more messages than it can handle.
 UDP (User Datagram Protocol) is an unreliable, connectionless protocol for applications that
do not want TCP's sequencing or flow control and wish to provide their own.
Application Layer
19
CS6551 COMPUTER NETWORKS
UNIT 1
 TCP/IP model does not have session or presentation layers.
 It contains all the higher-level protocols. The early ones included virtual terminal (TELNET),
file transfer (FTP), and electronic mail (SMTP).
 The virtual terminal protocol (TELNET) allows a user on one machine to log onto a distant
machine and work there.
 The file transfer protocol (FTP) provides a way to move data efficiently from one machine to
another.
 Electronic mail was originally just a kind of file transfer, but later a specialized protocol
(SMTP) was developed for it.
 Many other protocols have been added to these over the years: the Domain Name System
(DNS) for mapping host names onto their network addresses, NNTP, the protocol for moving
USENET news articles around, and HTTP, the protocol for fetching pages on the World Wide
Web, and many others.

Comparison of ISO/OSI and TCP/IP reference model

Network Performance
 Network performance is measured in two ways:
o Bandwidth (also called throughput)
o Latency (also called delay).
 Bandwidth of a network is given by the number of bits that can be transmitted over the
network in a certain period of time.
 Latency corresponds to how long it takes a message to travel from one end of a network to
the other. Latency is measured strictly in terms of time. It’s also called Transit time.
Latency =Propagation + Transmit + Queue
Propagation = Distance/Speed of Light
Transmit = Size/Bandwidth
where
Distance  length of the wire
Speed of Light  effective speed of light over that wire
Size  size of the packet

20
CS6551 COMPUTER NETWORKS
UNIT 1
Bandwidth  bandwidth at which the packet is transmitted.

Delay × Bandwidth Product

 The latency corresponds to the length of the pipe and the bandwidth gives the diameter of the
pipe, then the delay × bandwidth product gives the volume of the pipe the number of bits it
holds.
 The delay × bandwidth product is important to know when constructing high performance
networks because it corresponds to how many bits the sender must transmit before the first
bit arrives at the receiver.
Throughput = TransferSize/TransferTime
where
TransferTime = RTT+1/Bandwidth_TransferSize
where,
RTT (Round Trip Time) for a request message being sent across the network and the data being
sent back.

ISSUES IN DATA LINK LAYER

The data link layer has a number of specific functions it can carry out. These functions include,
1. Providing a well-defined service interface to the network layer.
2. Dealing with transmission errors.
3. Regulating the flow of data so that slow receivers are not swamped (flooded) by fast senders.

 The data link layer takes the packets it gets from network layer and encapsulates them into
frames for transmission.
 Each frame contains frame header, a payload field for holding the packet, and a frame trailer.

Functions of Data link layer


1. Services Provided to the Network Layer
 The function of the data link layer is to provide services to the network layer.
 The principal service is transferring data from the network layer on the source machine to the
network layer on the destination machine.

21
CS6551 COMPUTER NETWORKS
UNIT 1

 On the source machine is an entity, call it a process, in the network layer that hands some bits
to the data link layer for transmission to the destination. The job of the data link layer is to
transmit the bits to the destination machine so they can be handed over to the network layer
there, as shown in Fig. (a).
 The actual transmission follows the path of Fig. (b), but it is easier to think in terms of two
data link layer processes communicating using a data link protocol.

2. Framing
 To provide service to the network layer, the data link layer must use the service provided to it
by the physical layer.
 The physical layer does is accept a raw bit stream and attempt to deliver it to the destination.
 This bit stream is not guaranteed to be error free.
 The number of bits received may be less than, equal to, or more than the number of bits
transmitted, and they may have different values.
 It is up to the data link layer to detect and, if necessary, correct errors.

3. Error Control
 The usual method to ensure reliable delivery is to provide the sender with some feedback
about what is happening at the other end of the line.
 Typically, the protocol calls for the receiver to send back special control frames bearing
positive or negative acknowledgements about the incoming frames.
 If the sender receives a positive acknowledgement about a frame, it knows the frame has
arrived safely.
 If the sender receives a negative acknowledgement means that something has gone wrong,
and the frame must be transmitted again.

4. Flow Control
 Another important design issue in data link layer when a sender wants to transmit frames
faster than the receiver can accept them.
Two approaches are commonly used,

22
CS6551 COMPUTER NETWORKS
UNIT 1
 In the first one, feedback-based flow control, the receiver sends back information to the
sender giving it permission to send more data or at least telling the sender how the receiver is
doing.
 In the second one, rate-based flow control, the protocol has a built-in mechanism that limits
the rate at which senders may transmit data, without using feedback from the receiver.

FRAMING
Framing is the process of converting the physical layer’s raw bit stream into discrete units called
frames. This is done by the data link layer.
 To transmit frames over the node it is necessary to mention start and end of each frame.
 There are three techniques to solve this frame,
1. Byte - Oriented Protocols (BISYNC, PPP, DDCMP).
2. Bit – Oriented Protocols (HDLC).
3. Clock – Based Framing (SONET).
1. Byte - Oriented Protocols
 Each frame as a collection of bytes (characters) rather than a collection of bits.
 Such a byte-oriented approach is exemplified by the BISYNC (Binary Synchronous
Communication) and DDCMP (Digital Data Communication Message Protocol).
 These two protocols are using two different framing techniques, the sentinel approach and
the byte-counting approach.
Sentinel Approach (BISYNC)
This approach uses a special byte to mark at the beginning and end of frame.
 The BISYNC protocol illustrates the sentinel approach to framing; its frame format is
depicted in below figure,

 The beginning of a frame is denoted by sending a special SYN (synchronization) character.


 The data portion of the frame is then contained between special sentinel characters: STX
(start of text) and ETX (end of text).
 The SOH (start of header) field serves much the same purpose as the STX field.
 The frame format also includes a field labeled CRC (cyclic redundancy check) that is used to
detect transmission errors.
 The problem with the sentinel approach is that the ETX character might appear in the data
portion of the frame.
 BISYNC overcomes this problem by “escaping” the ETX character by preceding it with a
DLE (data-link-escape) character whenever it appears in the body of a frame. The DLE
character is also escaped (by preceding it with an extra DLE) in the frame body. This
approach is often called “character stuffing” because extra characters are inserted in the data
portion of the frame.

23
CS6551 COMPUTER NETWORKS
UNIT 1

Point – to –Protocol (PPP)


 The more recent Point-to-Point Protocol (PPP). The frame format of PPP is given below,

 Flag field has 01111110 as starting and ending sequence.


 The Address and Control fields usually contain default values.
 The Protocol field is used for de-multiplexing.
 The frame payload size can be negotiated, but it is 1500 bytes by default.
 The Checksum field is either 2 (by default) or 4 bytes long.
 The PPP frame format is unusual in that several of the field sizes are negotiated rather than
fixed.
 This negotiation is conducted by a protocol called LCP (Link Control Protocol).
 LCP sends control messages encapsulated in PPP frames, such messages are denoted by an
LCP identifier in the PPP Protocol.
Byte-Counting Approach (DDCMP)
 The number of bytes contained in a frame can be included as a field in the frame header.
DDCMP protocol header format is shown in below figure

 The COUNT field specifies how many bytes are contained in the frame’s body.
 Error in count field could not detect the end of frame correctly. Error in count field is called
as Framing Error.
 When framing error occurs receiver waits for next SYN character to start reading the next
frame.

2. Bit – Oriented Protocols (HDLC)


 The frame is a collection of bits. These bits might come from some character set, such as
ASCII, they might be pixel values in an image, or they could be instructions and operands
from an executable file.

24
CS6551 COMPUTER NETWORKS
UNIT 1

 HDLC denotes both the beginning and the end of a frame with the distinguished bit sequence
01111110.
 This sequence is also transmitted during any times that the link is idle so that the sender and
receiver can keep their clocks synchronized.
 On the sending side, any time five consecutive 1’s have been transmitted from the body of
the message (i.e., excluding when the sender is trying to transmit the distinguished 01111110
sequence), the sender inserts a 0 before transmitting the next bit.
 On the receiving side, should five consecutive 1’s arrive, the receiver makes its decision
based on the next bit it sees (i.e., the bit following the five 1’s).
 If the next bit is a ‘0’, it must have been stuffed, and so the receiver removes it.
 If the next bit is a ‘1’, then one of two things is true: Either this is the end-of-frame marker or
an error has been introduced into the bit stream.
 By looking at the next bit, the receiver can distinguish between these two cases:
 If it sees a ‘0’ (i.e., the last eight bits it has looked at are 01111110), then it is the end-of
frame marker;
 If it sees a ‘1’ (i.e., the last eight bits it has looked at are 01111111), then there must have
been an error and the whole frame is discarded.
 The process of adding one extra ‘0’ whenever five consecutive 1’s follow a 0 in the data, so
that the receiver does not mistake the pattern 0111110 for a flag is called as bit stuffing.

3. Clock – Based Framing (SONET)


 Synchronous Optical Network (SONET) is a standard for long-distance transmission of data
over optical networks.
 It supports multiplexing of several low-speed links onto one high-speed link.
 The lowest-speed SONET link, which is known as STS-1 and runs at 51.84 Mbps. SONET
STS-1 frame is given below figure,

25
CS6551 COMPUTER NETWORKS
UNIT 1

 It is arranged as nine rows of 90 bytes each, and the first 3 bytes of each row are overhead,
with the rest being available for data that is being transmitted over the link.
 The first 2 bytes of the frame contain a special bit pattern, and it is these bytes that enable the
receiver to determine where the frame starts.
 The receiver looks for the special bit pattern consistently, once every 810 bytes, since each
frame is 9 × 90 = 810 bytes long.
 The STS-N frame can be thought of as consisting of N STS-1 frames, where the bytes from
these frames are interleaved; that is, a byte from the first frame is transmitted, then a byte
from the second frame is transmitted, and so on.
 The payload from these STS-1 frames can be linked together to form a larger STS-N
payload; such a link is denoted STS-Nc (for concatenated). One of the fields in the overhead
is used for this purpose.
 Concatenation in the case of three STS-1 frames being concatenated into a single STS-3c
frame in given below,

ERROR DETECTION

ERROR
 Networks must be able to transfer data from one device to another with complete accuracy.

26
CS6551 COMPUTER NETWORKS
UNIT 1
 Some part of a message will be altered during transmission. For reliable communication
errors must be detected and corrected. Many factors like line noise can alter one or more bits
of a given data unit. This is known as errors.

Types of Errors
 When bits are transferred from one point to another they are subjected to unpredictable
changes because of interference.
 The bit when changed from 0 to 1 or from 1 to 0 causes the error.
There are two types. They are,

1. Single Bit Error


 It means that only one bit of a given data unit is changed from 1 to 0 or from 0 to 1.

2. Burst Bit Error


 It means that two or more bits in the data unit have changed.

 The length of the bust error is measured from the first corrupted bit to the last corrupted bit.
Some bits in between may not be corrupted.

ERROR DETECTION
 For reliable communication errors must be detected and corrected.
 For error detection we are using many mechanisms.
Method 1: (Sending every data twice)

 One error detection mechanism is to send every data unit twice, so that receiver checks every
bit of the two copies and detects the error.
Drawback
 Transmission time is doubled.
 Bit by bit comparison takes more time.

Method 2: (Extra bits are added with data)


 Instead of transmitting the entire data stream twice, a shorter group of bits may be appended
to the end of each unit. This technique is called redundancy because extra bits are redundant
to the information.

27
CS6551 COMPUTER NETWORKS
UNIT 1

Types of Redundancy Checks


Three types of redundancy checks are used in data communications. They are,
1. Parity Check
i. Simple parity check [Vertical Redundancy Check (VRC) ]
ii. Two dimensional parity check [Longitudinal Redundancy Check (LRC) ]
2. Cyclic Redundancy Check (CRC)
3. Checksum

1. Parity Check
It is most common and least expensive mechanism for error detection.

Simple Parity Check [Vertical Redundancy Check (VRC)]


 In this technique a parity bit is appended to every data unit so that the total number of 1’s in
the unit including the parity bit becomes even for even parity or odd for odd parity.
Sender side
 In even parity, the data unit is passed through the even parity generator.
 It counts the number of 1’s in the data unit.
 If odd number of 1’s, then it sets ‘1’ in the parity bit to make the number of 1’s as even.
 If the data unit having even number of ‘1’s then it sets ‘0’ in the parity bit to maintain the
number of 1’s as even.

Receiver side

28
CS6551 COMPUTER NETWORKS
UNIT 1
 When it reaches its destination, the receiver puts all bits through an even parity checking
function.
 If it counts even number of 1s than there is no error. Otherwise there some error.

Performance
 Simple parity check can detect all single bit errors.
 It can also detect burst errors as long as total number of errors in each data unit is odd (1, 3,
5, etc)
 If any 2 bits change in transmission, the changes cancel each other and the data unit will pass
a parity check even though the data unit is damaged.
 It can determine only an odd number of bits. It cannot determine an even number of errors.

Example 1:

The data unit is :0101011


Odd Parity – Append ‘1’ and Even Parity – Append ‘0’.
Count the number of 1’s in data unit; here the number of 1 is four so this data unit is Even Parity
so Append ‘0’ with data unit.
The VRC check :01010110

Example 2: The data unit is :1010100


Odd Parity – so Append ‘1’ (1 0 1 0 1 0 0 1)
Case 1: (Not detecting error)
Even number of bits changed in the transmission
The VRC check :11111001
The parity checker now counts the number of 1’s. Even number of 1’s present in the data. So it
detects the data as correct data. So simple parity check fails in this case.
Case 2: (Detecting error)
Odd number of bits changed in the transmission
The VRC check :11111101
The parity checker now counts the number of 1’s. Odd number of 1’s present in the data. So error
is detected in data. The receiver discard the data and ask for retransmission.

Two dimensional parity check [Longitudinal Redundancy Check (LRC)]


 Block of bits is organized in a table (rows and columns).
 We calculate the parity bit for each row and create a new parity column.
 We then calculate the parity for each column and add a new parity row.
Example
In LRC, a block of bits is divided into rows and a redundant row of bits added to the
whole block.
Data units: 1100111 1011101 0111001

Now the data units are transmitted in row wise manner including the parity bits.
29
CS6551 COMPUTER NETWORKS
UNIT 1
11001111 10111011 01110010 00000110
Performance
 This method has a high probability of detecting burst errors.
 If 2-bits in one data units are damaged and 2-bits in the same position in another data unit are
also damaged, the checker will not detect an error.
Example
Data sent: 10101100 10010011 00111111
Case 1: (Burst errors are detected)
Data received with burst errors are: 10101011 01110011 00111111
10101011 Five 1’s – odd 1’s error
01110011 Five 1’s – odd 1’s error.
Burst error is detected.
Case 2: (Errors in same positions of two data units are not detected)
Data received with burst errors are: 01110001 01000010
0 111000 1 – even 1’s – No error
0 100001 0 - even 1’s – No error
Burst errors are not detected in this case.

2. Cyclic Redundancy Check (CRC)


 CRC is based on binary division.
 In this a sequence of redundant bits, called CRC remainder is appended to the end of a data
unit.
 CRC remainder is so that the resulting data unit becomes exactly divisible by a second
predetermined binary number.
 At its destination, the incoming data unit is divided by the same number.
 If at this step there is no reminder, the data unit is assumed to be intact and therefore
accepted.
 A remainder indicates that the data unit has been changed in transit and therefore must be
rejected.
Two qualities of CRC,
 It must have exactly one less bit than the divisor.
 Data string appended with CRC must exactly divisible by the divisor.

30
CS6551 COMPUTER NETWORKS
UNIT 1

Sender Side
 The data unit is ‘m’ bits.
 A string of (n-1) 0’s are appended to the data unit where ‘n’ is the number of bits of the
receiver.
 The new elongated data unit (data + appended 0’s) is divided by the divisor using modulo-2
division method. The remainder is the CRC.
Receiver Side
 The data unit arrives at the receiver first, followed by the CRC.
 The receiver treats whole string as the data unit and divides it by the same divisor that was
used to find the CRC remainder.
 If the remainder is ‘0’ then the data unit is error free. Otherwise it having some error and it
must be discarded.
Modulo-2 division method
 CRC generator uses modulo-2 division method. The binary modulo-2 division uses the
modulo-2 subtraction. This is identical to XOR operation.
First Value Second Value Output
0 0 0
0 1 1
1 0 1
1 1 0
 In CRC generating process the divisor always begins with 1.
 The dividend is dividing by divisor using modulo-2 division method.
 The remainder obtained as result of the division. The remainder’s left most bit is ‘0’. This bit
is discarded.
 Remainder’s second left most bit may be either ‘0’ or ‘1.
 If the remainder’s second left most bit is ‘0’, then a string of 0’s of the length equal to
divisor’s length replaces the divisor. (Example if divisor is 4 bits long it is replaced by
‘0000’.

Example: 1

31
CS6551 COMPUTER NETWORKS
UNIT 1
The data unit is: 1 0 0 1 0 0 and Divisor: 1 1 0 1
Divisor 4 bits (n bits). So n-1 bits (three bits) are appended to the data unit.
CRC Generator

CRC checker
 CRC checker functions exactly as generator does. After receiving the data appended with the
CRC, it does the same modulo-2 division.
 If the remainder is all 0’s, the CRC is dropped and data are accepted; otherwise the received
data is error so discard and resent.

CRC checker (Corrupted data)


 Suppose the receiver receives the corrupted data. The correct data plus CRC is 100100 001
but received data is 100110 001. The corrupted bit is circled.

32
CS6551 COMPUTER NETWORKS
UNIT 1

 The remainder is other than ‘0’, we can conclude that data unit has been corrupted during
transmission.
Example: 2
 The data unit is: 1 1 0 1 0 1 1 0 1 1 and Divisor: 1 0 0 1 1
 Divisor 5 bits (n bits). So n-1 bits (four bits) are appended to the data unit.

CRC Generator

33
CS6551 COMPUTER NETWORKS
UNIT 1
CRC checker

 CRC checker functions exactly as generator does. After receiving the data appended with the
CRC, it does the same modulo-2 division.
 If the remainder is all 0’s, the CRC is dropped and data are accepted; otherwise the received
data is error so discard and resent.

CRC checker (Corrupted data)

Suppose the receiver receives the corrupted data. The correct data plus CRC is 1 1 0 1 0 1 1 0 1
1 but received data is 1 1 0 1 0 0 1 0 1 1. The corrupted bit is circled.

34
CS6551 COMPUTER NETWORKS
UNIT 1

Performance
 CRC is very effective error detection method. If the divisor is chosen according to the
previously mentioned rules,
1. CRC can detect all burst errors that affect an odd number of bits.
2. CRC can detect all burst errors of length less than or equal to the degree of the polynomial.
3. CRC can detect, with a very high probability, burst errors of length greater than the degree of
polynomial.

3. CHECKSUM

The error detection method used by the higher layer protocols is called checksum. It consists
of two arts. They are,
1. Checksum generator.
2. Checksum checker
Checksum Generator
 In the sender, the checksum generator subdivides the data unit into equal segments of ‘n’ bits.
 These segments are added with each other by using one’s complement arithmetic in such a
way that the total is also ‘n’ bits long.
 That total (sum) is then complemented and appended to the end of the data unit.
35
CS6551 COMPUTER NETWORKS
UNIT 1
Checksum Checker
 The receiver subdivides the data unit as above and adds all segments together and
complements the result.
 If the extended data unit is un damaged, the total value found by adding the data segments
and the checksum field should be zero.
 Otherwise the packet contains an error and the receiver rejects it.
Example:
At the sender
Data unit: 10101001 00111001

0 0 1 1 1 0 0 1 (First segment of data units)


1 0 1 0 1 0 0 1 (Second segment of data units)
Sum 11100010

Checksum 0 0 0 1 1 1 0 1 (Complement of sum)

At the receiver
Received data: 1 0 1 0 1 0 0 1 00111001 00011101

10101001
00111001
00011101
Sum 11111111

Complement of Receiver sum0 0 0 0 0 0 0 0


It means that the patter is ok.

(Check whether the data is corrupted or not)


Received data: 1 0 1 0 1 1 1 1 11111001 00011101

10101111
11111001
00011101

Result 11000101
Carry 1

Sum 11000110
Complement 0 0 1 1 1 0 0 1
It means that the patter is corrupted.

ERROR CORRECTION

 Error correction is handled in two ways.

36
CS6551 COMPUTER NETWORKS
UNIT 1
1. Error correction by retransmission.
2. Forward error correction (FEC).
1. Error correction by retransmission
When an error is discovered, the receiver can have the sender retransmit the entire data unit.
2. Forward error correction (FEC)
In FEC, a receiver can use an error correcting code, which automatically corrects certain
errors.
Types of error correction:
1. Single bit error correction.
2. Burst bit error correction.

FLOW CONTROL
 It refers to a set of procedures used to restrict the amount of data flow between sending and
receiving stations.
 It tells the sender how much data it can transmit before it must wait for an acknowledgement
from the receiver.
 Flow control is a technique that a transmitting entity does not overcome a receiving entity
with data.
 Two functional mechanisms are acknowledgement and timeouts.
 After getting each frame the receiver will send ACK to sender.
 If the sender does not receive ACK up to reasonable amount of time then it transmit the
original frame waiting for reasonable amount of time is called timeout.
 There are two flow control methods are used. They are,
1. Stop and wait Flow control.
2. Sliding window Flow control.

1. Stop and wait Flow control


 The sends a frame, stops sending next frame until it receives acknowledgement for the
previous frame.
 Data frames numbered alternatively as 0 and1’s.
 Data frame 0 is acknowledged by ACK 1(requesting sender to send the next frame with
number 1).
 Sending device holds a copy of frame transmitted. If ACK is received then the copy is
deleted otherwise the copy is used for retransmission.
 Sender starts timer when it sends a frame. If the acknowledgment is not received in the
specified time, the frame is retransmitted. If ACK received within specified time, the next
frame is sent and its timer is started.
i) Normal Operation
 The Frame 0 is sent successfully (without damage or loss of frame). The ACK 1 is sent back
by receiver to sender.
 Sender sends the next frame, Frame 1 and waits for ACK 0 and so on. All the frames are sent
successfully and ACK are received before the timer expires.

37
CS6551 COMPUTER NETWORKS
UNIT 1

ii) Lost or Damaged Frame


 If the frame sent, is lost in transmission, then the ACK is not sent for that frame.
 If the frame is received with error then the frame is discarded and ACK is not sent for that
frame when the timer expires the sender retransmits the lost / damaged frame.

iii) Lost Acknowledgement


 If the ACK is lost, then the sender waits for the specified time and assumes that the frame is
not received by the receiver successfully. So it retransmits the frame.
 The receiver has already received the frame which is retransmitted. So the receiver discards
second copy of the frame and it sends the ACK for that frame.

iv) Delayed Acknowledgment

38
CS6551 COMPUTER NETWORKS
UNIT 1
 If an ACK does not reaches the sender within the specified time, the sender assumes that the
frame sent may be lost and so it retransmits the frame.
 The receiver has successfully received the frame and the second copy of the frame
retransmitted is discarded.
 The ACK which reaches after the specified time is accepted and the next frame is sent. The
ACK for the second copy is discarded in the sender side.

Piggybacking
 During each transmission the frame is sent along with the ACK for the previous frame. This
method of combining data frame with an ACK is called Piggybacking.
 Piggybacking saves bandwidth. The overhead like addresses, CRC computation is done only
once for both frame ACK, instead of computing it separately for frame and ACK.

Disadvantages of stop and wait:


1. The sender waits for more time till it receives the acknowledgement for each frame.

39
CS6551 COMPUTER NETWORKS
UNIT 1
2. The transmission medium is not efficiently utilized.
3. The time taken for sending ‘n’ frame is more.

2. Sliding window Flow control


 Each frame is assigned a unique consecutive sequence number.
 The receiver uses the numbers to place received frames in the correct order, discarding
duplicate frames and identifying missing ones.
Sender
 The sender assigns a sequence number, denoted SeqNum, to each frame.
 The sender maintains three variables:
1. The Send Window Size, denoted SWS, gives the upper bound on the number of
outstanding (unacknowledged) frames that the sender can transmit;
2. LAR denotes the sequence number of the Last Acknowledgment Received;
3. LFS denotes the sequence number of the Last Frame Sent.
 The sender maintains the following invariant:
LFS - LAR ≤ SWS

Receiver
 The receiver maintains the following three variables:
1. The receive window size, denoted RWS, gives the upper bound on the number of out-of-
order frames that the receiver is willing to accept.
2. LAF denotes the sequence number of the largest acceptable frame.
3. LFR denotes the sequence number of the last frame received.
 The receiver also maintains the following invariant:
LAF – LFR ≤ RWS

Two types of sliding window protocol


1. Go Back N ARQ
2. Selective Repeat ARQ
Go Back N ARQ

Sender Sliding Window


 The frames are stored in a buffer.
 The frames that are sent but the ACK is expected (outstanding frames) are enclosed in a
window.
 The size of the window is 2m – 1.
 On receiving an ACK the window slides.
Receiver Sliding Window
 The window size = 1 in the receiver side.

40
CS6551 COMPUTER NETWORKS
UNIT 1
 The receiver is expecting a specific frame to arrive specific order.
Timers
 Sender starts a timer for every frame that was sent.

 Receiver has not timers.


Acknowledgment

 If the frame is received without damage then the receiver sends a positive acknowledgment,
requesting the next frame.
 If the frame received is damaged or out of order other than expected frame then the receiver
keeps silent without sending acknowledgment.
 So the timer in sender side expires and the sender retransmits the frames starting from the
one with expired timer. Can send single or cumulative ack.
i) Normal Operation
For ‘n’ frames inside Window only one ACK can be sent. (For 0 & 1, only one ACK, ACK 2
is sent)
Sender:
 The frames in the window are sent sequentially without waiting for the ACK.
 The ACK can be accepted as cumulative ACK. That is for all the frames in the window one
ACK is received.
Ex: For 0,1,2 frames, after the receiver receives 0,1,2 it send only one ACK, ACK3 which
means all the previous frames are received successfully.

 Once the ACK is got the sender window slides to its right and the control variable are
updated.
Receiver:
 The receiver window slides to its right after receiving its expected frame.

ii) Damaged or lost Frame


 If any frame is lost or damaged the sender sends the next frame sequentially. The receiver
expecting a specified frame (lost frame) discards all other incoming frame. The sender timer
expires and it retransmits from the lost frame.

41
CS6551 COMPUTER NETWORKS
UNIT 1

iii) Lost Acknowledgment


The frame is resend if the ACK doesn’t reach the sender at time or lost or damaged if the
previous ACK are lost but the cumulative ACK reaches the sender, then there is no need for
retransmission.
iv) Delayed Acknowledgment
If the ACK doesn’t reach the sender in specified time then frame is resend.

Selective Repeat ARQ

 In go-back N if one frame is damaged or lost “N” frames are resend.


 To avoid this overhead, the selective repeat ARQ uses a mechanism to retransmit only the
damaged or lost frame instead of N frames.
Sender Sliding Window
 The frames are stored in a buffer.
 The frames that are sent but the ACK is expected (outstanding frames) are enclosed in a
window.
 The size of the window is 2m / 2.
 On receiving an ACK the window slides.
Receiver Window
 Receiver Window size is same as the sender window size.
 After a frame is received successfully they receiver sends an ACK to the sender.
 The receiver window sides to its right side if the frame is received successfully.

i) Normal operation
Sender sends the frame in the window one by one. After the ACK is received the sender
window slides to its right.

42
CS6551 COMPUTER NETWORKS
UNIT 1

ii) Frame lost or damage

 If frame 2 is lost, frame 3 is sent by the sender sequentially.


 The receiver accepts frame 3 if frame 3 is in receiver window and sends the NAK 2 to sender
requesting for the transmission of frame 2.
 After receiving the NAK the sender retransmits the lost or damaged frame to receiver.

iii) Lost and delayed ACK’s


The sender sets a timer when a frame is sent. If ACK or NAK is not received in the specified
time the sender retransmits the frame.

43

Vous aimerez peut-être aussi