Professional Documents
Culture Documents
Stop-and-Wait ARQ Protocol: Unit 02.01.01 CS 5220: Computer Communications
Stop-and-Wait ARQ Protocol: Unit 02.01.01 CS 5220: Computer Communications
01
CS 5220:
COMPUTER COMMUNICATIONS
Header
CRC
Information Header
packet CRC
Information frame Control frame: ACKs
Need for Sequence Numbers
(a) Frame 1 lost Time-out
Time
A Frame 0 Frame 1 Frame 1 Frame 2
ACK ACK
B
In cases (a) & (b) the transmitting station A acts the same way
But in case (b) the receiving station B accepts frame 1 twice
Sequence Numbers in ACK
(c) Premature Time-out
Time-out
Time
A
Frame 0
Frame 0 Frame 1 Frame 2
ACK
ACK
B
Slast Rnext
Timer
Rnext
Global State:
1-Bit Sequence
Error-free frame 0
(Slast, Rnext) (0,0)
arrives at receiver
(0,1) Numbering
ACK for
ACK for Suffices
frame 0
frame 1 arrives at
arrives at transmitter
transmitter Error-free frame 1
arrives at receiver
(1,0) (1,1)
Stop-and-Wait ARQ
Transmitter Receiver
Ready state Always in Ready State
Await request from higher layer for packet transfer Wait for arrival of new frame
When request arrives, transmit frame with updated When frame arrives, check for errors
Slast and CRC If no errors detected and sequence number is correct
Go to Wait State (Slast=Rnext), then
Wait state accept frame,
Wait for ACK or timer to expire; block requests from update Rnext,
higher layer send ACK frame with Rnext,
If timeout expires deliver packet to higher layer
retransmit frame and reset timer If no errors detected and wrong sequence number
If ACK received: discard frame
If sequence number is incorrect or if errors detected: send ACK frame with Rnext
ignore ACK If errors detected
If sequence number is correct (Rnext = Slast +1): discard frame
accept frame, go to Ready state
Summary: Applications of Stop-and-Wait ARQ
IBM Binary Synchronous Communications protocol (Bisync):
character-oriented data link control
Xmodem: modem file transfer protocol
Trivial File Transfer Protocol (RFC 1350): simple protocol for
file transfer over UDP