Lecture 6: Switching
Nick McKeown
CS244
Advanced Topics in Networking
Spring 2020
“High-speed switch scheduling for local-area networks”
[Tom Anderson, Susan Owicki, James Saxe, Chuck Thacker. 1993]
CS244 Advanced Topics in Networking Lecture 6: Switching Nick - - PowerPoint PPT Presentation
CS244 Advanced Topics in Networking Lecture 6: Switching Nick McKeown High-speed switch scheduling for local-area networks [Tom Anderson, Susan Owicki, James Saxe, Chuck Thacker. 1993] Spring 2020 Context Tom Anderson James B. Saxe At
Nick McKeown
Spring 2020
“High-speed switch scheduling for local-area networks”
[Tom Anderson, Susan Owicki, James Saxe, Chuck Thacker. 1993]
2
Tom Anderson
At the time: DEC SRC (Palo Alto) Professor of CS, University of Washington Previously: UC Berkeley, EECS
Susan Owicki
At the time: DEC SRC (Palo Alto) Before that: Prof of EE & CS, Stanford Today: Marriage and Family Therapist, Palo Alto
James B. Saxe
At the time: DEC SRC (Palo Alto) After that: Compaq and HP Labs
?
Chuck Thacker (d. 2017)
At the time: DEC SRC (Palo Alto) Before that: Xerox PARC (“Alto”) After that: Microsoft 2010 Turing Award Winner
At the time the paper was written…
4
𝜇 R = line rate.
e.g. 100M bit/s, 10Gb/s
Observation: With one arrival “line” at the same rate, the queue is always empty (or at most one store-and-forward packet). The arrival process is “bounded” by R.
Q: For any “load” what arrival pattern leads to the most customers in the queue?
𝜇 ≤ 1,
Packet buffer
R R
time
Cumulative arrivals, A(t)
R gradient R
≤
Cumulative bits
R R
( 𝜇 2 )
R
( 𝜇 2 )
Q: For any “load” what arrival pattern leads to the most customers in the queue?
𝜇 ≤ 1,
time
Cumulative arrivals, A(t)
R gradient R
≤ 2
Cumulative bits
2R
q(t)
Observation: The arrival rate is “bounded” by R on average.
5 time, s
0.5 1 1.5 2
1
line 1 line 2 Q: How big does the buffer need to be?
time, s
0.5 1 1.5 2
2
line 1 line 2 Q: How big does the buffer need to be?
time
1hr 2hr 3hr 4hr
3
line 1 line 2 Q: How big does the buffer need to be?
Observation: For a given arrival rate, in order to know the queueing delay, we need to know the pattern (or “process”) of arrivals.
6
2 3 4 1 N … … …
A switch, or router, with N “ports”. Each port runs at rate R b/s.
We say the “switching capacity” is N x R b/s.
R R R
R R
1
R R R R R R
2 3 N …
7
R R
1
R R R R R R
2 3 N … Properties of an OQ switch
packets at rate N x R.
Consequences
packet in the system, its output is busy sending a packet. No unnecessary idling.
capacity.
8
R R
1
R R R R R R
2 3 N …
0.1 . 2 0.2 0.4
Traffic matrix,
is the fraction of traffic from input i to output j
𝜇𝑗,𝑘
0.1 0.2 0.2 0.4 0.2 0.3 0.1 0.1 1.0 0.0 0.0 0.0 0.1 0.4 0.3 0.1
For example: Λ =
Note that the row (input) sum: ∑
𝑘
𝜇𝑗,𝑘 ≤ 1, ∀𝑗
Uniform Traffic Matrix:
Λ = 𝜇
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
𝑥h𝑓𝑠𝑓: 𝜇 ≤ 1/𝑂
∑
𝑗
𝜇𝑗,𝑘 ≤ 1, ∀𝑘
Total traffic rate to each
≤ 1
𝑏 𝑜 𝑒 𝑡 𝑢 𝑗 𝑚𝑚 :∑ 𝑘 𝜇𝑗,𝑘 ≤ 1, ∀𝑗
Non-oversubscribed TM:
Put another way, an OQ switch can “keep up” with any reasonable traffic matrix we throw at it.
𝑗
9
10
R R
1
R R R R R R
2 3 N … Properties of an IQ switch
packets at rate R (instead of N x R).
Consequences
ahead destined to a different output.
conserving”. It can unnecessarily idle.
12
IQ switch with uniform traffic matrix, 𝜇 ≤ 1
Load, 𝜇 Delay, d
1 0.5
3/2
0.75
5/2
Poisson arrivals:
𝐹(𝑒) = 1 2 ( 2 − 𝜇 1 − 𝜇)
O Q S w i t c h
0.58 Poisson arrivals:
𝜇 ≤ 2 − 2 ≈ 58%
Observation: HOL Blocking means we lose 42% of the switching capacity
I Q S w i t c h
Karol ‘87
13
R R
1
R R R R R R
2 3 N … 𝜇 𝜈
R R
𝜇, 𝜈 ≤ 1
Arrival rate Departure rate
𝜇R
R
Arrival rate Departure rate
OQ switch 𝜇 0.58
R R
Arrival rate Departure rate
IQ switch uniform TM, Poisson
15
16
𝜇 0.58
R R
Arrival rate Departure rate
IQ switch uniform TM, Poisson ? 𝜇R
R
Arrival rate Departure rate
IQ switch with VOQs
Any TM, Any arrivals
17
18
R R
1
R R R R R R
2 3 N …
N2 VOQs crossbar
…
R R R R
1 2 3 N
R
1
R R R
2 3 N …Observation: scheduling is
equivalent to choosing a permutation.
19
N2 VOQs crossbar
bipartite request graph bipartite match
e.g. “maximum size match”
20
crossbar
Fixed cycle of permutations:
crossbar crossbar crossbar
( 𝜇 𝑂)
R
( 1 𝑂 )
R , therefore arrival rate departure rate. True for all VOQs, therefore 100% throughput for uniform TM
𝜇 ≤ 1
≤
uniform TM schedule
1. Cycle through permutations in “round-robin” (i.e. previous slide). 2. Each time, randomly pick one of the permutations in (1). 3. Each time, pick a permutation uniformly and at random from all possible N! permutations. 4. Wait until all VOQs are non-empty, then pick any algorithm above.
21
23
R R
1
R R R R R R
2 3 N … Properties of an IQ switch
packets at rate R (instead of N x R).
Consequences
packet ahead destined to a different output.
conserving”. It can unnecessarily idle.
24
IQ switch with uniform traffic matrix, 𝜇 ≤ 1
Load, 𝜇 Delay, d
1 0.5
3/2
0.75
5/2
Poisson arrivals:
𝐹(𝑒) = 1 2 ( 2 − 𝜇 1 − 𝜇)
O Q S w i t c h
0.58 Poisson arrivals:
𝜇 ≤ 2 − 2 ≈ 58%
Observation: HOL Blocking means we lose 42% of the switching capacity
I Q S w i t c h
Karol ‘87
1. Cycle through permutations in “round-robin”. 2. Each time, randomly pick one of the permutations in (1). 3. Each time, pick a permutation uniformly and at random from all possible N! permutations. 4. Wait until all VOQs are non-empty, then pick any algorithm above.
25
Because in practice, arrivals are not uniform. (If know the matrix, we can still create a cycle of permutations to serve every VOQ at the rate in the traffic matrix). In practice we don’t know the traffic matrix. Hence, PIM….
A maximal bipartite match
1 2 3 4 1 2 3 4
Request
1 2 3 4 1 2 3 4
Grant uar selection
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
Accept uar selection Iteration 1:
1 2 3 4 1 2 3 4
Iteration 2:
1 2 3 4 1 2 3 4
Q: Are we done? Q: Is a larger match possible?
A maximal match is guaranteed to be at least half the cardinality (size) of a maximum match.
Q: How large is a maximal match compared to a maximum match?
Parallel Iterative Matching
Simulation 16-port switch Uniform traffic matrix I Q + F I F O VOQ + Maximum Size Match Output Queued
Note log scale
Parallel Iterative Matching
PIM with
Simulation 16-port switch Uniform traffic matrix I Q + F I F O VOQ + Maximum Size Match Output Queued
Parallel Iterative Matching
PIM with
Simulation 16-port switch Uniform traffic matrix PIM with four iterations I Q + F I F O
VOQ + Maximum Size Match
Output Queued
Requesting inputs receiving no other grants Requesting inputs receiving
k n-k
j
w.p. k n, all requests to j are resolved 1− k n, at most k remain unresolved ⎧ ⎨ ⎪ ⎩ ⎪ E Num unresolved requests
[ ]≤ k
n⋅ 0 + 1- k n ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ ⋅ k ≤ n 4 , because 1− a
( )⋅ a ≤ 1
4 , when a <1 Therefore, 3/4 of all requests are resolved each iteration. (It follows that the number of iterations ≤ log2N + 4 3) w.p. k n, all requests to j are resolved 1− k n, at most k remain unresolved ⎧ ⎨ ⎪ ⎩ ⎪ E Num unresolved requests
[ ]≤ k
n⋅ 0 + 1- k n ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ ⋅ k ≤ n 4 , because 1− a
( )⋅ a ≤ 1
4 , when a <1 Therefore, 3/4 of all requests are resolved each iteration. (It follows that the number of iterations ≤ log2N + 4 3)
the total matching weight (e.g. weight is VOQ occupancy)
34
M, Walrand and Anantharam, 1996
35
N2 VOQs
bipartite request graph bipartite match
“maximum WEIGHT match” crossbar 1 2 3 1 3
Observation: give preference to longer VOQs Leads to 100% throughput for any traffic matrix.
𝑀𝑗,𝑘 = 3
Choose matching
that maximizes
𝑁
∑
𝑗,𝑘∈𝑁
𝑀𝑗,𝑘
transfer two cells per cell time)
36
Intuition: Because maximal match is at least half the size of a maximum match, running twice as fast compensates for it.
Dai and Prabhakar, 2000
37
C-S Chang, 2001
38
N2 VOQs crossbar
…
R R R R
1 2 3 N
R
1
R R R
2 3 N …
Intuition: If uniform traffic is so easy, can I make non-uniform traffic “sufficiently uniform”?
Fixed cycle of permutations
R
1
R R R
2 3 N …
Fixed cycle of permutations
39
N2 VOQs
…
R R R R
1 2 3 N
R
1
R R R
2 3 N …
R/N R/N R/N R/N
Deceptively simple but works for non-uniform traffic! Q: Where is the switching taking place? Q: Can packets be mis-sequenced?