Congestion Control Tanenbaum 5.3, 6.5. 6/12/2015Congestion Control (A Loss Based Technique: TCP)2...

33
Congestion Control Tanenbaum 5.3, 6.5
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    215
  • download

    2

Transcript of Congestion Control Tanenbaum 5.3, 6.5. 6/12/2015Congestion Control (A Loss Based Technique: TCP)2...

Congestion Control

Tanenbaum 5.3, 6.5

04/18/23 Congestion Control (A Loss Based Technique: TCP) 2

What? Why?

• Congestion occurs when – there is no reservation– Demand exceeds Resources

• If congestion persists, resources must be increased

• If congestion happens in short bursts, buffers can avoid packet losses to some extent.

04/18/23 Congestion Control (A Loss Based Technique: TCP) 3

Congestion Control, How?

• Network Layer– Congestion control point to point

• Transport Layer– Congestion control end-to-end

PacketsDelivered

Packets Sent

Maximum capacity of bottleneck link

ObjectiveCongestion

Congestion Collapse

04/18/23 Congestion Control (A Loss Based Technique: TCP) 4

Network As Black Box

Network/Network/Network ElementNetwork Element

Load

State variable u

What can U be?

Round trip time (e2e)

Packet loss (e2e or p2p)

Link utilization (p2p)

Queue size (p2p)

Throughput (e2e)

04/18/23 Congestion Control (A Loss Based Technique: TCP) 5

Congestion Control in Packet Switched Networks

• Monitor some system state variable u

• u may be link utilization (p2p), loss rate (p2p or e2e)

• Instantaneous unow

• Average value u computed as:– unew = .ulast + (1- ) unow

– 0 <= <= 1

• Use of thresholds

04/18/23 Congestion Control (A Loss Based Technique: TCP) 6

Congestion Control:Strategies

• Open loop– Prevent congestion by design– E.g., resource reservation, admission control

• Closed loop– Monitor some characteristics of system– Inform key elements that can take action– Adjust system operation whenever needed

End-to-end Congestion Control

04/18/23 Congestion Control (A Loss Based Technique: TCP) 8

Network As Black Box

NetworkNetworkWindow Size

OrRate

Packet Loss,Round trip time,

or Throughput

Packet Loss BasedCongestion Control

TCP Congestion Control(Read Van Jacobson, “Congestion Avoidance and Control,” Sigcomm’88)

04/18/23 Congestion Control (A Loss Based Technique: TCP) 10

System (Connection) In Equilibrium

Time

Bandwidth

High Speed LANs Slow long-haul link

04/18/23 Congestion Control (A Loss Based Technique: TCP) 11

Keeping A System in Equilibrium

• Suppose that a system is in equilibrium, how to keep it there?– If there are no losses, easy: just send a

packet whenever an ack is received.– If losses occur, we need to distinguish

between delayed packets (link capacity shortage) and lost packets need an accurate retransmission timer.

04/18/23 Congestion Control (A Loss Based Technique: TCP) 12

How to Get A System To Equilibrium?

• At the beginning, no packet is sent yet.

• Propose a strategy. Let us discuss some strategies:

Strategy 1: Blast a guessed number of packets.

Strategy 2: Start with sending one packet (WS=1) and wait1. when ack is received, send two packets (WS=2)

2. For each ack, send one packet, plus one packet when all window is acked (WS=3)

04/18/23 Congestion Control (A Loss Based Technique: TCP) 13

How to Get A System To Equilibrium?

• Strategy 2 may be inefficient

• Consider a download of a 21 KB file using a 1 KB segment size over a 45 Mbps link with 25ms one way latency.

• Compute the efficiency of such a transfer

04/18/23 Congestion Control (A Loss Based Technique: TCP) 14

How to Get A System To Equilibrium? (Strategy 2)

Time WS Segments Delivered Throughput Efficiency

RTT 1 1 160 Kbps 0.3%

2 RTT 2 3 320 Kbps 0.7%

3 RTT 3 6 480 Kbps 1.0%

4 RTT 4 10 640 Kbps 1.4%

5 RTT 5 15 800 Kbps 1.7%

6 RTT 6 21 960 Kbps 2.1%

04/18/23 Congestion Control (A Loss Based Technique: TCP) 15

A Faster Strategy: Slow Start

• For each acked packet, increase window by 1

04/18/23 Congestion Control (A Loss Based Technique: TCP) 16

Slow-Start to Get A System To Equilibrium? (Strategy 2)

Time WS Segments Delivered Throughput Efficiency

RTT 1 1 160 Kbps 0.3%

2 RTT 2 3 320 Kbps 0.5%

3 RTT 4 7 640 Kbps 1.4%

4 RTT 8 15 1.28 Mbps 2.8%

5 RTT 16 21 ----- ----

6 RTT

04/18/23 Congestion Control (A Loss Based Technique: TCP) 17

A System in Equilibrium MayUNDERUTILIZE the Link Capacity

• If losses do not happen, this is an indication that link capacity may not be fully utilized

• What to do?– Slightly INCREASE the window size after a

complete window of data made it safely through the network (this happens every round trip time.) Congestion avoidance phase

04/18/23 Congestion Control (A Loss Based Technique: TCP) 18

TCP Congestion Avoidance and Control

• Start with congestion window=1 (CWND)

• Use slow start until CWND reaches the threshold sstresh (sstresh is half the congestion window vale reached when last loss occured)

• From CWND=sstresh, use congestion avoidance

04/18/23 Congestion Control (A Loss Based Technique: TCP) 19

Example

Round trip time

CWND

04/18/23 Congestion Control (A Loss Based Technique: TCP) 20

Code

When a packet is acked if cwnd < ssthresh* {

/* Slow-Start: increment cwnd every ack*/cwnd = cwnd + 1;

} else {/* Congestion avoidance: increment cwnd every RTT */cwnd = cwnd + 1/cwnd

}

When a packet is lost (timeout) ssthresh = cwnd / 2; cwnd = init_cwnd;

* ssthresh may be dynamically adjusted at start-up (see Janey Hoe work)

04/18/23 Congestion Control (A Loss Based Technique: TCP) 21

Fast Recovery/ Fast Retransmit

• When 3rd dupack received:– Fast Recovery:

• ssthresh = cwnd / 2;• cwnd = ssthresh + 3;

– Fast Retransmit:• Retransmit missing packet without waiting for

timeout

04/18/23 Congestion Control (A Loss Based Technique: TCP) 22

Example

Round trip time

CWND

24

8

16

04/18/23 Congestion Control (A Loss Based Technique: TCP) 23

TCP Performance: A Simple Derivation

• Mathis et. Al: "The Macroscopic Behavior of the TCP

Congestion Avoidance Algorithm”

• Assume – a very simple loss model: periodical loss with

loss rate p– No timeout– Neglect the start-up behavior

04/18/23 Congestion Control (A Loss Based Technique: TCP) 24

TCP Performance: A Simple Derivation (2)cwnd

W

Startup Before

Stabiliza.

0loss

(RTT)W/2loss

Wloss

3W/2loss

W/2

04/18/23 Congestion Control (A Loss Based Technique: TCP) 25

TCP Performance (3)

• Facts:– A loss happens whenever packets are sent

(periodical loss model).– A loss happens every RTTs– The total number of packets sent every cycle (time

between consecutive 2 losses) is the area under the curve.

– The area is

p1

2W

2832

2212

2 WWW

04/18/23 Congestion Control (A Loss Based Technique: TCP) 26

TCP Performance (4)

• Facts (cont’d):– The number of packets delivered per cycle is – Solving,

– Throughput = # packets received per cycle/cycle

duration

– Throughput = (packets per second)

pW 38

p1

pRTT 231

04/18/23 Congestion Control (A Loss Based Technique: TCP) 27

Taking Into Account Timeout• Jitendra Padhye et. Al “Modeling TCP Reno Performance: A Simple Model

and Its Empirical Validation” .

• Wmax : Max window size (flow control)• RTT: round trip time• b = # of packets received by an ack.• p: probability of packet loss• To= Duration of first timeout

04/18/23 Congestion Control (A Loss Based Technique: TCP) 28

Shortcomings/Limits of TCP

• TCP is not suited for streams => how to exercise TCP like congestion control on streams (UDP)?

• TCP, as is, will not scale well to very high speeds => How to adapt TCP to very high speed networks?

04/18/23 Congestion Control (A Loss Based Technique: TCP) 29

Impact of Policies on Congestion Control

• Link Layer policies– Retransmission– Out-of-order caching– Acknowledgement– Flow control

04/18/23 Congestion Control (A Loss Based Technique: TCP) 30

Impact of Policies on Congestion Control (2)

• Network Layer policies– Virtual circuit/datagram– Packet scheduling– Queue management– Routing algorithm– Packet lifetime management

04/18/23 Congestion Control (A Loss Based Technique: TCP) 31

Impact of Policies on Congestion Control (3)

• Transport Layer policies– Retransmission– Out-of-order caching– Acknowledgement– Flow control– Timeout determination

04/18/23 Congestion Control (A Loss Based Technique: TCP) 32

Congestion Control in Packet Switched Networks

• Monitor some system state variable u

• u may be link utilization, loss rate

• Instantaneous unow

• Average value u computed as:– unew = .ulast + (1- ) unow

– 0 <= <= 1

• Use of thresholds

04/18/23 Congestion Control (A Loss Based Technique: TCP) 33

Techniques at Link Layer

• DECBit (Warning bit)

• Source Quench packets (choke packets)

• Hop-by-hop choke packets

• Load shedding

• RED