Tutorial TCP 101 r The Transmission Control Protocol






















- Slides: 22
Tutorial: TCP 101 r The Transmission Control Protocol (TCP) is r r the protocol that sends your data reliably Used for email, Web, ftp, telnet, p 2 p, … Makes sure that data is received correctly: right data, right order, exactly once Detects and recovers from any problems that occur at the IP network layer Mechanisms for reliable data transfer: sequence numbers, acknowledgements, timers, retransmissions, flow control. . . CPSC 601. 38 1
TCP 101 (Cont’d) r TCP is a connection-oriented protocol SYN/ACK GET URL ACK YOUR DATA HERE FIN ACK FIN/ACK CPSC 601. 38 2
TCP 101 (Cont’d) r TCP slow-start and congestion avoidance ACK CPSC 601. 38 3
TCP 101 (Cont’d) r TCP slow-start and congestion avoidance ACK CPSC 601. 38 4
TCP 101 (Cont’d) r TCP slow-start and congestion avoidance ACK CPSC 601. 38 5
TCP 101 (Cont’d) r This (exponential growth) “slow start” process continues until either: m m m packet loss: after a brief recovery phase, you enter a (linear growth) “congestion avoidance” phase based on slow-start threshold found limit reached: slow-start threshold, or maximum advertised receive window size all done: terminate connection and go home CPSC 601. 38 6
Tutorial: TCP 201 r There is a beautiful way to plot and visualize the dynamics of TCP behaviour r Called a “TCP Sequence Number Plot” r Plot packet events (data and acks) as points in 2 -D space, with time on the horizontal axis, and sequence number on the vertical axis CPSC 601. 38 7
Seq. Num + X + X Key: X Data Packet + Ack Packet X + X X + + Time CPSC 601. 38 8
TCP 201 (Cont’d) r What happens when a packet loss occurs? r Quiz Time. . . m Consider a 14 -packet Web document m For simplicity, consider only a single packet loss CPSC 601. 38 9
Seq. Num + X + X Key: X Data Packet + Ack Packet X + X X + + Time CPSC 601. 38 10
Seq. Num ? Key: X Data Packet + Ack Packet X + X X + X + X + X + + Time CPSC 601. 38 11
Seq. Num Key: X Data Packet + Ack Packet X + X X + X + X + X X + + + Time CPSC 601. 38 12
Seq. Num + X + X Key: X Data Packet + Ack Packet X + X X + + Time CPSC 601. 38 13
Seq. Num Key: X Data Packet + Ack Packet X + X X + + X X X ? + X + X + X + + Time CPSC 601. 38 14
Seq. Num Key: X Data Packet + Ack Packet X + X X + + X X X ++ X + X + X X + + + Time CPSC 601. 38 15
Seq. Num + X + X Key: X Data Packet + Ack Packet X + X X + + Time CPSC 601. 38 16
Seq. Num Key: X Data Packet + Ack Packet X X X ? X X + + X X + + + + Time CPSC 601. 38 17
Seq. Num Key: X Data Packet + Ack Packet X X X X + + X X + X +++ + + + Time CPSC 601. 38 18
Seq. Num + X + X Key: X Data Packet + Ack Packet X + X X + + Time CPSC 601. 38 19
Seq. Num Key: X Data Packet + Ack Packet ? X + Time CPSC 601. 38 20
Seq. Num Key: X Data Packet + Ack Packet X X X + X + ++ X X + + + X Time CPSC 601. 38 21
TCP 201 (Cont’d) r Main observation: m “Not all packet losses are created equal” r Losses early in the transfer have a huge adverse impact on the transfer latency r Losses near the end of the transfer always cost at least a retransmit timeout r Losses in the middle may or may not hurt, depending on congestion window size at the time of the loss CPSC 601. 38 22