TCP Westwood for Wireless תוכן מבוא 1. רקע טכני בקרת עומס ב- TCP 2. TCP על קשר אלחוטי 3. שיפור תפוקה עם פרוטוקול TCP Westwood 4. סיכום 5. Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 1
מבוא מתאר בקצרה מקומו של הנושא בתחום התקשורת הבעיות שהנושא פותר המצב שהיה לפני קיומו כיצד הנושא מקדם את המדע Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 2
TCP Over Wireless Wireless internet Widely used Routine workflow Requires TCP/IP Problem TCP handles packet loss as congestion Lost packet bit error or congestion TCP designed for cable (BER < 10-9 ) Congestion slow packet transmission Wireless BER 10-3 http://www.quora.com/public-transport/what-did-passengers-do-on-the-metro-trains-before-the-proliferation-of-smart-phones Many random errors without congestion No need (or efficacy) in lower packet rate Westwood Modified TCP SEQ/ACK mechanism Improved treatment of random errors http://cdn.androidpolice.com/wp-content/uploads/ 2011/10/SC20111017-101459.png Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 3
הרקע התיאורטי מתאר בקצרה תיאור התפקוד של הטכנולוגיה/המערכת/הפיתוח המדעי ברמה הדרושה להבנת הנושא על ידי בעל תואר ראשון במדעי המחשב שאין לו מומחיות מיוחדת בתחום הנדון בסגנון של מאמר מקצועי או כתב התקן Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 4
Congestion Control Flow control Avoid overflow in TCP receiver buffer Congestion control Avoid overflow in router buffers Flow Control TCP Buffer Router Buffer Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 5
Slow-Start Congestion window (cwnd) Source window Maximum number of "unacked" bytes Initial cwnd = 1 MSS (maximum segment size) Data rate = 1 MSS / RTT Sender Receiver RTT ACK 1 MSS ACK 2 MSS Exponential growth On each ACK cwnd cwnd + size of data ACKed if (cwnd > maximum cwnd = destination window) cwnd max cwnd if (ACK timeout) Segment size threshold (ssthresh) last cwnd cwnd initial cwnd = 1 MSS Timeout ACK 3 MSS Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 6
RTT and Buffer Errors Round Trip Time RTT = data transmit time + send buffer times + ACK transmit time + ACK buffer times Buffer time ~ typical service time buffer level RTT = random variable (rise / fall sharply) RTT Sender SEQ ACK Receiver Buffer time in TCP Timeout Buffer level RTT > RTO (retransmit timeout) Packet considered lost Out-of-order packet Buffer level RTT(packet k) > RTT(packet k+1) Receiver will send cumulative ACK if OOO packet not lost Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 7
RTT and Congestion Buffer error condition Sender Receiver Buffer level RTT > RTO for time T error Isolated error T error < time between packets Buffer empties before next packet No need to lower transmission rate RTT SEQ ACK Congestion T error > time between packets Multiple buffer errors Lower transmission rate to prevent buffer errors Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 8
Congestion Avoidance TCP Reno protocol Slow start phase On (ACK && cwnd < ssthresh) cwnd cwnd + size of data ACKed On (ACK timeout) ssthresh cwnd cwnd initial cwnd = 1 MSS RTO 2 * RTO Congestion avoidance phase On (ACK && cwnd > ssthresh) cwnd cwnd + 1 MSS Fast retransmit with fast recovery On (3 dupacks) ssthresh cwnd cwnd cwnd / 2 Retransmit lost packet Wait 1 RTT continue sending For > 3 dupacks cwnd++ on each new dupack Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 9
Error-Free Transmission 100 80 ACK SEQ cwnd 60 Latency = 2.77 Utilization = 34.2% goodput = 34.2% 40 20 Slow Start Collision Avoidance 0 0 1 2 3 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 10
Congestion Longer RTT 100 80 ACK (no congestion) SEQ (no congestion) cwnd (no congestion) ACK SEQ cwnd 60 40 Latency = 3.70 Latency (lossless) = 2.77 Excess latency = 33.57% Utilization = 25.6% goodput = 25.6% 20 0 0 1 2 3 4 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 11
1 Lost Packet Early 100 80 ACK SEQ cwnd 60 Latency = 6.87 Latency (lossless) = 2.77 Excess latency = 148.01% Utilization = 14.0% goodput = 13.8% 40 20 Packet 3 lost Timeout 0 0 2 4 6 8 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 12
Steady State 100 80 ACK SEQ cwnd 60 Latency = 5.32 Latency (lossless) = 2.77 Excess latency = 92.06% Utilization = 20.8% goodput = 17.8% 40 20 0 0 2 4 6 Packet 9 lost 3 dupacks Packet 29 lost 3 dupacks Packet 49 lost 3 dupacks Packet 69 lost 3 dupacks Packet 89 lost 3 dupacks Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 13
The Trouble with Wireless 1 Variations in transmission medium Multiple correlated packet losses + bit errors TCP interprets as serious congestion timeouts + slow start Fading channels Refraction Reflection Absorption Multipath refraction reflection absorption medium EMI (electromagnetic interference) Other users Other radio equipment Other radiating equipment station station station station Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 14
The Trouble with Wireless 2 Mobility drops User moves between wireless domains Adds delays + buffers + dupacks + timeouts MSC MSC RNC-1 RNC-2 Clusters RNC-1 RNC-2 1 2 3 4 Node-B Cells 1 2 3 4 TCP request in cell 1 TCP response in cell 4 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 15
The Trouble with Wireless 3 Link asymmetry Upstream channel slower than downstream channel Larger buffer longer buffer delay lower average B/s ACK compression Base Mobile ACKs delayed in upstream buffer RTT B/s All ACKs arrive together cwnd sharply Sender floods forward channel buffer Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 16
The Trouble with Wireless 4 MACA in WiFi Required to prevent hidden node problem RTS RTS CTS CTS A B C D E F DATA ACK MAC MACA overhead RTS+CTS+ACK MAC time TCP ACK time TCP WiFi ACK delay = 2 wired TCP ACK delay RTT Timeouts cwnd cwnd segment size B/s = RTT RTT and cwnd B/s Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 17
דיון ממו קד חומר המקצועי הבסיסי שהוסכם עליו עם המנחה תיאור של החומר שנקרא ומטרתו סקירה על תוכן החומר שנלמד דוגמאות מקוריות להמחשת הנושא Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 18
TCP Westwood Reference Saverio Mascolo, Claudio Casetti, Mario Gerla, M. Y. Sanadidi and Ren Wang, TCP Westwood: Bandwidth Estimation for Enhanced Transport over Wireless Links (2001) ACM SIGMOBILE. Modifies TCP sender Not dependent on negotiation with TCP sender Not dependent on support in router or receiver Estimates available bandwidth Counts dupacks as successful traffic On packet loss set cwnd = available bandwidth Improves on Reno cwnd = cwnd / 2 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 19
Average Transmission Rate in Reno Senders must measure bandwidth estimate R Know cwnd packets sent R = = Measure <RTT> time to ACK cwnd RTT TCP average RTT (simplified) R'= last RTT measurement SRTT (1 - α) * SRTT + α * R' RTO max(1 sec, SRTT) α = 1/8 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 20
Noise Filtering in Westwood Model bandwidth as noisy signal BW meas (time) = BW (time) + noise (time) Filter out noise with low-pass filter H 2πift x t X f e df () = ( ) 2πift y t H f X f e df () = ( ) ( ) ( f ) = 1 f 1+ f0 2 Fourier transform input signal Filter in frequency domain Low-pass filter Output signal "cut off" at frequency f 0 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 21
Low Pass Filter Example Filter input Filter output 1 x() t = sin ( 2πt) + sin ( 20πt) 10 1 1 1 y t t t 2 2 1 10 10 1+ 1+ 2 2 () = sin ( 2π ) + sin ( 20π ) ( ) () x t y t 1 H( f ) =, f 2 0 = f 1+ f0 2 X ( f ) 1 10 f Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 22
DSP Low Pass Filter for Sampled Signals Sample input at times t k k, k = 0,1,2,... Δ t = t t b k k k 1 Sample stream from input dk dk number of bytes ACKed = = =, k = 0,1,2,... Δt t t time of ACK time of previous ACK k k k 1 Output stream (Tustin approximation) ˆ ˆ b + b bk =αkbk 1 + αk 2 2τ Δtk α k = < 1, 2τ> Δt 2τ+Δt Cutoff frequency τ= 1 f 0 k k k 1 ( 1 ) k parameter related to Nyquist sampling theorem Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 23
Bandwidth Sampling in Westwind Bandwidth sample b k dk dk number of bytes ACKed = = = Δt t t time of ACK time of previous ACK k k k 1 No ACK for time > 2τ insert "virtual ACK" Insert d = 0 b at time = t + 2τ k k k 1 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 24
Westwood Packet Counting Example Packet transmission times 1 2 3 4 5 6 7 8 5 9 t 0 t 1 t 2 t 3 t 6 Time ACK Arrived at Receiver Packets for BWE Counted dupack BWE t 1 1 1 1 0 1 / (t 1 t 0 ) t 2 3 2 + 3 2 0 2 / (t 2 t 1 ) t 3 4 4 1 0 1 / (t 3 t 2 ) t 4 4 6 1 1 1 / (t 4 t 3 ) t 5 4 7 1 2 1 / (t 5 t 4 ) t 6 4 8 1 3 1 / (t 6 t 5 ) t 7 9 5 + 9 2 0 2 / (t 7 t 6 ) ACK jumps to 9 from 4 = 5 but 3 ACKs (6, 7, 8) already counted as dupacks Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 25
Westwood ACK Counter (for BWE) newack = ACK prevack ; Packets ACKed by new ACK // if (newack = 1) do nothing No error condition report 1 ACK if (newack = 0) count++ ; newack = 1 ; if (newack > 1) ACK "stuck" on old value (dupack) Increment dupack counter Count 1 dupack ACK advances if (count >= newack) count = count newack + 1 ; newack = 1 ; else if (count < newack) newack = newack - count ; count = 0; Not all arrived packets ACKed Remove ACKed from dupack count Count as additional dupack All packets ACKed in order Report ACKed counted (new ACKs) Zero dupack counter prevack = ACK ; return(newack); Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 26
Westwood Scenario 1 No Errors Receive 1 2,3 4,5,6,7 8,9,10,11,12,13,14,15 ACK 1 3 7 11 15 newack= 1 2 4 4 4 newack = ACK prevack ; 1 2 4 4 4 if (newack = 0) count++ ; newack = 1 ; if (newack > 1) if (count >= newack) count = count newack + 1 ; newack = 1 ; else if (count < newack) newack = newack - count ; count = 0; 2 0 4 0 4 0 4 0 prevack = ACK ; 1 3 7 11 15 return(newack); Total = 15 1 2 4 4 4 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 27
Westwood Scenario 2 1 Packet Out-of-Order Receive 1 2,3 5,6,7,4 8,9,10,11,12,13,14,15 ACK 1 3 3 3 3 7 11 15 newack = ACK prevack ; 1 2 0 0 0 4 4 4 if (newack = 0) count++ ; newack = 1 ; 1 1 2 1 3 1 if (newack > 1) if (count >= newack) count = count newack + 1 ; newack = 1 ; else if (count < newack) newack = newack - count ; count = 0; 2 0 1 0 4 0 4 0 prevack = ACK ; 1 3 3 3 3 7 11 15 return(newack); Total = 15 1 2 1 1 1 1 4 4 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 28
Westwind Congestion Control Reno slow start On (ACK && cwnd < ssthresh) cwnd cwnd + size of data ACKed Reno congestion avoidance On (ACK && cwnd > ssthresh) cwnd cwnd + 1 Modified fast recovery On 3 dupacks ssthresh = BWE * RTT_min / segment_size if (cwnd > ssthresh) cwnd = ssthresh Modified timeout ssthresh = BWE * RTT_min / segment_size if (ssthresh < 2) ssthresh = 2 cwnd = 1 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 29
Westwood Performance Throughput Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 30
Loss Example Reno After 100 packets cwnd = 32 ssthresh = 16 Transmit 32 packets 101 132 packet 129 lost Round cwnd Packets ACK 1 32 101 132 3 dupacks = 129 2 16 129 133 (cumulative ACK) 3 17 133 149 150 4 18 150 167 168 Performance Total time to ACK = 4 RTT Average BW = (67 packets b bits per packet) / (4 RTT) For RTT = 100 msec with 10,000 bits per packet Average BW = 1.675 Mbps Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 31
Reno versus Westwood Example After 100 packets cwnd = 32 Transmit 32 packets 101 132 packet 129 lost Round BWE cwnd Packets ACK 1 32 b / RTT 32 101 132 3 dupacks = 129 2 32 b / RTT 32 129 133 (cumulative ACK) 3 32 b / RTT 32 133 164 165 4 32 b / RTT 32 165 196 197 Comparison of round 2 Reno: cwnd cwnd / 2 = 4 Westwood: ssthresh = cwnd BWE = 32 Performance Total time to ACK = 4 RTT Average BW = 2.4 Mbps = 43% (96/67) better than Reno ( ) ( ) ( 31 ) + ( 32 ) bˆ =α 32 + 1 α 2 2 2 1 α = 2 2 32 32 2 Seminar in Computer Networks and Distributed Systems Hadassah College Spring 2017 TCP over Wireless Networks Dr. Martin Land 32