congestion control - universitetet i osloheim.ifi.uio.no/~inf3190/forelesninger05/2005mai04...04....

35
04. Mai 2005 1 INF-3190: Congestion Control Congestion Control Foreleser: Carsten Griwodz Email: [email protected]

Upload: lamminh

Post on 11-Jul-2019

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 1 INF-3190: Congestion Control

Congestion Control

Foreleser: Carsten GriwodzEmail: [email protected]

Page 2: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 2 INF-3190: Congestion Control

Internet Congestion Control

TCP Congestion Control

Page 3: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 3 INF-3190: Congestion Control

TCP Congestion Control! TCP limits sending rate as a function of

perceived network congestion! Little traffic � increase sending rate ! Much traffic � reduce sending rate

! TCP�s congestion algorithm has four major �components�:! Additive-increase! Multiplicative-decrease (together AIMD algorithm)! Slow-start! Reaction to timeout events

Page 4: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 4 INF-3190: Congestion Control

TCP Congestion Controlsender receiver Initially, the CONGESTION WINDOW

is 1 MSS (message segment size)

roun

d 1

roun

d 2

roun

d 3

roun

d 4

sent packetsper round(congestion window)

time

16

8

4

21

Then, the size increases by 1 for each received ACKuntila threshold is reachedoran ACK is missing

Page 5: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 5 INF-3190: Congestion Control

TCP Congestion Control

16

8

4

21

Normally, the threshold is 64K

sent packetsper round

(congestion window)

time

40

20

10

5

80

15

30

25

35

75

55

45

50

65

60

70

Loosing a single packet (TCP Tahoe):" threshold drops to half CONGESTION WINDOW" CONGESTION WINDOW back to 1

Loosing a single packet (TCP Reno):" if notified by timeout: like TCP Tahoe" if notified by fast retransmit:

threshold drops to half CONGESTION WINDOW" CONGESTION WINDOW back to new threshold

Page 6: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 6 INF-3190: Congestion Control

Congestion Control: Example! Parameters

! Maximum segment size = 1024 bytes! Initial congestion window = 64 KB

! Areas! Previously (transm. nr. = 0)

! Congestion window before timeout: 64 KB! Threshold after timeout: 32 KB! Congestion window after timeout: 1 KB

! Exponential area! �slow start�

! Linear area! �congestion avoidance�

! Note! Altways observe receiver�s window size, i.e. use minimum of

! Congestion window! Actual send window (receiver status)

Page 7: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 7 INF-3190: Congestion Control

Additive Increase! Objective

! To avoid immediate network overload! After just recent overload has finished! After timeout! At the start of a data transmission

! Method: congestion window! Defined/initiated at connection set-up

! Initial max. window size = 1 segment! Threshold (based on previous max. window size)

! Max. size of segment to be transferred! To be doubled as long as

! 1. segment size below a certain threshold and! 2. all ACKs arrive in time (i.e. correct segment transfer)! (each burst acknowledged, i.e. successfully transmitted,

doubles congestion window)! To be linearly increased

! 1. segment size above a certain threshold and! 2. all ACKs arrive in time (i.e. correct segment transfer)

Page 8: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 8 INF-3190: Congestion Control

AIMD! Threshold

! Adaptive! Parameter in addition to the actual and the congestion window

! Assumption! Threshold, i.e. adaptation to the network: �sensible window size�

! Use: on missing acknowledgements! Threshold is set to half of current congestion window! Congestion window is reduced

! Implementation- and situation-dependant: to 1 or to new threshold! Use slow start of congestion window is below threshold

! Use: on timeout! Threshold is set to half of current congestion window! Congestion window is reset to one maximum segment! Use slow start to determine what the network can handle

! Exponential growth stops when threshold is hit! From there congestion window grows linearly (1 segment) on successful

transmission

Page 9: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 9 INF-3190: Congestion Control

TCP Congestion Control! Some parameters

! 65.536 byte max. per segment! IP recommended value TTL interval 2 min

! Optimization for low throughput rate! Problem

! 1 byte data requires 162 byte incl. ACK (if, at any given time, it shows up just by itself)

! Algorithm! Acknowledgment delayed by 500 msec because of window

adaptation! Comment

! Often part of TCP implementation

Page 10: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 10 INF-3190: Congestion Control

TCP Congestion Control! TCP assumes that every loss is an indication for

congestion! Not always true

! Packets may be discarded because of bit errors! Low bit error rates

! Optical fiber! Copper cable under normal conditions! Mobile phone channels (link layer retransmission)

! High bit errors rates! Modem cables! Copper cable in settings with high background noise! HAM radio (IP over radio)

! TCP variations exist

Page 11: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 11 INF-3190: Congestion Control

TCP Congestion Control! TCP congestion control is based on the notion that the

network is a �black box�! Congestion indicated by a loss

! Sufficient for best-effort applications, but losses might severely hurt traffic like audio and video streams # congestion indication better enabling features like

quality adaptation

! Approaches! Use ACK rate rather than losses for bandwidth estimation

! Example: TCP Westwood! Use active queue management to detect congestion

Page 12: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 12 INF-3190: Congestion Control

The TCP family! TCP Tahoe

! Oldest TCP variation still around! Assumes that every packets loss is due to congestion! If there is at least one loss during one RTT

! Reduction of threshold to half of the congestion window! Congestion window back to 1! Slow start

! Only the missing packet is retransmitted! Efficient handling of single losses! Inefficient handling of multiple losses by RTT

! �Fast Retransmit�! One packet is sent for every arriving packet! If there is a gap, acknowledge the last packet before the gap again! Sender interprets 3 ACKs for the same packet as a loss event

Page 13: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 13 INF-3190: Congestion Control

The TCP family! TCP Reno

! Next oldest variation still around! In case of Fast Retransmit, continue with �Fast Recovery�

! Reduction of the threshold to half the congestion window! Congestion window to the new threshold! Do not enter slow start

! Increase the congestion window for every ACK, even if it is a duplicate ACK

! An arriving ACK means that a packet has arrived! Although the sender doesn�t know which

Page 14: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 14 INF-3190: Congestion Control

The TCP family! Problem: Packets get dropped in bursts

! When queues get full and routers drop packets, all senders require time to notice the problem and back off

! Multiple losses are more likely than Tahoe and Reno assume! Particularly bad for Reno

! First approach! TCP New Reno

! TCP New Reno! Most frequently used today! Sender-only modification to TCP Reno! Define duration of Fast Recovery

! Note the highest sequence number sent when fast recovery was entered! Stay in fast recovery until that sequence number is ACK�d

! For duplicate ACKs received during fast recovery! Don�t reduce the congestion window or threshold! Retransmit the lost packet! Do not extend the fast recovery period! Increase the congestion window by 1 (as for good ACKs)

Page 15: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 15 INF-3190: Congestion Control

The TCP family! Problem: Assumes that every loss is an indication for congestion

! But loss may be due to bit errors! Severity: growing because of wireless links, satellite links and new bit-error

sources at multi-gigabit speeds! Approach

! TCP SACK

! TCP Sack (Selective ACK)! Becoming wide-spread! Modification at both sides! Reports in addition to standard cumulative ACK

! Successfully received blocks of packets behind a gap! Always including the packets that triggered the ACK in first block

! Uses a TCP option! There can�t be more than 40 bytes TCP options per packet! SACK requires 2+8*n! Most likely used with 10 bytes timestamp option (PAWS option)! Therefore no more than 3 blocks

! Distinguish: single loss, multiple loss, actual duplicates

Page 16: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 16 INF-3190: Congestion Control

The TCP family! Bottleneck router

! Term used under the assumption that exactly one router between sender and receiver is responsible for packet loss

! Approaches look for! Capacity of the bottleneck router! Available bandwidth at the bottleneck router

! Bandwidth-delay product

! 1 Gbit/s, 40msec # 41Mbit can be �in flight�

...

...

...Data Acknowledgements

t=0 t=11.2 µsec t=20 msec t=40 msec

Page 17: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 17 INF-3190: Congestion Control

The TCP family! Problem: A loss event reduces congestion window but

not sending rate! Tahoe, Reno, New Reno and SACK will send a new packet for

every incoming ACKs until congestion window is used up! They send in bursts! Bottleck router�s queue grows and shrinks

! Oscillating RTTs, packet drops! Approach

! TCP FACK

! TCP FACK (Forward ACK)! Quite rare! Sender-only modification! In Fast Recovery

! Sender uses a timer to spread packets evenly over one RTT

Page 18: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 18 INF-3190: Congestion Control

The TCP family! Problems

! Determines available bandwidth by probing! Incresse the transmission rate until there is a loss event! Severity: blocks advancement of the sliding window until the packet is retransmitted

! Climbs very slowly to highest bandwidth utilization when bandwidth is high! The threshold that ends slow start is fixed to 64k in original TCP! Severity: inhibits high bandwidth communication, esp. communication among

supercomputers! Does not use more than 75% of the available bandwidth! Sawtooth pattern! Severity: resource waste, intensive jitter in high bandwidth environments

! Can�t use high bandwidth if delay is high due to limited credit window size! The problem of �high bandwidth delay products�! Impossible to have more than 216 bytes unacknowledged! Severity: most severe for satellite communication and communication among

supercomputers; problem increases linearly with network speeds, and network speed grows potentially

Page 19: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 19 INF-3190: Congestion Control

The TCP family! TCP Vegas

! Rare! Sender-only modification! Tries to fix all of the 3 problems above! Model

! Congestion build-up can be detected! RTT gets longer! Throughput drops

Page 20: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 20 INF-3190: Congestion Control

The TCP family! TCP Vegas

! Congestion window maintenance! In each RTT, time-stamp one packet! Between two marked packets, count bytes sent and bytes ACK�d! If throughput lower than expected congestion window � 1! If throughput higher than expected congestion window + 1

! Retransmission handling! Course-grained 500ms timer for original retransmission behavior! Maintain a fine-grained timer for every packet in flight! Retransmit if on the first duplicate ACK if the RTT is exceeded

according to the fine-grained timer! Slow start handling

! Grow congestion window only every second RTT in slow start! Don�t leave slow start until congestion is detected

⇒TCP Vegas is a congestion avoidance approach

Page 21: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 21 INF-3190: Congestion Control

Internet Congestion Control

TCP Congestion Avoidance

Page 22: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 22 INF-3190: Congestion Control

Random Early Detection (RED)! Random Early Detection (discard/drop) (RED) uses active queue

management

! Drops packet in an intermediate node based on average queue length exceeding a threshold! TCP receiver reports loss in ACK! Sender applies multiple decrease

! Idea! Congestion should be attacked as early as possible! Some transport protocols (e.g., TCP) react to lost packets by rate

reduction

Page 23: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 23 INF-3190: Congestion Control

Random Early Detection (RED)! Router drops some packet before congestion significant (i.e., early)

! Gives time to react

! Dropping starts when moving avg. of queue length exceeds threshold! Small bursts pass through unharmed! Only affects sustained overloads! Packet drop probability is a function of mean queue length

! Prevents severe reaction to mild overload

! RED improves performance of a network of cooperating TCP sources

! No bias against bursty sources

! Controls queue length regardless of endpoint cooperation

Page 24: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 24 INF-3190: Congestion Control

Early Congestion Notification (ECN)! Early Congestion Notification (ECN) - RFC 2481

! an end-to-end congestion avoidance mechanism! Implemented in routers and supported by end-systems! Not multimedia-specific, but very TCP-specific! Two IP header bits used

! ECT - ECN Capable Transport, set by sender! CE - Congestion Experienced, may be set by router

! Extends RED! if packet has ECT bit set

! ECN node sets CE bit! TCP receiver sets ECN bit in ACK! sender applies multiple decrease (AIMD)

! else! Act like RED

Page 25: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 25 INF-3190: Congestion Control

Early Congestion Notification (ECN)

! Effects! Congestion is not oscillating - RED & ECN! ECN-packets are never lost on uncongested links! Receiving an ECN mark means

! TCP window decrease! No packet loss! No retransmission

Tail drop

RED

ECN

Page 26: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 26 INF-3190: Congestion Control

Endpoint Admission Control! Motivation

! Let end-systems test whether a desired throughput can be supported

! In case of success, start transmission

! Applicability! Only for some kinds of traffic (traffic classes)! Inelastic flows! Requires exclusive use of some resources for this traffic! Assumes short queues in that traffic class

! Send probes at desired rate! Routers can mark or drop probes! Probe packets can have separate queues or use main queue

Page 27: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 27 INF-3190: Congestion Control

Endpoint Admission Control! Thrashing and Slow Start Probing

! Thrashing! Many endpoints probe concurrently! Probes interfere with each other and all deduce insufficient

bandwidth! Bandwidth is underutilized

! Slow start probing! Probe for small bandwidth! Probe for twice the amount of bandwidth! �! Until desired speed is reached! Start sending

Page 28: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 28 INF-3190: Congestion Control

XCP: eXplicit Control Protocol

IP header TCP headerXCP Payload

Round-trip-time

Desired congestion window

Feedback

initialize

update

Provide feedback

Page 29: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 29 INF-3190: Congestion Control

XCP: eXplicit Control Protocol! Congestion Controller

! Goal: Match input traffic to link capacity

! Compute an average RTT for all connections

! Looks at queue! Combined traffic

changes by ∆! ∆ ~ Spare Bandwidth! ∆ ~ - Queue Size

sendable per RTT! So, ∆ = α Spare - β

Queue

! Fairness Controller! Goal: Divide ∆

between flows to converge to fairness

! Looks at a state in XCP header

! If ∆ > 0 ⇒ Divide ∆equally between flows

! If ∆ < 0 ⇒ Divide ∆between flows proportionally to their current rates

Page 30: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 30 INF-3190: Congestion Control

TCP Friendliness

Page 31: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 31 INF-3190: Congestion Control

TCP Friendliness - TCP Compatible! A TCP connection�s throughput is bounded

! wmax - maximum retransmission window size! RTT - round-trip time

! Congestion windows size changes! AIMD (additive increase, multiple decrease) algorithm

! TCP is said to be fair! Streams that share a path will reach an equal share

! A protocol is TCP-friendly if! Colloquial

! It long-term average throughput is not bigger than TCP�s! Formal

! Its arrival rate is at most some constant over the square root of the packet loss rate

Page 32: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 32 INF-3190: Congestion Control

TCP Friendliness

RTT

wRs

max=

21, =⋅= αα ww

In case of at least one loss in an RTT

In case of no loss , 1, =+= ββww

Congestion windows size changes" AIMD algorithm" additive increase, multiple decrease

TCP is said to be fair" Streams that share a path will

reach an equal share

That�s not generally true" Bigger RTT

" higher loss probability per RTT" slower recovery

" Disadvantage for long-distance traffic

A TCP connection�s throughput is bounded

" wmax - maximum retransmission window size

" RTT - round-trip time

The TCP send rate limit is

Page 33: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 33 INF-3190: Congestion Control

TCP Friendliness! A protocol is TCP-friendly if

! Colloquial: It long-term averagethroughput is not bigger than TCP�s

! Formal: Its arrival rate is at mostsome constant over the square rootof the packet loss rate

! The AIMD algorithm with α≠1/2 and β≠1 is still TCP-friendly, if the rule is not violated

! TCP-friendly protocols may - if the rule is not violated -! Probe for available bandwidth faster than TCP! Adapt to bandwidth changes more slowly than TCP! Use different equations or statistics, i.e., not AIMD! Not use slow start (i.e., don�t start with w=0)

CpRr +≤

P � packet loss rate

C � constant value

Rr � packet arrival rate

Page 34: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 34 INF-3190: Congestion Control

Datagram Congestion Control Protocol(DCCP)

! Datagram Congestion Control Protocol! Under development! http://www.ietf.org/html.charters/dccp-charter.html

! Transport Protocol! Offers unreliable delivery! Low overhead like UDP! Applications using UDP can easily change to this new protocol

! Accommodates different congestion control mechanisms! Congestion Control IDs (CCIDs)

! Add congestion control schemes on the fly! Choose a congestion control scheme! TCP-friendly Rate Control (TFRC) is included

! Half-Connection! Data Packets sent in one direction

Page 35: Congestion Control - Universitetet i osloheim.ifi.uio.no/~inf3190/Forelesninger05/2005mai04...04. Mai 2005 7 INF-3190: Congestion Control Additive Increase! Objective! To avoid immediate

04. Mai 2005 35 INF-3190: Congestion Control

Datagram Congestion Control Protocol(DCCP)

! Congestion control is plugable! One proposal is TCP-Friendly Rate Control (TFRC)

! Equation-based TCP-friendly congestion control! Receiver sends rate estimate and loss event history! Sender uses models of SACK TCP to compute send rate

)321()8

33,1min(

32

1

2ppbp

tbp

RTT

T

RTO ++=

Steady state TCP send rate

Loss probability

Number of packets ack�d by one ACK

Retransmission timeout