Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)
Transmission
Control
Protocol
(TCP)
Stream of bytes
Segment N Segment 1
H H
Solution
The following shows the sequence number for each segment:
TCP
Application-layer data
header
IP
header
Frame
header
TCP payload
IP payload
Data-link layer payload
Passive
Active open
open seq: 8000
UAPRS F
SYN
seq: 15000
Connection ack: 8001
opened nd: 5000
U A P R S F rw
SYN + ACK
seq: 8000
ack: 15001
UAPRS F
rwnd: 10000
ACK
seq: 8001
Send
request ack: 15001
UAPRS F
Data Receive
bytes: 8001-9
000
Connection Termination
2
Segements are pushed
4
Flow control feedback
210
Three phases:
o Slow start
o Congestion avoidance
o Congestion detection
In the slow start phase, the sender starts with a
slow rate of transmission, but increases the rate
rapidly to reach a threshold.
When the threshold is reached, the rate of increase
is reduced.
1
cwnd
RTT
2
cwnd
RTT
4
cwnd
RTT
8
cwnd
= 1/8 , = 1/4
RTTS = (1-)*RTTS + *RTTM
RTTD = (1-)*RTTD + *|RTTS - RTTM|
RTO = RTTS + 4RTTD
The first segment in the figure is sent, but lost. The RTO timer
expires after 4.74 seconds. The segment is retransmitted and the
timer is set to 9.48, twice the previous value of RTO. This time an
ACK is received before the time-out. We wait until we send a new
segment and receive the ACK for it before recalculating the RTO
(Karn’s algorithm).