Week5 lec2-bscs1

363 views

Published on

Computer Networks

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

Week5 lec2-bscs1

  1. 1. Chapter 3 Transport Layer Computer Networking: A Top Down Approach, 4th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
  2. 2. 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
  3. 3. 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
  4. 4. 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
  5. 5. 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
  6. 6. GBN in action http://www.eecis.udel.edu/~amer/450/TransportApplets/GBN/GBNindex.html
  7. 7. Selective Repeat  Selective Repeat protocol avoids unnecessary retransmissions o Sender only retransmits packets that were lost or are in error o A window size N is used to limit the no of outstanding unacknowledged packets in the pipeline
  8. 8. Selective Repeat Sender:  Data received from upper layers o If window is full, returns data to upper layer o Maintain synchronization mechanism  Timeout o Each packet has its own timer o Single packet is retransmitted on timeout  ACK received: o Sender marked packet as received provided its in the window o Packets sequence no is equal to send_base, • The window base is moved forward to the unacknowledged packet
  9. 9. 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
  10. 10. Selective Repeat in Action http://www.eecis.udel.edu/~amer/450/TransportApplets/SR/SRindex.html
  11. 11. 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

×