SlideShare a Scribd company logo
SLOW START & CONGESTION AVOIDANCE
TRONG GIAO THỨC TCP/IP
GVHD: TS. Hà Hoàng Kha
HV: Trần Trường Sơn - 7140072
Lưu Quang Quyết - 7140450
• Problem – Slow Start1
• Procedure – Slow Start2
• Problem - Congestions3
• Procedure – Congestion
Avoidance4
• Simulations5
Overview
Problem – Slow Start
• Previous versions of TCP start a
connection with the sender
injecting multiple segments
into the network, up to the
windows size advertised by the
receiver.
• This is ok when the hosts are
placed on the same LAN. But if
there are routers and slower
links between the sender and
the receiver different problems
can arise. Some intermediate
router must queue the packets
and it is possible for the router
to run out of space in the
queue. The algorithm to avoid
this is called slow start.
Problem – Slow Start
• Beginning transmission into a network with unknown conditions requires
TCP to slowly probe the network to determine the available capacity, in
order to avoid congesting the network with an in appropriate large burst of
data.
• Slow start adds another window to the sender’s TCP: the congestion
window, called cwnd. When a new connection is established with a host on
another network, the congestion window is initialized to one segment
(typically 536 bytes or 512 bytes).
Procedure – Slow Start
• The sender starts by transmitting
one segment and waiting for its ACK.
When that ACK is received, the
congestion window is increased
from one to two, and two segments
can be sent. When each of those
two segments is acknowledged, the
congestion window is increased to
four. This provides an exponential
growth, although it is not exactly
exponential because the receiver
may delay its ACK’s. The sender can
transmit up to the minimum of the
congestion window and the
advertised window.
Problem – Congestion Avoidance
• At some point, the capacity of the internet can be reached and an
intermediate router will start discarding packets. This tells the
sender that its congestion window has gotten too large.
• Congestion avoidance is a way to deal with lost packets.
Congestion can occur when data arrives on a big pipe (a fast LAN)
and outputs on a smaller pipe (a slower WAN).
• Congestion can also occur when multiple input streams arrive at a
router whose output capacity is less than the sum of the inputs.
Problem – Congestion Avoidance
• There are two indications of packet loss at a sender: a timeout
occurring and the receipt of duplicate ACK’s . However, the overall
assumption of the algorithm is that packet loss caused by damage
is very small (much less than 1%), therefore the loss of a packet
signals congestion somewhere in the network between the source
and destination.
• Although congestion avoidance and slow start are independent
algorithms with different objectives, in practice they are
implemented together.
Problem – Congestion Avoidance
• When congestion occurs TCP must slow down its transmission rate
of packets into the network, and then slow start to avoid things
going again.
• The combined congestion avoidance and slow start algorithms
require that two variables are maintained for each connection:
– A congestion window (cwnd).
– A slow start threshold size (ssthresh)
Procedure – Congestion Avoidance
Procedure – Congestion Avoidance
• Initialization: give
connection sets cwnd to
one segment and sstresh
to 65535 bytes. The initial
value of cwnd must be
less than 2*SMSS bytes
and must not be more
than 2 segments. (SMSS:
Sender Maximum
Segment Size)
• When congestion occurs:
reduce one-half of the
current window. If the
congestion is indicated by
a timeout, cwnd is set to
one segment.
Procedure – Congestion Avoidance
• When new data is
acknowledged by the other
end, increase cwnd. The way
in which cwnd is increased
depends on whether TCP is
performing slow start or
congestion avoidance.
• If cwnd is less than or equal
to ssthresh , TCP is in slow
start, otherwise TCP is
performing congestion
avoidance. Slow start
continues until TCP is halfway
to where it was when
congestion occurred, and then
congestion avoidance takes
over. This is done due to the
recorded half of the window
size that caused the problem.
Tahoe and Reno
• Tahoe detect congestion only by setting a timer for receiving a related ACK.
Tahoe sets the slow start threshold to half of the current congestion window,
reduces the congestion window to 1 MSS, and resets to slow-start state.
• Reno: If three duplicate ACKs are received, it will halve the congestion window,
set the slow start threshold equal to the new congestion window, skipping slow-
start and going directly to Congestion Avoidance algorithm
Simulations
THANK YOU!

More Related Content

Tieu luan qo s

  • 1. SLOW START & CONGESTION AVOIDANCE TRONG GIAO THỨC TCP/IP GVHD: TS. Hà Hoàng Kha HV: Trần Trường Sơn - 7140072 Lưu Quang Quyết - 7140450
  • 2. • Problem – Slow Start1 • Procedure – Slow Start2 • Problem - Congestions3 • Procedure – Congestion Avoidance4 • Simulations5 Overview
  • 3. Problem – Slow Start • Previous versions of TCP start a connection with the sender injecting multiple segments into the network, up to the windows size advertised by the receiver. • This is ok when the hosts are placed on the same LAN. But if there are routers and slower links between the sender and the receiver different problems can arise. Some intermediate router must queue the packets and it is possible for the router to run out of space in the queue. The algorithm to avoid this is called slow start.
  • 4. Problem – Slow Start • Beginning transmission into a network with unknown conditions requires TCP to slowly probe the network to determine the available capacity, in order to avoid congesting the network with an in appropriate large burst of data. • Slow start adds another window to the sender’s TCP: the congestion window, called cwnd. When a new connection is established with a host on another network, the congestion window is initialized to one segment (typically 536 bytes or 512 bytes).
  • 5. Procedure – Slow Start • The sender starts by transmitting one segment and waiting for its ACK. When that ACK is received, the congestion window is increased from one to two, and two segments can be sent. When each of those two segments is acknowledged, the congestion window is increased to four. This provides an exponential growth, although it is not exactly exponential because the receiver may delay its ACK’s. The sender can transmit up to the minimum of the congestion window and the advertised window.
  • 6. Problem – Congestion Avoidance • At some point, the capacity of the internet can be reached and an intermediate router will start discarding packets. This tells the sender that its congestion window has gotten too large. • Congestion avoidance is a way to deal with lost packets. Congestion can occur when data arrives on a big pipe (a fast LAN) and outputs on a smaller pipe (a slower WAN). • Congestion can also occur when multiple input streams arrive at a router whose output capacity is less than the sum of the inputs.
  • 7. Problem – Congestion Avoidance • There are two indications of packet loss at a sender: a timeout occurring and the receipt of duplicate ACK’s . However, the overall assumption of the algorithm is that packet loss caused by damage is very small (much less than 1%), therefore the loss of a packet signals congestion somewhere in the network between the source and destination. • Although congestion avoidance and slow start are independent algorithms with different objectives, in practice they are implemented together.
  • 8. Problem – Congestion Avoidance • When congestion occurs TCP must slow down its transmission rate of packets into the network, and then slow start to avoid things going again. • The combined congestion avoidance and slow start algorithms require that two variables are maintained for each connection: – A congestion window (cwnd). – A slow start threshold size (ssthresh)
  • 10. Procedure – Congestion Avoidance • Initialization: give connection sets cwnd to one segment and sstresh to 65535 bytes. The initial value of cwnd must be less than 2*SMSS bytes and must not be more than 2 segments. (SMSS: Sender Maximum Segment Size) • When congestion occurs: reduce one-half of the current window. If the congestion is indicated by a timeout, cwnd is set to one segment.
  • 11. Procedure – Congestion Avoidance • When new data is acknowledged by the other end, increase cwnd. The way in which cwnd is increased depends on whether TCP is performing slow start or congestion avoidance. • If cwnd is less than or equal to ssthresh , TCP is in slow start, otherwise TCP is performing congestion avoidance. Slow start continues until TCP is halfway to where it was when congestion occurred, and then congestion avoidance takes over. This is done due to the recorded half of the window size that caused the problem.
  • 12. Tahoe and Reno • Tahoe detect congestion only by setting a timer for receiving a related ACK. Tahoe sets the slow start threshold to half of the current congestion window, reduces the congestion window to 1 MSS, and resets to slow-start state. • Reno: If three duplicate ACKs are received, it will halve the congestion window, set the slow start threshold equal to the new congestion window, skipping slow- start and going directly to Congestion Avoidance algorithm