EE384y: Packet Switch Architectures
This presentation is the property of its rightful owner.
Sponsored Links
1 / 45

EE384y: Packet Switch Architectures Matchings, implementation and heuristics PowerPoint PPT Presentation


  • 50 Views
  • Uploaded on
  • Presentation posted in: General

EE384y: Packet Switch Architectures Matchings, implementation and heuristics. Nick McKeown Professor of Electrical Engineering and Computer Science, Stanford University [email protected] www.stanford.edu/~nickm. Outline. Finding a maximum match. Maximum network flow problems

Download Presentation

EE384y: Packet Switch Architectures Matchings, implementation and heuristics

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Ee384y packet switch architectures matchings implementation and heuristics

EE384y: Packet Switch Architectures

Matchings, implementation and heuristics

Nick McKeown

Professor of Electrical Engineering

and Computer Science, Stanford University

[email protected]

www.stanford.edu/~nickm


Outline

Outline

  • Finding a maximum match.

    • Maximum network flow problems

      • Definitions and example

      • Augmenting paths

    • Maximum size/weight matchings as examples of maximum network flows

      • Maximum size matching

      • Complexity of maximum size matchings and maximum weight matchings

  • What algorithms are used in practice?

    • Maximal Matches

    • Wavefront Arbiter (WFA)

    • Parallel Iterative Matching (PIM)

    • iSLIP


Network flows

10

10

10

1

10

1

10

1

Network 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.


A maximum network flow example by 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 maximum network flow exampleBy inspection

a

c

Source

s

Sink

t

b

d

Step 1:


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

A 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 10+1 = 11


Ford fulkerson method of augmenting paths

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.


Example of residual graph

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


Example of residual graph1

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


Example of residual graph2

Example of Residual Graph

Step 3:

a

c

10, 9

s

t

10, 10

1, 1

10, 10

1, 1

10, 2

b

d

10, 2

1, 1

Flow is of size 10+2 = 12

1

Residual Graph

a

c

9

s

t

10

10

1

2

1

2

b

d

8

1

8


Complexity of network flow problems

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.


Outline1

Outline

  • Finding a maximum match.

    • Maximum network flow problems

      • Definitions and example

      • Augmenting paths

    • Maximum size/weight matchings as examples of maximum network flows

      • Maximum size matching

      • Complexity of maximum size matchings and maximum weight matchings

  • What algorithms are used in practice?

    • Maximal Matches

    • Wavefront Arbiter (WFA)

    • Parallel Iterative Matching (PIM)

    • iSLIP


Finding a maximum size match

A

1

2

B

3

C

4

D

5

E

6

F

Finding a maximum size match

  • How do we find the maximum size (weight) match?


Network flows and bipartite matching

Network flows and bipartite matching

A

1

2

B

Finding a maximum size bipartite matching is equivalent to solving a network flow problem with capacities and flows of size 1.

Sink

t

Source

s

3

C

4

D

5

E

6

F


Network flows and bipartite matching ford fulkerson method

Network flows and bipartite matchingFord-Fulkerson method

Residual Graph for first three paths:

A

1

2

B

t

s

3

C

4

D

5

E

6

F


Network flows and bipartite matching1

Network flows and bipartite matching

Residual Graph for next two paths:

A

1

2

B

t

s

3

C

4

D

5

E

6

F


Network flows and bipartite matching2

Network flows and bipartite matching

Residual Graph for augmenting path:

A

1

2

B

t

s

3

C

4

D

5

E

6

F


Network flows and bipartite matching3

Network flows and bipartite matching

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.


Network flows and bipartite matching4

Network flows and bipartite matching

Maximum flow graph:

A

1

2

B

t

s

3

C

4

D

5

E

6

F


Network flows and bipartite matching5

Network flows and bipartite matching

Maximum Size Matching:

A

1

2

B

3

C

4

D

5

E

6

F


Complexity of maximum matchings

Complexity of Maximum Matchings

  • Maximum Size Matchings:

    • Algorithm by Dinic O(N5/2)

  • Maximum Weight Matchings

    • Algorithm by Kuhn O(N3)

  • In general:

    • Hard to implement in hardware

    • Slooooow.


Outline2

Outline

  • Finding a maximum match.

    • Maximum network flow problems

      • Definitions and example

      • Augmenting paths

    • Maximum size/weight matchings as examples of maximum network flows

      • Maximum size matching

      • Complexity of maximum size matchings and maximum weight matchings

  • What algorithms are used in practice?

    • Maximal Matches

    • Wavefront Arbiter (WFA)

    • Parallel Iterative Matching (PIM)

    • iSLIP


Maximal matching

Maximal Matching

  • A maximal matching is one in which each edge is added one at a time, and is not later removed from the matching.

  • i.e. no augmenting paths allowed (they remove edges added earlier).

  • No input and output are left unnecessarily idle.


Example of maximal size matching

A

1

A

1

A

1

2

B

2

B

2

B

3

C

3

C

3

C

4

D

4

4

D

D

5

E

5

5

E

E

6

F

6

6

F

F

Example of Maximal Size Matching

Maximal

Size Matching

Maximum

Size Matching


Maximal matchings

Maximal Matchings

  • In general, maximal matching is simpler to implement, and has a faster running time.

  • A maximal size matching is at least half the size of a maximum size matching.

  • A maximal weight matching is defined in the obvious way.

  • A maximal weight matching is at least half the weight of a maximum weight matching.


Outline3

Outline

  • Finding a maximum match.

    • Maximum network flow problems

      • Definitions and example

      • Augmenting paths

    • Maximum size/weight matchings as examples of maximum network flows

      • Maximum size matching

      • Complexity of maximum size matchings and maximum weight matchings

  • What algorithms are used in practice?

    • Maximal Matches

    • Wavefront Arbiter (WFA)

    • Parallel Iterative Matching (PIM)

    • iSLIP


Wave front arbiter tamir

Wave Front Arbiter(Tamir)

Requests

Match

1

1

1

1

2

2

2

2

3

3

3

3

4

4

4

4


Wave front arbiter

Wave Front Arbiter

Requests

Match


Wave front arbiter implementation

2,4

1,4

4,4

3,4

4,3

4,2

4,1

3,3

3,2

3,1

2,2

2,1

1,3

1,2

1,1

2,3

Wave Front ArbiterImplementation

Simple combinational logic blocks


Wave front arbiter wrapped wfa wwfa

Wave Front ArbiterWrapped WFA (WWFA)

N steps instead of

2N-1

Match

Requests


Wavefront arbiters properties

Wavefront ArbitersProperties

  • Feed-forward (i.e. non-iterative) design lends itself to pipelining.

  • Always finds maximal match.

  • Usually requires mechanism to prevent Q11 from getting preferential service.

  • In principle, can be distributed over multiple chips.


Outline4

Outline

  • Finding a maximum match.

    • Maximum network flow problems

      • Definitions and example

      • Augmenting paths

    • Maximum size/weight matchings as examples of maximum network flows

      • Maximum size matching

      • Complexity of maximum size matchings and maximum weight matchings

  • What algorithms are used in practice?

    • Maximal Matches

    • Wavefront Arbiter (WFA)

    • Parallel Iterative Matching (PIM)

    • iSLIP


Parallel iterative matching

Iteration:

1

1

1

1

2

2

2

2

#1

1

1

3

3

3

3

2

2

4

4

4

4

f2: Grant

f3: Accept/Match

3

3

1

1

1

1

1

1

4

4

2

2

2

2

2

2

#2

3

3

3

3

3

3

4

4

4

4

4

4

Parallel Iterative Matching

uar selection

uar selection

f1: Requests


Pim properties

PIM Properties

  • Guaranteed to find a maximal match in at most N iterations.

  • In each phase, each input and output arbiter can make decisions independently.

  • In general, will converge to a maximal match in < N iterations.

  • How many iterations should we run?


Parallel iterative matching convergence time

Parallel Iterative MatchingConvergence Time

Number of iterations to converge:


Parallel iterative matching1

Parallel Iterative Matching


Parallel iterative matching2

Parallel Iterative Matching

PIM with a single iteration


Parallel iterative matching3

Parallel Iterative Matching

PIM with 4 iterations


Outline5

Outline

  • Finding a maximum match.

    • Maximum network flow problems

      • Definitions and example

      • Augmenting paths

    • Maximum size/weight matchings as examples of maximum network flows

      • Maximum size matching

      • Complexity of maximum size matchings and maximum weight matchings

  • What algorithms are used in practice?

    • Maximal Matches

    • Wavefront Arbiter (WFA)

    • Parallel Iterative Matching (PIM)

    • iSLIP


I slip

1

4

2

1

1

1

1

3

2

2

2

2

#1

1

1

3

3

3

3

2

2

4

4

4

4

F2: Grant

F3: Accept/Match

3

3

1

1

1

1

1

1

4

4

2

2

2

2

2

2

#2

3

3

3

3

3

3

4

4

4

4

4

4

iSLIP

F1: Requests


I slip operation

iSLIP Operation

  • Grant phase: Each output selects the requesting input at the pointer, or the next input in round-robin order. It only updates its pointer if the grant is accepted.

  • Accept phase: Each input selects the granting output at the pointer, or the next output in round-robin order.

  • Consequence: Under high load, grant pointers tend to move to unique values.


I slip properties

iSLIPProperties

  • Random under low load

  • TDM under high load

  • Lowest priority to MRU

  • 1 iteration: fair to outputs

  • Converges in at most N iterations. (On average, simulations suggest < log2N)

  • Implementation: N priority encoders

  • 100% throughput for uniform i.i.d. traffic.

  • But…some pathological patterns can lead to low throughput.


I slip1

iSLIP


I slip2

iSLIP


I slip implementation

iSLIPImplementation

Programmable

Priority Encoder

1

State

1

log2N

Decision

N

Grant

Accept

2

2

N

Grant

Accept

log2N

N

N

Grant

Accept

log2N

N


Maximal matches

Maximal Matches

  • Maximal matching algorithms are widely used in industry (PIM, iSLIP, WFA and others).

  • PIM and iSLIP are rarely run to completion (i.e. they are sub-maximal).

  • We will see shortly that a maximal match with a speedup of 2 is stable for non-uniform traffic.


  • Login