Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 59

CSE 306

UNIT 3
Prepared By: Dr. Krishan kumar, Professor,
LPU

LPU

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


DATA LINK LAYER
Unit III

DATA LINK LAYER : Data link Layer design issues, Elementary Datalink

Protocols, Error Detection and Correction- Hamming code, CRC, Parity,

Checksum, Switch working

MAC SUBLAYER : Multiple Access Protocols- ALOHA, CSMA and CSMA/CD,

Random Access, Controlled access, Ethernet protocol


KEYWORDS
-FRAME
-FRAME SIZE
-BIT/CHARACTER
STUFFING
-NOISY CHANNEL
-Simple PROTOCOL
The data link layer is divided into two sub-layers : 
1.Logical Link Control Sub-layer (LLC) – 
Provides the logic for the data link, Thus it controls the synchronization, flow control, and

error checking functions of the data link layer. Functions are – 


1.(i) Error Recovery. 
2.(ii) It performs the flow control operations. 
3.(iii) User addressing. 
 
2.Media Access Control Sub-layer (MAC) – 
It is the second sub-layer of data-link layer. It controls the flow and multiplexing for

transmission medium. Transmission of data packets is controlled by this layer. This layer is

responsible for sending the data over the network interface card. 

Functions are – 
Data Link Layer Design Issues

•Services Provided to the Network


Layer
•Framing
•Error Control
•Flow Control

LPU
• Services provided to the network layer – 
The data link layer act as a service interface to
the network layer.
• The principle service is transferring data from
network layer on sending machine to the network
layer on destination machine. This transfer also takes
place via DLL (Data link-layer). 
• Frame synchronization– 

The source machine sends data in the form of blocks


called frames to the destination machine.
The starting and ending of each frame should be
identified so that the frame can be recognized by the
destination machine.   LPU
FRAMING
•Frames are the units of digital transmission , comparable to the

packets of energy called photons in the case of light energy.

•The data link layer needs to pack bits into frames, so that
each frame is distinguishable from another.

• For Example-Our postal system practices a type of


framing. The simple act of inserting a letter into an
envelope separates one piece of information from another;
the envelope serves as the delimiter.
LPU
Types of Framing

-Fixed-Size Framing
-Variable-Size Framing
•In fixed-length framing, the size of the frame
works as the delimiter. Hence there is no need
to set a boundary for the frame.
• In variable-length framing, it's difficult to
determine the start and end of a frame.
•Variable Size Framing---Character oriented
protocols and Bit oriented Protocols.
LPU
A frame in a character-oriented protocol

LPU
Byte stuffing is the
process of adding 1 extra
byte whenever there is a
flag or escape character in
the text.
LPU
Byte stuffing and unstuffing

LPU
A frame in a bit-oriented protocol

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

LPU
Bit stuffing and unstuffing

LPU
W 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
Error Control

LPU
• Flow control refers to a set of
procedures used to restrict the
amount of data that the sender
can send before waiting for
acknowledgment.

LPU
Error control in the data link
layer is based on automatic
repeat request, which is the
retransmission of data.

LPU
Flow Control

•In a network, the sender sends the data and the


receiver receives the data.
•Suppose a situation where the sender is sending
the data at a speed higher than the receiver is
able to receive and process it, then the data will
get lost. 
•The flow control method will keep a check that
the senders send the data only at a speed that the
receiver is able to receive and process.
LPU
•Flow control is the management of data flow
between computers or devices or between
nodes in a network so that the data can be
handled at an efficient pace. Too much data
arriving before a device can handle it causes
data overflow, meaning the data is either lost or
must be retransmitted.
Factors-
•Transmission time
•Time taken to emit all bits into medium
•Propagation time
•Time for a bit to traverse the link

LPU
LPU
ISELESS CHANNELS
An ideal channel in which no frames are
lost, duplicated, or corrupted.

Two protocols for this type of channel.

-Simplest Protocol
-Stop-and-Wait Protocol

LPU
Simplest Protocol

•No flow and Error Control

LPU
The design of the simplest protocol with no flow or
error control

LPU
Flow diagram for Simplest

LPU
Stop-and-Wait Protocol

• Sender sends one frame, stops until it


gets confirmation from receiver.

LPU
Design of Stop-and-Wait Protocol

LPU
Flow diagram for Stop and Wait

LPU
OISY CHANNELS

Although the Stop-and-Wait Protocol gives us an


idea of how to add flow control to its predecessor,
noiseless channels are nonexistent.
Three protocols in this section that use error control.

Stop-and-Wait Automatic Repeat Request


Go-Back-N Automatic Repeat Request
Selective Repeat Automatic Repeat Request

LPU
In Stop-and-Wait ARQ, we use sequence
numbers to number the frames.
The sequence numbers can be
1,0,1,0,1…

LPU
In Stop-and-Wait ARQ, the
acknowledgment number is 0 if
sequence number is 1 and
acknowledgment number is 1 if
sequence number is 0

LPU
Design of the Stop-and-Wait ARQ Protocol

LPU
Flow diagram for Example

LPU
Disadvantage Stop-and-Wait ARQ Protocol

•Inefficient---if channel is thick and long


• Thick means high bandwidth
•Long means roundtrip delay
•Product of both is bandwidth delay.
•Bandwidth delay is number of bits we can send
while waiting for news from receiver.

LPU
Questions/Answers

Thanks

LPU
Assume that, in a Stop-and-Wait ARQ system, the
bandwidth of the line is 1 Mbps, and 1 bit takes 20 ms to
make a round trip. What is the bandwidth-delay product?
If the system data frames are 1000 bits in length, what is
the utilization percentage of the link?

Solution
The bandwidth-delay product is

LPU
Pipelining

• Task begins before end of first task.


• Stop-and-Wait ARQ does not use pipelining but other two
techniques do.

• This improves efficiency.

LPU
Go-Back-N Protocol

• This sends multiple frames before receiving acknowledgment from


receiver.

LPU
Note

In the Go-Back-N Protocol, the sequence


numbers are modulo 2m,
where m is the size of the sequence
number field in bits.

LPU
Sliding Window

• Defines the range of sequence numbers that is concern of sender


and receiver.
• The range which is concern of sender is called sender sliding window.
• The range which is concern of receiver is called receiver sliding
window.

LPU
Send window for Go-Back-N ARQ

LPU
Note

The send window is an abstract concept


defining an imaginary box of size 2m − 1
with three variables: Sf, Sn, and Ssize.

LPU
Note

The send window can slide one


or more slots when a valid
acknowledgment arrives.

LPU
Receive window for Go-Back-N ARQ

LPU
Note

The receive window is an abstract


concept defining an imaginary box
of size 1 with one single variable Rn.
The window slides
when a correct frame has arrived;
sliding occurs one slot at a time.

LPU
Design of Go-Back-N ARQ

LPU
Note

In Go-Back-N ARQ, the size of the send


window must be less than 2m;
the size of the receiver window
is always 1.

LPU
Flow diagram

LPU
Flow diagram

LPU
Note

Stop-and-Wait ARQ is a special case of


Go-Back-N ARQ in which the size of the
send window is 1.

LPU
Send window for Selective Repeat ARQ

LPU
Receive window for Selective Repeat ARQ

LPU
Design of Selective Repeat ARQ

LPU
Note

In Selective Repeat ARQ, the size of the


sender and receiver window
must be at most one-half of 2m.

LPU
Delivery of data in Selective Repeat ARQ

LPU
Flow diagram

LPU
Design of piggybacking in Go-Back-N ARQ

LPU
Questions/Answers

LPU
THANKS

LPU

You might also like