15-441 Computer Networking: Lecture 18 - More TCP & Congestion Control
15-441 Computer Networking: Lecture 18 - More TCP & Congestion Control
• Flow control
• Stop & wait
• Parallel stop & wait
• Sliding window (e.g., advertised windows)
• Loss recovery
• Timeouts
• Acknowledgement-driven recovery (selective repeat or cumulative
acknowledgement)
• Congestion control
• AIMD fairness and efficiency
• TCP reliability
• Be nice to your data
• Client SYN
• SeqC: Seq. #4019802004, window 65535, max. seg. 1260
• Server SYN-ACK+SYN
• Receive: #4019802005 (= SeqC+1)
• SeqS: Seq. #3428951569, window 5840, max. seg. 1460
• Client SYN-ACK
• Receive: #3428951570 (= SeqS+1)
Lecture 18: TCP Details 6
TCP State Diagram: Connection Setup
Client
CLOSED active OPEN
Server create TCB
passive OPEN CLOSE Snd SYN
create TCB delete TCB
LISTEN CLOSE
delete TCB
CLOSE
Send FIN ESTAB
• Session
• Echo client on 128.2.222.198, server on 128.2.210.194
• Client FIN
• SeqC: 1489294581
• Server ACK + FIN
• Ack: 1489294582 (= SeqC+1)
• SeqS: 1909787689
• Client ACK
• Ack: 1909787690 (= SeqS+1)
Lecture 18: TCP Details 9
State Diagram: Connection Tear-down
CLOSE
Active Close ESTAB
send FIN
CLOSE rcv FIN Passive Close
send FIN send ACK
FIN CLOSE
WAIT-1 WAIT
rcv FIN
ACK snd ACK CLOSE
rcv FIN+ACK snd FIN
FIN WAIT-2 snd ACK CLOSING LAST-ACK
rcv ACK of FIN rcv ACK of FIN
• TCP reliability
A B A B
Original trans Original trans
miss ion miss ion
X
RTO RTO
ACK
Sample retran
smiss Sample retran
io smiss
RTT n
RTT ion
ACK
• Key observation:
• At high loads round trip variance is high
• Solution:
• Base RTO on RTT and standard deviation
• RTO = RTT + 4 * rttvar
• new_rttvar = β * dev + (1- β) old_rttvar
• Dev = linear deviation
• Inappropriately named – actually smoothed linear
deviation
Retransmission
X
Sequence No Duplicate Acks
Packets
Acks
Time
X
X
X
Now what? - timeout
X
Sequence No
Packets
Acks
Time
X
X
X
Now what? – send
X retransmissions as soon
Sequence No as detected
Packets
Acks
Time
• Need 3 dupacks/sacks
• TCP reliability
• Both X1 and X2
increase/ decrease
by the same amount Fairness Line
over time T1
• Both X1 and X2
increase by the Fairness Line
same factor over T1
time
User 2’s
• Extension from Allocation
x2 T0
origin – constant
fairness
Efficiency Line
• Constraints limit
us to AIMD x1
Fairness Line
• Improves or
keeps fairness User 2’s
x0
constant at Allocation
x2 x2
each step
• AIMD moves
Efficiency Line
towards optimal
point User 1’s Allocation x1
Rate
Time
10-30-2007 Lecture 18: TCP Details 31
Implementation Issue
Sequence No
Packets
Acks
Time
Congestion
Window
Cut Grabbing
Time
Packet loss
+ retransmit Congestion back
Window Bandwidth
and Rate