Advanced Computer Networks: MS-2 Semester
Advanced Computer Networks: MS-2 Semester
Lecture 06
TCP-Congestion Control
MS- 2nd Semester
Instructor
Mr. Sadiq Shah
1
Principles of Congestion Control
Congestion:
Informally: “too many sources sending too much data
too fast for network to handle”
Congestion occurs due to:
lost packets (buffer overflow at routers)
long delays (queueing in router buffers)
a top-10 problem!
2
The Causes and the Costs of
Congestion
Scenario 1: Two Senders, a Router with Infinite
Buffers
Two hosts (A and B) each have a connection that
shares a single hop between source and destination,
Let’s assume that the application in Host A is
sending data into the connection at an average rate
of in bytes/sec.
the rate at which Host A offers traffic to the router in
this first scenario is thus in bytes/sec.
Host B operates in a similar manner, and we assume
for simplicity that it too is sending at a rate of in
bytes/sec.
3
The Causes and the Costs of
Congestion
4
Scenario 1: Two Senders, a Router with
Infinite Buffers
Packets from Hosts A and B pass through a router and over a shared
outgoing link of capacity R.
The router has buffers that allow it to store incoming packets when the
packet-arrival rate exceeds the outgoing link’s capacity.
In this first scenario, we assume that the router has an infinite amount
of buffer space.
The left graph plots the per-connection throughput (number of bytes
per second at the receiver) as a function of the connection-sending
rate.
For a sending rate between 0 and R/2, the throughput at the receiver
equals the sender’s sending rate—everything sent by the sender is
received at the receiver with a finite delay.
5
Scenario 1: Two Senders, a Router with Infinite
Buffers
6
Causes/costs of congestion: scenario 2
As the sending rate approaches R/2 (from the left),
the average delay becomes larger and larger.
7
Approaches to Congestion Control
8
Approaches to Congestion Control
9
Approaches to Congestion Control
i. Direct feedback
ii. Router marks/updates a field in a packet
11
Network-assisted congestion control.
…Contiued
12
TCP Congestion Control
key component of TCP is its congestion-control mechanism.
TCP must use end-to-end congestion control rather than
network-assisted congestion control, since the IP layer
provides no explicit feedback to the end systems regarding
network congestion.
The approach taken by TCP is to have each sender limit the
rate at which it sends traffic into its connection as a function
of perceived network congestion.
If a TCP sender perceives that there is little congestion on
the path between itself and the destination, then the TCP
sender increases its send rate;
if the sender perceives that there is congestion along the
path, then the sender reduces its send rate.
13
TCP Congestion Control
But this approach raises three questions.
1. First, how does a TCP sender limit the rate at which it
sends traffic into its connection?
2. Second, how does a TCP sender perceive that there
is congestion on the path between itself and the
destination?
3. And third, what algorithm should the sender use to
change its send rate as a function of perceived end-
to-end congestion?
14
TCP Congestion Control
end-end control (no network assistance)
transmission rate limited by congestion window size, Congwin, over
segments:
Congwin
15
TCP Congestion Control
Each side of a TCP connection consists of a
receive buffer, a send buffer, and several
variables (LastByteRead, rwnd,and so on).
The TCP congestion-control mechanism
operating at the sender keeps track of an
additional variable, the congestion window
The congestion window, denoted cwnd,
imposes a constraint on the rate at which a
TCP sender can send traffic into the
network.
16
TCP Congestion Control
Specifically, the amount of nacknowledged data at a
sender may not exceed the minimum of cwnd and
rwnd, that is:
18
TCP congestion-control algorithm
Slow Start
In the slow-start state, the value of cwnd begins at 1 MSS and
increases by 1 MSS every time a transmitted segment is first
acknowledged.
TCP sends the first segment into the network and waits for an
acknowledgment.
When this acknowledgment arrives, the TCP sender increases
the congestion window by one MSS and sends out two
maximum-sized segments.
These segments are then acknowledged, with the sender
increasing the congestion window by 1 MSS for each of the
acknowledged segments, giving a congestion window of 4 MSS,
and so on.
19
20
When should this exponential growth end?
Slow start provides several answers to this
question.
First, if there is a loss event (i.e., congestion)
indicated by a timeout, the TCP sender sets the
value of cwnd to 1 and begins the slow start
process anew.
21