《计算机网络——自顶向下方法与internet特色》幻灯片lecture35.ppt
26页Chapter 3 outline• 3.1 Transport-layer services • 3.2 Multiplexing and demultiplexing • 3.3 Connectionless transport: UDP • 3.4 Principles of reliable data transfer• 3.5 Connection-oriented transport: TCP – segment structure – reliable data transfer – flow control – connection management • 3.6 Principles of congestion control • 3.7 TCP congestion control3.7 TCP congestion controln TCP uses end-to-end congestion control rather then network-assisted congestion control, since the IP layer provides no explicit feedback to the end systems regarding network congestion. n The approach taken by TCP is to have each sender limit the rate at which it sends traffic into its connection as a function of perceived network congestion. n Question: Ø How limit the rate? congestion window (CongWin) Ø How perceive a congestion? Timeout or 3 duplicate ACKs Ø How change the send rate?TCP Reno congestion control algorithm:TCP Congestion Control: details • sender limits transmission:LastByteSent-LastByteAcked min{CongWin,RcvWindow} • Roughly,• CongWin is dynamic, function of perceived network congestion (新 增加的一个变量,叫做拥塞窗口; 若RcvWindow足够大,仅受拥塞 窗口控制)How does sender perceive congestion? • loss event = timeout or 3 duplicate acks • TCP sender reduces rate (CongWin) after loss event three mechanisms of TCP congestion control: – AIMD – slow start – conservative after timeout eventsrate = CongWin RTT Bytes/sec1.TCP congestion control: additive increase, multiplicative decrease (AIMD)• Approach: increase transmission rate (window size), probing for usable bandwidth, until loss occurs – additive increase: increase CongWin by 1 MSS every RTT until loss detected – multiplicative decrease: cut CongWin in half after loss timecongestion window sizeSaw tooth behavior: probing for bandwidth2. TCP Slow Start• When connection begins, CongWin = 1 MSS – Example: MSS = 500 bytes – window then grows exponentially – to a threshold, then grows linearlyq 3 dup ACKs indicates network capable of delivering some segments q timeout indicates a “more alarming” congestion scenarioPhilosophy:Summary: TCP Congestion Control• When CongWin is below Threshold, sender in slow -start phase, window grows exponentially.• When CongWin is above Threshold, sender is in congestion-avoidance phase, window grows linearly.• When a triple duplicate ACK occurs, Threshold set to CongWin/2 and CongWin set to Threshold.• When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS. TCP sender congestion control StateEvent TCP Sender Action Commentary 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 RTTCongestion Avoidance (CA) ACK receipt for previously unacked dataCongWin = CongWin+MSS * (MSS/CongWin)Additive increase, resulting in increase of CongWin by 1 MSS every RTT SS or CALoss event detected by triple duplicate ACKThreshold = 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 startSS or CADuplicate ACKIncrement duplicate ACK count for segment being ackedCongWin and Threshold not changed4. TCP throughput• What’s the average throughout of TCP as a function of window size and RTT? – Ignore slow start • Let W be the window size when loss occurs. • When window is W, throughput is W/RTT • Just after loss, window drops to W/2, throughput to W/2RTT. • Average throughout: .75 W/RTT5. TCP Futures• Example: 1500 byte segments, 100ms RTT, want 10 Gbps throughput • Requires window size W = 83,333 in-flight segments • Throughput in terms of loss rate:• ➜ L = 2·10-10 for 10Gbps • New versions of TCP for high-speed needed!Fairness goal: if K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/KTCP connection 1bottleneck router capacity RTCP connection 23.7.1 TCP FairnessWhy is TCP fair?Two competing sessions: •Additive increase gives slope of 1, as throughout increases •multiplicative decrease decreases throughput proportionally RRequal bandwidth shareConnection 1 throughputConnection 2 throughputcongestion avoidance: additive increaseloss: decrease window by factor of 2congestion avoidance: additive increaseloss: decrease window by factor of 2Fairness (more)Fairness and UDP (UDP 是不公平的,它没有限 制地向网络发送流量) • Multimedia apps often do not use TCP – do not want rate throttled by congestion control • Instead use UDP: – pump audio/video at constant rate, tolerate packet loss • Research area: TCP friendly (限制UDP流量)Fairness and parallel TCP connections (这种方式是不 公平的) • nothing prevents app from opening parallel connections between 2 hosts. • Web browsers do this • Example: link of rate R supporting 9 cnctions; – new app ask。





