CS244a: An Introduction to Computer Networks

Download Report

Transcript CS244a: An Introduction to Computer Networks

Algorithm Qualifying Examination Orals
Achieving 100% Throughput in IQ/CIOQ Switches
using Maximum Size and Maximal Matching Algorithms
High Performance
Switching and Routing
Telecom Center Workshop: Sept 4, 1997.
Sundar Iyer
Stanford University
[email protected]
www.stanford.edu/~sundaes
Algorithm Orals 2002
1
Outline


Introduction
Part-I: Properties of Maximum Size Matching
(MSM) in an IQ switch



Stability of critical MSM for any Bernoulli i.i.d. traffic
Stability of MSM for Bernoulli i.i.d. uniform traffic
Part-II: Properties of Maximal Matching (MXM) in
a CIOQ switch

A simple proof for stability
Algorithm Orals 2002
2
Simple Model of a Switch
R
R
R
R
Port 1, input
Port 1, output
Port 2, input
Port 2, output
Port 3, input
Port 3, output
Port 4, input
Port 4, output
R
R
R
R
Example: Output Queued Switch
Algorithm Orals 2002
3
Input Queued Switch Model
VOQs
R
Port 1, input
Crossbar
1
1
Port N, input
R
Port 1, output
R
Port 4, output
N
N
R
Example: Input Queued Switch with virtual output queues (VOQs)
Algorithm Orals 2002
4
Relation to a Graph Matching
VOQs
1
1
1
42
1
0
2
0
1
0
3
0
5
2
3
1
2
1
2
3
3
1
2
1
2
3
3
1
2
1
2
3
3
Algorithm Orals 2002
5
Classes of Scheduling Algorithms

Maximum Weight Matching (MWM)



Choose a matching which maximizes the weight of the
matching
MWM gives 100% throughput
Maximum Size Matching (MSM)

Choose a matching which maximizes the size of the
matching
Algorithm Orals 2002
6
Outline


Introduction
Part-I: Properties of Maximum Size Matching
(MSM) in an IQ switch



Stability of critical MSM for any Bernoulli i.i.d. traffic
Stability of MSM for Bernoulli i.i.d. uniform traffic
Part-II: Properties of Maximal Matching (MXM) in
a CIOQ switch

A simple proof for stability
Algorithm Orals 2002
7
MSM is Unstable
1
1
Switch schedule based on MSM
T=1
N
N
1
T=2 ……….
1
1
1
1
1
N
N
..
Request Graph
N
N
N
N
Algorithm Orals 2002
8
Questions

Are all MSMs unstable?



Is there a subclass of MSMs which are stable?
There is at least one MSM which is stable.
Are MSMs stable under uniform load?


Simulation seems to suggest this.
Can we prove this?
Algorithm Orals 2002
9
Non Pre-emptive Scheduling
Batch Scheduling
Batch-(k+1)
R
Batch-(k)
Port 1, input
Crossbar
1
1
Port 1, output
R
Port N, output
Port N, input
N
R
Priority-2
N
R
Priority-1
Algorithm Orals 2002
10
Non Pre-emptive Scheduling
Batch Scheduling
Batch-(k+1)
R
Batch-(k)
Port 1, input
Crossbar
1
1
Port 1, output
R
Port N, output
Port N, input
N
R
Priority-2
N
R
Priority-1
Algorithm Orals 2002
11
Degree of a Batch
Degree (dv,k):

The number of cells
departing from (destined to)
a vertex in batch k.
Batch Request Graph
0
1
0
0
Maximum Degree (Dk)

The maximum degree
amongst all inputs/outputs in
batch k.
2
2
2
1
0
3
1
1
0
1
3
Algorithm Orals 2002
12
Critical Maximum Size Matching
Batch Request Graph
0
1
degree =3
1
1
0
0
2
2
2
1
0
3
0
3
degree =3
1
1
2
1
2
1
2
1
2
1
2
1
2
3
3
3
3
3
3
Algorithm Orals 2002
13
Outline


Introduction
Part-I: Properties of Maximum Size Matching
(MSM) in an IQ switch



Stability of Critical MSM for any Bernoulli i.i.d. traffic
Stability of MSM for Bernoulli i.i.d. uniform traffic
Part-II: Properties of Maximal Matching (MXM) in
a CIOQ switch

A Simple proof for stability
Algorithm Orals 2002
14
The Arrival Process
1. Traffic matrix:
A   ij  , where :  ij  expected number of
arrivals in one timeslot
2.
If

ij
i
 1,

ij
 1; we say the traffic is "admissible".
j
3. For a Bernoulli i.i.d arrival process:
If  ij 

, (i, j ); we say the traffic is uniform.
N
Algorithm Orals 2002
15
Stability of CMSM

Theorem 1:


CMSM is stable under batch scheduling, if the input traffic
is admissible and Bernoulli i.i.d. uniform
Informal Arguments:






Let Tk be the time to schedule batch k
Then for batch k+1 we buffer packets for time Tk
We expect about  Tk packets at every input/output
Hence, the maximum degree of batch k +1, i.e. Dk+1   Tk
Hence for a CMSM Tk+1 = Dk+1 = Tk < Tk
Hence Tk converges to a finite number
Algorithm Orals 2002
16
Formal Arguments … 1

We shall use the Chernoff bound to get
 e
P{dv , k  1  (1   ) Tk}  
 (1 )

 Tk
(1  )



 pv
If we want to bound Dk, we require that all the 2N vertices are
bounded
P{Dk
1
 (1   ) Tk}  1  2 Npv  Q
Algorithm Orals 2002
17
Formal Arguments … 2

We can choose (1 + ) < 1 -  to get
P{Tk

 (1   )Tk}  Q
Observe that




1
Q is now a function of Tk only.
We can make Q as close to 1, by choosing a large Tk
Also, Tk+1  NTk
This gives
E (Tk
 1)
 Q (1 -  ) Tk  (1 - Q ) NTk
 (1 -  ) Tk , if .....
Algorithm Orals 2002
18
Formal Arguments …3

Hence, there is a constant Tc which depends only on  (and
hence only on ), such that
E (Tk  1)  (1-  ) Tk , Tk  Tc

Formally, using a linear Lyapunov function V(Tk) = Tk, we can say
that E(Tk) is bounded.
Algorithm Orals 2002
19
Stability of CMSM

Theorem 2:
CMSM is stable under batch scheduling, if the input traffic is
admissible and Bernoulli i.i.d.
Algorithm Orals 2002
20
Outline


Introduction
Part-I: Properties of Maximum Size Matching
(MSM) in an IQ switch



Stability of Critical MSM for any Bernoulli i.i.d. traffic
Stability of MSM for Bernoulli i.i.d. uniform traffic
Part-II: Properties of Maximal Matching (MXM) in
a CIOQ switch

A Simple proof for stability
Algorithm Orals 2002
21
Example of a Uniform Graph
Batch Request Graph
1
1
degree =3
1
1
1
1
2
1
2
1
1
3
1
3
degree =3
1
1
2
1
2
1
2
1
2
1
2
1
2
3
3
3
3
3
3
Algorithm Orals 2002
22
Properties of Uniform Graphs

Lemma-1:


If the request graph is uniform and the maximum degree
is D, then any MSM can schedule the requests in exactly
D time slots
Lemma-2:

Any request graph with maximum degree D, can be
scheduled by any MSM within 2D time slots
Algorithm Orals 2002
23
Property of any Graph

Theorem:


Any request graph with maximum degree is D, and minimum
VOQ length m, can be scheduled in less than 2D –Nm time slots
Proof:



Consider a request graph with minimum VOQ length m
The minimum degree of the graph is mN
Hence the original graph can be considered to be in two parts
• A uniform graph of degree mN
• Another graph of maximum degree D – mN

Hence the request graph can be scheduled in at most
mN + 2(D-mN) = 2D - Nm
Algorithm Orals 2002
24
Stability of MSM ..1

Theorem 3:
MSM is stable under batch scheduling, if the input traffic is
admissible and Bernoulli i.i.d. uniform

Informal Arguments


We can bound both the maximum degree D and the
minimum VOQ length m
The rest of the proof is similar to the CMSM proof
Algorithm Orals 2002
25
Outline


Introduction
Part-I: Properties of Maximum Size Matching
(MSM) in an IQ switch



Stability of critical MSM for any Bernoulli i.i.d. traffic
Stability of MSM for Bernoulli i.i.d. uniform traffic
Part-II: Properties of Maximal Matching (MXM) in
a CIOQ switch

A simple proof for stability
Algorithm Orals 2002
26
Maximal Matching Algorithms

Maximal Matching (MXM)



Choose a matching such that no unmatched input or
output has a packet meant for each other
They are easier to implement and have low complexity
They are known to be unstable and give low throughput
for input queued switches
Algorithm Orals 2002
27
A Model for a CIOQ switch
R
R
R
Port 1
2R
2R
Port 1 R
Port 2
2R
2R
Port 2
Port N
2R
2R
Port N R
R
Bandwidth: 2NR

A CIOQ switch with a speedup of 2, gives 100%
throughput for any MXM algorithm
• [Ref: Dai & Prabhakar, Leonardi. et. al.]
Algorithm Orals 2002
Combined Input-Output Queued Switch
28
Leaky Bucket Traffic


Let Aj(t1,t2) denote the number of arrivals to output j in the
interval between (t1,t2)
A leaky bucket constrained traffic satisfies, the property
that for each output j
Aj (t1, t 2)   j (t 2  t1)  B; where αj<1


Note that this means that for an ideal output queued switch
no output has more than B packets in the switch
Let DT denote the departure time of a packet from this ‘ideal’
output queued switch
Algorithm Orals 2002
29
Stability of MXM

Theorem 4:
A CIOQ switch with an MXM algorithm gives bounded
delay and hence 100% throughput with a speedup greater
than 2, under arrivals which satisfy the leaky bucket
constraint
Algorithm Orals 2002
30
Constraint Set ‘Maximal’ Algorithm



The algorithm is greedy i.e. when a cell arrives, it
immediately attempts to allot a time (in the
future) when it should be transferred
Each input and output maintains a constraint set
of the future times during which it is free to
send/receive a packet
The algorithm attempts to bound the time of
departure of a packet to within k time slots of its
departure time DT, i.e each packet is transferred
in the time (DT, DT+k)
Algorithm Orals 2002
31
Allocations as seen by the Output
c
k
…
DT + k
DT

Packet has an OQ Departure Time = DT

Packet should leave in the interval (DT, DT + k)

In the interval (DT, DT + k)



DT- k
There is one cell which tries to get allotted in that interval.
No more than k cells get delayed and are allotted to that interval
k 
Number of Time Slots Available is more than k 
S 
 
Algorithm Orals 2002
32
Allocations as seen by the Input
c
B+k
k
…
DT + k
DT

Packet has an OQ Departure Time = DT

Packet should leave during interval (DT, DT + k)

In the interval (DT, DT + k)



DT-B
DT-B-k
There is one cell which tries to get allotted in that interval
No cell which arrived before DT–B-k will be allotted to this interval
k  B

 S 
Number of Time Slots Available is more than k 

Algorithm Orals 2002
33
Sufficiency Conditions on Speedup

We are guaranteed a timeslot if
k  B
k 
k 

k

k



 S 
S 

The above equation can be satisfied if
k 


B
S 2
This means S > 2 is sufficient to guarantee that the delay is
bounded
This implies 100% throughput
Algorithm Orals 2002
34
Stability of MXM

Theorem 5:
A CIOQ switch with an MXM algorithm gives 100%
throughput with a speedup greater than 2, under admissible
arrivals which satisfy the strong law of large numbers
Algorithm Orals 2002
35
Summary

In an IQ switch with batch scheduling



A subclass of MSM called CMSM is stable, if the input
traffic is admissible and Bernoulli i.i.d.
MSM is stable, if the input traffic is admissible and
Bernoulli i.i.d. uniform
In a CIOQ switch with S>2,

MXM is stable under any traffic which satisfies the
strong law of large numbers
Algorithm Orals 2002
36
Future Questions

We have seen that MSM is stable under the
auspices of batch scheduling



Perhaps we could incorporate this (well known) idea into a number
of other algorithms to prove stability?
It would be nice to nail down the stability of MSM
with uniform load in the absence of batch
scheduling
Other open questions remain
Algorithm Orals 2002
37
Backup
Algorithm Orals 2002
38
Stability of MSM …2

Informal Arguments:

Similar to the CMSM proof, derive P{D < (1 + 1) Tk }

Use Chernoff bound, to derive P{mN > (1 - 2) Tk}

We can now write the probability of using less than
2[(1 + 1) Tk] – (1 - 2) Tk = (1 + 21 + 2)Tk time slots

Then rest of the proof is similar to CMSM
Algorithm Orals 2002
39