EEC4113
Data Communication &
Multimedia System
Chapter 4: Flow Control
by Muhazam Mustapha, October 2013
Learning Outcome
• By the end of this chapter, students are
expected to be able to explain link level
flow control of tran...
Chapter Content
•
•
•
•
•

Stop-and-Wait ARQ
Go-Back-N ARQ
Selective Reject ARQ
Line Utilization
High-level Data Link Cont...
Automatic Repeat Request
(ARQ)

CO1
Stop-and-Wait ARQ
• Data and acknowledgement (ACK) frames
are numbered.
• For each correctly received data frame,
there wi...
Stop-and-Wait ARQ
• If there is a damaged data frame
– Receiver discards the frame and NAK frame
is returned.
– On receivi...
Stop-and-Wait ARQ
Normal operation diagram:
Sender
Wait

Frame
1

Receiver

ACK1
Frame
2

Wait

ACK2

Wait

ACK3
Frame
4

...
Stop-and-Wait ARQ
Event of damage frame:
Sender
Wait

Frame
1
ACK1

×
Wait

Frame
2

ACK2
Frame
3

CO1

ACK3

.
.
.

Time
...
Stop-and-Wait ARQ
Event of damage ACK:
Sender
Wait

Frame
1

Receiver

ACK1
Frame
2
ACK2

×
Time

Wait

Time out

Retransm...
Stop-and-Wait ARQ
Event of frame lost:
Sender
Wait

Frame
1
ACK1

×

Frame
2

Time out

CO1

Frame lost
Time

Wait

Retran...
Stop-and-Wait ARQ
Event of lost ACK:
Sender
Wait

Frame
1

Receiver

ACK1
Frame
2
ACK2

×
Time

Wait

Time out

Retransmit...
Go-Back-N ARQ
• A pipelined protocol.
• Inefficiency of Stop-and-Wait: Sender has
to wait for ACK for each and every data
...
Go-Back-N ARQ
• At receiver, all good, in-sequence frames
must be ACK as normal.
• All out-of-sequence frames will be
disc...
Go-Back-N ARQ
• At sender, on receiving an NAK, it retransmits that frame, and all subsequence
frames.
• If sender finishe...
Go-Back-N ARQ
Normal operation diagram:
Sender

Frame
1
Frame
2

ACK1

Frame
3

ACK2
ACK3

Frame
4
Frame
5
Frame
6

Time

...
Go-Back-N ARQ
Event of damage frame:
Error occur
Time

e5
Fra
m

e4
Fra
m

e3
Fra
m

e6
Fra
m

e5
Fra
m

e4
Fra
m

e3
Fra
...
ACK

4
5

4 frames buffered
4 frames buffered

4 frames buffered

4 frames buffered

e3

×

e5

e4

Fra
m

e8

e7

m e6
Fr...
4 frames buffered

4 frames buffered

4 frames buffered

4 frames buffered

5 frames buffered

4 frames buffered

4 frames...
Selective Reject ARQ
• An extension of Go-Back-N but now the
sender is asked to re-transmit only the
damaged or lost frame...
Selective Reject ARQ
• The receiver will buffer the subsequence
frames after the damaged or lost frames.
• Once the missin...
Selective Reject ARQ
• At sender side, sender is required to
respond to SREJ immediately, then
continue to normal frame se...
Selective Reject ARQ
Event of lost frame:
Frame damaged

Frame lost

m e1

10

Fra

Fra
m

e6

. . .

10
9
8
7*
6

11
10
9...
Windowed & Pipelined Processing
• Go-Back-N and Selective Reject are
pipelined and windowed ARQ.
• Pipelined means they do...
Windowed & Pipelined Processing
• In Selective Reject ARQ, both sender and
receiver need buffers.
• For both sides, the bu...
Detailed Window Processing
• Sender sends frames to receiver
– Sender’s windows shrinks according to the
no. frames sent
–...
Detailed Window Processing
• Receiver sends ACK to sender
– Receiver’s windows expands according to the
no. ACK sent
– Rec...
Detailed Window Processing
Window

Sender
Buffer
0

1

2

3

4

Initial
5

6

7

0

1

2

3

4

5

6

7

Receiver
Buffer

...
Piggyback Transmission
• There are times where the receiver too
has to transmit data to the sender besides
the acknowledge...
Piggyback Transmission
• If the receiver wants to send both data and
ACK to sender, it will send both fields.
• If the rec...
Line Utilization

CO2
Line Utilization
• A measure (a) of ratio between no. bits
present on a physical link (B) over no. bits
per frame (L)
a=B/...
Line Utilization
• B can be computed from data rate (R in
bps), physical distance (d in meters) and
velocity of propagatio...
Line Utilization
• Consider 1Mbps (R) link between 2
ground stations communicating through
satellite relay.
• Geo-satellit...
Line Utilization
8000bits
8000bits
240,000 bits

• Sender finishes sending long before first
bit physically arrived at rec...
Line Utilization
• Consider 200 m (d) optical fiber operating
at 1 Gbps (R).
• Propagation velocity: 2×108 ms-1 (V)
• B = ...
Line Utilization
8000bits
8000bits
1000 bits

• Sender doesn’t finish sending long after
first bit physically arrived at r...
High-level Data Link Control

CO1
HDLC
• High-level Data Link Control
• A set of control commands made by OSI
to control data link communication.
• To accom...
HDLC Station Types
• Primary station
– Controls operation of link
– Frames sent-out are called commands
– Maintains separa...
HDLC Link Configurations
• Unbalanced
– One primary and one or more secondary
stations
– Supports full duplex and half dup...
HDLC Transfer Modes
• Three HDLC transfer modes
– Normal Response Mode (NRM)
– Asynchronous Response Mode (ARM)
– Asynchro...
Normal Response Mode (NRM)
• One primary and one or more secondary
(point-to-point or multicast)
• Used with unbalanced co...
Normal Response Mode (NRM)
Primary

Secondary

Command
Response
Unicast / Point-to-point

Secondary
Primary

Command
Respo...
Asynchronous Response Mode (ARM)
• One primary and one secondary (point-topoint)
• Used with unbalanced configuration
• Pr...
Asynchronous Balanced Mode (ABM)
• Two combined stations
• Used with balanced configuration
• Either station may initiate ...
HDLC Frame Structure
• HDLC uses synchronous transmission
• All transmissions in frames
• Single frame for all data and co...
Flag Fields
Flag
8 bits

•
•
•
•
•

Address

Control

Information

FCS

Flag
8 bits

Delimit a frame at both ends
An 8 bit...
Bit Stuffing
• Bit stuffing used to avoid confusion with
data containing 01111110
– Insert a 0 after every five consecutiv...
Bit Stuffing
Before bit stuffing
111111111111011111101111110

1111101111101101111101011111010
After bit stuffing
Inserted ...
Address Field
Flag

Address

Control

Information

FCS

Flag

8 bits
extendable

• Identifies secondary station that sent ...
Control Field
Flag

Address

Control

Information

FCS

Flag

8 or 16 bits

• Control field defines the three types:
– Inf...
Control Field – I-frames
Flag

Address

Control

Information

FCS

Flag

• Carry user data
• Flow and error control are pi...
Control Field – S-frames
Flag

Address

Control

FCS

Flag

• Provide ARQ mechanism when piggyback is not
used

CO1
Control Field – U-frames
Flag

Address

Control

Management Information

FCS

• Provide supplemental link control function...
Control Field – 8 bits format
1

2

I-frame

0

S-frame

1

0

U-frame

1

1

3

4

N(S)

5

6

7

P/F

N(R)

S

P/F

N(R)...
Control Field – 16 bits format
1
I-frame

2

3

4

0

S-frame 1

5

N(S)

0

S

6

7

8

9

10

11

12

P/F

N(R)

0 0 0 0...
Poll / Final Bit
• If it is a command frame (from primary to
secondary), then,
– The bit is called P (poll) bit
– If the b...
Information Field
Flag

Address

Control

Information

FCS

variable

• Appears only in I-frames or some U-frames
• It is ...
FCS Field
Flag

Address

Control

Information

FCS

Flag

16 or 32 bits

• Contains the Frame Check Sequence for error
det...
HDLC Commands & Responses
Name
Information (I)

Command/
Response
C/R

Supervisory (S)
Receive ready (RR / ACK)

C/R

Rece...
HDLC Commands & Responses
Name

Command/
Response

Unnumbered (U) continued
Disconnect (DISC)

C

Unnumbered acknowledge (...
HDLC Operation
• Three phases:
– Initialization
– Data transfer
– Disconnect

CO1
Example Operation (1)
A

B
SABM

Setup and
disconnect

Time out

SABM
UA

.
.
.
DISC
UA

CO1
Example Operation (2)
A

N(S)

N(R)

B

I,0,0
I,0,1

I,1,1
I,2,1
I,1,3

I,3,2
I,2,4
I,3,4

RR,4

CO1

Two way data
exchang...
Example Operation (3)
A

B
I,3,0

RNR,4
RR,0,P

RNR,4,F
RR,0,P

RR,4,F
I,4,0

CO1

Busy condition
Example Operation (4)
A

B
I,3,0
I,4,0
I,5,0
REJ,4

I,4,0
I,5,0
I,6,0

CO1

Reject recovery
Example Operation (5)
A

B
I,2,0
RR,3

I,3,0

Time out

RR,0,P
RR,3,F

I,3,0
RR,4

CO1

Timeout recovery
Upcoming SlideShare
Loading in …5
×

Chapter 4: Datalink Layer - Flow Control

653 views

Published on

First Part of Datalink Layer

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
653
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
25
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Chapter 4: Datalink Layer - Flow Control

  1. 1. EEC4113 Data Communication & Multimedia System Chapter 4: Flow Control by Muhazam Mustapha, October 2013
  2. 2. Learning Outcome • By the end of this chapter, students are expected to be able to explain link level flow control of transmission involving various protocols and techniques
  3. 3. Chapter Content • • • • • Stop-and-Wait ARQ Go-Back-N ARQ Selective Reject ARQ Line Utilization High-level Data Link Control
  4. 4. Automatic Repeat Request (ARQ) CO1
  5. 5. Stop-and-Wait ARQ • Data and acknowledgement (ACK) frames are numbered. • For each correctly received data frame, there will be an ACK frame. • Only on receiving an ACK, sender sends the next frame. CO1
  6. 6. Stop-and-Wait ARQ • If there is a damaged data frame – Receiver discards the frame and NAK frame is returned. – On receiving NAK, sender re-transmits the frame. • If ACK or NAK is damaged or never reach sender – Sender re-transmits on wait time-out. CO1
  7. 7. Stop-and-Wait ARQ Normal operation diagram: Sender Wait Frame 1 Receiver ACK1 Frame 2 Wait ACK2 Wait ACK3 Frame 4 Wait CO1 ACK4 . . . Time Frame 3
  8. 8. Stop-and-Wait ARQ Event of damage frame: Sender Wait Frame 1 ACK1 × Wait Frame 2 ACK2 Frame 3 CO1 ACK3 . . . Time Frame 2 Wait Error occur NAK2 Retransmit Wait Receiver
  9. 9. Stop-and-Wait ARQ Event of damage ACK: Sender Wait Frame 1 Receiver ACK1 Frame 2 ACK2 × Time Wait Time out Retransmit CO1 Frame 2 Wait ACK2 Error occur . . .
  10. 10. Stop-and-Wait ARQ Event of frame lost: Sender Wait Frame 1 ACK1 × Frame 2 Time out CO1 Frame lost Time Wait Retransmit Receiver Frame 2 ACK2 . . .
  11. 11. Stop-and-Wait ARQ Event of lost ACK: Sender Wait Frame 1 Receiver ACK1 Frame 2 ACK2 × Time Wait Time out Retransmit CO1 Frame 2 Wait ACK2 . . . ACK Lost
  12. 12. Go-Back-N ARQ • A pipelined protocol. • Inefficiency of Stop-and-Wait: Sender has to wait for ACK for each and every data frame sent. • In Go-Back-N, sender doesn’t wait for ACK. • Instead, sender keeps sending but not too rapidly – sliding window constrained. • Sender will respond to ACK as it comes. CO1
  13. 13. Go-Back-N ARQ • At receiver, all good, in-sequence frames must be ACK as normal. • All out-of-sequence frames will be discarded even if they are good. • On receiving bad frame, receiver sends NAK and requests for re-transmission of that frame. CO1
  14. 14. Go-Back-N ARQ • At sender, on receiving an NAK, it retransmits that frame, and all subsequence frames. • If sender finishes sending frames within its window, but lagging behind in receiving ACK, it re-transmits in-sequence starting from earliest frame not ACK-ed. CO1
  15. 15. Go-Back-N ARQ Normal operation diagram: Sender Frame 1 Frame 2 ACK1 Frame 3 ACK2 ACK3 Frame 4 Frame 5 Frame 6 Time ACK4 ACK5 ACK6 . . . CO1 Receiver
  16. 16. Go-Back-N ARQ Event of damage frame: Error occur Time e5 Fra m e4 Fra m e3 Fra m e6 Fra m e5 Fra m e4 Fra m e3 Fra m e2 . . . × Fra m Fra m e1 Receiver ACK 5 CO1 4 Retransmit ACK 3 2 ACK ACK 1 3 NAK ACK Sender
  17. 17. ACK 4 5 4 frames buffered 4 frames buffered 4 frames buffered 4 frames buffered e3 × e5 e4 Fra m e8 e7 m e6 Fra m Fra Fra m Fra m e3 m e8 m e7 m e6 Fra m Fra Fra Fra e5 4 Fra me Fra m 2 Fra me e1 Retransmit after time-out 4 frames buffered 3 frames buffered 2 frames buffered 1 frame buffered Fra m Fra m Frame lost 6 frames buffered 5 frames buffered ACK 3 4 frames buffered 3 frames buffered ACK 2 CO1 ACK 1 2 frames buffered ACK 1 frame buffered Go-Back-N ARQ Event of lost frame: (sender window = 6 frames) Time Receiver . . . Sender
  18. 18. 4 frames buffered 4 frames buffered 4 frames buffered 4 frames buffered 5 frames buffered 4 frames buffered 4 frames buffered 4 frames buffered 5 frames buffered 4 frames buffered 4 frames buffered 10 9 11 ACK ACK ACK 8 ACK 7 ACK 3 frames buffered 4 2 frames buffered 6 ACK 3 5 ACK ACK 1 CO1 × × ACK 2 ACK ACK 1 frame buffered e5 Fra m e1 4 13 e12 Fra me Fra m 11 e10 Fra me Fra m e9 m e8 m e7 m e6 Fra m Fra Fra Fra Fra m 4 e3 Fra me Fra m 2 e1 Fra me Fra m Go-Back-N ARQ Event of lost ACK: (sender window = 6 frames) ACK damaged or lost Time Receiver . . . Sender
  19. 19. Selective Reject ARQ • An extension of Go-Back-N but now the sender is asked to re-transmit only the damaged or lost frames. • Now the receiver is required to have buffer too (same size as the sender), and to respond to any subsequence frames after the error within its buffer limit. • The receiver will respond with a SREJ (or SREQ) upon a damaged or lost frame. CO1
  20. 20. Selective Reject ARQ • The receiver will buffer the subsequence frames after the damaged or lost frames. • Once the missing one is obtained, the receiver buffer is flushed up to the next missing frame (or all if no more missing). • If the receiver run out of buffer before receiving the missing frame, it will stop responding, and this reduces the whole protocol to Go-Back-N ARQ. CO1
  21. 21. Selective Reject ARQ • At sender side, sender is required to respond to SREJ immediately, then continue to normal frame sequence. • If it reaches to a condition where all its buffered frames are not ACK-ed, it is too will reduce to Go-Back-N ARQ and retransmit them all in sequence. CO1
  22. 22. Selective Reject ARQ Event of lost frame: Frame damaged Frame lost m e1 10 Fra Fra m e6 . . . 10 9 8 7* 6 11 10 9 8* 7* 6 11 10 9* 8* 7* 6 Time 6 ACK 9 8 7* 6 9 9 8 7 6 ACK 8 7 6 8 7 6 5* 4* 3* 2 ACK 7 6 5 4* 3* 2 P6 SRE 7 ACK ACK 6 5 4 3* 2 2 5 ACK 5 4 3 2 4 5 4 3 2 ACK 4 3 2 1 3 CO1 3 2 1 ACK 1 2 1 J2 SRE ACK 1 Receiver 11 1 10 Fra me e6 Fra m 9 Fra me e8 7 9 8 7 6 × Fra m e2 7 Fra e5 Fra m 4 Fra me e3 Fra m 2 Fra me × Fra m e1 1 9 8 7 8 7 Fra m 3 5 4 3 2 m e7 5 4 3 4 3 11 10 Sender
  23. 23. Windowed & Pipelined Processing • Go-Back-N and Selective Reject are pipelined and windowed ARQ. • Pipelined means they don’t wait for the transmitted frames to be ACK-ed, instead continue with transmission of next frame in buffer. • In Go-Back-N ARQ, only sender needs buffers, receiver doesn’t. CO1
  24. 24. Windowed & Pipelined Processing • In Selective Reject ARQ, both sender and receiver need buffers. • For both sides, the buffer (window) size must be the same so that flushing can be properly timed. • And the window size <= half of possible frame number = 2n-1, n is the no. bits available to encode the frames – to avoid ambiguity in the frame numbers. CO1
  25. 25. Detailed Window Processing • Sender sends frames to receiver – Sender’s windows shrinks according to the no. frames sent – Sent frames would still be kept in sender’s buffer • Receiver receives frames from sender – Receiver’s windows shrinks according to the no. frames received CO1
  26. 26. Detailed Window Processing • Receiver sends ACK to sender – Receiver’s windows expands according to the no. ACK sent – Receiver’s windows restores to the original size • Sender receives ACK-s from receiver – Sender’s windows expands according to the no. ACK-s received – Sender’s windows restores to the original size CO1
  27. 27. Detailed Window Processing Window Sender Buffer 0 1 2 3 4 Initial 5 6 7 0 1 2 3 4 5 6 7 Receiver Buffer After 3 frames sent and received 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Sender Buffer 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 After 3 ACK received Receiver Buffer 1 2 3 4 Sender Buffer 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 Receiver Buffer 0 CO1 1 2 3 4 5 6 7
  28. 28. Piggyback Transmission • There are times where the receiver too has to transmit data to the sender besides the acknowledgement data. – E.g. AJAX transaction, HTML page with many images (request for next image is made before the currently sending finished) • To improve efficiency of such bi-directional transmission, piggyback technique is used – Data frame with additional field to carry ACK CO1
  29. 29. Piggyback Transmission • If the receiver wants to send both data and ACK to sender, it will send both fields. • If the receiver wants to send only ACK, a separate ACK frame is sent – not a piggybacked data. • If the receiver wants to send only data, the data is sent with the previous ACK which is ignored by the sender side due to duplication. CO1
  30. 30. Line Utilization CO2
  31. 31. Line Utilization • A measure (a) of ratio between no. bits present on a physical link (B) over no. bits per frame (L) a=B/L • a is to be made as close to 1 as possible for the line to be utilized optimally. • This can be achieved by adjusting L. – Value of L needs to be optimized for various protocols so that a is close enough to 1. CO2
  32. 32. Line Utilization • B can be computed from data rate (R in bps), physical distance (d in meters) and velocity of propagation (V in ms-1): B = R × d/V CO2
  33. 33. Line Utilization • Consider 1Mbps (R) link between 2 ground stations communicating through satellite relay. • Geo-satellite: altitude of 36000km (d) • Propagation velocity: 3×108 ms-1 (V) • B = 240,000 bits • For a frame length of 8000 bits, a = 30 CO2
  34. 34. Line Utilization 8000bits 8000bits 240,000 bits • Sender finishes sending long before first bit physically arrived at receiver. • This is a serious inefficiency in link utilization. CO2
  35. 35. Line Utilization • Consider 200 m (d) optical fiber operating at 1 Gbps (R). • Propagation velocity: 2×108 ms-1 (V) • B = 1000 bits • For a frame length of 8000 bits, a = 0.125 CO2
  36. 36. Line Utilization 8000bits 8000bits 1000 bits • Sender doesn’t finish sending long after first bit physically arrived at receiver. • This is also an inefficiency because the rest of the circuitry might need wait too long for this operation to finish. CO2
  37. 37. High-level Data Link Control CO1
  38. 38. HDLC • High-level Data Link Control • A set of control commands made by OSI to control data link communication. • To accomplish the data link control task, HDLC defines the following: – 3 types of stations – 2 link configurations – 3 data transfer modes CO1
  39. 39. HDLC Station Types • Primary station – Controls operation of link – Frames sent-out are called commands – Maintains separate logical link to each secondary station • Secondary station – Under control of primary station – Frames sent out are called responses • Combined station – May send out commands and responses CO1
  40. 40. HDLC Link Configurations • Unbalanced – One primary and one or more secondary stations – Supports full duplex and half duplex • Balanced – Two combined stations – Supports full duplex and half duplex CO1
  41. 41. HDLC Transfer Modes • Three HDLC transfer modes – Normal Response Mode (NRM) – Asynchronous Response Mode (ARM) – Asynchronous Balanced Mode (ABM) CO1
  42. 42. Normal Response Mode (NRM) • One primary and one or more secondary (point-to-point or multicast) • Used with unbalanced configuration • Primary initiates transfer to secondary • Secondary may only transmit data in response to command from primary • Host computer as primary • Terminals as secondary CO1
  43. 43. Normal Response Mode (NRM) Primary Secondary Command Response Unicast / Point-to-point Secondary Primary Command Response Multicast CO1 Secondary Response
  44. 44. Asynchronous Response Mode (ARM) • One primary and one secondary (point-topoint) • Used with unbalanced configuration • Primary sends commands, secondary can respond at any time Primary Secondary Command Response CO1
  45. 45. Asynchronous Balanced Mode (ABM) • Two combined stations • Used with balanced configuration • Either station may initiate transmission without receiving permission • Most widely used • No polling overhead Combined Command/Response Command/Response CO1 Combined
  46. 46. HDLC Frame Structure • HDLC uses synchronous transmission • All transmissions in frames • Single frame for all data and control exchanges Flag Address Control Information FCS Flag 8 bits 8 bits extendable 8 or 16 bits variable 16 or 32 bits 8 bits CO1
  47. 47. Flag Fields Flag 8 bits • • • • • Address Control Information FCS Flag 8 bits Delimit a frame at both ends An 8 bit sequence with a pattern 01111110 Each frame has 1 opening and 1 closing flag Receiver hunts for flag sequence to synchronize Bit stuffing used to avoid confusion with data containing 01111110 CO1
  48. 48. Bit Stuffing • Bit stuffing used to avoid confusion with data containing 01111110 – Insert a 0 after every five consecutive 1-s • If receiver reads five 1-s, it checks the next bit: – If it is 0, it is ignored – If it is 1, and the next is 0, then it is a flag – If it is 1, and the next is 1, then it is abort flag CO1
  49. 49. Bit Stuffing Before bit stuffing 111111111111011111101111110 1111101111101101111101011111010 After bit stuffing Inserted bits CO1
  50. 50. Address Field Flag Address Control Information FCS Flag 8 bits extendable • Identifies secondary station that sent or receive frame • Usually 8 bits long with binary 1 in LSB • LSB indicates if the byte is the last byte (binary 1) or not (binary 0) • MSB binary 0: unicast • MSB binary 1: multicast / broadcast CO1
  51. 51. Control Field Flag Address Control Information FCS Flag 8 or 16 bits • Control field defines the three types: – Information Frames (I-frames) – Supervisory Frames (S-frames) – Unnumbered Frames (U-frames) • First 1 or 2 bits of control field identify the frame type CO1
  52. 52. Control Field – I-frames Flag Address Control Information FCS Flag • Carry user data • Flow and error control are piggybacked on this frame CO1
  53. 53. Control Field – S-frames Flag Address Control FCS Flag • Provide ARQ mechanism when piggyback is not used CO1
  54. 54. Control Field – U-frames Flag Address Control Management Information FCS • Provide supplemental link control functions CO1 Flag
  55. 55. Control Field – 8 bits format 1 2 I-frame 0 S-frame 1 0 U-frame 1 1 3 4 N(S) 5 6 7 P/F N(R) S P/F N(R) M P/F M N(S): Send sequence number N(R): Receive sequence number S: Supervisory function bits M: Unnumbered function bits P/F: Poll/Final bit CO1 8
  56. 56. Control Field – 16 bits format 1 I-frame 2 3 4 0 S-frame 1 5 N(S) 0 S 6 7 8 9 10 11 12 P/F N(R) 0 0 0 0 P/F N(R) N(S): Send sequence number N(R): Receive sequence number S: Supervisory function bits P/F: Poll/Final bit CO1 13 14 15 16
  57. 57. Poll / Final Bit • If it is a command frame (from primary to secondary), then, – The bit is called P (poll) bit – If the bit is 1, it means the command is polling (soliciting) response from the peer • If it is a response frame (from secondary to primary), then, – The bit is called F (final) bit – If the bit is 1, it means the response is responding to a soliciting (polling) command CO1
  58. 58. Information Field Flag Address Control Information FCS variable • Appears only in I-frames or some U-frames • It is variable length, but must be in integral number of bytes CO1 Flag
  59. 59. FCS Field Flag Address Control Information FCS Flag 16 or 32 bits • Contains the Frame Check Sequence for error detection purposes • Usually 16 bit CRC (if 16 FCS) or may be 32 bit CRC (if 32 FCS) CO1
  60. 60. HDLC Commands & Responses Name Information (I) Command/ Response C/R Supervisory (S) Receive ready (RR / ACK) C/R Receive not ready (RNR) C/R Reject (REJ) C/R Selective Reject (SREJ) C/R Unnumbered (U) Set normal response mode (SNRM) Set asynchronous response mode (SARM) C Set asynchronous balanced mode (SABM) C Set initialization mode (SIM) CO1 C C
  61. 61. HDLC Commands & Responses Name Command/ Response Unnumbered (U) continued Disconnect (DISC) C Unnumbered acknowledge (UA) R Disconnected mode (DM) R Request disconnect (RD) R Request initialization mode (RIM) R Unnumbered information (UI) C/R Unnumbered poll (UP) C Reset (RSET) C Exchange identification (XID) Test (TEST) CO1 C/R C/R Frame reject (FRMR) R
  62. 62. HDLC Operation • Three phases: – Initialization – Data transfer – Disconnect CO1
  63. 63. Example Operation (1) A B SABM Setup and disconnect Time out SABM UA . . . DISC UA CO1
  64. 64. Example Operation (2) A N(S) N(R) B I,0,0 I,0,1 I,1,1 I,2,1 I,1,3 I,3,2 I,2,4 I,3,4 RR,4 CO1 Two way data exchange
  65. 65. Example Operation (3) A B I,3,0 RNR,4 RR,0,P RNR,4,F RR,0,P RR,4,F I,4,0 CO1 Busy condition
  66. 66. Example Operation (4) A B I,3,0 I,4,0 I,5,0 REJ,4 I,4,0 I,5,0 I,6,0 CO1 Reject recovery
  67. 67. Example Operation (5) A B I,2,0 RR,3 I,3,0 Time out RR,0,P RR,3,F I,3,0 RR,4 CO1 Timeout recovery

×