1 EE 122: Final Review Ion Stoica TAs: Junda Liu, DK Moon, David Zats ee122/fa09 (Materials with...

Preview:

Citation preview

1

EE 122: Final Review

Ion Stoica

TAs: Junda Liu, DK Moon, David Zatshttp://inst.eecs.berkeley.edu/~ee122/fa09

(Materials with thanks to Vern Paxson, Jennifer Rexford,and colleagues at UC Berkeley)

Announcements

Project 2 due Friday, Dec 11, 11:59pm

Final exam: Dec 17, 8-11am, 10 Evans Hall

My office hours next week My office hours: MW 10-11:30am The office hours of everyone else unchanged

Final Exam

Open book, open notes! Crib sheets ok if you like

Comprehensive, but greater focus on material since midterm

Questions similar in format to the first midterm Problem set-up descriptions + multipart fill-ins

All answers on the exam sheets we hand out Bring PENCIL, ERASER, no calculators needed

Outline

Persistent Oscillations TCP Multicast: DVRMP Token Bucket Integrated & Differentiated Services Routing in Chord

Routing: Persistent Oscillations

Assume link cost = amount of carried traffic

A

D

C

B

0 0

000 0

No traffic

A

D

C

B1 1

000 0

B to A: 1 unit of trafficD to A: 1 unit of traffic

1 1

A

D

C

B1 1+e

e10 0

CA: e units of traffic

1 1

e

Routing: Persistent Oscillations

Assume link cost = amount of carried traffic

A

D

C

B

1 1+e

e0

e

1 1

0 0

A

D

C

B2+e 0

001+e 1

B to A:cost(BCDA) = 1 lowerthan cost(BA) = 1+e

C to A:cost(CDA) = 1 lowerthan cost(CBA) = 1+2*e

1 1

e

B to A: switches to BCDA

C to A: switches to CDA

Routing: Persistent Oscillations

Assume link cost = amount of carried traffic

A

D

C

B

2+e 0

00

e

1 1

1+e 1

B to A:cost(BA) = 0 lower thancost(BCDA) = 4+2*eC to A:cost(CBA) = 0 lowerthan cost(CDA) = 3+2*eD to A:cost(DCBA) = 0 lowerthan cost(DA) = 2+e

B to A: switches to BA

C to A: switches to CBA

D to A: switches to DCBA

A

D

C

B0 2+e

1+e10 0

1 1

e

Routing: Persistent Oscillations

Assume link cost = amount of carried traffic

B to A:cost(BCDA) = 0 lower thancost(BCDA) = 4+2*eC to A:cost(CBA) = 0 lowerthan cost(CDA) = 3+2*eD to A:cost(DCBA) = 0 lowerthan cost(DA) = 2+e

B to A: switches to BCDA

C to A: switches to CDA

D to A: switches to DA

A

D

C

B0 2+e

1+e10 0

1 1

e

A

D

C

B2+e 0

e01+e 1

1 1

e

Outline

Persistent Oscillations TCP Wireless MAC Multicast: DVRMP Token Bucket Integrated & Differentiated Services Routing in CAN & Chord

TCP Congestion Control

Flow control keeps one fast sender from overwhelming a slow receiver

Congestion control keeps a set of senders from overloading the network

Three congestion control problems: Adjusting to bottleneck bandwidth

Without any a priori knowledge Could be a Gbps link; could be a modem

Adjusting to variations in bandwidth Sharing bandwidth between flows

11

The big picture (with timeouts)

Time

cwnd

Initially:cwnd = 1;ssthresh = infinite;

New ack received:if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1;else /* Congestion Avoidance */ cwnd = cwnd + 1/cwnd;

Timeout:/* Multiplicative decrease */ssthresh = cwnd/2;cwnd = 1;

12

The big picture (with timeouts)

Time

cwnd

SlowStart

Initially:cwnd = 1;ssthresh = infinite;

New ack received:if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1;else /* Congestion Avoidance */ cwnd = cwnd + 1/cwnd;

Timeout:/* Multiplicative decrease */ssthresh = cwnd/2;cwnd = 1;

13

The big picture (with timeouts)

Time

cwnd

Timeout

SlowStart

Initially:cwnd = 1;ssthresh = infinite;

New ack received:if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1;else /* Congestion Avoidance */ cwnd = cwnd + 1/cwnd;

Timeout:/* Multiplicative decrease */ssthresh = cwnd/2;cwnd = 1;

1/2 cwnd

ssthresh

14

The big picture (with timeouts)

Time

cwnd

Timeout

SlowStart

1/2 cwnd

ssthresh

Initially:cwnd = 1;ssthresh = infinite;

New ack received:if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1;else /* Congestion Avoidance */ cwnd = cwnd + 1/cwnd;

Timeout:/* Multiplicative decrease */ssthresh = cwnd/2;cwnd = 1;

SlowStart

15

The big picture (with timeouts)

Time

cwnd

Timeout

SlowStart

AIMD

ssthresh

SlowStart

1/2 cwnd

Initially:cwnd = 1;ssthresh = infinite;

New ack received:if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1;else /* Congestion Avoidance */ cwnd = cwnd + 1/cwnd;

Timeout:/* Multiplicative decrease */ssthresh = cwnd/2;cwnd = 1;

16

The big picture (with timeouts)

Time

cwnd

Timeout

SlowStart

AIMDTimeout

ssthresh

SlowStart

1/2 cwnd

Initially:cwnd = 1;ssthresh = infinite;

New ack received:if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1;else /* Congestion Avoidance */ cwnd = cwnd + 1/cwnd;

Timeout:/* Multiplicative decrease */ssthresh = cwnd/2;cwnd = 1;

17

The big picture (with timeouts)

Time

cwnd

Timeout

SlowStart

AIMDTimeout

ssthresh

SlowStart

SlowStart

AIMD

1/2 cwnd

Initially:cwnd = 1;ssthresh = infinite;

New ack received:if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1;else /* Congestion Avoidance */ cwnd = cwnd + 1/cwnd;

Timeout:/* Multiplicative decrease */ssthresh = cwnd/2;cwnd = 1;

18

The big picture (with timeouts)

Time

cwnd

AIMD

Timeout

SlowStart

AIMD

Initially:cwnd = 1;ssthresh = infinite;

New ack received:if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1;else /* Congestion Avoidance */ cwnd = cwnd + 1/cwnd;

Timeout:/* Multiplicative decrease */ssthresh = cwnd/2;cwnd = 1;

AIMD

SlowStart

sstresh

19

Congestion Detection Revisited

Wait for Retransmission Time Out (RTO) RTO kills throughput

In BSD TCP implementations, RTO is usually more than 500ms The granularity of RTT estimate is 500 ms Retransmission timeout is RTT + 4 * mean_deviation

Solution: Don’t wait for RTO to expire

20

Fast Retransmits

Resend a segment after 3 duplicate ACKs Duplicate ACK means

that an out-of sequence segment was received

Notes: ACKs are for next

expected packet Packet reordering can

cause duplicate ACKs Window may be too

small to get enough duplicate ACKs

ACK 2

segment 1cwnd = 1

cwnd = 2 segment 2segment 3

ACK 4cwnd = 4 segment 4

segment 5segment 6segment 7

ACK 3

3 duplicateACKs

ACK 4

ACK 4

ACK 4

21

Fast Retransmit and Fast Recovery

Retransmit after 3 duplicated acks Prevent expensive timeouts

Reduce slow starts At steady state, cwnd oscillates around

the optimal window size

Time

cwnd

Slow Start

AIMD

Fast retransmit

22

Fast Recovery: After a Fast Retransmit

ssthresh = cwnd / 2 cwnd = ssthresh

Instead of setting cwnd to 1, cut cwnd in half (multiplicative decrease)

For each dup ack arrival dupack++ Indicates packet left network, so we may be able to send more MaxWindow = min(cwnd + dupack, AdvWin)

Receive ack for new data (beyond initial dup ack) dupack = 0 Exit fast recovery

But when RTO expires still do cwnd = 1

Outline

Persistent Oscillations TCP Multicast: DVRMP Token Bucket Integrated & Differentiated Services Routing in CAN & Chord

Distance Vector Multicast Routing Protocol (DVRMP)

An elegant extension to DV routing Use shortest path DV routes to determine if link

is on the source-rooted spanning tree Three steps in developing DVRMP

Reverse Path Flooding Reverse Path Broadcasting Truncated Reverse Path Broadcasting

Reverse Path Flooding

What: node Y forwards packet from node X to all its neighbors

(except X), iff X is the next hop

of Y to source (A) How: just use unicast

routing tables Why: eliminate the

loops of simple flooding protocol

4

2

10

3

6

89

1

57

A

D

B

C

E

F

G

H

Unicast shortest path

Multicast data packets

Packets not forwarded

Reverse Path Flooding

What: node Y forwards packet from node X to all its neighbors

(except X), iff X is the next hop

of Y to source (A) How: just use unicast

routing tables Why: eliminate the

loops of simple flooding protocol

4

2

10

3

6

89

1

57

A

D

B

C

E

F

G

H

Unicast shortest path

Multicast data packets

Packets not forwarded

Duplicatepacket

Reverse Path Broadcasting

What: node X forwards packet to node Y iff X is next hop of Y to source (A)

How: X infers this info from routing messages (see multicast lecture)

Why: Avoid a router receiving duplicate packets

4

2

10

3

6

89

1

57

A

D

B

C

E

F

G

H

Unicast shortest path

Multicast data packets

Truncated Reverse Broadcasting

What: don’t forward packets to non-members

How: use prune messages

Why: eliminate un-needed forwarding

4

2

10

3

6

89

1

57

A

D

B

C

E

F

G

H

Unicast shortest path

Multicast data packets

Non-membership report

Subscription message

Truncated Reverse Broadcasting

What: don’t forward packets to non-members

How: use prune messages

Why: eliminate un-needed forwarding

4

2

10

3

6

89

1

57

A

D

B

C

E

F

G

H

Unicast shortest path

Multicast data packets

Non-membership report

Subscription message

Pruning Details

Prune (Source,Group) at leaf if no members Send Non-Membership Report (NMR) up tree

If all children of router R send NRM, prune (S,G) Propagate prune for (S,G) to parent R

On timeout: Prune dropped Flow is reinstated Down stream routers re-prune

Note: a soft-state approach

Outline

Persistent Oscillations TCP Multicast: DVRMP Token Bucket Integrated & Differentiated Services Routing in Chord

Token Bucket and Arrival Curve

Parameters r – average rate, i.e., rate at which tokens fill the bucket b – bucket depth R – maximum link capacity or peak rate (optional parameter)

A bit is transmitted only when there is an available token Arrival curve – maximum number of bits transmitted within an

interval of time of size t

r bps

b bits

<= R bps

regulatortime

bits

b*R/(R-r)

slope R

slope r

Arrival curve

Traffic Enforcement: Example r = 100 Kbps; b = 3 Kb; R = 500 Kbps

3Kb

T = 0 : 1Kb packet arrives

(a)

2.2Kb

T = 2ms : packet transmitted b = 3Kb – 1Kb + 2ms*100Kbps = 2.2Kb

(b)

2.4Kb

T = 4ms : 3Kb packet arrives

(c)

3Kb

T = 10ms : packet needs to wait until enough tokens are in the bucket!

(d)

0.6Kb

T = 16ms : packet transmitted

(e)

Source Traffic Characterization: Arrival Curve

Arrival curve – maximum amount of bits transmitted during any interval of time Δt

Use token bucket to bound arrival curve

Δt

bits

Arrival curve

time

bps

Arrival Curve: Example Arrival curve – maximum amount of bits

transmitted during any interval of time Δt Use token bucket to bound arrival curve

bitsArrival curve

time

bps

0 1 2 3 4 5

1

2

1 2 3 4 5

1

2

3

4

(R=2,b=1,r=1)

Δt

Per-hop Reservation End-host: specify

the arrival rate characterized by token-bucket with parameters (b,r,R) the maximum maximum admissible delay D

Router: allocate bandwidth ra and buffer space Ba such that no packet is dropped no packet experiences a delay larger than D

bits

b*R/(R-r)

slope rArrival curve

DBa

slope ra

Outline

Persistent Oscillations TCP Multicast: DVRMP Token Bucket Integrated and Differentiated Services Routing in CAN & Chord

Integrated Services

Provide service guarantees at a per-flow granularity

Reservation Protocol How service request gets from host to network

Admission control algorithm How network decides if it can accept flow

Packet scheduling algorithms How routers deliver service

Control Plane: Resource Reservation

SenderReceiver

Control Plane: Resource Reservation

SenderReceiver

Sender sends specificationof traffic profile

Control Plane: Resource Reservation

SenderReceiverPath established (or perhaps admission control denies path)

Control Plane: Resource Reservation

SenderReceiver

The receiver acceptsreservation request

Control Plane: Admission Control

SenderReceiver

Per-flow state(soft state)

SenderReceiver

Control Plane: Admission Control

Per-flow state on all routers in path

Data Plane

SenderReceiver

Per-flow classification on each router

Data Plane

SenderReceiver

Per-flow classification on each router

Data Plane

SenderReceiver

Per-flow scheduling on each router

Differentiated Services (DiffServ) Give some traffic better treatment than other

App. requirements: interactive vs. bulk transfer Economic arrangements: first-class versus coach

What kind of better service could you give? Fewer drops Lower delay Lower delay variation (jitter)

How to know which packets get better service? Bits in packet header

Deals with traffic in aggregate Provides weaker services But much more scalable

Diffserv Architecture

Ingress routers - entrance to a DiffServ domain Police or shape traffic Set Differentiated Service Code Point (DSCP) in IP header

Core routers Implement Per Hop Behavior (PHB) for each DSCP Process packets based on DSCP

IngressEgress

IngressEgress

DS-1 DS-2

Edge router Core router

Differentiated Services

Expedite Forwarding (EF) Give packet minimal delay and loss service P-bit denotes premium traffic

Assured Forwarding (AS) Packets are all serviced in order

Makes TCP implementations perform well But some packets can be marked as low-drop

Think of it as priority levels for dropping A-bit denotes assured traffic

Comparison to Best-Effort & Intserv

Best-Effort Diffserv Intserv

Service ConnectivityNo isolationNo guarantees

Per aggregate isolationPer aggregate guarantee

Per flow isolationPer flow guarantee

Service scope

End-to-end Domain End-to-end

Complexity No setup Long term setup Per flow steup

Scalability Highly scalable (nodes maintain only routing state)

Scalable(edge routers maintain per aggregate state; core routers per class state)

Not scalable (each router maintains per flow state)

Outline

Persistent Oscillations TCP Multicast: DVRMP Token Bucket Integrated & Differentiated Services Routing in CAN & Chord

Routing in CAN

O(d*N1/d) d: dimensions N: number of nodes

Example: route from S to D on a 2-dimensional grid d = 2 N = m x m Path length: 2*m =

2*N1/2

S

D

m

m

Routing in Chord using Fingers

Finger i at node n:

80 + 2080 + 21

80 + 22

80 + 23

80 + 24

80 + 25

(80 + 26) mod 27 = 160

32

4580

20112

96

i ft[i]0 961 962 963 964 96

5 1126 20

)2(mod2 min

5570

Routing in Chord using Fingers

Route length: O(log N) N: number of nodes

Justification: every hop reduces the distance to destination by at least half

0

32

4580

20112

96

5570

S

D

Recursive vs. Iterative Routing

0

32

4580

20112

96

5570

S

D

0

32

4580

20112

96

5570

S

D

12

3

1

2

3

Recursive Iterative

Final Exam

Open book, open notes! Crib sheets ok if you like

Comprehensive, but greater focus on material since midterm

Questions similar in format to the first midterm Problem set-up descriptions + multipart fill-ins

All answers on the exam sheets we hand out Bring PENCIL, ERASER, no calculators needed

Recommended