Week5 lec2-bscs1
-
Upload
syedhaiderraza -
Category
Education
-
view
16 -
download
0
description
Transcript of Week5 lec2-bscs1
Chapter 3Transport Layer
Computer Networking: A Top Down Approach, 4th edition. Jim Kurose, Keith RossAddison-Wesley, July 2007.
Pipelined Reliable Data Transfer Protocols
Pipelining has the following consequences for reliable data transfer Range of sequence numbers must be
increased Sender and receiver sides may have to
buffer more than one packet.
Two basic approaches towards pipeline error recovery:
Go-Back-N, Selective Repeat
Go-Back-N (GBN)
Sender: Sender is allowed to transmit multiple packets without
waiting for an acknowledgement Constrained to a certain maximum number N.
Base or send_base Sequence number of oldest unacknowledged packet
Nextseqnum Sequence number of next packet to be sent
The range of sequence numbers for transmitted but not acknowledged packets can be viewed as a window of size N.
This window slides forward as the protocol operates
Go-Back-N
GBN sender must respond to three types of events
Invocation from above (rdt_send() is called): If window is full, returns data to upper layer Maintain synchronization mechanism
Receipt of an ACK: ACK for packet with seq # n is taken as“Cumulative ACK” More shortly in receiver
Time out event: Sender has timer for oldest unacknowledged packet
• If timer expires, retransmit all unacknowledged packets
Go-Back-N
Receiver: If a packet with seq # n is received correctly and
is in order ACK is sent and data is delivered to upper layers
For all other cases Receiver discards the packet and resends ACK for most
recently received in order packet Packets are delivered one at a time to upper
layers If a packet k has been received and delivered, then all
packets with seq # lower than k have also been delivered.
Receiver discards out of order packets No receiver buffering Need only remember expectedseqnum
GBN inaction
http://www.eecis.udel.edu/~amer/450/TransportApplets/GBN/GBNindex.html
Selective Repeat Selective Repeat protocol avoids unnecessary
retransmissionso Sender only retransmits packets that were lost or
are in erroro A window size N is used to limit the no of
outstanding unacknowledged packets in the pipeline
Selective Repeat
Sender: Data received from upper layers
o If window is full, returns data to upper layero Maintain synchronization mechanism
Timeouto Each packet has its own timero Single packet is retransmitted on timeout
ACK received:o Sender marked packet as received provided its in
the windowo Packets sequence no is equal to send_base,
• The window base is moved forward to the unacknowledged packet
Selective Repeat
Receiver:
Packets with sequence no in the window Selective ACK is sent to the sender whether or not
it is in order. Out-of-order: buffer but send ACK for that packet Deliver base plus buffered packets
Packets with sequence number below the window base An ACK must be generated even though the packet
has already been acknowledged by the receiver
Selective Repeat in Action
http://www.eecis.udel.edu/~amer/450/TransportApplets/SR/SRindex.html
Selective Repeat: Dilemma
Finite range of sequence numbers
Example:
Seq #’s: 0, 1, 2, 3 Window size=3 Receiver sees no difference
in two scenarios! Incorrectly passes duplicate
data as new in (a) Window size of one less than
the sequence number space does not work
Window size must be less than or equal to half the size of sequence no. space