Professional Documents
Culture Documents
introduction to the
Transport Control Protocol
(TCP)
RFC 793
(estensioni RFC 1122,1323,2018,2581,working group tsvwg)
ÎConnection oriented
Öimplements mechanisms to setup and tear down a
full duplex connection between end points
ÎReliable
Öimplements mechanisms to guarantee error free
and ordered delivery of information
ÎFlow & Congestion controlled
Öimplements mechanisms to control traffic
Appl.
Appl.
TCP
TCP
IP IP IP
IP
IP
Application view
TCP view
Îchecksum as in UDP
Ösame calculation including same pseudoheader
DATA 1
ACK Duplicated
ACK
DATA 2
Queueing
Delay
ACK
DATA 3
Data 2 lost !!
ÎSequence number:
ÖSequence number of the first byte in the segment.
ÖWhen reaches 232-1, next wraps back to 0
ÎAcknowledgement number:
Övalid only when ACK flag on
ÖContains the next byte sequence number that the host expects to
receive (= last successfully received byte of data + 1)
Ögrants successful reception for all bytes up to ack# - 1 (cumulative)
ÎWhen seq/ack reach 232-1, next wrap back to 0
sender receiver
seq=0
ÎNo explicit segment size
indication
36
Ack=5 Ö Seq = first byte number
seq=536
Ö Returning Ack = last byte
number + 1
0 24 Ö Segment size = Ack-seq#
Ack=1
time time
sender receiver
seq=0
seq=536 Î Other name
Ö sliding window mechanisms
36
Ack=5 Î Basic approaches for error recovery
0 24 Ö Go-Back-N and Selective Repeat
Ack=1
time time
Why pipelining? Dramatic improvement in efficiency!
sender receiver
seq=0
ÎCumulative ack
seq=536
Ö ACK = all previous bytes
correctly received!
0 24 Ö E.g. ACK=1024: all bytes 0-1023
Ack=1 received
ÎOther names of pipelining:
Ö Go-Back-N ARQ mechanisms
time time Ö Sliding window mechanisms
Why pipelining? Dramatic improvement in efficiency!
Immediate ack,
, A ck = 200
no payload EMPTY , a c k = 200 Data in reverse
s e q= 45 0 direction,carries
4 5 0 - 525,
Bytes previous ack
Bytes 200
-2 49, seq=2
00, ack=5
26
Next segment,
CLIENT SERVER
piggybacked ack
Time 3:
Seq=119, ack=17
prop2
tx2
prop3
tx3
Completion time =
Tx1 + Prop1 + Tx2 + Prop2 + Tx3 + Prop3 +
Ack_Tx1 + Prop1 + Ack_Tx2 + Prop2 + Ack_Tx3 +
Prop3 + [same computation for other segments]=
……………
= RTT + Tx1 + Tx2 + Tx3 + Ack_Tx1 +
Ack_Tx2 + Ack_Tx3 +...
time time
G.Bianchi, G.Neglia, V.Mancuso
Stop-and-wait performance
Numerical example
Router 1 Router 2
Router 1 Router 2
With
ISDN? 128 Kbps 1024 Kbps 128 Kbps
1 ms 30 ms 1 ms
Î Segment 1: Î Acks:
Ö Tx1 = Tx3 = Ö Tx1 = Tx3 =
576*8/128 = 36ms 40*8/128 = 2,5 ms on Gbps fiber optics?
Ö Tx2 = 576*8/1024 = Ö Tx2 = 40*8/1024 =
4,5 ms 0,3 ms D = negligible + 2*RTT =
Î Segment 2: = 128 ms
RESULT:
Ö Tx1 = Tx3 =
528*8/128 = 33 ms D = 157,2 (tx total) + 2*RTT = THR = 1024*8/128 =
Ö Tx2 = 528*8/1024 = = 64 kbps
= 279,9 ms
4,1 ms
THR = 1024*8/279,9 =
= 29,3 kbps
G.Bianchi, G.Neglia, V.Mancuso
Pipelining performance
Router 1 Router 2
prop2
tx2
prop3
tx3
D = negligible + RTT = 64 ms
C bits/sec
MSS/C
RTT
MSS
throughput =
RTT + MSS / C
time time
RTT
MSIZE ⎡ MSIZE ⎤
latency = 2 RTT + +⎢ − 1⎥ RTT
C ⎢ MSS ⎥
Number of segments
In which message
is split
time time
throughput
10000
Throughput (Kbps)
C=28,8 kbps
C=128 kbps
1000 C=640 kbps
C=10 Mbps
100
10
1 10 100 1000
RTT (ms)
C=28,8 kbps
100% C=128 kbps
90% C=640 kbps
80% C=10 Mbps
70%
Utilization
60%
50%
40%
30%
20%
10%
0%
1 10 100 1000
RTT (ms)
time time
MSS MSS
W⋅ > RTT +
C C
D
After D/4 s
ÎC [bit/s] x RTT [s]
Ö number of bits “flying” in the
network (partly received)
Ö number of bits injected in the
network by the tx, before that the
ack of the first bit is received
D
After D s
ÎC [bit/s] x RTT [s]
Ö number of bits “flying” in the
network (partly received)
Ö number of bits injected in the
network by the tx, before that the
ack of the first bit is received
D Ack
After 5/4*D s
ÎC [bit/s] x RTT [s]
Ö number of bits “flying” in the
network (partly received)
Ö number of bits injected in the
network by the tx, before that the
ack of the first bit is received
D Ack
After 2D s
ÎC [bit/s] x RTT [s]
Ö number of bits “flying” in the
network (partly received)
Ö number of bits injected in the
network by the tx, before that the
ack of the first bit is received
D2 Ack
After RTT=D1+D2 s
ÎC [bit/s] x RTT [s]
Ö number of bits “flying” in the
network (partly received)
Ö number of bits injected in the
network by the tx, before that the
ack of the first bit is received
The 65535 (16 bit field in TCP header) maximum window size W
may be a limiting factor!
W=1
1000
W=2
800 W=4
W=16
600
400
200
0
0 100 200 300 400 500 600
RTT (ms)
100
10
1
0 100 200 300 400 500
RTT (ms)