stopandwait-091118052946-phpapp02

22
STOP AND WAIT ARQ STOP AND WAIT

Transcript of stopandwait-091118052946-phpapp02

Page 1: stopandwait-091118052946-phpapp02

STOP AND WAIT ARQ

STOP

AND

WAIT

Page 2: stopandwait-091118052946-phpapp02

Team members

DNAA

• Nishita• Ananya• Archana• Dhanusha Awesum4sum

• Lisha• Anita• Prabha• Caroline

Krazzy4

• Royston• Aayush• Himanshu• Vinayak

Page 3: stopandwait-091118052946-phpapp02

Noiseless and

Noisy Channels

Page 4: stopandwait-091118052946-phpapp02

PROTOCOLSPROTOCOLS

FOR NOISELESS CHANNELS FOR NOISY

CHANNELS

SIMPLEST

STOP AND WAIT

STOP AND WAIT ARQ

GO BACK N ARQ

SELECTIVE REPEAT ARQ

Noisy Channel – Error free channelsNoiseless Channel – Error creating channels

Page 5: stopandwait-091118052946-phpapp02

STOP AND WAIT

Page 6: stopandwait-091118052946-phpapp02

Automatic Repeat reQuest

• Is an error-control method for data transmission

• uses acknowledgements and timeouts to achieve reliable data transmission over an unreliable service.

Page 7: stopandwait-091118052946-phpapp02

STOP AND WAIT ARQ

Page 8: stopandwait-091118052946-phpapp02

FramesPacket Error Free Packet

Transmitter Receiver

Information Frame

Control Frame

Timer is set after each frame transmission

Page 9: stopandwait-091118052946-phpapp02

Information Frame

Acknowledgement Frame

header Information Packet CRC

Header CRC

Page 10: stopandwait-091118052946-phpapp02

Need for Sequence

number

Page 11: stopandwait-091118052946-phpapp02
Page 12: stopandwait-091118052946-phpapp02

Need for Sequence Numbers(a) Frame 1 lost

A

B

Frame 0

Frame 1

ACK

Frame 1

ACK

TimeTime-out

Frame 2

(b) ACK lost

A

B

Frame 0

Frame 1

ACK

Frame 1

ACK

TimeTime-out

Frame 2

ACK

Page 13: stopandwait-091118052946-phpapp02

Sequence Numbers(c) Premature Time-out

A

B

Frame 0

Frame 0

ACK

Frame1

ACK

Time

Time-out

Frame 2

Page 14: stopandwait-091118052946-phpapp02

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

}

Page 15: stopandwait-091118052946-phpapp02

ContdWaitforevent();if(event(arrivalnotification){

Receiveframe(ackno);If(ackno==Sn){Stoptimer();Purge(Sn-1);Cansend=true;}

}If(event(timeout)){

Starttimer();Resendframe(Sn-1);

}}

Page 16: stopandwait-091118052946-phpapp02

Receiver-site algorithm for Stop and Wait ARQ

Rn = 0;While (true){

WaitForEvent ( );If (Event (ArrivalNotification) ){

ReceiveFrame ( );If (corrupted (frame) );sleep ( );{ExtractData ( );DelieverData ( );Rn = Rn + 1;}SendFrame (Rn);

}}

Page 17: stopandwait-091118052946-phpapp02

(0,0) (0,1)

(1,0) (1,1)

Global State:(Slast, Rnext)

Error-free frame 0arrives at receiver

ACK forframe 0arrives attransmitter

ACK forframe 1arrives attransmitter Error-free frame 1

arrives at receiver

Transmitter A Receiver B

SlastRnext

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Timer

Rnext

Slast

1-Bit Sequence Numbering Suffices

Page 18: stopandwait-091118052946-phpapp02

Advantages and disadvantages

of Stop and Wait ARQ

Page 19: stopandwait-091118052946-phpapp02

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

1. It can be used for noisy channels2. It has both error and flow control

mechanism3. It has a timer implementation

Page 20: stopandwait-091118052946-phpapp02

• 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).

Disadvantages of Stop and Wait ARQ

Page 21: stopandwait-091118052946-phpapp02

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.

Page 22: stopandwait-091118052946-phpapp02

THANK YOU