Top Banner
• PS2 is out, due Oct 15 Email [email protected] by tomorrow – your project team-list – bi-weekly meeting (wed 5-6pm, fri 5-6pm) • No class next Monday, proposal due
45

PS2 is out, due Oct 15 Email [email protected] by [email protected] –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Jan 15, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

• PS2 is out, due Oct 15

• Email [email protected] by tomorrow– your project team-list– bi-weekly meeting (wed 5-6pm, fri 5-6pm)

• No class next Monday, proposal due

Page 2: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Congestion control & Resource management

Page 3: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

It is important to control load

• Scenario: ISP buys an expensive cross country link– Underload: idle link, waste of money– Overload: equally bad…

• Buy a fatter “pipe”?– Expensive; pipe is never fat enough– How to measure load?

Page 4: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Queues smooth bursty traffic

• Data traffic is bursty• What if avg load < capacity < peak load?• Queues smooth load

– Buffer grows when load > capacity– Buffer drains when load < capacity

• Is a bigger queue always better?

Page 5: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Bad things could happen upon overload …

• Scenario: Load >> capacity

• Router queue grows– Long queuing delay

• Sender retransmits after incurring timeout• Retransmissions make the queues longer• Useful throughput --> zero

Page 6: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Congestion collapse

goodput

Avg offered load

Queues start building up

Congestion collapse

Link utilization increases with load

Page 7: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Our goal

goodput

Avg offered load

Stay here!•Low queuing delay•High utilization•No danger of collapse

Page 8: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Congestion control strategies

• End-to-end (TCP)– Routers give minimal feedback

• e.g. drops with FIFO queue

– Sources control load based on feedback

• Router-assisted

Page 9: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

A strawman

4 pkt/sec

R1 R2

10 pkt/sec

• Host A sends a packet, waits for an ACK, sends a packet etc.• How fast does A send when both A->B and C->D flows are active?• How fast does A send when C->D goes away?• Ack “clocks” packet transmission (conservation of packets)

AB

C D

Page 10: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Strawman under-utilizes link with non-negligible RTT

• RTT 0.5s, link speed 4 packets/sec• Strawman’s throughput?

– 1/0.5 = 2 pkts/sec << link speed

AB

Page 11: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Control send rate w/ window size

• Allow w un-acknowledged packets in flight

• Send rate: w /RTT

• Change w to:– Keep long-delay networks busy– Adjust send rate to available b/w

Page 12: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

What is the right w?

• Let the network tell end hosts?– Not always possible, e.g. cable modem is not

an IP router

• Try different w’s and see which is best?

• Can we use the same w over time?

Page 13: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Try some w, adjust as we go

• When should we increase w?– If current w works well, try a bigger one

• When should we decrease w?– When we hit link capacity (i.e. see drops)– Can we squeeze more b/w out of our

competitors?

Page 14: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

How to adjust w?

• Simple ways to increase/decrease w– MI: Increase w by 10%– AI: Increase w by 10 pkts– MD: Decrease w by 50%– AD: Decrease w by 10 pkts

Page 15: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

AI or MI, AD or MD?

• Some intuitive arguments– AI: too slow at high speed, too fast at low speed

– MI: scales better with link speed

– AD: does not slow down fast enough, esp. when another connection starts

– MD: when overload, queues grow exponentially, MD also cuts down load exponentially.

Page 16: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Why AIMD? Goals of congestion control

• Scalable– Should work well in any situations

• Efficient– High link utilization w/o danger of congestion collapse

• Fair– Ideally, all users obtain equal share

• Distributed operation• Convergence

Page 17: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Why AIMD? [Chiu,Jain 89]

User1’s b/w

User2’s b/w

Optimal fairnessx1 = x2

optimal efficiencyx1+x2 = link speed

Our goal: optimal fairness and efficiency

Page 18: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

MIMD does not converge to fairness

User1’s b/w

User2’s b/w

Page 19: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

AIMD converges to optimal fairness and efficiency

Page 20: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

TCP

• At equilibrium: AIMD– AI: w = w+1– MD: w = w/2 upon loss

• To bootstrap: – slow start: w = 2w

• How to use ack to “clock” adjustments to w?– Upon receiving an ack: w += 1/w

Page 21: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Evolution of TCP’s congestion windowW

Wmax/2

Wmax

time

Page 22: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

How much buffer space is needed?

• Bigger buffer is not always good– Expensive and results in longer delay

• Smaller buffer is also not good– Might not fully utilize the link

• At any time, – Q + b/w * RTT =

wii

Homework question: calculate buffer space required for 100% utilization

Page 23: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Loss rate vs. TCP throughput

= O( )

Wmax/2

Wmax

1

rtt p

In one epoch, TCP sendswmax/2 + (wmax/2 + 1) + … wmax ≈ pkts

So, loss rate p =

3

8wmax2

8

3wmax2

Avg window is(wmax/2 + wmax)/2 =

So, throughput =

3

4wmax

3wmax4 • rtt

Page 24: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Loss rate vs. # of connections

• TCP uses loss as a signal to adjust rate

• N connections, each gets share of b/w

=O(b

n) =O(

1

rtt p)

p =O(n2) €

1

n

Page 25: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Some concrete numbers

• A very slow modem with 8 pkts queue

• TCP window varies from 4 to 8 pkts

• Loss rate? 1/(4+5+…+8) = 3.3%

• A second TCP starts, each TCP window varies from 2 to 4 pkts

• Loss rate? 1/(2+3+4) = 11% !!

Page 26: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

TCP-friendly congestion control

• Not all protocols use window-based congestion controls

• To compete fairly with TCP, one must send at rates

1

p

Page 27: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Congestion control & resource management

• End-to-end (TCP)

• Router-assisted resource management– Explicit congestion notification– Active queue management

Page 28: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Why add “smarts” to routers?

1. Congestion avoidance instead of control– Routers have the most information about congestion

2. Fair queueing– Isolation

• End-to-end schemes cannot prevent a mishaving flow from affecting others

– Quality of Service (QoS)• Ensure desired delay, rate, jitter etc.

Page 29: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Routers’ “bag of tricks”

• Congestion signaling– Tell sources if congestion occurs (about to

occur), or how much to send

• Buffer management– Decide which packets to drop/mark

• Scheduling– Which packets get priority to send over others

Page 30: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

#1 Better congestion control w/ routers’ help

• Can routers alone solve congestion control?– No!– End points must still curb send rate based on

router feedback

Page 31: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Congestion signalling

• Packet drop– One bit information (binary)

• Marking packets– Set one or more bits in header, echoed by

ACKs

Page 32: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

RED (random early detection)[Floyd, Jacobson 93]

Drop-fail queues drop packets from multiple connections in burst• all connections cut w simultaneously,

resulting in link underutilization

• Key idea: • Drop/mark packets before queue is full• When min< qa< max, mark packets with pa

Avg queue length,calculated using EWMA

Varies between 0 and increases as qa increases

pmax

Page 33: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

XCP [Katabi et al, 02]

• Key ideas:– router explicitly allocates rate for each flow– Separate efficiency control from fairness control

Page 34: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Summary: congestion control techniques

• Drop-tail queue + TCP– Binary feedback when congestion happens

• RED + TCP– Binary feedback before congestion

• XCP– Precise feedback (many bits of information)

Page 35: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

What if end hosts cheat?

• Cheating senders

• Cheating receivers

Page 36: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Why add “smarts” to routers?

1. Better congestion control

2. Fair queueing

Page 37: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Why scheduling?

• Fairness– Drop-tail (FIFO)/RED do not guarantee fairness

among flows– Abusive flows get more b/w by sending more

• Differentiated service– Different flows have different requirements– Real time video conference desires low delay, low

jitter

Page 38: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Anatomy of a router

CheckIPHeader

LookupIPRoute

Classifier Classifier

Scheduler Scheduler

ToDevice(eth0) ToDevice(eth1)

Classify packets according to ToS field, individual connection or aggregate flows

Buffer management: whether to drop/mark packets

Which queue and which of the packets to send next

Page 39: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

A simple fair scheduler: round-robin (RR)

• How? – Serve packets in round-robin order, skip

empty queues

• If a flow sends at faster than 1/n rate?

• If a flow sends less than 1/n rate?

• RR tries to achieve max-min fairness

Page 40: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Is RR really fair?

• What if packets have different sizes?

• We want fairness at bit-level

Page 41: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Bit-level round robin

• Idea: – assign round # to start and finish of a packet

according to bit-level RR– Send packet with the smallest finish round #

Page 42: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

S:0F:20

Bit-level RR example

S:0F:1460

S:0F:100

Current round = 0

S:100F:600

20

S:20F:520

1005206001460

Page 43: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

FQ is too complex for fast routers

• Lots of state– 100,000 flows are common in core routers

• High speed processing– 50ns to process each packet for a 10Gbps link

• Only reasonable to implement FQ at low speed, at edge routers

Page 44: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Core stateless fair queueing(CSFQ)

• Stoica et. al. (suggested reading list)

Edge routers keep track of per-flow state: mark input ratesin packet header (dynamic packet state)

Core routers are stateless: emulate FQ by dropping a flow’s packets with the right probability according to its input rate

Page 45: PS2 is out, due Oct 15 Email jinyang@cs.nyu.edu by tomorrowjinyang@cs.nyu.edu –your project team-list –bi-weekly meeting (wed 5-6pm, fri 5-6pm) No class.

Summary

• Congestion control– End-to-end + FIFO queue– End-to-end + router assisted

• Fair queueing– Forcing (giving incentives to) endpoints to

send at fair share