lecture 22: congestion control cont. and intro to links...
TRANSCRIPT
Lecture 22:Congestion Control cont. andIntro to Links and Signaling
CSE 123: Computer NetworksAaron Schulman
Project 3 due Thur 5/20
2
Lecture 22 Overview! Finish congestion control
! Signalingu Channel characteristicsu Types of physical media
! Modulationu Narrowband vs. Broadbandu Encoding schemes
! Warning: A lot of this material is not in the book
CSE 123 – Lecture 21: Links and Signaling
TCP Bandwidth Probing! TCP uses AIMD to adjust congestion window
u Converges to fair share of bottleneck linku Increases modestly in good timesu Cuts drastically in bad times
! But what rate should a TCP flow use initially?u Need some initial congestion windowu We’d like to TCP to work on all manner of linksu Need to span 6+ orders of magnitude, e.g., 10 K to 10 Gbps.u Starting too fast is catastrophic!
3CSE 123 – Lecture 22: Congestion Control
! Goal: quickly find the equilibrium sending rate
! Quickly increase sending rate until congestion detectedu Remember last rate that worked and don’t overshoot it
! TCP Reno Algorithm: u On new connection, or after timeout, set cwnd=1 MSSu For each segment acknowledged, increment cwnd by 1 MSSu If timeout then divide cwnd by 2, and set ssthresh = cwndu If cwnd >= ssthresh then exit slow start
! Why called slow? Its exponential after all…
4
Slow Start
CSE 123 – Lecture 22: Congestion Control
1
2Ack 2
3Ack 3
4567
cwnd=1
cwnd=2
cwnd=4
cwnd=8
Sender Receiver
0
50
100
150
200
250
300
0 1 2 3 4 5 6 7 8round-trip times
cwnd
Ack 4
Ack 5Ack 6Ack 7Ack 8
5
Slow Start Example
CSE 123 – Lecture 22: Congestion Control
Slow Start + Congestion Avoidance
0
2
4
6
8
10
12
14
16
18
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
round-trip times
cwnd
Timeout
ssthresh
Slow start
Congestionavoidance
6
Basic Mechanisms
CSE 123 – Lecture 22: Congestion Control
! Fast retransmitu Timeouts are slow (default often 200 ms or 1 second)u When packet is lost, receiver still ACKs last in-order packetu Use 3 duplicate ACKs to indicate a loss; detect losses quickly
» Why 3? When wouldn’t this work?
! Fast recoveryu Goal: avoid stalling after loss u If there are still ACKs coming in, then no need for slow startu If a packet has made it through -> we can send another oneu Divide cwnd by 2 after fast retransmitu Increment cwnd by 1 MSS for each additional duplicate ACK
7
Fast Retransmit & Recovery
CSE 123 – Lecture 22: Congestion Control
1
2Ack 2
3
4567
Sender Receiver
Ack 4
Ack 4Ack 4Ack 4Ack 4
Ack 3
4
3 Dup Acks
Fast retransmit
Fast recovery(increase cwnd by 1)
8
8
Fast Retransmit Example
CSE 123 – Lecture 22: Congestion Control
Slow Start + Congestion Avoidance +Fast Retransmit + Fast Recovery
0
2
4
6
8
10
12
14
16
18
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
round-trip times
cwnd
Fast recovery
9
More Sophistication
CSE 123 – Lecture 22: Congestion Control
! Short connection: only contains a few pkts! How do short connections and Slow-Start interact?
u What happens when a packet is lost during Slow-Start?u What happens when the SYN is dropped?
! Bottom line: Which packet gets dropped matters a lotu SYNu Slow-Startu Congestion avoidance
! Do you think most flows are short or long?! Do you think most traffic is in short flows or long flows?
10
Short Connections
CSE 123 – Lecture 22: Congestion Control
! TCP is designed around the premise of cooperationu What happens to TCP if it competes with a UDP flow?u What if we divide cwnd by 3 instead of 2 after a loss?
! There are a bunch of magic numbersu Decrease by 2x, increase by 1/cwnd, 3 duplicate acks, initial
timeout = 3 seconds, etc.
! But overall it works really well!u Still being constantly tweaked…
11
Open Issues
CSE 123 – Lecture 22: Congestion Control
! TCP Probes the network for bandwidth, assuming that loss signals congestion
! The congestion window is managed with an additive increase/multiplicative decrease policyu It took fast retransmit and fast recovery to get thereu Fast recovery keeps pipe “full” while recovering from a loss
! Slow start is used to avoid lengthy initial delaysu Ramp up to near target rate, then switch to AIMD
12
TCP CC Summary
CSE 123 – Lecture 22: Congestion Control
Underneath it all: Sending bits! A three-step process
u Take an input stream of bits (digital data)u Modulate some physical media to send data (analog)u Demodulate the signal to retrieve bits (digital again)u Anybody heard of a modem (Modulator-demodulator)?
20
digital data(a string of symbols)
digital data(a string of symbols)a signal
modulation demodulation
0101100100100 0101100100100
CSE 123 – Lecture 22: Links and Signaling
A Simple Signaling System
21CSE 123 – Lecture 22: Links and Signaling
Morse Code
22CSE 123 – Lecture 22: Links and Signaling
Morse Code Message
23CSE 123 – Lecture 22: Links and Signaling
For Next Class
! Read 2.2
24CSE 123 – Lecture 22: Links and Signaling