CPSC 601.381 TCP Plots r Slides originally from Williamson at Calgary r Minor modifications are made

Preview:

DESCRIPTION

CPSC TCP 101 (Cont’d) r TCP is a connection-oriented protocol SYN SYN/ACK ACK GET URL YOUR DATA HERE FIN FIN/ACK ACK Web ClientWeb Server

Citation preview

CPSC 601.38 1

TCP Plots Slides originally from Williamson at

Calgary Minor modifications are made

CPSC 601.38 2

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...

CPSC 601.38 3

TCP 101 (Cont’d) TCP is a connection-oriented protocol

SYNSYN/ACK

ACKGET URL

YOUR DATA HERE

FIN FIN/ACKACK

Web Client Web Server

CPSC 601.38 4

TCP 101 (Cont’d) TCP slow-start and congestion

avoidance

ACK

CPSC 601.38 5

TCP 101 (Cont’d) TCP slow-start and congestion

avoidance

ACK

CPSC 601.38 6

TCP 101 (Cont’d) TCP slow-start and congestion

avoidance

ACK

CPSC 601.38 7

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

CPSC 601.38 8

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: Consider a 14-packet transfer

CPSC 601.38 9

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

CPSC 601.38 10

So What? What can it tell you?

Everything!!!

CPSC 601.38 11

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

RTT

CPSC 601.38 12

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

TCPSeg.Size

CPSC 601.38 13

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

TCP Connection Duration

CPSC 601.38 14

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

NumBytesSent

CPSC 601.38 15

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

Avg Thro

ughp

ut (B

ytes/S

ec)

Bytes

Sec

CPSC 601.38 16

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++Access

Network Bandwidth(Bytes/Sec)

CPSC 601.38 17

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

Sender’sFlow ControlWindow Size

CPSC 601.38 18

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

TCP SlowStart

CPSC 601.38 19

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

+

++

++

+

+

Delayed ACK

CPSC 601.38 20

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet

XXXX

XXXX

XX

X

++

++++

+

++++

PacketLoss

DuplicateACK

CPSC 601.38 21

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet

XXXX

XXXX

XX

X

++

++++

+

+++

X+

Retransmit

Cumulative ACK

+

CPSC 601.38 22

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet

XXXX

XXXX

XX

X

++

++++

+

+++

X+

RTO (Retranmission Timeout)

+

CPSC 601.38 23

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

CPSC 601.38 24

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

CPSC 601.38 25

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

X

++

++++

+

+++++

?

CPSC 601.38 26

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

X

++

++++

+

+++++

X +

CPSC 601.38 27

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

CPSC 601.38 28

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

X

++

++++

+

++++

?

CPSC 601.38 29

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

+

+++++

CPSC 601.38 30

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

CPSC 601.38 31

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXX

XXXX

XX

XX

++

++++

+

++

?

CPSC 601.38 32

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXX

XXXX

XX

XX

++

++++

+

+++++

X

+

CPSC 601.38 33

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

CPSC 601.38 34

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet

X +?

CPSC 601.38 35

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet

XX

X + ++X

XX +

+

+

X +X +X +

CPSC 601.38 36

TCP 201 (Cont’d) Main observation:

“Not all packet losses are created equal”

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

CPSC 601.38 37

Congratulations!

You are now a TCP expert! Or you are so confused now that you

will finally take my advice and buy the TCP book and read through some chapters

Recommended