TCP Westwood for Wireless - cs.hac.ac.ilcs.hac.ac.il/staff/martin/seminar/westwood.pdf · Seminar...
Transcript of TCP Westwood for Wireless - cs.hac.ac.ilcs.hac.ac.il/staff/martin/seminar/westwood.pdf · Seminar...
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 1
TCPWestwood
for Wirelessתוכן
מבוא1.
TCP - בקרת עומס ב—רקע טכני 2.
.3TCPעל קשר אלחוטי
TCP Westwoodשיפור תפוקה עם פרוטוקול 4.
סיכום5.
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 2
מבואמתאר בקצרה
מקומו של הנושא בתחום התקשורת
הבעיות שהנושא פותר
המצב שהיה לפני קיומו
כיצד הנושא מקדם את המדע
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 3
TCP Over WirelessWireless internet
Widely usedRoutine workflowRequires TCP/IP
ProblemTCP handles packet loss as congestion
Lost packet ⇒ bit error or congestionTCP designed for cable (BER < 10-9)Congestion ⇒ slow packet transmission
Wireless BER ≈ 10-3
Many random errors without congestionNo need (or efficacy) in lower packet rate
Westwood Modified TCP SEQ/ACK mechanismImproved treatment of random errors http://cdn.androidpolice.com/wp-content/uploads/
2011/10/SC20111017-101459.png
http://www.quora.com/Public-Transport/What-did-passengers-do-on-the-metro-trains-before-the-proliferation-of-smart-phones
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 4
הרקע התיאורטימתאר בקצרה
הפיתוח /המערכת/תיאור הת פקוד של הטכנולוגיה
המדעי
ברמה הדרושה להבנת הנושא על ידי בעל תואר ראשון
במדעי המחשב
שאין לו מומחיות מיוחדת בתחום הנדון
בסגנון של מאמר מק צועי או כתב התקן
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 5
Congestion ControlFlow control
Avoid overflow in TCP receiver bufferCongestion control
Avoid overflow in router buffers
Flow Control TCPBuffer
RouterBuffer
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 6
Slow-StartCongestion window (cwnd)
Source windowMaximum number of "unACKed" bytes
Initial cwnd = 1 MSS (maximum segment size)Data rate = 1 MSS / RTT
Exponential growthOn each ACK
cwnd ← cwnd + size of data ACKedif (cwnd > maximum cwnd = destination window)
cwnd ← max cwndif (ACK timeout)
Segment size threshold (ssthresh) ← last cwndcwnd ← initial cwnd = 1 MSS
Sender Receiver
RTT
Timeout
ACK 1 MSS
ACK 2 MSS
ACK 3 MSS
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 7
RTT and Buffer ErrorsRound Trip Time
RTT = data transmit time + send buffer times+ ACK transmit time + ACK buffer times
Buffer time ~ typical service time × buffer levelRTT = random variable (rise / fall sharply)
Buffer time in TCPTimeout
Buffer level ⎯→ RTT > RTO (retransmit timeout)Packet considered lost
Out-of-order packetBuffer level ⎯→ RTT(packet k) > RTT(packet k+1)Receiver will send cumulative ACK if OOO packet not lost
Sender Receiver
SEQRTT
ACK
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 8
RTT and CongestionBuffer error condition
Buffer level ⎯→ RTT > RTO for time Terror
Isolated errorTerror < time between packetsBuffer empties before next packetNo need to lower transmission rate
CongestionTerror > time between packets Multiple buffer errorsLower transmission rate to prevent buffer errors
Sender Receiver
SEQRTT
ACK
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 9
Congestion Avoidance
Slow start phaseOn (ACK && cwnd < ssthresh)
cwnd ← cwnd + size of data ACKed
On (ACK timeout)
ssthresh ← cwnd
cwnd ← initial cwnd = 1 MSS
RTO ← 2 * RTO
Congestion avoidance phaseOn (ACK && cwnd > ssthresh)
cwnd ← cwnd + 1 MSS
Fast retransmit with fast recoveryOn (3 dupACKs)
ssthresh ← cwnd
cwnd ← cwnd / 2
TCP Reno protocol
Retransmit lost packetWait 1 RTT → continue sending
For > 3 dupACKscwnd++ on each new dupACK
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 10
Error-Free Transmission
0
20
40
60
80
100
0 1 2 3
ACKSEQcwnd
Slow Start CollisionAvoidance
Latency = 2.77Utilization = 34.2%goodput = 34.2%
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 11
Congestion ⎯→ Longer RTT
0
20
40
60
80
100
0 1 2 3 4
ACK (no congestion)SEQ (no congestion)cwnd (no congestion)ACKSEQcwnd
Latency = 3.70Latency (lossless) = 2.77Excess latency = 33.57%Utilization = 25.6%goodput = 25.6%
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 12
0
20
40
60
80
100
0 2 4 6 8
ACKSEQcwnd
1 Lost Packet — Early
Packet 3 lostTimeout
Latency = 6.87Latency (lossless) = 2.77Excess latency = 148.01%Utilization = 14.0%goodput = 13.8%
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 13
Steady State
0
20
40
60
80
100
0 2 4 6
ACKSEQcwnd
Packet 9 lost3 dupACKs
Packet 29 lost3 dupACKs
Packet 49 lost3 dupACKs
Packet 69 lost3 dupACKs
Packet 89 lost3 dupACKs
Latency = 5.32Latency (lossless) = 2.77Excess latency = 92.06%Utilization = 20.8%goodput = 17.8%
1 —> ACK 1 cwd —> 22,3 —> ACK 3 cwd —> 4
4 – 7 —> ACK 7 cwd —> 88 – 15, 9 lost —> ACK 8, 3 dupACK 8
(on 10, 11, 12)cwd —> 4 + resend 8
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 14
The Trouble with Wireless — 1Variations in transmission medium
Multiple correlated packet losses + bit errors TCP interprets as serious congestion — timeouts + slow start
Fading channelsRefractionReflectionAbsorptionMultipath
EMI (electromagnetic interference)Other usersOther radio equipmentOther radiating equipment
absorption
reflection
refraction
medium
station
station
station
station
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 15
The Trouble with Wireless — 2Mobility drops
User moves between wireless domainsAdds delays + buffers + dupACKs + timeouts
MSC
RNC-1 RNC-2
1 2 3 4
MSC
RNC-1 RNC-2
1 2 3 4Node-B Cells
Clusters
TCP response in cell 4TCP request in cell 1
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 16
The Trouble with Wireless — 3Link asymmetry
Upstream channel slower than downstream channelLarger 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 ↑ sharplySender floods forward
channel buffer
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 17
The Trouble with Wireless — 4MACA in WiFi
Required to prevent hidden node problem
MACA overheadRTS+CTS+ACKMAC time ≈ TCP ACK timeTCP WiFi ACK delay = 2 × wired TCP ACK delay ⇒ RTT ↑Timeouts ⇒ cwnd ↓
RTS
CTS
DATA
ACKMAC
A B C D
RTS CTS
E F
cwnd segment sizeB/s
RTT
RTT and cwnd B/s
×=
⇒↑ ↓ ↓
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 18
דיון ממו קדחומר המ קצועי הבסיסי שהוסכם עליו עם המנחה
תיאור של החומר שנקרא ומטרתו
סקירה על תוכן החומר שנלמד
דוגמאות מקוריות להמחשת ה נושא
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 19
TCP WestwoodReference
Saverio Mascolo, Claudio Casetti, Mario Gerla, M. Y. Sanadidi and RenWang, TCP Westwood: Bandwidth Estimation for Enhanced Transport over Wireless Links (2001) ACM SIGMOBILE.
Modifies TCP senderNot dependent on negotiation with TCP senderNot dependent on support in router or receiver
Estimates available bandwidthCounts dupACKs as successful traffic
On packet loss set cwnd = available bandwidthImproves on Reno cwnd = cwnd / 2
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 20
Average Transmission Rate in RenoSenders must measure bandwidth estimate R
Know cwndMeasure <RTT>
TCP average RTT (simplified)R'= last RTT measurement
SRTT ← (1 - α) * SRTT + α * R'
RTO ← max(1 sec, SRTT)
α = 1/8
= =packets sent cwnd
Rtime to ACK RTT
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 21
Noise Filtering in WestwoodModel bandwidth as noisy signal
BWmeas (time) = BW (time) + noise (time)
Filter out noise with low-pass filter
( ) ( )
( ) ( ) ( )
( )
2
2
20
0
1
1
Fourier transform input signal
Filter in frequency domain
Low-pass filter
Output signal "cut off" at frequency
ift
ift
x t X f e df
y t H f X f e df
H fff
f
π
π
∞
−∞
∞
−∞
=
=
=⎛ ⎞
+ ⎜ ⎟⎝ ⎠
∫
∫
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 22
Low Pass Filter Example
( ) ( ) ( )
( ) ( ) ( )2 2
1sin 2 sin 20
101 1 1
sin 2 sin 20101 10
1 12 2
x t t t
y t t t
π π
π π
= +
= +⎛ ⎞ ⎛ ⎞+ +⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠
Filter input
Filter output
( )( )
x t
y t
( ) 02
0
12
1
, H f ff
f
= =⎛ ⎞
+ ⎜ ⎟⎝ ⎠
( )X f
f1 10
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 23
DSP — Low Pass Filter for Sampled Signals
1
1
, 0,1, 2,...
, 0,1, 2,...
ˆ ˆ
number of bytes ACKedtime of ACK time of previous ACK
k
k k k
k kk
k k k
k k k
t k
t t t
d db k
t t t
b b
−
−
=Δ = −
= = = =Δ − −
= α
Sample input at times
Sample stream from input
Output stream (Tustin approximation)
( ) 11
0
12
21 , 2
2
1
parameter related to Nyquist sampling theorem
k kk
kk k
k
b b
tt
t
f
−−
++ − α
τ − Δα = < τ > Δ
τ + Δ
τ =
Cutoff frequency
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 24
Bandwidth Sampling in Westwind Bandwidth sample
1
1
2
0 2
number of bytes ACKedtime of ACK time of previous ACK
No ACK for time > insert "virtual ACK"
Insert at time
k kk
k k k
k k k
d db
t t t
d b t τ
−
−
= = =Δ − −
τ ⇒= ⇒ = +
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 25
Westwood Packet Counting ExamplePacket transmission times
Time ACKArrived at Receiver
Packets for BWE
Counted
dupACKBWE
t1 1 1 1 0 1 / (t1 – t0)
t2 3 2 + 3 2 0 2 / (t2 – t1)
t3 4 4 1 0 1 / (t3 – t2)
t4 4 6 1 1 1 / (t4 – t3)
t5 4 7 1 2 1 / (t5 – t4)
t6 4 8 1 3 1 / (t6 – t5)
t7 9 5 + 9 2 0 2 / (t7 – t6)
1 2 3 4 5 6 7 8 5 9
t0 t1 t2 t3 t6
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 2019 TCP over Wireless Networks Dr. Martin Land 26
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 ;
ACK "stuck" on old value (dupACK)
Increment dupACK counter
Count 1 dupACK
if (newACK > 1) ACK advances
if (count >= newACK)
count = count – newACK + 1 ;
newACK = 1 ;
Not all arrived packets ACKed
Remove ACKed from dupACK count
Count as additional dupACK
else if (count < newACK)
newACK = newACK - count ;
count = 0;
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 2019 TCP over Wireless Networks Dr. Martin Land 27
Westwood Scenario 1 — No ErrorsReceive 1 — 2,3 — 4,5,6,7 — 8,9,10,11,12,13,14,15ACK 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;
20
40
40
40
prevACK = ACK ; 1 3 7 11 15
return(newACK); 1 2 4 4 4Total = 15
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 28
Westwood Scenario 2 — 1 Packet Out-of-OrderReceive 1 — 2,3 — 5,6,7,4 — 8,9,10,11,12,13,14,15ACK 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 ;
— — 11
21
31
— — —
if (newACK > 1)
— — — —
if (count >= newACK)
count = count – newACK + 1 ;
newACK = 1 ;
— — — —
else if (count < newACK)
newACK = newACK - count ;
count = 0;
20
10
40
40
prevACK = ACK ; 1 3 3 3 3 7 11 15
return(newACK); 1 2 1 1 1 1 4 4Total = 15
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 29
Westwind Congestion ControlReno slow start
On (ACK && cwnd < ssthresh)
cwnd ← cwnd + size of data ACKed
Reno congestion avoidanceOn (ACK && cwnd > ssthresh)
cwnd ← cwnd + 1
Modified fast recoveryOn 3 dupACKs
ssthresh = BWE * RTT_min / segment_size
if (cwnd > ssthresh) cwnd = ssthresh
Modified timeoutssthresh = BWE * RTT_min / segment_size
if (ssthresh < 2) ssthresh = 2
cwnd = 1
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 30
Westwood Performance — Throughput
Seminar in Computer Networks and Distributed Systems — Hadassah College — Spring 2019 TCP over Wireless Networks Dr. Martin Land 31
SummaryTCP over wireless
TCP designed for wired systemsDoes not expect isolated bit errors
Treats all lost packets as congestion
Congestion ⇒ TCP lowers transmission rate
Many more isolated errors over wireless No need to lower transmission rate
TCP over wireless wastes bandwidth
WestwoodImproves error handling at senderCounts dupACKs as traffic arriving successfully after lost packet
Estimated available bandwidth including dupACKsCounts real ACKs and dupACKs separately
Higher average throughput than standard TCPFuture prospects — not implemented since 2001 research paper