SlideShare a Scribd company logo
1 of 50
Javier Araúz
TCP Dynamic
Behavior
TCP: The Basics
Transmission Control Protocol, invented in 1974 by
Cerf&Kahn
Provides connection-oriented, reliable, causal octet
delivery between hosts in the Internet...
...at the expense of potentially long delays and low
throughput
One of the possible ______ choices to exchange data on
top of IP
four
TCP: The Basics
TCP packet format (from Wikipedia, the free
Encyclopedia)
Payload
TCP: The Basics
The TCP Sliding Window (the LEN value is inferred)
Alice Bob
SEQ=x, LEN=dA
SEQ=y, ACK=x+dA, LEN=dB
SEQ=x+dA, ACK=y+dB, LEN=dA
TCP: The Basics
Connection establishment
Alice Bob
SYN, SEQ=x, LEN=0
SYN, SEQ=y, ACK=x+dA, LEN=0
SEQ=x, ACK=y, LEN=dA
Presence of ACK allows
Bob to tell this message
apart from the initial one
TCP: The Basics
Connection release - ordered
Alice Bob
FIN, SEQ=x, LEN=0
FIN, SEQ=y, ACK=x+1, LEN=0
possibly k more octetsFIN, SEQ=y+k, ACK=x+1, LEN=0
FIN, SEQ=x, ACK=y+k+1, LEN=0
The additional 1 allows Bob
to tell this message apart
from a spontaneous FIN
from Alice
The additional 1 allows Alice
to tell this message apart
from a re-transmisison of the
initial FIN from Bob
TCP: The Basics
Connection release - unilateral
Alice Bob
RST, SEQ=y, LEN=0
TCP: The Basics
Alice Bob
Segment Exchange, Nagle algorithm
SEQ=x, ACK=y, LEN=dA
SEQ=x+dA, ACK=y, LEN=dA
SEQ=x+2dA, ACK=y, LEN=dA/3
time-out
SEQ=y, ACK=x+dA, LEN=0
Nagle criteria #1: send when
have complete segment
dA
Nagle criteria #3: send when
time-out happens
TCP: The Basics
Alice Bob
SEQ=x, ACK=y, LEN=dA
SEQ=y, ACK=x+dA, LEN=dB
SEQ=x+dA, ACK=y+dB, LEN=dASEQ=x+2dA, ACK=y+dB, LEN=dASEQ=x+3dA, ACK=y+dB, LEN=dA
SEQ=y+dB, ACK=x+3dA, LEN=dB
typically
>200ms
typically
>200ms
Single ACK acknowledges
multiple segments
One ACK for every two full
segments
Segment exchange, delayed ACK
SEQ=y+2dB, ACK=x+4dA, LEN=dB
SEQ=x, ACK=y, LEN=dA
SEQ=x+dA, ACK=y, LEN=dA
SEQ=x+2dA, ACK=y+dB, LEN=dA
SEQ=y, ACK=x+dA, LEN=dB
TCP: The Basics
Segment exchange, loss
Alice Bob
RTO
SEQ=x, ACK=y, LEN=dA
SEQ=y+dB, ACK=x+2dA, LEN=0
SEQ=x+dA, ACK=y, LEN=dA
SEQ=x, ACK=y, LEN=dA
SEQ=y, ACK=x+dA, LEN=dB
SEQ=x+dA, ACK=y, LEN=dA
SEQ=x+3dA, ACK=y+dB, LEN=dA
SEQ=x+dA, ACK=y+2dB, LEN=dA
SEQ=y+dB, ACK=x+dA, LEN=dB
TCP: The Basics
Segment exchange, loss with fast recovery
Alice Bob
SEQ=y+dB, ACK=x+3dA, LEN=0
SEQ=x+4dA, ACK=y+2dB, LEN=dA
:O
:O :O :O
SEQ=x+2dA, ACK=y, LEN=dA
TCP: The Basics
Flow Control
SEQ=y, ACK=x+dA, LEN=dB, W=4dA
SEQ=x+dA, ACK=y+dB, LEN=dA, W=4dB
SEQ=x+2dA, ACK=y+2dB, LEN=dA, W=3dB
SEQ=y+dB, ACK=x+2dA, LEN=dB, W=4dA
Alice BobSEQ=x, ACK=y, LEN=dA, W=5dB
SEQ=y+2dB, ACK=x+3dA, LEN=0, W=3dA
TCP: The Basics
Flow Control: breaking deadlocks
SEQ=y, ACK=x+dA, LEN=0, W=4dA
SEQ=x+dA, ACK=y, LEN=dA, W=5dB
SEQ=x+2dA, ACK=y, LEN=dA, W=5dB
SEQ=y, ACK=x+2dA, LEN=dB, W=3dA
Alice Bob
SEQ=x, ACK=y, LEN=dA, W=5dB
SEQ=x+3dA, ACK=y, LEN=dA, W=5dB
SEQ=x+4dA, ACK=y, LEN=dA, W=5dB
SEQ=y+dB, ACK=x+3dA, LEN=0, W=2dA
SEQ=y+dB, ACK=x+4dA, LEN=dB, W=dA
SEQ=y+2dB, ACK=x+5dA, LEN=0, W=0 !!!
SEQ=y+2dB, ACK=x+5dA, LEN=0, W=1
TCP: Congestion Control
Congestion and how it shows up:
•Congestion is the situation in which a router within the IP
network is not able to route all the traffic offered to it
•A router is congested when one or more of its ingress
queues are full
•Congestion manifests at end hosts in the form of one or
more lost TCP segments, which is known as a "congestion
event"
TCP: Congestion Control
How does TCP react to a congestion event?
•A congestion event may take one of two shapes:
1. A burst loss, detected as no ACK for the sent bytes received within RTO
seconds from sending a byte
2. A single loss, detected as a delayed ACK (an ACK for a byte sent later than a
not-yet-acknowledged byte)
•On detection of a congestion event at a sender, TCP throttles down its sending rate by
decreasing its send window size (represented as W), entering a state known as
Congestion Avoidance mode
•While in Congestion Avoidance mode, the sending window is known as the congestion
window and its size is represented as cWnd
Congestion Avoidance mode in TCP-Reno
•On a congestion event, TCP-Reno slashes its sending window as follows:
• While in congestion avoidance mode, TCP-Reno increases its congestion window by n
segments for each n acknowledged segments:
•Additionally, in the face of a burst loss TCP Reno shuts down its sending window and
starts a slow-start phase until it reaches the congestion window size:
TCP: Congestion Control
Congestion Avoidance mode in TCP-Reno
TCP: Congestion Control
TCP: Congestion Control
Congestion Avoidance mode in TCP-Cubic:
TCP: Congestion Control
Congestion Avoidance mode in TCP-Vegas:
TCP: Congestion Control
Other CC algorithms:
•TCP-Ledbat
•TCP-Ericsson-Akamai
To know which CC algorithm your box is running:
> $ cat /proc/sys/net/ipv4/tcp_congestion_control
reno
To change the CC algorithm in your box:
•edit /boot/config-x.y.zz-generic
•change CONFIG_DEFAULT_TCP_CONG
Main parameters affecting host performance:
TCP: End host charact.
*: tcp_wmem overrides /proc/sys/net/core/wmem_default
**: tcp_wmem overridden by /proc/sys/net/core/wmem_max
***: setsockopt() changing buffer sizes disables auto-tuning!!
Browse with (requires super-user privileges):
sysctl -a | fgrep net.ipv4.tcp
sysctl name
(net.ipv4)
meaning default explanation
tcp_low_latency Nagle algorithm status 0 Nagle enabled
tcp_window_scaling Window scaling status 1 Window scaling
enabled
tcp_adv_win_scale Window scaling factor 2 W = w2
tcp_wmem Sending buffer size 4KB 85KB* 170KB** min/default/max
tcp_moderate_rcvbu
f
Auto-tuning (2.6.7 and later) 1*** Auto-tuning enabled
TCP: End host charact.
Measuring end-host performance:
> netstat -natuw
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:36285 127.0.0.1:12865 TIME_WAIT
tcp 0 0 10.0.0.5:37322 10.0.0.4:33932 TIME_WAIT
tcp 0 1 10.0.0.5:55351 10.0.0.4:33932 SYN_SENT
tcp 0 1 10.0.0.5:55350 10.0.0.4:33932 LAST_ACK
tcp 0 0 10.0.0.5:64093 10.0.0.4:33932 TIME_WAIT
tcp 0 0 10.0.0.5:35122 10.0.0.4:12865 ESTABLISHED
tcp 0 0 10.0.0.5:17318 10.0.0.4: 0 0 :::22 :::* LISTEN
TCP: IP Network charact.
Measuring end-to-end performance:
netserver -p <portnum>
netperf -p <portnum> -l <secs> -H <target> -t TCP_RR -r
<reqsize,rspsize> -s <sndbuf,rcvbuf> -S <sndbuf,rcvbuf> -C -c
TCP: IP Network charact.
How Sprint characterized its network:
TCP: IP Network charact.
TCP: IP Router behavior
IP router simplified model:
switch fabric
Routing logic
Line cards Line cards
Queue management strategies:
Passive: drop every incoming packet when the ingress
queue is full
Active: drop incoming packets selectively when the ingress
queue lenght grows above a threshold
TCP: IP Router behavior
threshold
Router can't choose, Red
flow gets more share than
Green and Blue
Router can choose, thus
share queue space more
evenly
Active Queue Management flavors:
Random Early Discard (RED)
Weighted Fair Queueing (WFQ)
TCP: IP Router behavior
minThresmaxThres
token buckets
1
RED mitigates tail-drops
but is unfair
drop probability
distribution
WFQ mitigates tail-drops
and is fair
TCP: IP Router behavior
Packet drop probability distributions
Passive
RED
WFQ
Ideal
TCP: Dynamic Performance
Bandwidth-delay product: physical analogy
h
l
P lpm @ V mps
W mps
2
r
h r2 ≥ VP*l/W + P*l = (1 + V/W)P*lᴫ
If V=W then h r2 ≥ 2P*lᴫ
TCP: Dynamic Performance
Bandwidth-delay product: a TCP invariant
BW bps
T s
W
W > 2BW*T = BW*D
TCP: Dynamic Performance
Window sizes for different BW and D values:
TCP w/o LFN extensions (RFC1323) limits window size to 216 = 64KB
Solutions:
A) open multiple TCP connections (each has its own 64KB window)
B) use a LFN-friendly TCP stack (i.e. supporting RFC1323), like the one in Linux kernel 2.6.16 that
comes with LOTC
2 sources of packet loss:
1) Transmission errors: random, non-correlated
2.a) Router queues: random, correlated
2.b) Router queues with Active Queue Management (e.g. RED): random,
non-correlated
Theoretical throughput model comes given by:
(non-correlated)
Max values are capped by send/receive window size limits
TCP: Dynamic Performance
TCP: Dynamic Performance
TCP stable state:
s
t
w
w/2
D
2D
3D
wD/2 wD 3wD/2
3w/4
Group was not exported from SlideRocket
TCP: Dynamic Performance
Congestion window size (cWnd) is independent of buffer size at the
receiver (RCVBUF):
Group was not exported from SlideRocket
p
RCVBUF
D
2D
3D
wD
w
wD/2
cWnd=2*w/2=w
cWnd’=(3w/2)/2=3w/4
3wD/2
cWnd’’=(5w/4)/2=5w/8
3w/2
TCP: Dynamic Performance
BW limit for different p and D values (W = ∞, non-correlated loss with C=1):
Solutions:
Multiple TCP connections in theory allow more aggregated throughput; however, effect of increasing
load on the network at congestion spots is unknown
TCP: Dynamic Performance
Evolution of sender’s buffer with time (uniform arrival rate):
w
w
--
-
2
D 2
D
3
D
w
--- D
2
Queued packets
3w
---
4
Qi = 3w/4 – [(w/2 + i) – Qi-1], Q-1 = 1
Qi = w/4 – i + Qi-1
= w/4 – i + [w/4 – (i-1) + [w/4 – (i-2) + … ]]
= w/4*i – [i + (i-1) + (i-2) + … ]
= w/4*i – [i*i – (1+2+3+…+i)]
= w/4*i – i2 + i(1+i)/2 =
= w/4*i – i2 + (i2+i)/2 =
= (w+2)*i/4 – i2/2
Note: the term 1+2+3+…+i is an arithmetic
progression of n=i elements which initial value a1=1,
final value an=i and coefficient d=1 which sums up to
n(a1+an)/2 = i(1+i)/2 = (i2+i)/2
TCP: Dynamic Performance
How does the TCP buffer at the sender look like?
TCP: Dynamic Performance
μλ
Qi
S
cWndicWndi+1
i = ¼*(w+2-2k ± √((w+2)2+4k(2-5w-3k))
kmax < 1/6[(2-5w)+√((2-5w)2+3(w+2)2)
When Qi < cWndi -> S = 0
When cWndi < Qi < cWndi+cWndi+1 -> S = D
cWndi+cWndi+1 < Qi < cWndi+cWndi+1+cWndi+2 -> S = 2D
…
When ΣcWndi+k-1 < Qi < ΣcWndi+k -> S = kD
Since cWndi = w/2 + i:
ΣcWndi+k = (w/2+i) + (w/2+i+1) + … + (w/2+i+k)
= (k+1)(w/2+i) + k(1+k)/2
= ½[k(w+1+2i+k)]
Service time (S) evolution:
i
Q
TCP: Dynamic Performance
Expected throughput, latency and jitter
p=10-3 => w = 51.64 => kmax = 88
Group was
not
exported
from
SlideRocket
TCP: Aggregation
Flows ingressing a congested back-bone router "resonate"
after a few packet drops:
T2
T3
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Tk
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Resonance takes place once every flow has suffered at least one drop
Resonance period tends to the average of all periods weighted by the
flow size
Group was
not
exported
from
SlideRocket
Group was
not
exported
from
SlideRocket
TCP: Aggregation
Resonating flows with similar RTT have their own micro-
resonance ; this phenomenon is known as 'flocking':
T2
T3
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
Gr
ou
p
wa
s
no
t
ex
po
rte
d
fro
m
Sli
de
Ro
ck
et
There is no theoretical approach to calculating the micro-resonance
thresholds
Flows with short micro-resonance periods steal throughput from flows
with long micro-resonance periods
TCP: Application Behavior
Misbehaved applications:
A host is allowed to open as many flows as its resources can afford to the
same target host
IP routers deal with each flow blindly, ignoring the fact that many flows
might start and end in the same host pair
Therefore the bandwidth share taken by an application at a congested
link depends on the number of flows it puts through that link:
BW = k*BWi
Corollary: applications holding many flows between end-hosts are both
unfair to applications holding fewer flows and a potential congestion
cause
TCP: Application Behavior
Misbehaved applications:
A host may start transmitting at a high rate (if the receiver
has enough buffer) then drop the connection when stable
state has been reached (connection is trained)
If the host re-connects very quickly and starts trasmitting
at high rate again, on average it shall take more bandwidth
than its peers maintaining trained connections
Corollary: dropping a trained connection is never a good
idea if there's a chance it shall be used soon
TCP: Application Behavior
Well-behaved applications:
A sensible application shall open more connections if
needed, but close them if it perceives it is causing
congestion
A sensible application shall try to maintain and re-use
trained connections as much as possible
TCP: Application Behavior
De-bunking send&receive window limitations:
From Linux kernel 2.6.7, the TCP receiving window adjusts itself
depending on the free space in the buffer
Remember the /proc/sys/net/ipv4/tcp_write_mem system variable?:
Window starts at the middle value (default 16KB)
Window grows and shrinks as needed depending on number of queued
segments
Window growth is limited by the right-most value (default 1MB), and
never shrinks to less than the left-most value (default 4KB)
Sending window has been self-adjusting from much earlier than 2.6.7
kernel
TCP: Research Issues
Research topic #1: improving congestion control by
routers
Though much more harmless than tail drops, single packet
drops drive TCP into congestion avoidance mode
Even when using WFQ, traffic spikes can cause the much
undesirable tail drops
If a router could signal transmitters when congestion is
coming, trasmitters might adjust their transmission rates
without drops and without entering congestion avoidance
mode
This research field focuses on the use of the ECN bit in
the TCP packet header
TCP: Research Issues
Research topic #2: how to conciliate the congestion-bound
TCP traffic with the unbound, heavyweight UDP traffic
TCP traffic can be throttled up and down before, during
and after congestion
UDP traffic on the contrary cannot be throttled, and is
potentially causing more congestion than TCP
Focus of this research area is on congestion-controlling
UDP (for instance the just-created RMCAT IETF WG,
check https://datatracker.ietf.org/wg/rmcat/charter/)
TCP: Research Issues
Research topic #3: congestion control algorithms for 4G
radio accesses
Which of the existing CC algorithms (Reno, Vegas,
Cubic...) performs best in 4G RANs?
Would new CC algorithms perform better than existing
ones?
How can the more aggressive algorithms co-exist
pacifically with the more conservative ones?
Research report on CC algorithm performance in LTE
networks (link)
TCP: References
Macroscopic Behavior of the TCP Congestion Avoidance
Algorithm, http://citeseerx.ist.psu.edu/viewdoc/summary?
doi=10.1.1.25.3452
Modeling TCP Throughput: A Simple Model and its
Empirical Validation, http://?

More Related Content

What's hot

Network and TCP performance relationship workshop
Network and TCP performance relationship workshopNetwork and TCP performance relationship workshop
Network and TCP performance relationship workshopKae Hsu
 
Computer network (11)
Computer network (11)Computer network (11)
Computer network (11)NYversity
 
3g umts-originating-call Call Flow
3g umts-originating-call Call Flow3g umts-originating-call Call Flow
3g umts-originating-call Call FlowEduard Lucena
 
Part 8 : TCP and Congestion control
Part 8 : TCP and Congestion controlPart 8 : TCP and Congestion control
Part 8 : TCP and Congestion controlOlivier Bonaventure
 
Bandwidth Efficiency Improvement for Online Games by the use of Tunneling, Co...
Bandwidth Efficiency Improvement for Online Games by the use of Tunneling, Co...Bandwidth Efficiency Improvement for Online Games by the use of Tunneling, Co...
Bandwidth Efficiency Improvement for Online Games by the use of Tunneling, Co...Jose Saldana
 
RIP RTCP RTSP
RIP RTCP RTSPRIP RTCP RTSP
RIP RTCP RTSPDev Heba
 
Surviving The Stump The Chump Interview Questions
Surviving The Stump The Chump Interview QuestionsSurviving The Stump The Chump Interview Questions
Surviving The Stump The Chump Interview QuestionsDuane Bodle
 

What's hot (17)

Rtsp
RtspRtsp
Rtsp
 
8 congestion-ipv6
8 congestion-ipv68 congestion-ipv6
8 congestion-ipv6
 
7. protocols
7. protocols7. protocols
7. protocols
 
high speedla-ns
high speedla-nshigh speedla-ns
high speedla-ns
 
5 sharing-app
5 sharing-app5 sharing-app
5 sharing-app
 
Network and TCP performance relationship workshop
Network and TCP performance relationship workshopNetwork and TCP performance relationship workshop
Network and TCP performance relationship workshop
 
Computer network (11)
Computer network (11)Computer network (11)
Computer network (11)
 
3g umts-originating-call Call Flow
3g umts-originating-call Call Flow3g umts-originating-call Call Flow
3g umts-originating-call Call Flow
 
RTP
RTPRTP
RTP
 
Part 8 : TCP and Congestion control
Part 8 : TCP and Congestion controlPart 8 : TCP and Congestion control
Part 8 : TCP and Congestion control
 
Bandwidth Efficiency Improvement for Online Games by the use of Tunneling, Co...
Bandwidth Efficiency Improvement for Online Games by the use of Tunneling, Co...Bandwidth Efficiency Improvement for Online Games by the use of Tunneling, Co...
Bandwidth Efficiency Improvement for Online Games by the use of Tunneling, Co...
 
RIP RTCP RTSP
RIP RTCP RTSPRIP RTCP RTSP
RIP RTCP RTSP
 
Real-Time Streaming Protocol
Real-Time Streaming Protocol Real-Time Streaming Protocol
Real-Time Streaming Protocol
 
RTP.ppt
RTP.pptRTP.ppt
RTP.ppt
 
6 app-tcp
6 app-tcp6 app-tcp
6 app-tcp
 
Surviving The Stump The Chump Interview Questions
Surviving The Stump The Chump Interview QuestionsSurviving The Stump The Chump Interview Questions
Surviving The Stump The Chump Interview Questions
 
udp , tcp ,sctp
udp , tcp ,sctpudp , tcp ,sctp
udp , tcp ,sctp
 

Viewers also liked

Lecture 5
Lecture 5Lecture 5
Lecture 5ntpc08
 
Socket网络编程
Socket网络编程Socket网络编程
Socket网络编程qhm123
 
TCP with delayed ack for wireless networks
TCP with delayed ack for wireless networksTCP with delayed ack for wireless networks
TCP with delayed ack for wireless networksambitlicksolutions
 
CS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked GamesCS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked GamesWei Tsang Ooi
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Controltameemyousaf
 

Viewers also liked (8)

Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Socket网络编程
Socket网络编程Socket网络编程
Socket网络编程
 
TCP with delayed ack for wireless networks
TCP with delayed ack for wireless networksTCP with delayed ack for wireless networks
TCP with delayed ack for wireless networks
 
CS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked GamesCS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked Games
 
TCP Model
TCP ModelTCP Model
TCP Model
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Control
 
2 reliability-network
2 reliability-network2 reliability-network
2 reliability-network
 
4 transport-sharing
4 transport-sharing4 transport-sharing
4 transport-sharing
 

Similar to Course on TCP Dynamic Performance

Troubleshooting TCP/IP
Troubleshooting TCP/IPTroubleshooting TCP/IP
Troubleshooting TCP/IPvijai s
 
chapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxchapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxTekle12
 
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverterKernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverterAnne Nicolas
 
Tcp congestion control
Tcp congestion controlTcp congestion control
Tcp congestion controlAbdo sayed
 
Introduction to tcpdump
Introduction to tcpdumpIntroduction to tcpdump
Introduction to tcpdumpLev Walkin
 
(NET404) Making Every Packet Count
(NET404) Making Every Packet Count(NET404) Making Every Packet Count
(NET404) Making Every Packet CountAmazon Web Services
 
Performance Evaluation of High Speed Congestion Control Protocols
Performance Evaluation of High Speed Congestion Control  ProtocolsPerformance Evaluation of High Speed Congestion Control  Protocols
Performance Evaluation of High Speed Congestion Control ProtocolsIOSR Journals
 
Abandon Decades-Old TCPdump for Modern Troubleshooting
Abandon Decades-Old TCPdump for Modern TroubleshootingAbandon Decades-Old TCPdump for Modern Troubleshooting
Abandon Decades-Old TCPdump for Modern TroubleshootingAvi Networks
 
TCP Traffic Control Chapter12
TCP Traffic Control Chapter12TCP Traffic Control Chapter12
TCP Traffic Control Chapter12daniel ayalew
 
AWS re:Invent 2016: Making Every Packet Count (NET404)
AWS re:Invent 2016: Making Every Packet Count (NET404)AWS re:Invent 2016: Making Every Packet Count (NET404)
AWS re:Invent 2016: Making Every Packet Count (NET404)Amazon Web Services
 
Unit III IPV6 UDP
Unit III IPV6 UDPUnit III IPV6 UDP
Unit III IPV6 UDPsangusajjan
 
Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6Olivier Bonaventure
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Andriy Berestovskyy
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Chandra Meena
 

Similar to Course on TCP Dynamic Performance (20)

Troubleshooting TCP/IP
Troubleshooting TCP/IPTroubleshooting TCP/IP
Troubleshooting TCP/IP
 
chapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxchapter 3.2 TCP.pptx
chapter 3.2 TCP.pptx
 
Tcp traffic control and red ecn
Tcp traffic control and red ecnTcp traffic control and red ecn
Tcp traffic control and red ecn
 
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverterKernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverter
 
Tcp congestion control
Tcp congestion controlTcp congestion control
Tcp congestion control
 
Introduction to tcpdump
Introduction to tcpdumpIntroduction to tcpdump
Introduction to tcpdump
 
(NET404) Making Every Packet Count
(NET404) Making Every Packet Count(NET404) Making Every Packet Count
(NET404) Making Every Packet Count
 
Performance Evaluation of High Speed Congestion Control Protocols
Performance Evaluation of High Speed Congestion Control  ProtocolsPerformance Evaluation of High Speed Congestion Control  Protocols
Performance Evaluation of High Speed Congestion Control Protocols
 
NE #1.pptx
NE #1.pptxNE #1.pptx
NE #1.pptx
 
Tcp congestion avoidance
Tcp congestion avoidanceTcp congestion avoidance
Tcp congestion avoidance
 
Abandon Decades-Old TCPdump for Modern Troubleshooting
Abandon Decades-Old TCPdump for Modern TroubleshootingAbandon Decades-Old TCPdump for Modern Troubleshooting
Abandon Decades-Old TCPdump for Modern Troubleshooting
 
TCP Traffic Control Chapter12
TCP Traffic Control Chapter12TCP Traffic Control Chapter12
TCP Traffic Control Chapter12
 
AWS re:Invent 2016: Making Every Packet Count (NET404)
AWS re:Invent 2016: Making Every Packet Count (NET404)AWS re:Invent 2016: Making Every Packet Count (NET404)
AWS re:Invent 2016: Making Every Packet Count (NET404)
 
Part5-tcp-improvements.pptx
Part5-tcp-improvements.pptxPart5-tcp-improvements.pptx
Part5-tcp-improvements.pptx
 
Unit III IPV6 UDP
Unit III IPV6 UDPUnit III IPV6 UDP
Unit III IPV6 UDP
 
TCP_Congestion_Control.ppt
TCP_Congestion_Control.pptTCP_Congestion_Control.ppt
TCP_Congestion_Control.ppt
 
Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
 
HIGH SPEED NETWORKS
HIGH SPEED NETWORKSHIGH SPEED NETWORKS
HIGH SPEED NETWORKS
 

Recently uploaded

VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
Gram Darshan PPT cyber rural in villages of india
Gram Darshan PPT cyber rural  in villages of indiaGram Darshan PPT cyber rural  in villages of india
Gram Darshan PPT cyber rural in villages of indiaimessage0108
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 

Recently uploaded (20)

VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Gram Darshan PPT cyber rural in villages of india
Gram Darshan PPT cyber rural  in villages of indiaGram Darshan PPT cyber rural  in villages of india
Gram Darshan PPT cyber rural in villages of india
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 

Course on TCP Dynamic Performance

  • 2. TCP: The Basics Transmission Control Protocol, invented in 1974 by Cerf&Kahn Provides connection-oriented, reliable, causal octet delivery between hosts in the Internet... ...at the expense of potentially long delays and low throughput One of the possible ______ choices to exchange data on top of IP four
  • 3. TCP: The Basics TCP packet format (from Wikipedia, the free Encyclopedia) Payload
  • 4. TCP: The Basics The TCP Sliding Window (the LEN value is inferred) Alice Bob SEQ=x, LEN=dA SEQ=y, ACK=x+dA, LEN=dB SEQ=x+dA, ACK=y+dB, LEN=dA
  • 5. TCP: The Basics Connection establishment Alice Bob SYN, SEQ=x, LEN=0 SYN, SEQ=y, ACK=x+dA, LEN=0 SEQ=x, ACK=y, LEN=dA Presence of ACK allows Bob to tell this message apart from the initial one
  • 6. TCP: The Basics Connection release - ordered Alice Bob FIN, SEQ=x, LEN=0 FIN, SEQ=y, ACK=x+1, LEN=0 possibly k more octetsFIN, SEQ=y+k, ACK=x+1, LEN=0 FIN, SEQ=x, ACK=y+k+1, LEN=0 The additional 1 allows Bob to tell this message apart from a spontaneous FIN from Alice The additional 1 allows Alice to tell this message apart from a re-transmisison of the initial FIN from Bob
  • 7. TCP: The Basics Connection release - unilateral Alice Bob RST, SEQ=y, LEN=0
  • 8. TCP: The Basics Alice Bob Segment Exchange, Nagle algorithm SEQ=x, ACK=y, LEN=dA SEQ=x+dA, ACK=y, LEN=dA SEQ=x+2dA, ACK=y, LEN=dA/3 time-out SEQ=y, ACK=x+dA, LEN=0 Nagle criteria #1: send when have complete segment dA Nagle criteria #3: send when time-out happens
  • 9. TCP: The Basics Alice Bob SEQ=x, ACK=y, LEN=dA SEQ=y, ACK=x+dA, LEN=dB SEQ=x+dA, ACK=y+dB, LEN=dASEQ=x+2dA, ACK=y+dB, LEN=dASEQ=x+3dA, ACK=y+dB, LEN=dA SEQ=y+dB, ACK=x+3dA, LEN=dB typically >200ms typically >200ms Single ACK acknowledges multiple segments One ACK for every two full segments Segment exchange, delayed ACK SEQ=y+2dB, ACK=x+4dA, LEN=dB
  • 10. SEQ=x, ACK=y, LEN=dA SEQ=x+dA, ACK=y, LEN=dA SEQ=x+2dA, ACK=y+dB, LEN=dA SEQ=y, ACK=x+dA, LEN=dB TCP: The Basics Segment exchange, loss Alice Bob RTO SEQ=x, ACK=y, LEN=dA SEQ=y+dB, ACK=x+2dA, LEN=0 SEQ=x+dA, ACK=y, LEN=dA
  • 11. SEQ=x, ACK=y, LEN=dA SEQ=y, ACK=x+dA, LEN=dB SEQ=x+dA, ACK=y, LEN=dA SEQ=x+3dA, ACK=y+dB, LEN=dA SEQ=x+dA, ACK=y+2dB, LEN=dA SEQ=y+dB, ACK=x+dA, LEN=dB TCP: The Basics Segment exchange, loss with fast recovery Alice Bob SEQ=y+dB, ACK=x+3dA, LEN=0 SEQ=x+4dA, ACK=y+2dB, LEN=dA :O :O :O :O SEQ=x+2dA, ACK=y, LEN=dA
  • 12. TCP: The Basics Flow Control SEQ=y, ACK=x+dA, LEN=dB, W=4dA SEQ=x+dA, ACK=y+dB, LEN=dA, W=4dB SEQ=x+2dA, ACK=y+2dB, LEN=dA, W=3dB SEQ=y+dB, ACK=x+2dA, LEN=dB, W=4dA Alice BobSEQ=x, ACK=y, LEN=dA, W=5dB SEQ=y+2dB, ACK=x+3dA, LEN=0, W=3dA
  • 13. TCP: The Basics Flow Control: breaking deadlocks SEQ=y, ACK=x+dA, LEN=0, W=4dA SEQ=x+dA, ACK=y, LEN=dA, W=5dB SEQ=x+2dA, ACK=y, LEN=dA, W=5dB SEQ=y, ACK=x+2dA, LEN=dB, W=3dA Alice Bob SEQ=x, ACK=y, LEN=dA, W=5dB SEQ=x+3dA, ACK=y, LEN=dA, W=5dB SEQ=x+4dA, ACK=y, LEN=dA, W=5dB SEQ=y+dB, ACK=x+3dA, LEN=0, W=2dA SEQ=y+dB, ACK=x+4dA, LEN=dB, W=dA SEQ=y+2dB, ACK=x+5dA, LEN=0, W=0 !!! SEQ=y+2dB, ACK=x+5dA, LEN=0, W=1
  • 14. TCP: Congestion Control Congestion and how it shows up: •Congestion is the situation in which a router within the IP network is not able to route all the traffic offered to it •A router is congested when one or more of its ingress queues are full •Congestion manifests at end hosts in the form of one or more lost TCP segments, which is known as a "congestion event"
  • 15. TCP: Congestion Control How does TCP react to a congestion event? •A congestion event may take one of two shapes: 1. A burst loss, detected as no ACK for the sent bytes received within RTO seconds from sending a byte 2. A single loss, detected as a delayed ACK (an ACK for a byte sent later than a not-yet-acknowledged byte) •On detection of a congestion event at a sender, TCP throttles down its sending rate by decreasing its send window size (represented as W), entering a state known as Congestion Avoidance mode •While in Congestion Avoidance mode, the sending window is known as the congestion window and its size is represented as cWnd
  • 16. Congestion Avoidance mode in TCP-Reno •On a congestion event, TCP-Reno slashes its sending window as follows: • While in congestion avoidance mode, TCP-Reno increases its congestion window by n segments for each n acknowledged segments: •Additionally, in the face of a burst loss TCP Reno shuts down its sending window and starts a slow-start phase until it reaches the congestion window size: TCP: Congestion Control
  • 17. Congestion Avoidance mode in TCP-Reno TCP: Congestion Control
  • 18. TCP: Congestion Control Congestion Avoidance mode in TCP-Cubic:
  • 19. TCP: Congestion Control Congestion Avoidance mode in TCP-Vegas:
  • 20. TCP: Congestion Control Other CC algorithms: •TCP-Ledbat •TCP-Ericsson-Akamai To know which CC algorithm your box is running: > $ cat /proc/sys/net/ipv4/tcp_congestion_control reno To change the CC algorithm in your box: •edit /boot/config-x.y.zz-generic •change CONFIG_DEFAULT_TCP_CONG
  • 21. Main parameters affecting host performance: TCP: End host charact. *: tcp_wmem overrides /proc/sys/net/core/wmem_default **: tcp_wmem overridden by /proc/sys/net/core/wmem_max ***: setsockopt() changing buffer sizes disables auto-tuning!! Browse with (requires super-user privileges): sysctl -a | fgrep net.ipv4.tcp sysctl name (net.ipv4) meaning default explanation tcp_low_latency Nagle algorithm status 0 Nagle enabled tcp_window_scaling Window scaling status 1 Window scaling enabled tcp_adv_win_scale Window scaling factor 2 W = w2 tcp_wmem Sending buffer size 4KB 85KB* 170KB** min/default/max tcp_moderate_rcvbu f Auto-tuning (2.6.7 and later) 1*** Auto-tuning enabled
  • 22. TCP: End host charact. Measuring end-host performance: > netstat -natuw Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:36285 127.0.0.1:12865 TIME_WAIT tcp 0 0 10.0.0.5:37322 10.0.0.4:33932 TIME_WAIT tcp 0 1 10.0.0.5:55351 10.0.0.4:33932 SYN_SENT tcp 0 1 10.0.0.5:55350 10.0.0.4:33932 LAST_ACK tcp 0 0 10.0.0.5:64093 10.0.0.4:33932 TIME_WAIT tcp 0 0 10.0.0.5:35122 10.0.0.4:12865 ESTABLISHED tcp 0 0 10.0.0.5:17318 10.0.0.4: 0 0 :::22 :::* LISTEN
  • 23. TCP: IP Network charact. Measuring end-to-end performance: netserver -p <portnum> netperf -p <portnum> -l <secs> -H <target> -t TCP_RR -r <reqsize,rspsize> -s <sndbuf,rcvbuf> -S <sndbuf,rcvbuf> -C -c
  • 24. TCP: IP Network charact. How Sprint characterized its network:
  • 25. TCP: IP Network charact.
  • 26. TCP: IP Router behavior IP router simplified model: switch fabric Routing logic Line cards Line cards
  • 27. Queue management strategies: Passive: drop every incoming packet when the ingress queue is full Active: drop incoming packets selectively when the ingress queue lenght grows above a threshold TCP: IP Router behavior threshold Router can't choose, Red flow gets more share than Green and Blue Router can choose, thus share queue space more evenly
  • 28. Active Queue Management flavors: Random Early Discard (RED) Weighted Fair Queueing (WFQ) TCP: IP Router behavior minThresmaxThres token buckets 1 RED mitigates tail-drops but is unfair drop probability distribution WFQ mitigates tail-drops and is fair
  • 29. TCP: IP Router behavior Packet drop probability distributions Passive RED WFQ Ideal
  • 30. TCP: Dynamic Performance Bandwidth-delay product: physical analogy h l P lpm @ V mps W mps 2 r h r2 ≥ VP*l/W + P*l = (1 + V/W)P*lᴫ If V=W then h r2 ≥ 2P*lᴫ
  • 31. TCP: Dynamic Performance Bandwidth-delay product: a TCP invariant BW bps T s W W > 2BW*T = BW*D
  • 32. TCP: Dynamic Performance Window sizes for different BW and D values: TCP w/o LFN extensions (RFC1323) limits window size to 216 = 64KB Solutions: A) open multiple TCP connections (each has its own 64KB window) B) use a LFN-friendly TCP stack (i.e. supporting RFC1323), like the one in Linux kernel 2.6.16 that comes with LOTC
  • 33. 2 sources of packet loss: 1) Transmission errors: random, non-correlated 2.a) Router queues: random, correlated 2.b) Router queues with Active Queue Management (e.g. RED): random, non-correlated Theoretical throughput model comes given by: (non-correlated) Max values are capped by send/receive window size limits TCP: Dynamic Performance
  • 34. TCP: Dynamic Performance TCP stable state: s t w w/2 D 2D 3D wD/2 wD 3wD/2 3w/4
  • 35. Group was not exported from SlideRocket TCP: Dynamic Performance Congestion window size (cWnd) is independent of buffer size at the receiver (RCVBUF): Group was not exported from SlideRocket p RCVBUF D 2D 3D wD w wD/2 cWnd=2*w/2=w cWnd’=(3w/2)/2=3w/4 3wD/2 cWnd’’=(5w/4)/2=5w/8 3w/2
  • 36. TCP: Dynamic Performance BW limit for different p and D values (W = ∞, non-correlated loss with C=1): Solutions: Multiple TCP connections in theory allow more aggregated throughput; however, effect of increasing load on the network at congestion spots is unknown
  • 37. TCP: Dynamic Performance Evolution of sender’s buffer with time (uniform arrival rate): w w -- - 2 D 2 D 3 D w --- D 2 Queued packets 3w --- 4 Qi = 3w/4 – [(w/2 + i) – Qi-1], Q-1 = 1 Qi = w/4 – i + Qi-1 = w/4 – i + [w/4 – (i-1) + [w/4 – (i-2) + … ]] = w/4*i – [i + (i-1) + (i-2) + … ] = w/4*i – [i*i – (1+2+3+…+i)] = w/4*i – i2 + i(1+i)/2 = = w/4*i – i2 + (i2+i)/2 = = (w+2)*i/4 – i2/2 Note: the term 1+2+3+…+i is an arithmetic progression of n=i elements which initial value a1=1, final value an=i and coefficient d=1 which sums up to n(a1+an)/2 = i(1+i)/2 = (i2+i)/2
  • 38. TCP: Dynamic Performance How does the TCP buffer at the sender look like?
  • 39. TCP: Dynamic Performance μλ Qi S cWndicWndi+1 i = ¼*(w+2-2k ± √((w+2)2+4k(2-5w-3k)) kmax < 1/6[(2-5w)+√((2-5w)2+3(w+2)2) When Qi < cWndi -> S = 0 When cWndi < Qi < cWndi+cWndi+1 -> S = D cWndi+cWndi+1 < Qi < cWndi+cWndi+1+cWndi+2 -> S = 2D … When ΣcWndi+k-1 < Qi < ΣcWndi+k -> S = kD Since cWndi = w/2 + i: ΣcWndi+k = (w/2+i) + (w/2+i+1) + … + (w/2+i+k) = (k+1)(w/2+i) + k(1+k)/2 = ½[k(w+1+2i+k)] Service time (S) evolution: i Q
  • 40. TCP: Dynamic Performance Expected throughput, latency and jitter p=10-3 => w = 51.64 => kmax = 88
  • 41. Group was not exported from SlideRocket TCP: Aggregation Flows ingressing a congested back-bone router "resonate" after a few packet drops: T2 T3 Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Tk Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Resonance takes place once every flow has suffered at least one drop Resonance period tends to the average of all periods weighted by the flow size
  • 42. Group was not exported from SlideRocket Group was not exported from SlideRocket TCP: Aggregation Resonating flows with similar RTT have their own micro- resonance ; this phenomenon is known as 'flocking': T2 T3 Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et Gr ou p wa s no t ex po rte d fro m Sli de Ro ck et There is no theoretical approach to calculating the micro-resonance thresholds Flows with short micro-resonance periods steal throughput from flows with long micro-resonance periods
  • 43. TCP: Application Behavior Misbehaved applications: A host is allowed to open as many flows as its resources can afford to the same target host IP routers deal with each flow blindly, ignoring the fact that many flows might start and end in the same host pair Therefore the bandwidth share taken by an application at a congested link depends on the number of flows it puts through that link: BW = k*BWi Corollary: applications holding many flows between end-hosts are both unfair to applications holding fewer flows and a potential congestion cause
  • 44. TCP: Application Behavior Misbehaved applications: A host may start transmitting at a high rate (if the receiver has enough buffer) then drop the connection when stable state has been reached (connection is trained) If the host re-connects very quickly and starts trasmitting at high rate again, on average it shall take more bandwidth than its peers maintaining trained connections Corollary: dropping a trained connection is never a good idea if there's a chance it shall be used soon
  • 45. TCP: Application Behavior Well-behaved applications: A sensible application shall open more connections if needed, but close them if it perceives it is causing congestion A sensible application shall try to maintain and re-use trained connections as much as possible
  • 46. TCP: Application Behavior De-bunking send&receive window limitations: From Linux kernel 2.6.7, the TCP receiving window adjusts itself depending on the free space in the buffer Remember the /proc/sys/net/ipv4/tcp_write_mem system variable?: Window starts at the middle value (default 16KB) Window grows and shrinks as needed depending on number of queued segments Window growth is limited by the right-most value (default 1MB), and never shrinks to less than the left-most value (default 4KB) Sending window has been self-adjusting from much earlier than 2.6.7 kernel
  • 47. TCP: Research Issues Research topic #1: improving congestion control by routers Though much more harmless than tail drops, single packet drops drive TCP into congestion avoidance mode Even when using WFQ, traffic spikes can cause the much undesirable tail drops If a router could signal transmitters when congestion is coming, trasmitters might adjust their transmission rates without drops and without entering congestion avoidance mode This research field focuses on the use of the ECN bit in the TCP packet header
  • 48. TCP: Research Issues Research topic #2: how to conciliate the congestion-bound TCP traffic with the unbound, heavyweight UDP traffic TCP traffic can be throttled up and down before, during and after congestion UDP traffic on the contrary cannot be throttled, and is potentially causing more congestion than TCP Focus of this research area is on congestion-controlling UDP (for instance the just-created RMCAT IETF WG, check https://datatracker.ietf.org/wg/rmcat/charter/)
  • 49. TCP: Research Issues Research topic #3: congestion control algorithms for 4G radio accesses Which of the existing CC algorithms (Reno, Vegas, Cubic...) performs best in 4G RANs? Would new CC algorithms perform better than existing ones? How can the more aggressive algorithms co-exist pacifically with the more conservative ones? Research report on CC algorithm performance in LTE networks (link)
  • 50. TCP: References Macroscopic Behavior of the TCP Congestion Avoidance Algorithm, http://citeseerx.ist.psu.edu/viewdoc/summary? doi=10.1.1.25.3452 Modeling TCP Throughput: A Simple Model and its Empirical Validation, http://?