Professional Documents
Culture Documents
Part 1-1 - Data Link Layer Protocols
Part 1-1 - Data Link Layer Protocols
Communications
Tenth Edition
by William Stallings
Frame synchronization
Flow control
Error control
Addressing
Link management
Flow Control
➢ Technique for assuring that a transmitting
entity does not over-whelm a receiving
entity with data
⚫ The receiving entity typically allocates a data
buffer of some maximum length for a transfer
⚫ When data are received, the receiver must do
a certain amount of processing before
passing the data to the higher-level software
➢ Inthe absence of flow control, the
receiver’s buffer may fill up and overflow
while it is processing old data
Source Destination Source Destination
Frame 1 Frame 1
Frame 1 Frame 1
Frame 2 Frame 2
Frame 2
Frame 3 Frame 3
Time
Frame 3 Frame 3
Frame 4 Frame 4
Frame 4 Garbled
frame
Frame 5 Frame 5
Frame 5 Frame 5
Frame
t0 + a T R t0 + 1 T R
t0 + 1 T R t0 + a T R
t0 + 1 + a T R t0 + 1 + a T R
ACK
t0 + 1 + 2a T R t0 + 1 + 2a T R
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
Window of frames
Frames already received that may be accepted
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
F0
F1
F2
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
RR 3 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
F3
F4
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
F5
F6
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 4
RR
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
Damaged frames
Negative
- frame arrives
Retransmission acknowledgment but some of
after timeout and the bits are in
retransmission
error
Automatic Repeat Request
(ARQ)
➢ Collective name
for error control Stop-and-wait
mechanisms
Go-back-N
➢ Effect of ARQ is to
turn an unreliable
Selective-reject
data link into a
reliable one
Versions of ARQ
Stop and Wait ARQ
Source
transmits
single frame
frame
0
Time
Time-out interval
Frame 0 lost;
A retransmits
frame
0
1
AC K
frame
1
0
Time-out interval AC K
ACK0 lost;
A retransmits
frame
1
0 B discards
ACK duplicate frame
0 1 2 3 4 5 6 7 0 1 2 3 4 5 ...
S
RR7 lost
k=3, W=7
retx
R
0 1 2 3 4 5 6 7 0 1 2 ...
S
RR4 lost
k=3, W=4 retx
R x
A B A B
f r am fram
e0 e0
f r am fram
e1 e1
f r am fram
e2 2 e2 2
RR RR
fram fram
e3 e 3
fram f r am
e 4 4 e4 4
RR RR
fram f r am
e5 e5
f r am fram
e6 4 e6 J4
REJ discarded by SRE buffered by
receiver receiver
f r am 4 retransmitted fram
4, 5, and 6 e4 e4
retransmitted
fram fram
e 5 5 e 7 7
RR RR
f r am fram
e6 e0
fram fram
Timeout e7 7 e 1 1
RR RR
Timeout
f r am fram
e0 e2
RR RR
(P b (P b
it = it =
1 ) 1 )
1
RR RR
3
fram fram
e 1 e3
fram fram
e2 e 4
➢ Where 2a+1 is the time needed to send a frame and receive its ack.
Performance Issues
➢ Stop-and-wait ARQ
➢ Some frames are repeated because of bit errors.
Performance Issues
➢ Stop-and-wait ARQ
➢ Assume ACK and NAK are never in error →
probability that it will take k attempts to send a
frame is:
Performance Issues
➢ Selective-Reject ARQ
Performance Issues
➢ Go-back N ARQ
Performance Issues
➢ Go-back N ARQ
High Level Data Link Control
(HDLC)
Most important data link control protocol
Station types
Primary - controls operation of link
Secondary - under control of primary station
Combined - issues commands and responses
Link configurations
8 8 8 or 16 variable 16 or 32 8
bits extendable
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8n
0 0 1
1 2 3 4 5 6 7 8
I: Information 0 N(S) P/F N(R)
N(S) = Send sequence number
N(R) = Receive sequence number
S: Supervisory 1 0 S P/F N(R) S = Supervisory function bits
M = Unnumbered function bits
P/F = Poll/final bit
U: Unnumbered 1 1 M P/F M
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Information 0 N(S) P/F N(R)
111111111111011111101111110
After bit-stuffing
1111101111101101111101011111010
1 2 3 4 5 6 7 8
I: Information 0 N(S) P/F N(R)
N(S) = Send sequence number
N(R) = Receive sequence number
S: Supervisory 1 0 S P/F N(R) S = Supervisory function bits
M = Unnumbered function bits
P/F = Poll/final bit
U: Unnumbered 1 1 M P/F M
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Information 0 N(S) P/F N(R)
➢ HDLC defines three types of frames, each with a different control field
format
⚫ Information frames (I-frames)
⚫ Carry the data to be transmitted for the user
⚫ Flow and error control data, using the ARQ mechanism, are piggybacked
on an information frame
⚫ Supervisory frames (S-frames)
• Provide the ARQ mechanism when piggybacking is not used
⚫ Unnumbered frames (U-frames)
• Provide supplemental link control functions
Control Field
➢ Use of poll/final (P/F) bit depends on context
➢ In command frames P bit is set to 1 to solicit
(poll) a response from the peer HDLC entity
➢ In response frames F bit is set to 1 to indicate
the response frame transmitted as a result of a
soliciting command
➢ The basic control field for S- and I-frames uses
3 bit sequence numbers
⚫ An extended control field can be used that employs
7-bit sequence numbers
➢ U-frames always contain an 8-bit control field
Information and Frame Check
Sequence (FCS) Fields
Frame Check
Information Field Sequence Field
(FCS)
Error detecting code calculated
Present only in I-frames and
from the remaining bits of the
some U-frames
frame, exclusive of flags
Signals the other side The N(S) and N(R) fields Either module can
that initialization is of the I-frame are initiate
requested sequence numbers that • Either on its own
Specifies which of the support flow control initiative if there is
three modes (NRM, and error control some sort of fault, or
ABM, ARM) is An HDLC module will at the request of its
Initialization
Disconnect
Data Transfer
requested number them higher-layer user
Specifies whether 3- or sequentially Sends disconnect
7-bit sequence numbers Receive Ready (RR) is (DISC) frame
are to be used used when there is no Remote entity replies
reverse user data traffic with a UA
Any outstanding
unacknowledged
I-frames may be lost
• Recovery is the
responsibility of
higher layers
N(S) N(R)
A B A B A B
SABM I, 0, 0
I , 3, 0
Time- I, 0, 1 RNR, 4
out
I, 1, 1
P
SABM I, 2, 1 RR, 0,
RN R, 4
UA I, 1, 3 ,F
I, 3, 2
P
RR, 0,
I, 2, 4
RR, 4,
F
DISC I, 3, 4
UA RR, 4 I , 4, 0
(a) Link setup and disconnect (b) Two-way data exchange (c) Busy condition
A B A B
I, 3, 0 I, 2, 0
I, 4, 0 I, 3, 0 RR, 3
I, 5, 0 Time-
out
REJ, 4
RR, 0,
P
I, 4, 0
F
I, 5, 0 RR, 3,
I, 3, 0
I , 6, 0
R R, 4