8- Data Link Layer
8- Data Link Layer
Data link layer is divided into two sub-layers: Data Link Control
(DLC) and Multiple Access Control (MAC).
The data link control deals with the design and procedures for
communication between two adjacent nodes: node to node
communication.
Data link control functions include framing, flow and error control,
and software implemented protocols that provides smooth and
reliable transmission of frames between nodes.
Can we send the whole message in a frame?
Types of framing:
• Fixed-Size Framing
• Variable-Size Framing
2
A frame in a bit-oriented protocol
3
Variable-Size Framing: Bit Stuffing and
Unstuffing
4
A frame in a character-oriented
protocol
5
Variable-Size Framing: Byte Stuffing and
Unstuffing
6
Flow control at the data link layer
7
Data Link Layer protocols
8
Simplest Protocol
9
Stop-and-Wait Protocol
10
Sender Site Algorithm of Simplex Stop – and –
Wait Protocol for Noiseless Channel
begin
canSend = True; //Allow the first frame to be sent
while (true) //check repeatedly
do
Wait_For_Event(); //wait for availability of packet
if ( Event(Request_For_Transfer) AND canSend) then
Get_Data_From_Network_Layer();
Make_Frame();
Send_Frame_To_Physical_Layer();
canSend = False;
else if ( Event(Acknowledgement_Arrival)) then
Receive_ACK();
canSend = True;
end if
end while
end
11
Receiver Site Algorithm of Simplex Stop
– and – Wait Protocol for Noiseless
Channel
while (true) //check repeatedly
do
if ( Event(Frame_Arrival) then
Receive_Frame_From_Physical_Layer();
Extract_Data();
Deliver_Data_To_Network_Layer();
Send_ACK();
end if
end while
12
Stop-and-Wait Automatic Repeat
Request
The sender will not send the next frame until it is sure that the current one
is correctly receive
Sequence number is necessary to check for duplicated frames
14
Design of the Stop-and-Wait ARQ
Protocol
15
Stop-and-Wait ARQ
16
Stop-and-Wait ARQ
18
Go-Back-N Automatic Repeat
Request
19
Send window for Go-Back-N ARQ
20
The size of receive window is always 1.
21
Receive window for Go-Back-N ARQ
22
Design of Go-Back-N ARQ
23
Window size for Go-Back-N ARQ
24
Go-Back-N Automatic Repeat
Request
ACK1 is not necessary if ACK2 is sent: Cumulative ACK
27
Send window for Selective Repeat
ARQ
28
Receive window for Selective Repeat
ARQ
29
Design of Selective Repeat ARQ
30
Selective Repeat ARQ, window size
31
Piggybacking ( Bidirectional
transmission)
It is a method to combine a data frame with an acknowledgment.
It can save bandwidth because data frame and an ACK frame can
combined into just one frame
32
High-level Data Link Control (HDLC)
33
HDLC transfer modes
34
HDLC transfer modes
35
Frames
36
HDLC Frame Format
37
HDLC frames
38
39
Point-to-Point Protocol (PPP)
40
PPP uses set of protocols to establish the link, authenticate the parties
involved, and carry the network layer data.
Three set of protocols are defined to make PPP powerful:
• Link control protocol (LCP): responsible for establishing, maintaining,
configuring, and terminating links.
• Authenticate protocol (APs): it validate the identity of a user who need to
access a set of resources.
• Network control protocols (NCPs): PPP is multiple network layer protocol.
IT can carry a N/w layer data packet from protocols defined by Internet,
OSI, DECnet, Novel, AppleTalk etc.
41
Components of PPP
42
Question 1: Station A uses 32 byte packets to transmit messages to Station B
using a sliding window protocol. The round trip delay between A and B is 80
milliseconds and the bottleneck bandwidth on the path between A and B is 128
kbps. What is the optimal window size that A should use?
43
Host A is sending data to host B over a full duplex link. A
and B are using the sliding window protocol for flow control.
The send and receive window sizes are 5 packets each.
Data packets (sent only from A to B) are all 1000 bytes long
and the transmission time for such a packet is 50 µs.
Acknowledgement packets (sent only from B to A) are very
small and require negligible transmission time. The
propagation delay over the link is 200 us. What is the
maximum achievable throughput in this communication?
44
Consider the sliding window flow-control protocol operating between a sender and a
receiver over a full-duplex error-free link. Assume the following:
• The time taken for processing the data frame by the receiver is negligible.
• The time taken for processing the acknowledgement frame by the sender is
negligible.
• The sender has infinite number of frames available for transmission.
• The size of the data frame is 2,000 bits and the size of the acknowledgement frame
is 10 bits.
• The link data rate in each direction is 1 Mbps (=10^6 bits per second).
• One way propagation delay of the link is 100 milliseconds.
The minimum value of the sender's window size in terms of the number of frames,
(rounded to the nearest integer) needed to achieve a link utilization of 50% is__
45