37
CPSC 601.38 1 TCP Plots Slides originally from Williamson at Calgary Minor modifications are made

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

Embed Size (px)

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

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

CPSC 601.38 1

TCP Plots Slides originally from Williamson at

Calgary Minor modifications are made

Page 2: CPSC 601.381 TCP Plots r Slides originally from Williamson at Calgary r 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...

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

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

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

CPSC 601.38 4

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

avoidance

ACK

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

CPSC 601.38 5

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

avoidance

ACK

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

CPSC 601.38 6

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

avoidance

ACK

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

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

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

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

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

CPSC 601.38 9

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

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

CPSC 601.38 10

So What? What can it tell you?

Everything!!!

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

CPSC 601.38 11

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

RTT

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

CPSC 601.38 12

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

TCPSeg.Size

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

CPSC 601.38 13

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

TCP Connection Duration

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

CPSC 601.38 14

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

NumBytesSent

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

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

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

CPSC 601.38 16

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++Access

Network Bandwidth(Bytes/Sec)

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

CPSC 601.38 17

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

Sender’sFlow ControlWindow Size

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

CPSC 601.38 18

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

TCP SlowStart

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

CPSC 601.38 19

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

+

++

++

+

+

Delayed ACK

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

CPSC 601.38 20

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet

XXXX

XXXX

XX

X

++

++++

+

++++

PacketLoss

DuplicateACK

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

CPSC 601.38 21

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet

XXXX

XXXX

XX

X

++

++++

+

+++

X+

Retransmit

Cumulative ACK

+

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

CPSC 601.38 22

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet

XXXX

XXXX

XX

X

++

++++

+

+++

X+

RTO (Retranmission Timeout)

+

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

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

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

CPSC 601.38 24

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

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

CPSC 601.38 25

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

X

++

++++

+

+++++

?

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

CPSC 601.38 26

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

X

++

++++

+

+++++

X +

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

CPSC 601.38 27

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

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

CPSC 601.38 28

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

X

++

++++

+

++++

?

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

CPSC 601.38 29

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

+

+++++

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

CPSC 601.38 30

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

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

CPSC 601.38 31

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXX

XXXX

XX

XX

++

++++

+

++

?

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

CPSC 601.38 32

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXX

XXXX

XX

XX

++

++++

+

+++++

X

+

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

CPSC 601.38 33

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet X

XXXX

XXXX

XX

XX

++

++++

+

++++++

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

CPSC 601.38 34

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet

X +?

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

CPSC 601.38 35

Time

SeqN

um

X +

Key: X Data Packet + Ack Packet

XX

X + ++X

XX +

+

+

X +X +X +

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

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

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

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