15-441 Computer Networking Lecture 18-More TCP Congestion Control
15-441 Computer Networking Lecture 18 – More TCP & Congestion Control
Good Ideas so far Flow control Stop wait ° Parallel stop&wait Sliding window(e.g, advertised windows) OSs recovery Timeouts Acknowledgement-driven recovery(selective repeat or cumulative acknowledgement Congestion control AIMD> fairness and efficiency How does TCP actually implement these? Lecture 18: TCP Details
2 Lecture 18: TCP Details Good Ideas So Far… • 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 • How does TCP actually implement these?
Outline The devilish details of tcp TCP connection setup and data transfer TCP reliability Be nice to your data TCP congestion avoidance · Be nice to your routers Lecture 18: TCP Details
3 Lecture 18: TCP Details Outline • The devilish details of TCP • TCP connection setup and data transfer • TCP reliability • Be nice to your data • TCP congestion avoidance • Be nice to your routers 3
Sequence Number Space Each byte in byte stream is numbered ·32 bit va|ue · Wraps around Initial values selected at start up time TCP breaks up the byte stream into packets Packet size is limited to the maximum Segment size Each packet has a sequence number Indicates where it fits in the byte stream 13450 1495016050 17550 packet 8 packet 9 packet 10 Lecture 18: TCP Details
4 Lecture 18: TCP Details Sequence Number Space • Each byte in byte stream is numbered. • 32 bit value • Wraps around • Initial values selected at start up time • TCP breaks up the byte stream into packets. • Packet size is limited to the Maximum Segment Size • Each packet has a sequence number. • Indicates where it fits in the byte stream packet 8 packet 9 packet 10 13450 14950 16050 17550
Establishing Connection Three-Way handshake Each side notifies other of starting sequence number SYN: Seqc it will use for sending ° Why not simply chose0? Must avoid overlap with earlier ACK: Seqc+1 incarnation SYN: Seqs Security issues Each side acknowledges ACK: Seqs+1 other's sequence number SYN-ACK: Acknowledge sequence number 1 Can combine second sYn Client Server with first acK Lecture 18: TCP Details
5 Lecture 18: TCP Details Establishing Connection: Three-Way handshake • Each side notifies other of starting sequence number it will use for sending • Why not simply chose 0? • Must avoid overlap with earlier incarnation • Security issues • Each side acknowledges other’s sequence number • SYN-ACK: Acknowledge sequence number + 1 • Can combine second SYN with first ACK SYN: SeqC ACK: SeqC+1 SYN: SeqS ACK: SeqS+1 Client Server