Download presentation
Presentation is loading. Please wait.
1
Copyright © 2005 Department of Computer Science CPSC 641 Winter 20111 Tutorial: TCP 101 The Transmission Control Protocol (TCP) is the protocol that sends your data reliably Used for email, Web, ftp, telnet, p2p,… 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...
2
Copyright © 2005 Department of Computer Science CPSC 641 Winter 20112 TCP 101 (Cont’d) TCP is a connection-oriented protocol SYN SYN/ACK ACK GET URL YOUR DATA HERE FIN FIN/ACK ACK Web ClientWeb Server
3
Copyright © 2005 Department of Computer Science CPSC 641 Winter 20113 TCP 101 (Cont’d) TCP slow-start and congestion avoidance ACK
4
Copyright © 2005 Department of Computer Science CPSC 641 Winter 20114 TCP 101 (Cont’d) TCP slow-start and congestion avoidance ACK
5
Copyright © 2005 Department of Computer Science CPSC 641 Winter 20115 TCP 101 (Cont’d) TCP slow-start and congestion avoidance ACK
6
Copyright © 2005 Department of Computer Science CPSC 641 Winter 20116 TCP 101 (Cont’d) This (exponential growth) “slow start” process continues until either: –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
7
Copyright © 2005 Department of Computer Science CPSC 641 Winter 20117 Tutorial: TCP 201 There is a beautiful way to plot and visualize the dynamics of TCP behaviour Called a “TCP Sequence Number Plot” 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 Example: 20 KB Web page (14 packets)…
8
Copyright © 2005 Department of Computer Science CPSC 641 Winter 20118 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + +
9
Copyright © 2005 Department of Computer Science CPSC 641 Winter 20119 So What? What can it tell you? Everything!!!
10
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201110 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + RTT
11
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201111 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + TCP Seg. Size
12
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201112 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + TCP Connection Duration
13
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201113 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + Num Bytes Sent
14
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201114 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + Avg Throughput (Bytes/Sec) Bytes Sec
15
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201115 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + Access Network Bandwidth (Bytes/Sec)
16
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201116 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + Sender’s Flow Control Window Size
17
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201117 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + TCP Slow Start
18
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201118 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + Delayed ACK
19
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201119 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X + + + + + + + ++ + + Packet Loss Duplicate ACK
20
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201120 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X + + + + + + + + + + X + Retransmit Cumulative ACK +
21
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201121 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X + + + + + + + + + + X + RTO +
22
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201122 TCP 201 (Cont’d) What happens when a packet loss occurs? Quiz Time... –Consider a 14-packet Web document –For simplicity, consider only a single packet loss
23
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201123 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + +
24
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201124 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X + + + + + + + + + + + + ?
25
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201125 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X + + + + + + + + + + + + X +
26
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201126 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + +
27
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201127 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X + + + + + + + + + + + ?
28
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201128 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + ++ + + +
29
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201129 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + +
30
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201130 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X + + + + + + + + + ?
31
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201131 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X + + + + + + + ++++ + X +
32
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201132 SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + +
33
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201133 SeqNum X + Key: X Data Packet + Ack Packet X + ?
34
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201134 SeqNum X + Key: X Data Packet + Ack Packet X X X + + + X X X + + + X + X + X +
35
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201135 TCP 201 (Cont’d) Main observation: –“Not all packet losses are created equal” - CLW 2002 Losses early in the transfer have a huge adverse impact on the transfer latency Losses near the end of the transfer always cost at least a retransmit timeout Losses in the middle may or may not hurt, depending on congestion window size at the time of the loss
36
Copyright © 2005 Department of Computer Science CPSC 641 Winter 201136 Congratulations! You are now a TCP expert!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.