Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.

Similar presentations


Presentation on theme: "Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles."— Presentation transcript:

1 Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles of reliable data transfer r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management r 3.6 Principles of congestion control r 3.7 TCP congestion control

2 Transport Layer3-2 TCP Congestion Control (a) fast network feeding a low capacity receiver. (b) A slow network feeding a high- capacity receiver.

3 Transport Layer3-3 TCP congestion control: additive increase, multiplicative decrease r Approach: increase transmission rate (window size), probing for usable bandwidth, until loss occurs m additive increase: increase CongWin by 1 MSS every RTT until loss detected m multiplicative decrease: cut CongWin in half after loss time congestion window size Saw tooth behavior: probing for bandwidth

4 Transport Layer3-4 TCP Congestion Control: details r sender limits transmission: LastByteSent-LastByteAcked  CongWin r Roughly, r CongWin is dynamic, function of perceived network congestion How does sender perceive congestion? r loss event = timeout or 3 duplicate acks r TCP sender reduces rate ( CongWin ) after loss event three mechanisms: m AIMD m slow start m conservative after timeout events rate = CongWin RTT Bytes/sec

5 Transport Layer3-5 TCP Slow Start r When connection begins, CongWin = 1 MSS m Example: MSS = 500 bytes & RTT = 200 msec m initial rate = 20 kbps r available bandwidth may be >> MSS/RTT m desirable to quickly ramp up to respectable rate r When connection begins, increase rate exponentially fast until first loss event

6 Transport Layer3-6 TCP Slow Start (more) r When connection begins, increase rate exponentially until first loss event: m double CongWin every RTT m done by incrementing CongWin for every ACK received r Summary: initial rate is slow but ramps up exponentially fast Host A one segment RTT Host B time two segments four segments

7 Transport Layer3-7 Refinement: inferring loss r After 3 dup ACKs: m CongWin is cut in half m window then grows linearly r But after timeout event: m CongWin instead set to 1 MSS; m window then grows exponentially m to a threshold, then grows linearly  3 dup ACKs indicates network capable of delivering some segments  timeout indicates a “more alarming” congestion scenario Philosophy:

8 Transport Layer3-8 Refinement Q: When should the exponential increase switch to linear? A: When CongWin gets to 1/2 of its value before timeout. Implementation: r Variable Threshold r At loss event, Threshold is set to 1/2 of CongWin just before loss event

9 Transport Layer3-9 Summary: TCP Congestion Control r When CongWin is below Threshold, sender in slow-start phase, window grows exponentially. r When CongWin is above Threshold, sender is in congestion-avoidance phase, window grows linearly. r When a triple duplicate ACK occurs, Threshold set to CongWin/2 and CongWin set to Threshold. r When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS.

10 Transport Layer3-10 TCP sender congestion control StateEventTCP Sender ActionCommentary Slow Start (SS) ACK receipt for previously unacked data CongWin = CongWin + MSS, If (CongWin > Threshold) set state to “Congestion Avoidance” Resulting in a doubling of CongWin every RTT Congestion Avoidance (CA) ACK receipt for previously unacked data CongWin = CongWin+MSS * (MSS/CongWin) Additive increase, resulting in increase of CongWin by 1 MSS every RTT SS or CALoss event detected by triple duplicate ACK Threshold = CongWin/2, CongWin = Threshold, Set state to “Congestion Avoidance” Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS. SS or CATimeoutThreshold = CongWin/2, CongWin = 1 MSS, Set state to “Slow Start” Enter slow start SS or CADuplicate ACK Increment duplicate ACK count for segment being acked CongWin and Threshold not changed

11 Transport Layer3-11 TCP throughput r What’s the average throughout of TCP as a function of window size and RTT? m Ignore slow start r Let W be the window size when loss occurs. r When window is W, throughput is W/RTT r Just after loss, window drops to W/2, throughput to W/2RTT. r Average throughout:.75 W/RTT

12 Transport Layer3-12 TCP Futures: TCP over “long, fat pipes” r Example: 1500 byte segments, 100ms RTT, want 10 Gbps throughput r Requires window size W = 83,333 in-flight segments r Throughput in terms of loss rate: r ➜ L = 2·10 -10 Wow r New versions of TCP for high-speed

13 Transport Layer3-13 Problem 1 r Consider sending a large file from a host to another over a TCP connection that has no loss m Suppose TCP uses AIMD for its congestion control without slow start. Assuming CongWin increases by 1 MSS every time a batch of ACKs is received and assuming constant RTTs, how long does it take for CongWin to increase from 1 MSS to 6 MSS (assuming no loss events)? m What is the average throughput for this connection up to time = 5 RTT?

14 Transport Layer3-14 Solution 1 a) It takes 1 RTT to increase CongWin to 2 MSS; 2 RTTs to increase to 3 MSS; 3 RTTs to increase to 4 MSS; 4 RTTs to increase to 5 MSS; and 5 RTTs to increase to 6 MSS. b) In the first RTT 1 MSS was sent; in the second RTT 2 MSS was sent; in the third RTT 3 MSS was sent; in the forth RTT 4 MSS was sent; in the fifth RTT, 5 MSS was sent. Thus, up to time 5 RTT, 1+2+3+4+5 = 15 MSS were sent (and acknowledged). Thus, once can say that the average throughput up to time 5 RTT was (15 MSS)/(5 RTT) = 3 MSS/RTT.

15 Transport Layer3-15 Problem 2 r Show that the loss rate (fraction of packet loss) for a high speed TCP connection is equal to: r If TCP is needed to support 1 Gbps connection, what would the tolerable loss be?

16 Transport Layer3-16 Fairness goal: if K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/K TCP connection 1 bottleneck router capacity R TCP connection 2 TCP Fairness

17 Transport Layer3-17 Why is TCP fair? Two competing sessions: r Additive increase gives slope of 1, as throughout increases r multiplicative decrease decreases throughput proportionally R R equal bandwidth share Connection 1 throughput Connection 2 throughput congestion avoidance: additive increase loss: decrease window by factor of 2 congestion avoidance: additive increase loss: decrease window by factor of 2

18 Transport Layer3-18 Fairness (more) Fairness and UDP r Multimedia apps often do not use TCP m do not want rate throttled by congestion control r Instead use UDP: m pump audio/video at constant rate, tolerate packet loss r Research area: TCP friendly Fairness and parallel TCP connections r nothing prevents app from opening parallel connections between 2 hosts. r Web browsers do this r Example: link of rate R supporting 9 connections; m new app asks for 1 TCP, gets rate R/10 m new app asks for 11 TCPs, gets R/2 !

19 Transport Layer3-19 Chapter 3: Summary r 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 m UDP m TCP Next: r leaving the network “edge” (application, transport layers) r into the network “core”


Download ppt "Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles."

Similar presentations


Ads by Google