Simplex Stop and Wait n Sender n n

  • Slides: 11
Download presentation
Simplex Stop and Wait n Sender n n Get data from network layer Send

Simplex Stop and Wait n Sender n n Get data from network layer Send it to physical layer Wait for Ack Receiver n n Mc. Graw-Hill Wait for frame arrival Get data from physical layer Send it to network layer Send Ack to the receiver ©The Mc. Graw-Hill Companies, Inc. , 2004

Normal operation Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Normal operation Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Analysis n What if the channel is noisy. n n Add a timer n

Analysis n What if the channel is noisy. n n Add a timer n n n Data can be lost during the transmission Resend data if receiver times out Sender starts timer when it sends a frame Receiver sends Ack only if data is correctly received Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Stop-and-Wait ARQ, lost frame Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Stop-and-Wait ARQ, lost frame Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Analysis n n n What if the Ack is lost Receiver correctly receives the

Analysis n n n What if the Ack is lost Receiver correctly receives the data and expect the next frame Sender times out because Ack is lost Sender resends the frame Receiver gets the duplicate data without noticing it Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Stop-and-Wait ARQ, lost ACK frame Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Stop-and-Wait ARQ, lost ACK frame Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Positive Ack with Retransmission n Sender n n n Send next-frame-to-send to physical layer

Positive Ack with Retransmission n Sender n n n Send next-frame-to-send to physical layer Start timer Wait for event (frame arrival, error, timeout) If(event == frame arrival) n n Get Ack from physical layer If(Ack == next-frame-tosend) n n n Mc. Graw-Hill Stop timer Get next frame to send from network layer Increment next-frame-to -send Receiver n n Wait for event(frame arrival, error) If(event == frame arrival) n n Get data from physical layer If(frame# == expected) n n Pass data to network layer Increment frame expected Ack = 1 – frame expected Send Ack to physical layer ©The Mc. Graw-Hill Companies, Inc. , 2004

Piggybacking (delay Ack until next outgoing frame - bidirectional) Mc. Graw-Hill ©The Mc. Graw-Hill

Piggybacking (delay Ack until next outgoing frame - bidirectional) Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Go-Back-N Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Go-Back-N Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Selective Repeat ARQ n n n Go-Back-N ARQ inefficient because multiple frames are resent

Selective Repeat ARQ n n n Go-Back-N ARQ inefficient because multiple frames are resent when errors or losses occur Selective Repeat retransmits only an individual frame n Timeout causes individual corresponding frame to be resent n NAK causes retransmission of oldest un-acked frame Receiver maintains a receive window of sequence numbers that can be accepted n Error-free, but out-of-sequence frames with sequence numbers within the receive window are buffered n Arrival of frame with Rnext causes window to slide forward by 1 or more Mc. Graw-Hill ©The Mc. Graw-Hill Companies, Inc. , 2004

Selective Repeat ARQ A fr 0 fr 1 fr 2 fr 3 fr 4

Selective Repeat ARQ A fr 0 fr 1 fr 2 fr 3 fr 4 fr 5 fr 6 fr 2 fr 7 A C K 2 fr 8 fr fr 9 10 11 12 Time B A C K 1 Mc. Graw-Hill A C K 2 N A K 2 A C K 7 A C K 8 A C K 9 A C K 1 0 A C K 1 1 A C K 1 2 ©The Mc. Graw-Hill Companies, Inc. , 2004