1 Transport Layer goals: r understand principles behind transport layer services: m multiplexing/demultiplexing m reliable data transfer m flow control.
Published byModified over 4 years ago
Presentation on theme: "1 Transport Layer goals: r understand principles behind transport layer services: m multiplexing/demultiplexing m reliable data transfer m flow control."— Presentation transcript:
1 Transport Layer goals: r understand principles behind transport layer services: m multiplexing/demultiplexing m reliable data transfer m flow control m congestion control r instantiation and implementation in the Internet Overview: r transport layer services r multiplexing/demultiplexing r connectionless transport: UDP r principles of reliable data transfer r connection-oriented transport: TCP m reliable transfer m connection management m flow control r principles of congestion control r TCP congestion control
2 Transport services and protocols r provide logical communication between app’ processes running on different hosts r transport protocols run in end systems (primarily) transport vs network layer services: r network layer: data transfer between end systems r transport layer: data transfer between processes m relies on, enhances, network layer services similar issues at data link layer. application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical logical end-end transport
3 Transport-layer protocols Internet transport services: r reliable, in-order unicast delivery (TCP) m congestion m flow control m connection setup r unreliable (“best-effort”), unordered unicast or multicast delivery: UDP r services not available: m real-time m bandwidth guarantees m reliable multicast application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical logical end-end transport
4 Principles of Reliable data transfer r important in app., transport, link layers r an important networking topic! r characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt)
5 Reliable data transfer: getting started send side receive side rdt_send(): called from above, (e.g., by app.). Passed data to deliver to receiver upper layer udt_send(): called by rdt, to transfer packet over unreliable channel to receiver rdt_rcv(): called when packet arrives on rcv-side of channel deliver_data(): called by rdt to deliver data to upper
6 Reliable data transfer: getting started We’ll: r incrementally develop sender, receiver sides of reliable data transfer protocol (rdt) r consider only unidirectional data transfer m but control info will flow on both directions! r use finite state machines (FSM) to specify sender, receiver state 1 state 2 event causing state transition actions taken on state transition state: when in this “state” next state uniquely determined by next event event actions
7 Rdt1.0: reliable transfer over a reliable channel r underlying channel perfectly reliable m no bit errors m no loss of packets r separate FSMs for sender, receiver: m sender sends data into underlying channel m receiver read data from underlying channel
8 Rdt2.0: channel with bit errors r underlying channel may flip bits in packet m use checksum to detect bit errors r the question: how to recover from errors: m acknowledgements (ACKs): receiver explicitly tells sender that pkt received OK. m negative acknowledgements (NACKs): receiver explicitly tells sender that pkt had errors. m sender retransmits pkt on receipt of NAK. r new mechanisms in rdt2.0 (beyond rdt1.0): m error detection. m receiver feedback: control msgs (ACK,NACK) rcvr->sender.
10 rdt2.0: in action (no errors) sender FSMreceiver FSM
11 rdt2.0: in action (error scenario) sender FSMreceiver FSM
12 rdt 2.0 (correctness) Assumptions for unreliable channel (uc 2.0): Packets (data, ACK and NACK) are delivered in order. Data packets might get corrupt (and the corruption is detectable). If we continue sending data packets, eventually, an uncorrupted data packet arrives. ACK and NACK do not get corrupt. Theorem : rdt 2.0 delivers packets reliably over channel uc 2.0. Claim 1: There is at most one packet in transit.
13 Rdt 2.0 (correctness) Typical sequence in the system: “wait for call” rdt_send(data) “wait for Ack/Nack” udt_send(data) udt_snd(NACK)... udt_send(data) udt_snd(ACK) “wait for call”
14 rdt 2.0 (correctness) Claim I: In state “wait for call” all data received at sender was delivered (once and in order) to the receiver. Claim II: In state “wait ACK/NACK” (1) all data received (except current packet) was delivered, and (2) eventually move to state “wait for call”. Sketch of Proof: Proof is by induction on the events. The base of the induction is trivial.
15 Rdt 2.0 (correctness) Initially the sender is in “wait for call” (Claim I holds). Assume rdt_snd(data) occurs. The sender changes state “wait for Ack”. Part 1 of Claim B holds from Claim I. In “wait for Ack/ Nack” sender performs udt_send(sndpkt). If sndpkt is corrupt, the receiver sends NACK, and the sender resends. Eventually sndpkt is delivered un-corrupted. The receiver delivers the data (all data delivered) and sends Ack. The sender moves to “wait for call” (Part 2 Claim II holds). When sender is in “wait for call” all data was delivered (Claim I holds).
16 rdt2.0 - garbled ACK/NACK What happens if ACK/NACK corrupted? r sender doesn’t know what happened at receiver! r If ACK was lost: m Data was delivered m Needs to return to “wait for call” r If NACK was lost: m Data was not delivered. m Needs to re-send data. What to do? r Assume it was a NACK - retransmit, but this might cause retransmission of correctly received pkt! Duplicate. r Assume it was an ACK - continue to next data, but this might cause the data to never reach the receiver! Missing. r sender ACKs/NACKs receiver’s ACK/NACK. What if sender ACK/NACK corrupted?
17 rdt2.0 - garbled ACK/NACK Handling duplicates: r sender adds sequence number to each packet r sender retransmits current packet if ACK/NACK garbled receiver discards (doesn’t deliver up) duplicate packet Sender sends one packet, then waits for receiver response stop and wait
20 rdt2.1: discussion Sender: r seq # added to pkt r two seq. #’s (0,1) will suffice. Why? r must check if received ACK/NACK corrupted r twice as many states m state must “remember” whether “current” pkt has 0 or 1 seq. # Receiver: r must check if received packet is duplicate m state indicates whether 0 or 1 is expected pkt seq # r note: receiver can not know if its last ACK/NACK received OK at sender
21 rdt2.2: a NAK-free protocol r same functionality as rdt2.1, using ACKs only r instead of NAK, receiver sends ACK for last pkt received OK m receiver must explicitly include seq # of pkt being ACKed r duplicate ACK at sender results in same action as NAK: retransmit current pkt sender FSM !
22 rdt3.0: channels with errors and loss New assumption: underlying channel can also lose packets (data or ACKs) m checksum, seq. #, ACKs, retransmissions will be of help, but not enough Q: how to deal with loss? Approach: sender waits “reasonable” amount of time for ACK r retransmits if no ACK received in this time r if pkt (or ACK) just delayed (not lost): m retransmission will be duplicate, but use of seq. #’s already handles this m receiver must specify seq # of pkt being ACKed r requires countdown timer
27 Performance of rdt3.0 r rdt3.0 works, but performance stinks r example: 1 Gbps link, 15 ms e-e prop. delay, 8Kb packet: T transmit = 8kb/pkt 10**9 b/sec = 8 microsec Utilization = U = = 8 microsec 30.016 msec fraction of time sender busy sending = 0.00015 m 8Kb pkt every 30 msec -> 266kb/sec throughput over 1 Gbps link m network protocol limits use of physical resources!
28 rdt 3.0 - correctness Two main issues: Safety - the data that the receiver outputs are correct. Liveness - the receiver eventually outputs more data Assumptions for unreliable channel (uc 3.0): Data packets and Ack packets are delivered in order. Data and ACK packets might get corrupt or lost If we continue sending data/ACK packets, eventually, an uncorrupted data packet arrives.
29 rdt 3.0 - correctness Wait call 0 wait for 0 Wait Ack0 wait for 0 Wait Ack0 wait for 1 Wait Ack1 wait for 1 Wait call 1 wait for 1 Wait Ack1 wait for 0 rdt_send(data,seq0) rdt_send(data,seq1) rdt_rcv(data, seq0) rdt_rcv(ACK0) rdt_rcv(data,seq1) rdt_rcv(ACK1)
30 rdt 3.0 - correctness Wait Ack0 wait for 0 Wait Ack0 wait for 1 rdt_rcv(data, seq0) Wait call 1 wait for 1 rdt_rcv(ACK0) Wait Ack0 wait for 1 All packets in transit have seq. Num. 0 All ACK in transit are ACK0