Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 26

TCP Congestion Control and

Queue Management
Outline

 Congestion Control
• Slow start
• AIMD
• Fast Retransmit/Recovery
 Queue Management
• ECN
• RED
• WRED
• RIO

Engineering Internet QoS 2


Why Study TCP Congestion Control in
a QoS Course?

 Most Internet services are based on TCP


• file transfer, e-mail, world wide web, telnet all
use TCP
 Quality of these valuable services largely
depends on TCP’s congestion control
mechanisms
 These services will still be very valuable even in
the next generation Internet with many new
multimedia services

Engineering Internet QoS 3


IPv4 Header Format (Revision)

Engineering Internet QoS 4


TCP Segment Format (Revision)
0 31
Source port # Destination port #
Sequence number
Acknowledgement number
Header
length Unused U A P R S F Receiver window size
Checksum Urgent pointer data
Options (variable )

Application Data (variable length)

Engineering Internet QoS 5


UDP Header (Revision)

Engineering Internet QoS 6


3-Way Handshake (Revision)
SYN, SeqNo=88

SYN, ACK, SeqNo=155, AckNo=89

ACK, AckNo=156

Client Server
Reprinted with Permission from “Engineering Internet QoS - Jha & Hassan, Artech House Publishing, Norwood, MA, USA. www.artechhouse.com

Engineering Internet QoS 7


Sliding Window (Revision)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 Step 1

0 1 2 3 4 5 6 7 8 9 10 11 12 13 Step 2

0 1 2 3 4 5 6 7 8 9 10 11 12 13 Step 3

0 1 2 3 4 5 6 7 8 9 10 11 12 13 Step 4
Time
Acknowledged Can be sent

Waiting for ACK Can't be sent

Reprinted with Permission from “Engineering Internet QoS - Jha & Hassan, Artech House Publishing, Norwood, MA, USA. www.artechhouse.com

Engineering Internet QoS 8


TCP Congestion Control

 Assumes FCFS or FQ scheduling discipline


 Acknowledgements used to regulate
transmission speed
 Feed is of implicit nature
• no explicit rate notification from network
 Each source determines network capacity
• Dynamically adapt to capacity changes

Engineering Internet QoS 9


Congestion Control Mechanism

 Congestion indicated by retransmission timout


 Sliding Window mechanism used for Congestion
control
 Window size is control as follows
• Increased upon receipt of ACKs
• Decreased upon expiration of retransmission
timer

Engineering Internet QoS 10


Slow Start

 Initially CongestionWindow = 1 MSS


 Increase CongestionWindow by 1 upon receipt of ACK
• Allowed window size = min (AdvertisedWindow,
CongestionWindow)
 AdvertisedWindow = Receiver’s available window size
• Window size doubled every RTT
 See figure on next foil
• Initially 1 segment sent
• Upon receipt of 1st ACK, 2 segments are sent
• Once ACK for these two segments arrive, four
segments are sent
Engineering Internet QoS 11
Slow Start Example

Engineering Internet QoS 12


Additive Increase/Multiplicative
Decrease

 Additive Increase phase


• Increase window size by 1/CongestionWindow for
each ACK received
 Window size increase by 1 every RTT
 Transition from Exponential
• Variable ssthresh = ½ initial window size
• Upon loss, ssthresh set to half the current window
size
 Rather maximum of the min (Congestion Window,
Adverstised Window)/2 or 2 MSS

Engineering Internet QoS 13


AIMD

Reprinted with Permission from “Engineering Internet QoS - Jha & Hassan, Artech House Publishing, Norwood, MA, USA. www.artechhouse.com
Engineering Internet QoS 14
Fast Retransmit

 Timer implementation may be too big


• wastage of bandwidth
 Fast retransmit adapts to congestion quickly
• Duplicate ACKs trigger retransmission
• TCP-Reno: 3 duplicate ACKs before
retransmission timer expiration triggers
retransmission of segment
 TCP-Reno also uses fast recovery : No slow start
after fast retransmission

Engineering Internet QoS 15


Proactive Congestion Management

 TCP-Vegas
• Keep track of RTT measurements
• Longer RTT indicates future congestion
• Rate reduced linearly

Engineering Internet QoS 16


Queue Management

 Queue management different from packet scheduling


• Packet scheduling – which packet to send next +
per-flow bandwidth Guarantees
 Queue management tasks:
• Move packets to appropriate queue
• Remove packets from a queue on request from
packet scheduler
• Drop and remark packets if queue full or approaching
saturation

Engineering Internet QoS 17


Explicit Congestion Notification

 RFC2481 proposed ECN scheme (based on


DECbit)
 IPv4 ToS field to indicate
• ECN Capable Transport (ECT) bit: whether
end system is ECN capable
• Congestion Experienced (CE): Network
elements mark this flag to indicate congestion

Engineering Internet QoS 18


Global Synchronization Problem

 Drop tail scheme creates global synch. Problem


• Congested router drops packet from multiple flows
simultaneously
• Each TCP sender detects loss and goes into slow
start
• Congestion situation improves at the bottleneck
router
• TCP sources start increasing their rate again
• If the router can’t cope with this load, source back
off again.
 RED proposal to eliminate this problem

Engineering Internet QoS 19


Random Early Detection (RED)

 Drop packets from randomly selected flows with


some drop probability whenever the queue
length exceeds some threshold
• Don’t wait for queue to become full
(proactive).
 No explicit indication to source
• TCP source use standard implicit timeout
mechanism

Engineering Internet QoS 20


RED Queue

AvQlen t  (1   )  AvQlen t  1    Qlent

Reprinted with Permission from “Engineering Internet QoS - Jha & Hassan, Artech House Publishing, Norwood, MA, USA. www.artechhouse.com

Engineering Internet QoS 21


RED Details (contd)

Two queue length thresholds


• if AvQlent < Minth then buffer the packet;
 No congestion
• if AvQlent > Maxth , discard packet (drop
probability 1);
 High congestion
• If Minth <= AvQlent <= Maxth , packet drop
based on drop probability p.
 Drop proability increases linearly towards Maxp as buffer
occupancy approaches Maxth

Engineering Internet QoS 22


RED packet drop probability

p  Maxp ( AvQlen t  Minth / Maxth  Minth )


Reprinted with Permission from “Engineering Internet QoS - Jha & Hassan, Artech House Publishing, Norwood, MA, USA. www.artechhouse.com

Engineering Internet QoS 23


Weighted RED

 Set of Minth , Maxth and and Maxp for each class


 Drop probability is applied from this set based on packet
marking
• Packets to be marked with different drop levels
 Diffserv chapter to revisit packet marking etc.
• Higher drop priority to be discarded first if queue
occupancy increases beyond minimum threshold
 Router vendors support up to 8 set of values based on
IPv4 precedence level

Engineering Internet QoS 24


Reprinted with Permission from “Engineering Internet QoS - Jha & Hassan, Artech House Publishing, Norwood, MA, USA. www.artechhouse.com

WRED

Engineering Internet QoS 25


RED with In/Out (RIO)

 RIO scheme assumes edge router marking of


packets conforming to SLA
• Conforming packets, in profile
• Non-conforming packets, out of profile
 Packets out of profile dropped first if a router
suffers congestion
 Different set of parameters used for in/out of
profile packets

Engineering Internet QoS 26

You might also like