End-to-End Transport Over Wireless II: Snoop and Explicit Loss Notification
End-to-End Transport Over Wireless II: Snoop and Explicit Loss Notification
End-to-End Transport Over Wireless II: Snoop and Explicit Loss Notification
2
Window-Based Flow Control: Motivation
5
Increasing utilization with pipelining
Data packet size L bits, bottleneck rate R bits/second
sender receiver
First bit sent, t = 0
Last bit sent, t = L / R
RTT
last bit of 2nd packet,
send ACK
ACK arrives, send
next
packet, t = RTT + L / R
The bandwidth-delay product
Data packet size L bits, bottleneck rate R bits/second
• Keep sending for time RTT = (N-1)L / R
sender receiver
N ⋅L /R
Usender = =1
RTT + L / R
( N −1) L = RTT ⋅ R
RTT
Number of bits Delay × Bandwidth
“in flight” product
8
TCP Header Details
• Connections inherently bidirectional; all TCP headers carry both data &
ACK sequence numbers
10
TCP: Receiver functionality
• Receiver indicates offered window size W explicitly to sender in
window field in TCP header
– Corresponds to available buffer space at receiver
11
TCP:
702
Sender’s Window
TCP Data Flow and Window Management
2IIHUHG:LQGRZ
Offered window(SND.WND)
(advertised by receiver)
13
TCP: Retransmit Timeouts
• Recall: Sender sets timer for each sent packet
– Expected time for ACK to return: RTT
– when ACK returns, timer canceled
– if timer expires before ACK returns, packet resent
14
Mean and Variance: Jacobson’s RTT Estimator
• Above link load of 30% at router, β × RTTi will retransmit too early!
– Response to increasing load: waste bandwidth on duplicate packets;
result: congestion collapse!
• Idea [Jacobson 88]: Estimate mean deviation vi, (EWMA of |mi – RTTi|), a
stand-in for variance:
vi = vi-1×(1-γ) + γ×|mi − RTTi|
– Then use retransmission timeout RTOi = RTTi + 4vi
15
Self-Clocking Transmission
17
Congestion Collapse
Knee
Throughput (bps)
Congestion
collapse!
18
Congestion Requires Slowing Senders
• Bigger buffers cannot prevent congestion: senders must slow down
• Absence of ACKs implicitly indicates congestion
• TCP sender’s window size determines sending rate
19
Reaching Equilibrium: Slow Start
• At connection start, sender sets congestion window size, cwnd, to
pktSize (one packet’s worth of bytes), not whole window
20
Avoiding Congestion: Multiplicative Decrease
• Recall sender uses window of size min(cwnd, W), where W is receiver’s
advertised window
21
Taking Your Fair Share: Additive Increase
• Drops indicate sending more than fair share of bottleneck
• No feedback to indicate using less than fair share
22
Refinement: Fast Retransmit (I)
• Sender must wait well over RTT for timer to expire before loss detected
– Receiver receives: 1, 3, 4, 5
23
Fast Retransmit (II)
• Upon arrival of three duplicate ACKs, A B
sender:
24
AIMD in Action
25
Modeling Throughput, Loss, and RTT
• How do packet loss rate and RTT affect throughput TCP achieves?
• Assume:
1. Only fast retransmits
2. No timeouts (so no slow starts in steady-state)
26
Evolution of Window Over Time
W
W/2
time
28
Throughput, Loss, and RTT Model
• W = √(8/3p) = (4/3) x √(3/2p)
• Consequences:
1. Increased loss quickly reduces throughput
29
Today
1. Transmission Control Protocol (TCP) primer, cont’d
30
Review: TCP on Wireless Links
• TCP interprets any packet loss as a sign of congestion
– TCP sender reduces congestion window
• On wireless links, packet loss can also occur due to random channel errors, or
interference
– Temporary loss not due to congestion
– Reducing window may be too conservative
– Leads to poor throughput
31
Review: Two Broad Approaches
1. Mask wireless losses from TCP sender
– Then TCP sender will not reduce congestion window
32
TCP Snoop: Introduction
• Removes most significant problem of split connection: breaking end-to-end
semantics
– No more split connection
– Single end-to-end connection like regular TCP
33
Snoop Protocol: High-level View
Per TCP-connection state
TCP connection
wireless
34
TCP Snoop: Downlink traffic case
TCP Segments
40 39 38 37
36
TCP Snoop: Downlink Example
TCP Segments
35
Snoop Cache (at AP):
TCP segments seen 36
(whose ACKs have
not yet been seen) 37
38
40 39 38 37
Wired Internet 34 Wireless Link 36
TCP ACKs
37
Downlink traffic operation, at Snoop AP
Packet arrives
1. Forward packet
No 2. Reset local rexmit
New pkt?
counter
Sender rexmission
Yes
1. Cache packet
2. Forward to
mobile
Common case
. A new packet in the normal TCP sequence: This is the common case, when a new packet in the normal 38
TCP Snoop: Downlink example
35 39
36
37
38
41 40 39 38
34 36
39
Downlink traffic operation, at Snoop AP
Ack arrives
1. Free buffers
2. Update RTT
Yes
New ack? estimate
3. Propagate ack
to sender
No
Common case
No
Discard Dup ack?
Spurious ack
Yes
40
1. A new ACK: This is the common case (when the connection is fairly error-free and there is little user m
TCP Snoop: Downlink example
35 39
36
37
38
41 40 39 38
34 36
41
TCP Snoop: Downlink example
37 40
38
39
42 41 40 39
36 36
First
dupack
37 40
38 41
39
43 42 41 40
36 36 36
First Second
dupack dupack
43
Downlink traffic operation, at Snoop AP
Ack arrives
1. Free buffers
2. Update RTT
Yes
New ack? estimate
3. Propagate ack
to sender
No
Common case
No
Discard Dup ack?
Spurious ack
Yes
44
1. A new ACK: This is the common case (when the connection is fairly error-free and there is little user m
TCP Snoop: Downlink example
37 40
38 41
39 42
44 43 37 41
36 36 36
45
Downlink traffic operation, at Snoop AP
Ack arrives
1. Free buffers
2. Update RTT
Yes
New ack? estimate
3. Propagate ack
to sender
No
Common case
No
Discard Dup ack?
Spurious ack
Yes
46
1. A new ACK: This is the common case (when the connection is fairly error-free and there is little user m
TCP Snoop: Downlink example
37 40 43
38 41
39 42
45 44 42 37
36 36
Discard
nd
2 dupack
36
47
TCP Snoop: Downlink example
37 40 43
38 41 44
39 42
46 45 43 42
36 41
Discard
rd
3 dupack
36 36
48
TCP Snoop: Downlink example
37 40 43
38 41 44
39 42 45
47 46 44 43
41
Discard
th
4 dupack
36 36 36
42 45
43 46
44
48 47 45 44
41 43
36 36 36
50
Uplink traffic case
TCP Segments
40 39 38 37
TCP Segments
40 39 38 37
Wireless Link 34 36
TCP ACKs
53
Two Broad Approaches
1. Mask wireless losses from TCP sender
– Then TCP sender will not reduce congestion window
54
Explicit Loss Notification (ELN)
• Notify the TCP sender that a wireless link (not congestion) caused a certain
packet loss
55
ELN for uplink TCP traffic
• AP keeps track of gaps in the TCP packet sequence received from the
mobile sender
Gap, size 1
at seqno 2
TCP Segments
4 3 2 1 4 3 1
Wireless Link TCP ACKs
Mobile Server
56
ELN for uplink TCP traffic
• When AP sees a dupack:
– AP compares dupack seqno with its recorded gaps
• If match: AP sets ELN bit in dupack and forwards it
Gap, size 1
TCP Segments at seqno 2
4 3 2 1 4 3 1
1 1 1 1
Mobile Server
Dupack with ELN set
57
Next Class
Lab 1: Build a spectrum analyzer (Holiday)
58