You are on page 1of 14

02/10/2019

GC
Topic: Congestion Control 2019-2020

What you will learn


The causes of congestion
Approaches to congestion control
TCP congestion control
TCP/IP ECN

Congestion Control 1

GC
Principles of congestion control 2019-2020

Congestion occurs when the rate at which packets are


injected into the network begins to approach the
packet-handling capacity of the network
Symptoms of network congestion:
long delays (queuing in router buffers)
lost packets (buffer overflow at routers)
Objective of congestion control:
to keep the number of packets below the level at which
performance drops off dramatically
Congestion control is different from flow control!

Congestion Control 2

1
02/10/2019

GC
Queueing Theory 2019-2020

A data network can be seen as a network of queues

to other
to terminal node

to other
node

to other

As the arrival rate approaches the node

service rate, queue length and,


hence, packet delay grow to terminal
Packet switching node
dramatically Congestion Control 3

GC
Ideal Performance 2019-2020

I.e., infinite buffers, no This figure represents the ideal,


overhead related to packet but unattainable, goal of all traffic
transmission or congestion and congestion control schemes
control
(In figure) Both throughput The (normalized) rate at
which packets leave the
and offered load are network is 1.0

normalized to the maximum


theoretical throughput of the
network
Queue sizes (and therefore
Throughput increases with queuing delays) grow to
infinity
offered load until full capacity
Packet delay increases with
offered load approaching
Ideal network utilization
infinity at full capacity
Congestion Control 4

2
02/10/2019

GC
Practical Performance 2019-2020

In practice, the buffer size is finite,


leading to buffer overflow
Assume that no congestion control
mechanism is used
increased load eventually causes
moderate congestion: throughput
increases at a rate lower than the rate at
which load is increased
a point (B in the plot) is reached beyond
which throughput drops to zero with
increased offered load (congestion
collapse)
• Sources retransmit the discarded packets
and even successfully delivered packets
(unneeded retransmissions) in case it
takes too long to acknowledge them
• Bandwidth is more and more wasted and,
eventually, the effective capacity of the The effects of congestion
network is virtually zero Congestion Control 5

GC
Approaches towards congestion control 2019-2020

Two broad approaches:


End-to-end congestion Network-assisted congestion control:
control: routers provide an explicit feedback to the
the network provides no sender regarding the congestion state
explicit feedback to the Feedback information types:
sender • Binary: a bit is set in a data packet as
congestion must be inferred it is forwarded by the congested node
by the end-systems based only • Rate-based: an explicit data rate limit
on observed network is provided to the source
behavior (for ex., packet loss, • Credit-based: the credit indicates how
high delay) many packets or how many bytes the
source may transmit. When the credit
• technique adopted by
is exhausted, the source must await
TCP
additional credit
Example:
TCP/IP ECN (Explicit Congestion
Notification)
Congestion Control 6

3
02/10/2019

GC
Network-assisted congestion control 2019-2020

A direct feedback may be sent by a network router to the sender


Choke packet: it is a control packet generated at a congested node and
transmitted back to a source node to restrict traffic flow
• example: ICMP Source Quench (in practice, it is not used)
Feedback via the receiver: a congested router notifies the
destination that congestion avoidance procedures should be
initiated in the same direction of the received packet
Upon reception of a congestion signal, the destination echoes the signal
back to the source
Host B

Congestion Control 7

GC
Mechanisms to prevent congestion 2019-2020

Reservation
Admission control: a new reservation is denied if network
resources are inadequate (congestion is avoided!)
The network and the user enter into a traffic contract
which specifies a data rate and other characteristics of the
traffic flow (traffic descriptors)
The network agrees to give a defined QoS as long as the
traffic flow is within contract parameters
Traffic policing: the access node monitors the flow
• Excess traffic is either discarded or marked to indicate that it is
liable to discard or delay
Scheme adopted also in IP networks (IntServ architecture)

Congestion Control 8

4
02/10/2019

GC
2019-2020

TCP traffic Control

Congestion Control 9

GC
Windows in TCP 2019-2020

TCP uses two windows (send window and receive window) for
each direction of data transfer
The amount of unacknowledged data is dictated by the receiver (flow
control) and the congestion in the underlying network (congestion control)

Congestion Control 10

5
02/10/2019

GC
TCP Flow Control 2019-2020

TCP
decouples acknowledgment of
received data units from the
granting of permission to send
additional data units
uses a credit allocation scheme for
flow control
• The receiver “advertises” the free
buffer space by including the value of
the rwnd variable in the TCP header
(in the field named “window”) of
receiver-to-sender segments
• The sender limits the amount of
unacknowledged (“in-flight”) data to
the receiver’s rwnd value

LastByteSent – LastByteAcked <= rwnd


Congestion Control 11

GC
TCP congestion control 2019-2020

TCP uses end-to-end congestion control


A number of techniques have been defined for TCP
to control congestion
Slow Start
Congestion Avoidance
Fast Recovery

Congestion Control 12

6
02/10/2019

GC
TCP congestion control (cont.) 2019-2020

A TCP sender limits its sending rate based on its


perception of network congestion
A “loss event” is taken to be an indication of congestion
• a retransmit timeout is the sign of a strong congestion in the network
• the reception of three duplicate ACKs is the sign of a light-to-moderate
congestion
A congestion window (cwnd) imposes a constraint on the
sending rate
LastByteSent – LastByteAcked <= min (cwnd, rwnd)

• Actually, cwnd is measured in MSS (in maximum-sized segments)


• By adjusting the value of cwnd, the sender can adjust the sending rate
• TCP uses acknowledgments to trigger its increase in cwnd (TCP self-
clocking behavior)
• Strategy: TCP increases its rate in response to arriving ACKs until a loss
event occurs, at which point the rate is decreased (bandwidth probing)
Congestion Control 13

GC
TCP Slow Start 2019-2020

When a connection begins, TCP enters the slow-


start state
cwnd starts with one MSS and increases by one MSS each
time an ACK arrives
thus cwnd is doubled every RTT (exponential growth!)

Slow Start, exponential increase

Congestion Control 14

7
02/10/2019

GC
TCP Slow Start (cont.) 2019-2020

Slow start ends if


cwnd reaches or surpasses the slow-start threshold
(ssthresh)
• TCP enters the Congestion Avoidance state
there is a timeout
• Cwnd is set to 1, ssthresh to cwnd/2 and the slow start process is
performed
Three duplicate ACKs are detected
• fast retransmit is performed and ssthresh is set to cwnd/2,
afterwards
– Tahoe TCP always enters slow start state
– Reno TCP (the most common version today) enters the Fast
Recovery state

Congestion Control 15

GC
Congestion Avoidance 2019-2020

More conservatively, TCP increases cwnd by one MSS every RTT


cwnd is increased by (MSS/cwnd) bytes for each ACK
On entry to the congestion-avoidance state, cwnd is about half its
value when congestion was last encountered

Congestion avoidance,
additive (linear) increase

Congestion Control 16

8
02/10/2019

GC
Fast Recovery 2019-2020

Optional in TCP
When the third duplicate TCP Reno
ACK arrives,
Set ssthresh = cwnd/2
Retransmit the missing
segment (fast retransmit)
Set cwnd = ssthresh +3
Adding 3 to ssthresh
accounts for the number of Round-trip times
segments that have left the
network and that the other Evolution of cwnd in Tahoe and Reno
end has buffered

Congestion Control 17

GC
Many variants of TCP congestion control 2019-2020

Congestion Control 18

9
02/10/2019

GC
TCP: AIMD congestion control 2019-2020

Assumptions:
Initial slow-start period ignored
losses indicated by triple duplicate ACK rather than timeouts
(light to moderate congestion)
Additive-Increase, Multiplicative Decrease (AIMD):
TCP’s congestion control consists of a linear increase in cwnd
of one MSS per RTT and then a halving of cwnd on a triple
duplicate-ACK event
congestion
window

24 Kbytes
The “saw-tooth” behavior
illustrates the TCP probing
16 Kbytes
for bandwidth

8 Kbytes

time Congestion Control 19

GC
TCP/IP Explicit Congestion Notification (ECN) 2019-2020

Extension to IP and TCP defined in RFC 3168


Changes to IP and TCP headers have been required
If ECN is adopted, TCP has no need to wait for a loss event
(retransmit timeout or three duplicate ACKs)
Network-assisted approach
• Feedback via the receiver
ECN is an optional feature that is only used when both endpoints
support it and are willing to use it (negotiation!)
Actually, ECN is also defined for other transport-layer protocols
that perform congestion control and have a method for echoing
the congestion indication to the transmitting endpoint

Congestion Control 20

10
02/10/2019

GC
Changes required for ECN 2019-2020

Two new flags added in the TCP header


TCP entities on hosts must recognize and set these flags
TCP entities enable ECN by negotiation at connection setup
A new field of two bits added to IP header
IP entity on hosts and routers must recognize and set these
bits
IP entities in routers must set these bits based on congestion
A TCP entity exchanges ECN information with the
underlying IP entity
New parameters in IP service primitives

Congestion Control 21

GC
ECN bits in IP header 2019-2020

ECN uses the two least significant bits (ECN field) of the
“DiffServ” field in the IPv4 or IPv6 header to encode four different
codes:
Value Meaning
00 Not-ECT - Not ECN-Capable Transport
01 ECT(1) - ECN-Capable Transport
10 ECT(0) - ECN-Capable Transport
11 CE - Congestion Encountered
When both endpoints support ECN, they mark their packets with
ECT(0) or ECT(1)
Instead of dropping the packet, a congested ECN-aware router
may change the code to CE (“marking” the packet) to inform the
receiving endpoint of impending congestion
This congestion indication is then echoed back to the transmitting
Congestion Control 22
endpoint

11
02/10/2019

GC
IP header (cont) 2019-2020

Congestion Control 23

GC
ECN bits in TCP header 2019-2020

To support ECN, two new flag bits have been added


ECN-Echo (ECE) flag
Used by the receiver (when a CE packet has been
received) to echo the congestion indication back to the
sender
Congestion Window Reduced (CWR) flag
Used by the sender to acknowledge that the congestion-
indication echoing was received

Congestion Control 24

12
02/10/2019

GC
TCP header (cont.) 2019-2020

Congestion Control 25

GC
ECN negotiation 2019-2020

TCP header flags are used at connection setup to


enable end points to agree to use ECN
“A” sends SYN segment to “B” with ECE and CWR
set
“A” is ECN-capable and prepared to use ECN as both a
sender and a receiver
If “B” is prepared to use ECN, it returns the SYN-
ACK segment with ECE set and CWR not set
If “B” not prepared to use ECN, it returns the SYN-
ACK segment with ECE and CWR not set

Congestion Control 26

13
02/10/2019

GC
Basic ECN operation 2019-2020

When ECN has been successfully negotiated on a TCP


connection, the sender indicates that IP packets are carrying
traffic from an ECN Capable Transport node by marking them
with an ECT code (01 or 10)
This allows intermediate routers that support ECN to mark those IP
packets with the CE code in order to signal impending congestion.
Upon receiving an IP packet with the CE code, the TCP receiver
echoes back this congestion indication using the ECE flag in the
TCP header
When an endpoint receives a TCP segment with the ECE bit set,
it reduces its congestion window as for a packet loss
It then acknowledges the congestion indication by sending a segment with
the CWR bit set
A node keeps transmitting TCP segments with the ECE bit set
until it receives a segment with the CWR bit set
Congestion Control 27

GC
Basic ECN operation (cont.) 2019-2020

Congestion Control 28

14

You might also like