Stop and Wait Arq

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 22

STOP AND WAIT ARQ

STOP WAIT

AND
Team members

DNAA Krazzy4

• Nishita • Royston
• Ananya • Aayush
• Archana • Himanshu
• Dhanusha Awesum4sum
• Vinayak
• Lisha
• Anita
• Prabha
• Caroline
Noiseless
and
Noisy Channels
Noisy Channel – Error free channels
Noiseless Channel – Error creating channels

PROTOCOLS
PROTOCOLS

FOR NOISELESS
CHANNELS FOR NOISY
CHANNELS

SIMPLEST STOP AND


WAIT ARQ

STOP AND GO BACK N


WAIT ARQ

SELECTIVE
REPEAT ARQ
STOP AND WAIT
Automatic Repeat reQuest
• Is an error-control method for data
transmission

• uses acknowledgements and timeouts to


achieve reliable data transmission over an
unreliable service.
STOP AND WAIT ARQ
Frames
Packet Error Free Packet

Information Frame

Transmitter Receiver
Control Frame

Timer is set after


each frame
transmission
Information Frame
header Information Packet CRC

Header CRC

Acknowledgement
Frame
Need for
Sequence number
Need for Sequence Numbers
(a) Frame 1 lost Time-out
Time
A
Frame Frame Frame Frame
0 1 1 2
ACK ACK
B
(b) ACK lost Time-out
Time
A Frame Frame Frame Frame
0 1 1 2
ACK ACK ACK
B
Sequence Numbers
(c) Premature Time-out

Time-out
Time
A
Frame Frame Frame Frame
0 0 1 2
ACK ACK
B
Sender-site algorithm for stop and wait
ARQ
Sn=0;
Cansend=true;
While(true)
{
Waitforevent()
If(event(requesttosend)AND cansend)
{
Getdata();
Makeframe(Sn);
Storeframe(Sn)
Sendframe(Sn);
Starttimer()
Cansend=false
}
Contd
Waitforevent();
if(event(arrivalnotification)
{
Receiveframe(ackno);
If(ackno==Sn)
{
Stoptimer();
Purge(Sn-1);
Cansend=true;
}
}
If(event(timeout))
{
Starttimer();
Resendframe(Sn-1);
}
}
Receiver-site algorithm for
Rn = 0;
Stop and Wait ARQ
While (true)
{
WaitForEvent ( );
If (Event (ArrivalNotification) )
{
ReceiveFrame ( );
If (corrupted (frame) );
sleep ( );
{
ExtractData ( );
DelieverData ( );
Rn = Rn + 1;
}
SendFrame (Rn);
}
}
1-Bit Sequence Numbering Suffices
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Slast Rnext
Timer

Transmitter A Slast Receiver B

Rnext

Global State: Error-free frame 0


(Slast, Rnext) (0,0) (0,1)
arrives at receiver
ACK for
ACK for frame 0
frame 1 arrives at
arrives at transmitter
transmitter Error-free frame 1
arrives at receiver
(1,0) (1,1)
Advantages and disadvantages

of Stop and Wait ARQ


Advantages of Stop and Wait ARQ over
simple Stop and Wait protocol

1. It can be used for noisy channels


2. It has both error and flow control mechanism
3. It has a timer implementation
Disadvantages of Stop and Wait ARQ

• Efficiency is very less.


• Only 1 frame is sent at a time.
• Timer should be set for each individual
frame.
• No pipelining.
• Sender window size is 1 ( disadvantage
over go back n ARQ).
• Receiver window size is 1
( disadvantage
over selective repeat ARQ).
Applications

• IBM Binary Synchronous Communication


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.
THANK YOU

You might also like