Tutorials Data Link Layer Protocols
Tutorials Data Link Layer Protocols
Tutorials Data Link Layer Protocols
Piggybacking
• Piggybacking is a method
that combines the data and
the ACK in one frame
• It is useful in bidirectional
communications
• Stations can send their data
along with ACK to data
previously received
• Piggybacking is faster and
saves bandwidth
a)
• • • 0 1 2 3 4 5 6 7 0 • • •
b) W
• • • 0 1 2 3 4 5 6 7 0 • • •
c) W
• • • 0 1 2 3 4 5 6 7 0 • • •
� 1 W �(2a + 1)
�
U = �W
� W < (2a + 1)
�2a + 1
where a = Tprop/Tf (i.e. length of link in bits)
• Sliding window protocol can achieve 100% utilization if W (2a + 1)
• The smaller the W needed the better! (Why?)
• To get high value for U, small value for a is needed as well !!
11
High-Level Data Link Control Protocol
(HDLC)
To satisfy a variety of applications, HDLC defines three types
of stations, two link configurations, and three types of data
transfer modes of operation.
Station types:
• Primary Station (PS):
Responsible for controlling the operation of the link
Frames issued by the PS are called commands
• Secondary Station (SS): Frames issued by the SS are called
responses – operates under the control of a primary station
• Combined Station: issues commands and responses
Link configurations:
• Unbalanced: one primary plus one or more secondary
• Balanced: two combined stations
12
High-Level Data Link Control Protocol
(HDLC)
Transfer modes:
• Normal Response Mode (NRM) – used in unbalanced config.;
secondary may only tx data in response to a command from
primary
• Asynchronous Response Mode (ARM) – used in unbalanced
config.; Secondary may initiate data tx without explicit
permission; primary still retains line control (initialization,
error recovery, …)
• Asynchronous Balanced Mode (ABM) – used in balanced
config.; either combined station may tx data without
receiving permission from other station
13
HDLC ABM
14
HDLC Bit Stuffing & Removal
15
HDLC Frames
• HDLC uses Synchronous transmission
• HDLC defines three types of frames
• Information frames (I-frames)
• Used to transport user data and user control information relating
to the user data (e.g. piggybacking)
• Supervisory frames (S-frames)
• Used to transport control information only
• Unnumbered frames (U-frames)
• Used in the link management
16
HDLC Generic Frame Format
Indicates that the first
transmitted field is the Header
flag, then the address, then the
control…
Header Trailer
17
HDLC I, S & U Frames Format
18
HDLC I-Frames
• I-frames are designed to carry user data from Network-layer
• They can include flow & error control information
(piggybacking)
• The bits of the I-frame Control field are:
• First bit is always “0”. It means it is an I-frame
• Next 3-bits, called N(S), define the sequence of the frame
• So possible sequences are 0,1,2,3,4,5,6,7
• Next bit is called P/F (Poll or Final)
• When a primary station polls other stations, it sets this bit to 1
• When a secondary station responds to a poll, it sets this bit to 1
• Next 3-bits, called N(R), define the value of the ACK when
piggybacking is used
19
HDLC Example: Piggybacking w/o
Errors
• Next slide shows an exchange using piggybacking when there is
no error
• Station A begins the exchange of information with an I-frame
numbered 0 followed by another I-frame numbered 1
• Station B piggybacks its acknowledgment of both frames onto an
I-frame of its own
• Station B’s first I-frame is also numbered 0 [N(S) field] and
contains a 2 in its N(R) field, acknowledging the receipt of A’s
frames 1 and 0 and indicating that it expects frame 2 to arrive
next
• Station B transmits its second and third I-frames (numbered 1
and 2) before accepting further frames from station A
• Its N(R) information, therefore, has not changed: B frames 1 and 2
indicate that station B is still expecting A’s frame 2 to arrive next
20
HDLC Example: Piggybacking w/o
Errors
21
HDLC Example: Piggybacking with
Errors
• Suppose frame 1 sent from station B to station A has an
error
• Station A informs station B to resend frames 1 and 2
(the system is using the Go-Back-N mechanism)
• Station A sends a reject supervisory frame to announce
the error in frame 1
• Next slide shows the exchange
22
HDLC Example: Piggybacking with Errors
23
NOTION OF SLOT TIME
• Consider the case where each channel transmits 1 unit every 3T
seconds