1 / 23

Chapter 3 Transport Layer

Chapter 3 Transport Layer. Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007. Last Lecture. Chapter 3: Transport layer Multiplexing and De-Multiplexing Connectionless Transport: UDP. Today’s Lecture.

Download Presentation

Chapter 3 Transport Layer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 3 Transport Layer Computer Networking: A Top Down Approach 4th edition. Jim Kurose, Keith RossAddison-Wesley, July 2007.

  2. Last Lecture • Chapter 3: Transport layer • Multiplexing and De-Multiplexing • Connectionless Transport: UDP

  3. Today’s Lecture • Principles of Reliable Data Transfer Protocol

  4. Important in application, transport, link layers Top-10 list of important networking topics! Principles of Reliable Data Transfer

  5. Important in application, transport, link layers Top-10 list of important networking topics! Principles of Reliable Data Transfer (rdt)

  6. Important in application, transport, link layers Top-10 list of important networking topics! Principles of Reliable Data Transfer

  7. rdt_send():called from above, (e.g., by app.). Passed data to deliver to receiver upper layer deliver_data():called by rdt to deliver data to upper layer udt_send():called by rdt protocol, to transfer packet over unreliable channel to receiver rdt_rcv():called when packet arrives on rcv-side of channel Reliable Data Transfer: Getting Started send side receive side

  8. We’ll: Incrementally develop sender, receiver sides of reliable data transfer protocol (rdt) Consider only unidirectional data transfer but control info will flow on both directions! Use Finite State Machines (FSM) to specify sender, receiver event state 1 state 2 actions Reliable Data Transfer: Getting Started event causing state transition actions taken on state transition state: When in this “state” next state uniquely determined by next event

  9. Underlying channel perfectly reliable no bit errors no loss of packets Separate FSMs for sender, receiver: sender sends data into underlying channel receiver read data from underlying channel The initial state of the FSM is indicated by the dashed line Rdt1.0: Reliable Data Transfer over a Perfectly Reliable Channel rdt_rcv(packet) rdt_send(data) Wait for call from above Wait for call from below extract (packet,data) deliver_data(data) packet =make_pkt(data) udt_send(packet) Receiver Sender Note:Perfectly reliable channel no need for feedback

  10. More realistic model Underlying channel may flip bits in packet How people deal with such a situation OK (positive acknowledgment) Please repeat that (negative acknowledgements) Acknowledgements (ACKs): Receiver explicitly tells sender that pkt received OK Negative acknowledgements (NAKs): Receiver explicitly tells sender that pkt had errors Sender retransmits pkt on receipt of NAK These control messages let the receiver know What has been received in error and requires repetition Automatic Repeat reQuest (ARQ) protocols. Rdt2.0: Channel with Bit Errors

  11. Three capabilities are required in ARQ to handle the presence of bit errors. Error Detection: Needed to allow the receiver to detect bit errors Checksum field in the header Receiver Feed Back Receiver provided explicit feedback ACK NAK Retransmission A packet that is received in error will be retransmitted New mechanisms in rdt2.0 (beyond rdt1.0): Error detection Receiver feedback: Control msgs (ACK,NAK) Rcvr->Sender Rdt2.0: Channel with Bit Errors

  12. Wait for ACK or NAK rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) Wait for call from below Rdt2.0: FSM Specification rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) receiver rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from above udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) L sender rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK)

  13. Wait for ACK or NAK rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) Rdt2.0: Operation with No Errors rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from above udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) Wait for call from below L rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK)

  14. Wait for ACK or NAK rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) Rdt2.0: error scenario rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from above udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) Wait for call from below L rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK)

  15. rdt2.0 is a stop and wait protocol Sender sends one packet, then waits for receiver response rdt2.0 has a fatal flaw What happens if ACK/NAK get corrupted? Add checksum bits to ACK/NAK How the protocol should recover from errors in ACK/NAK? Retransmission on receipt of a corrupt ACK/NAK Retransmission causes duplicates Receiver does not know whether ACK or NAK it sent was received correctly Receiver does not know a priori whether an arriving packet contains new data or is a retransmission Handling Duplicates: Sender retransmits current packet if ACK/NAK garbled Sender adds sequence numberto each packet Receiver discards (doesn’t deliver up) duplicate packet Rdt2.0

  16. Rdt2.1: Sender, handles garbled ACK/NAKs rdt_send(data) sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isNAK(rcvpkt) ) Wait for ACK or NAK 0 Wait for call 0 from above udt_send(sndpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt) L L Wait for ACK or NAK 1 Wait for call 1 from above rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isNAK(rcvpkt) ) rdt_send(data) udt_send(sndpkt) sndpkt = make_pkt(1, data, checksum) udt_send(sndpkt)

  17. Wait for 0 from below Wait for 1 from below Rdt2.1: Receiver, handles garbled ACK/NAKs rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq0(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && (corrupt(rcvpkt)) rdt_rcv(rcvpkt) && (corrupt(rcvpkt)) sndpkt = make_pkt(NAK, chksum) udt_send(sndpkt) sndpkt = make_pkt(NAK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && not corrupt(rcvpkt) && has_seq1(rcvpkt) rdt_rcv(rcvpkt) && not corrupt(rcvpkt) && has_seq0(rcvpkt) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq1(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt)

  18. Same functionality as rdt2.1, using ACKs only Instead of NAK, receiver sends ACK for last packet received OK Receiver must explicitly include seq # of the packet being ACKed Duplicate ACK at sender results in same action as NAK: retransmit current packet Rdt2.2: a NAK-free protocol

  19. Wait for ACK 0 Wait for call 0 from above Wait for 0 from below Rdt2.2: Sender, Receiver Fragments rdt_send(data) sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,1) ) udt_send(sndpkt) Sender FSM Fragment rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,0) rdt_rcv(rcvpkt) && (corrupt(rcvpkt) || has_seq1(rcvpkt)) L Receiver FSM Fragment udt_send(sndpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq1(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK,1, chksum) udt_send(sndpkt)

  20. New Assumption: Underlying channel can also lose packets (data or ACKs) What to do when packet loss occurs? Sequence nos, retransmissions How to detect loss? Sender waits “reasonable” amount of time for ACK Must wait at least as long as RTT plus processing delay. Retransmits if no ACK received in this time If packet (or ACK) just delayed (not lost): Retransmission will be duplicate, but use of sequence numbers can handles this. Rdt3.0: Channels with Errors and Loss

  21. Implement a Retransmission mechanism using a count down timer Interrupts the sender after certain amount of time The sender will need to be able to: Start the timer each time a packet is sent Respond to a timer interrupt Stop the timer Rdt3.0: Channels with Errors and Loss

  22. Wait for ACK 0 Wait for ACK1 Wait for call 0 from above Wait for call 1 from above Rdt3.0 Sender rdt_send(data) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,1) ) sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) start_timer L rdt_rcv(rcvpkt) L timeout udt_send(sndpkt) start_timer rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,1) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,0) stop_timer stop_timer timeout udt_send(sndpkt) start_timer rdt_rcv(rcvpkt) L rdt_send(data) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,0) ) sndpkt = make_pkt(1, data, checksum) udt_send(sndpkt) start_timer L

  23. Thank You

More Related