0% found this document useful (0 votes)
8 views33 pages

Unit 3 - Lec 11

The document provides an overview of the Data Link Layer, detailing how it encapsulates packets into frames with headers and trailers for transmission. It discusses various protocols, including Unrestricted Simplex, Simplex Stop-and-Wait, and Simplex Protocol for a Noisy Channel, highlighting their functionalities and limitations. Additionally, it introduces the Sliding Window Protocol and the concept of Piggybacking to improve efficiency in data transmission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views33 pages

Unit 3 - Lec 11

The document provides an overview of the Data Link Layer, detailing how it encapsulates packets into frames with headers and trailers for transmission. It discusses various protocols, including Unrestricted Simplex, Simplex Stop-and-Wait, and Simplex Protocol for a Noisy Channel, highlighting their functionalities and limitations. Additionally, it introduces the Sliding Window Protocol and the concept of Piggybacking to improve efficiency in data transmission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33

Module-3

Data Link Layer


Data Link Layer
 When the data link layer accepts a packet, it
encapsulates the packet in a frame by
adding a data link header and trailer to it

2
Data Link Layer
 The frame consists of an embedded packet,
some control information (in the header),
and a checksum (in the trailer).

 The frame is then transmitted to the data


link layer on the other machine.
3
Data Link Layer
 When a frame arrives at the receiver, the
hardware computes the checksum.

 If the checksum is incorrect (i.e., there was a


transmission error), the data link layer is
informed

 If the inbound frame arrived undamaged,


then also the data link layer is informed

4
Data Link Layer
 As soon as the receiving data link layer has
acquired an undamaged frame, it checks the
control information in the header, and if
everything is all right, passes the packet
portion to the network layer.

 Under no circumstances is a frame header


ever given to a network layer.

5
Frame
 A frame is composed of four fields:
 kind
 seq
 ack
 info
 The first three fields contain control
information and the last field contain actual
data to be transferred.

 These control fields are collectively called


the frame header. 6
Frame
 The kind field tells whether there are any
data in the frame

 The seq and ack fields are used for sequence


numbers and acknowledgements,
respectively

 The info field of a data frame contains a


single packet

 The info field of a control frame is not used.


7
Data Link Layer

8
Types of Stop and Wait Protocol:

The different types of Stop and Wait


Protocol s are:
• An Unrestricted Simplex Protocol
• A Simplex Stop-and-Wait Protocol
• A Simplex Protocol for a Noisy Channel

• These are also known as Elementary


Protocols

9
Elementary Data Link Protocols

 An Unrestricted Simplex Protocol


 A Simplex Stop-and-Wait Protocol
 A Simplex Protocol for a Noisy Channel

10
An Unrestricted Simplex Protocol

 Data are transmitted in one direction only.

 Processing time can be ignored.

 Infinite buffer space is available.

 And best of all, the communication channel


between the data link layers never damages
or loses frames.

 This thoroughly unrealistic protocol


11
An Unrestricted Simplex Protocol

 The sender runs in the data link layer of the


source machine, and the receiver runs in the
data link layer of the destination machine.

 No sequence numbers or acknowledgements


are used

 The only event type possible is frame_arrival


(i.e., the arrival of an undamaged frame)

12
An Unrestricted Simplex Protocol
 The sender is in an infinite while loop just
pumping data out onto the line as fast as it
can.

 Only the info field of the frame is used by


this protocol, because the other fields have
to do with error and flow control and there
are no errors or flow control restrictions here.

13
An Unrestricted Simplex Protocol
 The receiver initially waits the arrival of an
undamaged frame.

 Once the frame has arrived, it is removed


from the hardware buffer

 The data portion is passed on to the network


layer

 The data link layer settles back to wait for


the next frame effectively suspending itself
until the frame arrives 14
A Simplex Stop-and-Wait Protocol
 The main problem we have to deal with here
is how to prevent the sender from flooding
the receiver with data faster than the latter
is able to process them.

 A more general solution to this is to have the


receiver provide feedback to the sender.

15
A Simplex Stop-and-Wait Protocol
 After having passed a packet to its network
layer, the receiver sends a little dummy
frame back to the sender which gives the
sender permission to transmit the next
frame.

 The sender is required by the protocol to


strictly follow its time until the little dummy 16
A Simplex Stop-and-Wait Protocol

 Protocols in which the sender sends one


frame and then waits for an
acknowledgement before proceeding are
called stop-and-wait

17
A Simplex Stop-and-Wait Protocol

18
A Simplex Protocol for a Noisy Channel

 It is the task of the data link layer processes


to provide error-free, transparent
communication between network layer
processes.

 The network layer on machine A gives a


series of packets to its data link layer, which
must ensure that an identical series of
packets are delivered to the network layer
on machine B by its data link layer.

19
A Simplex Protocol for a Noisy Channel

 The network layer on B has no way of


knowing that a packet has been lost or
duplicated

 So the data link layer must guarantee that


no combination of transmission errors can
cause a duplicate packet to be delivered to a
network layer.

20
A Simplex Protocol for a Noisy Channel

1. The network layer on A gives packet 1 to its


data link layer. The packet is correctly
received at B and passed to the network
layer on B. B sends an acknowledgement
frame back to A.

2. The acknowledgement frame gets lost


completely

3. The data link layer on A eventually times


out. Not having received an
acknowledgement, it (incorrectly) assumes 21
A Simplex Protocol for a Noisy Channel

4. The duplicate frame also arrives at the data


link layer on B perfectly and is passed to
the network layer . If A is sending a file to B,
part of the file will be duplicated In other
words, the protocol will fail.

 The requirement is that there should be


some way for the receiver to be able to
distinguish a frame that it is seeing for the
first time from a retransmission.

22
A Simplex Protocol for a Noisy Channel

 The way to achieve this is to have the


sender put a sequence number in the
header of each frame it sends.

 Then the receiver can check the sequence


number of each arriving frame to see if it is
a new frame or a duplicate to be discarded.

23
A Simplex Protocol for a Noisy Channel

 Since a small frame header is desirable, the


question arises: What is the minimum
number of bits needed for the sequence
number?

 A 1-bit sequence number (0 or 1) is


sufficient.

 At each instant of time, the receiver


expects a particular sequence number next.

 Any arriving frame containing the wrong 24


A Simplex Protocol for a Noisy Channel

 When a frame containing the correct


sequence number arrives, it is accepted
and passed to the network layer.

 Then the expected sequence number is


incremented modulo 2 (i.e., 0 becomes 1
and 1 becomes 0).

25
A Simplex Protocol for a Noisy Channel

26
Disadvantage of Stop and Wait

1. Very Inefficient because at a moment , only


one frame is in transition.
2. The sender has to wait at least one round
trip time before sending the next frame.

27
Sliding Window Protocol
1. Data is transmitted in both the directions.
2. Requires full duplex communication
channel.
3. No separate ACK sent.
4. The channel is a Noisy channel.
5. Uses the concept of piggybacking

28
Piggybacking
 When a data frame
arrives, instead of
immediately sending a
separate control frame,
the receiver restrains
itself and waits until the
network layer passes it
the next packet.

 The acknowledgement is
attached to the outgoing 29
Piggybacking
 The acknowledgement gets a free ride on the
next outgoing data frame.

 The technique of temporarily delaying outgoing


acknowledgements so that they can be
attached onto the next outgoing data frame is
known as piggybacking.

30
Advantage of Piggybacking
 Better use of the available channel
bandwidth.
 The ack field in the frame header costs only a few
bits, whereas a separate frame would need a
header, the acknowledgement, and a checksum.

 Also fewer frames sent means fewer ''frame


arrival'' interrupts, and also fewer buffers in
the receiver
31
Disadvantage of Piggybacking

 How long should the data link layer wait for a


packet onto which to piggyback the
acknowledgement?

 If the data link layer waits longer than the


sender's timeout period, the frame will be
retransmitted, defeating the whole purpose
of having acknowledgements.

32
Piggybacking
 Solution:
 Waiting for a fixed number of milliseconds.
 If a new packet arrives quickly, the
acknowledgement is piggybacked onto it;
 Otherwise, if no new packet has arrived by the
end of this time period, the data link layer just
sends a separate acknowledgement frame.

33

You might also like