420 likes | 535 Views
048866: Packet Switch Architectures. MSM (Maximum Size Matching) and MWM (Maximum Weight Matching). Dr. Isaac Keslassy Electrical Engineering, Technion isaac@ee.technion.ac.il http://comnet.technion.ac.il/~isaac/. Achieving 100% throughput. Switch model Uniform traffic
E N D
048866: Packet Switch Architectures MSM (Maximum Size Matching) and MWM (Maximum Weight Matching) Dr. Isaac Keslassy Electrical Engineering, Technion isaac@ee.technion.ac.il http://comnet.technion.ac.il/~isaac/
Achieving 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 048866 – Packet Switch Architectures
Unknown Traffic Matrix • We want to maximize throughput • Traffic matrix unknown cannot use BvN • Idea: maximize instantaneousthroughput • In other words: transfer as many packets as possible at each time-slot • Maximum Size Matching (MSM) algorithm 048866 – Packet Switch Architectures
Maximum Size Matching (MSM) MSM maximizes instantaneous throughput MSM algorithm: among all maximum size matches, pick a random one Q11(n)>0 Maximum Size Match QN1(n)>0 Bipartite Match Request Graph 048866 – Packet Switch Architectures
Question • Is the intuition right? • Answer: No, there is a counter-example for which, in a given VOQ (i,j), ij < ij 048866 – Packet Switch Architectures
Counter-example Consider the following non-uniform traffic pattern, with Bernoulli IID arrivals: Three possible matches, S(n): 048866 – Packet Switch Architectures
Simulation of simple 3x3 example 048866 – Packet Switch Architectures
Idea: Use Lyapunov 048866 – Packet Switch Architectures
Some definitions 048866 – Packet Switch Architectures
Some definitions 048866 – Packet Switch Architectures
Problem 048866 – Packet Switch Architectures
Maximum 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 048866 – Packet Switch Architectures
Outline of Proof Note: proof based on paper by McKeown et al. 048866 – Packet Switch Architectures
Proof • Let’s prove: • First, we’ll work with the approximate Lyapunov function • We’ll 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 048866 – Packet Switch Architectures
Proof 048866 – Packet Switch Architectures
Proof 048866 – Packet Switch Architectures
Proof • We worked with the approximate Lyapunov function • Now, let’s work with the real Lyapunov function, and show that 048866 – Packet Switch Architectures
End of Proof 048866 – Packet Switch Architectures
Review of Proof 048866 – Packet Switch Architectures
Review of Proof 048866 – Packet Switch Architectures
LQF (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 doesn’t 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! 048866 – Packet Switch Architectures
LQF (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 doesn’t guarantee to serve the oldest cell! 048866 – Packet Switch Architectures
OCF (Oldest Cell First) Cij(n) Cij(n+l) Wij(n) n n+l tij(n) Cij(n) Cij(n+l) 048866 – Packet Switch Architectures
Rough outline of proof Expectation given W(n) Note: full proof in paper by McKeown et al. 048866 – Packet Switch Architectures
Implementing MSM • How can we find maximum size matches? • We do so by recasting the problem as a network flow problem 048866 – Packet Switch Architectures
Network Flows 10 10 10 1 10 1 10 1 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. 048866 – Packet Switch Architectures
A maximum network flow exampleBy inspection 10 10 10 1 10 1 10 1 a c 10, 10 Source s Sink t 10, 10 1 10, 10 10 1 10 b d 1 Flow is of size 10 a c Source s Sink t b d Step 1: 048866 – Packet Switch Architectures
A maximum network flow example Not obvious Maximum flow: a c 10, 9 Source s Sink t 10, 10 1,1 10, 10 1,1 10, 2 b d 10, 2 1, 1 Flow is of size 10+2 = 12 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 10+1 = 11 048866 – Packet Switch Architectures
Ford-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. 048866 – Packet Switch Architectures
Example 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 s t 10 1 10 b d 1 Augmenting path 048866 – Packet Switch Architectures
Example 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 10+1 = 11 Residual Graph a c 10 s t 10 10 1 1 1 1 b d 9 1 9 048866 – Packet Switch Architectures
Complexity 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. 048866 – Packet Switch Architectures
Finding a maximum size match How do we find the maximum size match? A 1 2 B 3 C 4 D 5 E 6 F 048866 – Packet Switch Architectures
Network flows and bipartite matching Finding a maximum size bipartite matching is equivalent to solving a network flow problem with capacities and flows of size 1. A 1 2 B Sink t Source s 3 C 4 D 5 E 6 F 048866 – Packet Switch Architectures
Example: Maximum Size MatchingFord-Fulkerson method Residual Graph for first three paths: A 1 2 B t s 3 C 4 D 5 E 6 F 048866 – Packet Switch Architectures
Example: Maximum Size MatchingFord-Fulkerson method Residual Graph for next two paths: A 1 2 B t s 3 C 4 D 5 E 6 F 048866 – Packet Switch Architectures
Example: Maximum Size MatchingFord-Fulkerson method Residual Graph for augmenting path: A 1 2 B t s 3 C 4 D 5 E 6 F 048866 – Packet Switch Architectures
Example: Maximum Size MatchingFord-Fulkerson method Residual Graph for last augmenting path: A 1 2 B 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. 048866 – Packet Switch Architectures
Example: Maximum Size MatchingFord-Fulkerson method Maximum flow graph: A 1 2 B t s 3 C 4 D 5 E 6 F 048866 – Packet Switch Architectures
Example: Maximum Size MatchingFord-Fulkerson method Maximum Size Matching: A 1 2 B 3 C 4 D 5 E 6 F 048866 – Packet Switch Architectures
LPF (Largest Port First) Note: full proof in paper by Mekkitikul and McKeown 048866 – Packet Switch Architectures
LPF 048866 – Packet Switch Architectures