Title: 048866: Packet Switch Architectures
1048866 Packet Switch Architectures
MSM (Maximum Size Matching) and MWM (Maximum
Weight Matching)
- Dr. Isaac Keslassy
- Electrical Engineering, Technion
- isaac_at_ee.technion.ac.il
- http//comnet.technion.ac.il/isaac/
2Achieving 100 throughput
- Switch model
- Uniform traffic
- Technique Uniform schedule (easy)
- Non-uniform traffic, but known traffic matrix
- Technique Non-uniform schedule (Birkhoff-von
Neumann) - Unknown traffic matrix
- Technique Lyapunov functions (MWM)
- Faster scheduling algorithms
- Technique Speedup (maximal matchings)
- Technique Memory and randomization (Tassiulas)
- Technique Twist architecture (buffered crossbar)
- Accelerate scheduling algorithm
- Technique Pipelining
- Technique Envelopes
- Technique Slicing
- No scheduling algorithm
- Technique Load-balanced router
3Unknown Traffic Matrix
- We want to maximize throughput
- Traffic matrix unknown ? cannot use BvN
- Idea maximize instantaneous throughput
- In other words transfer as many packets as
possible at each time-slot - Maximum Size Matching (MSM) algorithm
4Maximum Size Matching (MSM)
- MSM maximizes instantaneous throughput
- MSM algorithm among all maximum size matches,
pick a random one
Q11(n)gt0
Maximum Size Match
QN1(n)gt0
Bipartite Match
Request Graph
5Question
- Is the intuition right?
- Answer No, there is a counter-example for which,
in a given VOQ (i,j), ?ij lt ?ij
6Counter-example
Consider the following non-uniform traffic
pattern, with Bernoulli IID arrivals
Three possible matches, S(n)
7Simulation of simple 3x3 example
8Idea Use Lyapunov
9Some definitions
10Some definitions
11Problem
12Maximum Weight Matching (MWM)
S(n)
Q11(n)
A11(n)
A1(n)
D1(n)
1
1
A1N(n)
LQF MWM Algorithm
AN1(n)
AN(n)
DN(n)
ANN(n)
N
N
QNN(n)
Q11(n)
Maximum Weight Match
QN1(n)
Bipartite Match
Request Graph
13Outline of Proof
Note proof based on paper by McKeown et al.
14Proof
- Lets prove
- First, well work with the approximate Lyapunov
function - Well assume that there exists some ? such that
- For all i, ?j ?ij 1-?
- For all j, ?i ?ij 1-?
- In other words, ? (1-?) ?m with ?m doubly
stochastic
15Proof
16Proof
17Proof
- We worked with the approximate Lyapunov function
- Now, lets work with the real Lyapunov function,
and show that
18End of Proof
19Review of Proof
20Review of Proof
21LQF (Longest Queue First)
- LQF is the name given to the maximum weight
matching, where weight wij(n) Lij(n). - But the name is so bad that people keep the name
MWM! - LQF doesnt necessarily serve the longest queue.
- LQF can leave a short queue unserved
indefinitely. - However, MWM-LQF is very important theoretically
most (if not all) scheduling algorithms that
provide 100 throughput for unknown traffic
matrices are variants of MWM!
22LQF (Longest Queue First)
- Question what if or
- What if weight wij(n) Wij(n) (waiting time)?
- Preference is given to cells that have waited a
long-time. - Is it stable?
- We call the algorithm OCF (Oldest Cell First).
- Remember that it doesnt guarantee to serve the
oldest cell!
23OCF (Oldest Cell First)
Cij(n)
Cij(nl)
Wij(n)
n
nl
tij(n)
Cij(n)
Cij(nl)
24Rough outline of proof
Expectation given W(n)
Note full proof in paper by McKeown et al.
25Implementing MSM
- How can we find maximum size matches?
- We do so by recasting the problem as a network
flow problem
26Network Flows
a
c
Source s
Sink t
b
d
- Let G V,E be a directed graph with capacity
cap(v,w) on edge v,w. - A flow is an (integer) function, f, that is
chosen for each edge so that - We wish to maximize the flow allocation.
27A maximum network flow exampleBy inspection
a
c
Source s
Sink t
b
d
Step 1
28A maximum network flow example
Step 2
a
c
10, 10
Source s
Sink t
10, 10
1
10, 10
1
10, 1
b
d
10, 1
1, 1
Flow is of size 101 11
29Ford-Fulkerson Method of Augmenting Paths
- Set f(v,w) -f(w,v) on all edges.
- Define a Residual Graph, R, in which res(v,w)
cap(v,w) f(v,w) - Find paths from s to t for which there is
positive residue. - Increase the flow along the paths to augment them
by the minimum residue along the path. - Keep augmenting paths until there are no more to
augment.
30Example of Residual Graph
a
c
10, 10
10, 10
1
10, 10
s
t
10
1
10
b
d
1
Flow is of size 10
Residual Graph, R
res(v,w) cap(v,w) f(v,w)
a
c
10
10
10
1
t
s
10
1
10
b
d
1
Augmenting path
31Example of Residual Graph
Step 2
a
c
10, 10
s
t
10, 10
1
10, 10
1
10, 1
b
d
10, 1
1, 1
Flow is of size 101 11
Residual Graph
a
c
10
s
t
10
10
1
1
1
1
b
d
9
1
9
32Complexity of network flow problems
- In general, it is possible to find a solution by
considering at most V.E paths, by picking
shortest augmenting path first. - There are many variations, such as picking most
augmenting path first.
33Finding a maximum size match
- How do we find the maximum size match?
34Network flows and bipartite matching
A
1
B
2
Sink t
Source s
3
C
4
D
5
E
6
F
- Finding a maximum size bipartite matching is
equivalent to solving a network flow problem with
capacities and flows of size 1.
35Example Maximum Size MatchingFord-Fulkerson
method
Residual Graph for first three paths
A
1
B
2
t
s
3
C
4
D
5
E
6
F
36Example Maximum Size MatchingFord-Fulkerson
method
Residual Graph for next two paths
A
1
B
2
t
s
3
C
4
D
5
E
6
F
37Example Maximum Size MatchingFord-Fulkerson
method
Residual Graph for augmenting path
A
1
B
2
t
s
3
C
4
D
5
E
6
F
38Example Maximum Size MatchingFord-Fulkerson
method
Residual Graph for last augmenting path
A
1
B
2
t
s
3
C
4
D
5
E
6
F
Note that the path augments the match no input
and output is removed from the match during the
augmenting step.
39Example Maximum Size MatchingFord-Fulkerson
method
Maximum flow graph
A
1
B
2
t
s
3
C
4
D
5
E
6
F
40Example Maximum Size MatchingFord-Fulkerson
method
Maximum Size Matching
A
1
B
2
3
C
4
D
5
E
6
F
41LPF (Largest Port First)
Note full proof in paper by Mekkitikul and
McKeown
42LPF