David Larrabeiti Piotr Pacyna Universidad Carlos III de...

44
1 David David Larrabeiti Larrabeiti Piotr Piotr Pacyna Pacyna Dpto. de Ingenier Dpto. de Ingeniería Telem a Telemática tica Universidad Carlos III de Madrid Universidad Carlos III de Madrid Packet Packet- Switching Switching Rearrangable Rearrangable networks networks Switching, Chapter 10 2 Programe authors and contributors Lecturers (Spanish course): David Larrabeiti López José Félix Kukielka Teaching material : David Larrabeiti, Ricardo Romeral, Jorg Diederich, Huw Oliver Piotr Pacyna (English course)

Transcript of David Larrabeiti Piotr Pacyna Universidad Carlos III de...

Page 1: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

1

David David LarrabeitiLarrabeitiPiotrPiotr PacynaPacyna

Dpto. de IngenierDpto. de Ingenieríía Telema TelemááticaticaUniversidad Carlos III de MadridUniversidad Carlos III de Madrid

PacketPacket--SwitchingSwitching

RearrangableRearrangable networksnetworks

Switching, Chapter 10 2

Programe authors and contributorsLecturers (Spanish course):

David Larrabeiti LópezJosé Félix Kukielka

Teaching material :

David Larrabeiti, Ricardo Romeral,Jorg Diederich, Huw OliverPiotr Pacyna (English course)

Page 2: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

2

Switching, Chapter 10 3

Objectives

Introduce basic concepts and termof packet switching

Introduce important network types

Present examples of networks

Talk about properties of networks

Comment on application areas

Switching, Chapter 10 4

Part I. Basic information

Page 3: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

3

Switching, Chapter 10 5

Background info

Origins of the solutionsconnecting networks, inteconnection networkscentralised or distributed control

Connection capability of networksaccessibility

blocking

Switching, Chapter 10 6

Primary discriminator(functional property)

Non-blocking

Blocking„internal congestion”

Page 4: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

4

Switching, Chapter 10 7

Non-blocking property

Strict-sense non-blocking

Wide sense non-blocking

Rearrangable non-blocking

cost index: the number of cross-points (traditionally)

Switching, Chapter 10 8

Reference net.: crossbar network

N

M

Page 5: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

5

Switching, Chapter 10 9

Properties of crossbar network

C = N x M

strictly non-blocking

can set arbitrary permutationof inlets to outlets

< = > permutation set P = n!(fully accessible)

C = N 2

Switching, Chapter 10 10

General model for multi-stage nets.

N M

1 2 s

1

2

r1

1

2

r2 rs

Page 6: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

6

Switching, Chapter 10 11

General model for Multi-stage nets.

N Mni mi

Switching, Chapter 10 12

Inter-stage inter-connection patterns

mi*ri = n i+1 * r i+1

i i+1„full connection”

Page 7: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

7

Switching, Chapter 10 13

Network parameters

N x M N: # inlets to network,M: # outlets from network

s: # stages

ri: # crossbar matrices at stage i,(i=1 ... s)

ni , mi - are the „dimensions” of crossbars at stage i(all are identical at stage i)

Switching, Chapter 10 14

Network parameters (2)

ri * mi => total number of outlets fromstage stage i

N / n1 => number of crossbars at 1-st stage

Page 8: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

8

Switching, Chapter 10 15

Interconnection types

interconnection patterns are importantelement that define the network

EGS is an important classmany sub-classes

( ji , ki ) ( li+1 , mi+1 )

e.g. „full connection”

outlet crossbar inlet crossbar

Switching, Chapter 10 16

Interconnections:Extented Generalized Shuffle

ii+1

( )

+−=

++

11

1inti

iiii r

jkmj

( ji , ki ) ( ji+1 , ki+1 )

( ) 11

mod1

11 +

+

+−=

++

irrjkmk

i

iiii

Page 9: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

9

Switching, Chapter 10 17

Network graphsNetworks vs. network graphs

Matrices verticesConnections edges

Isomorphic graphs

Isomorphic networks

Switching, Chapter 10 18

Equivalence between networks

Topological equivalence

Isomorphism

Functional equivalence

Page 10: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

10

Switching, Chapter 10 19

Equivalence between networks

Source: A. Pattavina, „Switching Theory, architecture and performance ....”

Switching, Chapter 10 20

Isomorphic networks

Page 11: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

11

Switching, Chapter 10 21

Isomorphic networks

Switching, Chapter 10 22

Channel graph of multistage net.

channel = I/O path in a graph

Page 12: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

12

Switching, Chapter 10 23

Part II. ( Full-connection ) multi-stage networks

Switching, Chapter 10 24

General model of full-connectionmulti-stage net.

and

ni x mi switching element is a crossbar

r i-1 = n i m i-1 = r i

Page 13: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

13

Switching, Chapter 10 25

Multi-stage network types

Full-connection multistage networks

Partial-connection multistage networksPartial self-routing networks

Horizontal extensions

Vertical replication

Fully self-routing networks

Switching, Chapter 10 26

Two-stage network

Two-stage FC networks:

not rearrangeable since only one path exists between any inlet/outlet pair

n x r2

#1

#r1

n x r2

#1

#r2

r1 x m

r1 x m

Page 14: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

14

Switching, Chapter 10 27

Full-Connection Multistage Networks

At least three stages needed for FC multi-stage to be rearrangeable !

Switching, Chapter 10 28

Example: Three-Stage Switch

NxM three stage switch:

r1 = N/nmatrices

r2 matricesN

ninputs

mM

nN×

kn ×

mM

nN×

kn ×

...

...

...

moutputs

......

...... m

outputsn

inputs

r3 = M/mmatrices

mk ×

mk ×

M

...

k internal paths

possible

1st stage 3rd stage

2nd stage

Page 15: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

15

Switching, Chapter 10 29

Condition for rearrangability

Minimum requirement : Given a NxM three stage switch with r1 matrices in the 1st stage, r2 matrices in the 2nd stage, and r3matrices in the 3rd stage

Such a switch is rearrangeable if and only if the second stage has more than max(n, m) matrices of the size r1xr3. (n = N/r1 , m = M/r3)

Switching, Chapter 10 30

Part III. Partial-connection multi-stage networks

Page 16: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

16

Switching, Chapter 10 31

General properties

Matrices in intermediate stage are connecteed only to a subset of the matrices in the adjacent stages

Significant size !

High-performance in switching required

High degree of parallel processing required

Switching, Chapter 10 32

Design principles

Built as multi-stage

Switching elements (SE) small : 2k x 2k k = 1 ... 5

SE - autonomous processing

self-routingblocking :=(

Page 17: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

17

Switching, Chapter 10 33

Partial-Connection Multistage Rearrangeable Networks

Rearrangeable (i.e. non-blocking) networks can be built from banyan (i.e. blocking) networks Two classes of rearrangeable networks:

1. Partially self-routing networksSelf routing only in parts of the networkRequires processing to build up the required network permutation being partially distributed (for the self-routing parts of the network) and partially centralized (to determine the switching element states at the other network stages)

1. Horizontal extension

At least one stage added to basic banyan network2. Vertical replication

Whole banyan network replicated several times2. Fully self-routing networks

Self routing applied at all stages

Switching, Chapter 10 34

Typical network permutations (1)

h-shuffle:

F h (an-1 .... a0) = an-1 ... a h+1 ah-1 .... a0ah

( 0 < = h <= n-1 )

h-unshuffle:F h

-1 (an-1 .... a0) = an-1 ... a h+1 a0ah-1 .... a1ah

( 0 < = h <= n-1 )h= n-1 = perfect suffle / unshuffle

Page 18: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

18

Switching, Chapter 10 35

Typical network permutations (2)

butterfly permutation:

$ h (an-1 .... a0) = an-1 ... a h+1 a0ah-1 .... a1ah

( 0 < = h <= n-1 )

Identity permutation:j (an-1 .... a0) = an-1 ... a0

( 0 < = h <= n-1 )

Switching, Chapter 10 36

Typical network permutations (3)

Source: A. Pattavina, „Switching Theory, architecture and performance ....”

Page 19: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

19

Switching, Chapter 10 37

Other network permutations

Bit-switch:

* (an-1 .... a0) = a1 a2 ....... an-1a0

bit reversal:D (an-1 .... a0) = a0 a1 ... an-2 an-1

Switching, Chapter 10 38

Typical network permutations (3)

Source: A. Pattavina, „Switching Theory, architecture and performance ....”

Page 20: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

20

Switching, Chapter 10 39

Banyan NetworksMulti-stage

Simple SE, size: b x b

Only one path between any inlet / outlet I/O

Different I/O paths can share interstage links

# stages: n = log b N

each stage has: N / b SE

Switching, Chapter 10 40

Horizontal Extension: Extended Banyan Networks

Objective: provide multiple paths through the network between one inlet / outlet pairResult: Extended Banyan Network (EBN)Construction procedure: Mirror imaging

A NxN EBN network with n+m stages (m ≤ n – 1) is obtained by attaching m stages to the 1st stage of a banyan network

Connection pattern: mirror image of the permutations in the last m stage of the original banyan network

Note: Adding m stages means making available 2m paths between an inlet and an outletSelf-routing: Only in the last n = log2N stagesCentralized control necessary for the first m stages

Page 21: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

21

Switching, Chapter 10 41

Horizontal Extension: ExampleN = 16, m = 1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

Baseline banyan networkm=1

Switching, Chapter 10 42

Horizontal Extension: ExampleN = 16, m = 2

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

Baseline banyan networkm=2

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

Page 22: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

22

Switching, Chapter 10 43

Horizontal Extension: ExampleN = 16, m = 3

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

Baseline banyan network

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

m=3

Switching, Chapter 10 44

Horizontal Extension: Rearrangeability

Now: Multiple paths in EBNsProblem: Are EBNs rearrangeable?The following statement can be shown:

An EBN is rearrangeable if m = n – 1Proof built on the Ofman theorem (for SW-banyan)

Ofman theorem:It is always possible to split an arbitrary permutation of size N into two sub-permutations of size N/2 such that, if the permutation is to be set up by the NxN network shown on the next slide, then the two sub-permutations are set up by the two non-blocking N/2xN/2 central subnetworks and no conflicts occur at the first and the last switching stage of the overall network.

Page 23: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

23

Switching, Chapter 10 45

Recursive Network Construction(Ofman Theorem)

N/4 x N/4

N/4 x N/4

••••••

•••

•••

N/4 x N/4

N/4 x N/4•••

•••

•••

•••

•••

•••

•••

•••

••••••

N/2 x N/2

•••

•••

N inlets N outlets

N/2 x N/2

Switching, Chapter 10 46

Ofman Theorem: Properties

Iterate Ofman property to split each permutation of size N/2 into two of size N/4Finally: Rearrangeable network after n-1 steps when the central subnetwork is 2x2

N/2 permutations of size 2Number of 2x2 stages: 2(n-1) + 1 = 2n-1

(n-1): n-1 iterations

“2”: Each iteration adds two stages (symmetric design)

‘+1’: central 2x2 matrices

If an EBN with m = n-1 has n+m = 2n-1 stages, then a rearrangeable network can be constructed following the theorem of Ofman

Page 24: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

24

Switching, Chapter 10 47

Benes Networks

Construct EBNs recursively from a reverse baseline banyan network

Reverse baseline banyan network: Inverts the permutations of a baseline banyan network

Example (B16):B2

B4

B8

Reverse baseline banyan network

m = 3

Switching, Chapter 10 48

Benes Networks: Characteristics

Number of matrices:Number of stages: s = 2 log2N-1 = 2n-1Number of matrices per stage: N/2Number of matrices: S = N/2 * s = Nlog2N –N/2

Costs:C2x2 = 4 (for each 2x2 matrix)Total costs for the network:

C = 4 * S = 4Nlog2N – 2N

Page 25: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

25

Switching, Chapter 10 49

Setting Up Connections in Matrices

Set of connections / paths:Requested paths to be found (between the inlets and the outlets of the switch)

Complete set of connections:If N connections in an NxN network needed

Incomplete set of connections:If less than N connections required in an NxN network

Define: Size of the connection setNumber of connections to be set up

To establish a connection set of an arbitrary size: Necessary to determine the state of all matrices crossed by the connection

Use a recursive algorithm which can be applied to a recursive network of the Ofman type (e.g., a Benes network): The looping algorithm

Switching, Chapter 10 50

The Looping Algorithm I

Starting point: An NxN network of 3 stages The 1st and last stage having N/2 matrices Two middle networks of size N/2xN/2

Called upper (U) and lower (L) subnetworksTerminology:

A network termination (i.e. inlet or outlet) is said to be busy (idle) if a connection has (has not) been requested

Busy inlets: Those where packets will arrive which have to be delivered to a certain outlet

Idle inlets: Inlets where no packets will arriveThree steps:

1. Loop start2. Forward connection3. Backward connection

Page 26: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

26

Switching, Chapter 10 51

The Looping Algorithm II

1. Loop start: At the 1st stage: a) Select the unconnected busy inlet of an already connected elementb) Else: select a busy inlet of an unconnected elementc) Else: Stop the algorithm (no more paths to be built up)

2. Forward connectiona) Connected the selected inlet to the requested outlet

I. through the only accessible subnetwork if the element is already connected to the other subnetwork

II.Or through a randomly selected subnetwork if the element is not yet connectedb) If the other outlet of the element just reached is busy, select it step 3; c) Otherwise step 1

3. Backward connectiona) Connect the selected outlet to the requested inlet through the subnetwork

not used in the forward connection;b) If the other inlet of the element just reached is busy and not yet connected,

select it step 2; c) Otherwise step 1

Switching, Chapter 10 52

Example: Looping Algorithm I

Connection set: 0 5, 1 3, 4 7, 5 2, 6 1, 7 4 Incomplete set

Busy inlets: 0, 1, 4, 5, 6, 7; Busy outlets: 1, 2, 3, 4, 5, 7Loop start: 0 5Case b) Select upper inlet 0 and go to step 2

Forward connection: 0 5Case a) II) Connect (randomly) to subnetwork L set inlet matrix

0 to “cross” set outlet matrix 2 to “straight”Remember: L must connect L’s inlet 0 L’s outlet 2

Case b) Outlet 4 busy select outlet 4 and go to step 3

B2

B4

01234567

01234567

Inlets OutletsU

L

U:

L: 0 2

Page 27: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

27

Switching, Chapter 10 53

Example: Looping Algorithm II

Backward connection: 7 4Case a) Connect: 7 4 via the upper subnetwork

set inlet matrix 3 to “cross”Remember: Subnetwork U has to connect U’s inlet 3 U’s outlet 2

Case b) Inlet 6: busy go to step 2

B2

B4

01234567

01234567

Inlets OutletsU

L

U: 3 2

L: 0 2

Switching, Chapter 10 54

Example: Looping Algorithm III

Forward connection: 6 1Case a) I) Connect: 6 1 via the lower subnet

set outlet matrix 0 to “straight”Remember: Subnetwork L has to connect L’s inlet 3 with L’s outlet 0

Case c) Outlet 0 idle go to step 1

B2

B4

01234567

01234567

Inlets OutletsU

L

U: 3 2

L: 0 2, 3 0

Page 28: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

28

Switching, Chapter 10 55

Example: Looping Algorithm IV

Loop start:Connection set: (0 5), 1 3, 4 7, 5 2, (6 1), (7 4)

a) 1 3 not connected yet go to step 2Forward connection: 1 3Case a) I): Connect 1 3 via subnetwork U set outlet

matrix 1 to “cross”Remember: U must connect U’s inlet 0 U’s outlet 1

Case b) Outlet 2 busy go to step 3

B2

B4

01234567

01234567

Inlets OutletsU

L

U: 3 2, 0 1

L: 0 2, 3 0

Switching, Chapter 10 56

Example: Looping Algorithm V

Backward connection: 5 2Case a) Connect: 5 2 via the lower subnetwork

set inlet matrix 2 to “straight”Remember: Subnetwork L has to connect L’s inlet 2 L’s outlet 1

Case b) Inlet 4: busy go to step 2

B2

B4

01234567

01234567

Inlets OutletsU

L

U: 3 2, 0 1

L: 0 2, 3 0,2 1

Page 29: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

29

Switching, Chapter 10 57

Example: Looping Algorithm VI

Forward connection: 4 7Case a) Connect: 4 7 via the upper subnetwork set

outlet matrix 3 to “cross”Remember: Subnetwork U has to connect U’s inlet 2 U’s outlet 3

Case c) Outlet 6: idle, but connected go to step 1

Loop start: No busy unconnected inlets left: STOP

B2

B4

01234567

01234567

Inlets OutletsU

L

U: 3 2, 0 1,2 3

L: 0 2, 3 0,2 1

Switching, Chapter 10 58

Example: Looping Algorithm VII

First recursion doneMust repeat the same algorithm for subnetwork U with connection set 3 2, 0 1, 2 3 and subnetwork L with connection set 0 2, 3 0, 2 1

B2

B4

01234567

01234567

Inlets OutletsU

L

U: 3 2, 0 1,2 3

L: 0 2, 3 0,2 1

Page 30: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

30

Switching, Chapter 10 59

Example: Looping Algorithm VIII

Results:

Overall Benes network at the end of the looping algorithm:

UU: 3 2, 0 1,

2 3

L: 0 2, 3 0,2 1

L

0123

0123

0123

0123

01234567

01234567

Inlets Outlets

Switching, Chapter 10 60

Vertical Replication: Replicated Banyan Networks

Use N splitter of type 1xK, K banyan networks of type NxN, N combiners Kx1

Create a Replicated Banyan Network (RBN)

Objective: Find a K that guarantees rearrangeability

Utilization factor

0

1

K-1

01

N-1

01

N-1

1xK NxN Kx1

Page 31: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

31

Switching, Chapter 10 61

Vertical Replication: Utilization Factor

Definition: The utilization factor uk of a generic link in stage k is the maximum number of paths between inlets and outlets which share this linkOr: It is the minimum from

The number of inlets that can reach this link

The number of outlets that can be reached from

this link

Switching, Chapter 10 62

Utilization Factor in Banyan Networks

For a Banyan network topology:Easy to show that all links in the same interstage pattern have the same utilization factorExamples:

N=16N=32N=64N=128N=256

Maximum utilization factor:

NxN replicated banyan networkNumber of stages: n = log2NMaximum: At the central stage(s)

2 242 44 22 84 4 22 84 4 28

2 84 4 28 16

= 2max 2

n

u

Page 32: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

32

Switching, Chapter 10 63

Rearrangeability in RBN

Theorem:A Replicated Banyan Network (RBN) of size NxN is rearrangeable if and only if:

K ≥ umax

“Proof”: umax paths share the central stage

must be routed onto umax distinct banyan

networks as each banyan network provides a single

path per inlet / outlet pair

Switching, Chapter 10 64

RBN: Characteristics

Cost:

Splitters and combinersThus:

Horizontal extension more cost-effective than vertical replication when building a rearrangeable NxN network

Horizontal extension: Cost grows with Nlog2N

Vertical replication: Cost grows with N3/2log2N

)1(log2222log2

24 222

22 +=⋅+⋅=

NNNNNCnnn

Page 33: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

33

Switching, Chapter 10 65

Part IV. Fully self-routing networks

Switching, Chapter 10 66

Fully Self-Routing Networks

Problem until now:Either: Self-routing, but blocking possible (Banyan networks)Or: Non-blocking, but some centralized control necessary (Horizontal extension, vertical replication)

Batcher-Banyan networksSelf-routing and rearrangeable non-blockingBasic concept:

Use a banyan network

Modify the configuration of input packets such that

blocking cannot occurCyclically compact and monotone sequence

Page 34: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

34

Switching, Chapter 10 67

Some Definitions I

Sequence of N elements:X = x0, ..., xN-1

xi = e: empty element or xi ∈[0, N-1]Each non-empty xi occurs only once in the sequenceUsually: Sequence determines the requested outlets in a switch

Example: X = (1, 3, e, 2)On inlet 0: packet destined to outlet 1On inlet 1: packet destined to outlet 3On inlet 2: no packet currentlyOn inlet 3: packet destined for outlet 2

Size of a sequence k:Number of non-empty elements of a sequence

Switching, Chapter 10 68

CCM by example

Sequence: X1 = (5, 6, e, e, e, 0, 1, 3):N = 8 (number of elements = inlets/outlets)Size k = 5 (number of non-empty elements)Base m = 5 (has to be determined by looking at the sequence sharply)j = 0: x5+0 mod 8 = x5 : “0”j = 1: x5+1 mod 8 = x6 : “1”j = 2: x5+2 mod 8 = x7 : “3”j = 3: x5+3 mod 8 = x0 : “5”j = 4 = k-1: x5+4 mod 8 = x1 : “6”“0”, “1”, “3”, “5”, “6”: monotonically increasing CCM

Page 35: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

35

Switching, Chapter 10 69

Definitions I

Cyclically compact and monotone sequence (CCM):

If and only if there is a base m such that

x(m+j) mod N is non-empty for each 0 ≤ j ≤ k-1

x(m+i) mod N < x(m+j) mod N (increasing CCM) or

x(m+i) mod N > x(m+j) mod N (decreasing CCM)

for i, j ∈[0, k-1] and i < j

Switching, Chapter 10 70

Definition II

Compact and monotone sequences (CM)Subset of CCMSize k and base m as for CCMCondition:

m ≤ (m + k – 1) mod N

Page 36: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

36

Switching, Chapter 10 71

Further Examples: CCM and CM

Sequence: X2 = (6, 5, 4, 3, 2, 1, 0, 7):N = 8 (number of elements = inlets/outlets)Size k = 8 (number of non-empty elements)Base m = 7 (has to be determined by looking at the sequence sharply; element with highest value here)

“7”, “6”, “5”, “4”, “3”, “2”, “1”, “0”: Monotonically decreasing CCMSequence: X3 = (e, e, e, e, e, 5, 4, 1):

N = 8, k = 3, m = 5Monotonically decreasing CM (not cyclically)

Switching, Chapter 10 72

Analysis of Banyan Networks

Main question: For what input sequences is a Banyan Network non-blocking?

Theorem:An Omega banyan network is rearrangeable non-blocking for each set of input packets represented by a CCM sequence of arbitrary size m ≤ N.this means: If the input to the banyan network is monotonically

sorted (increasing or decreasing), then there will be no internal blocking

Assumption: No external blockingI.e.: There are no two elements in the input sequence with the same value (i.e., the same destination outlet)

Note: This theorem holds also for n-cube banyan networksFunctionally equivalent to Omega banyan networks

Use pre-sorting of the input sequence to make a banyan network non-blocking!

Page 37: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

37

Switching, Chapter 10 73

Batcher-Banyan Networks

Sorting networks: Can sort up to N packets received in an arbitrary configurationOutput: a CM sequence

Cascade sorting network and banyan network: Batcher-Banyan Network

Rearrangeable non-blocking (if no external blocking)

Completely self-routingc0a0

Batcher Bitonic Sorting Network

Banyan Routing Network

(Omega orn-cube)

c1

cN-1

•••

•••

•••

a1

aN-1 n(n+1)/2 n

Switching, Chapter 10 74

Discussion: Batcher-Banyan Networks

Number of stages:

Batcher BanyanNumber of matrices:

N/2 per stage

Cost:C2x2 = 4;

NNNNNs 222222 log

23log

21log)1(loglog

21

+=++=

[ ]NNNNNNNS 2222

22 log3log

4log

43log

4+=+=

[ ]NNNC 222 log3log +=

Page 38: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

38

Switching, Chapter 10 75

Demonstration of the Theorem I

Theorem:An Omega banyan network is rearrangeable non-blocking for each set of input packets represented by a CCM sequence of arbitrary size m ≤ N

“Proof” (better: demonstration)Omega banyan networks allow the identification of the used matrices at each stage and the outlet

Assumption:Inlet shall be X = xn-1 .... x0

Outlet shall be Y = yn-1 .... y0

Because of the Omega network topology:First matrix is xn-2...x0

Switching, Chapter 10 76

Demonstration of the Theorem II

At the first stage:Use the first bit yn-1 of the outlet identifier Y for self-routingOutlet address of link at stage 1: xn-2...x0yn-1

Second stage:Use the second bit yn-2 of Y for self routingOutlet address of link at stage 2: xn-3...x0yn-1yn-2

Stage k:Use the kth bit yn-k of Y for self routingOutlet address at stage k: xn-k-1...x0yn-1...yn-k

Stage n (after n iterations):Outlet address: Y = yn-1...y0 As expected for the last outlet = the outlet of the network

Comparable to shifting a window of size n over the string xn-1...x0yn-1...y0, starting from bit k+1

Page 39: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

39

Switching, Chapter 10 77

Example (Omega Network)

Inlet: 0101; Destination: 0111xn-1...x0yn-1...y0 = 01010111

110

111

100

101

010

011

000

001

110

111

100

101

010

011

000

001

110

111

100

101

010

011

000

001

110

111

100

101

010

011

000

001

0000000100100011010001010110011110001001101010111100110111101111

0000000100100011010001010110011110001001101010111100110111101111

01010111 01010111 01010111 01010111 01010111

Switching, Chapter 10 78

Theorem Proof I

Proof by contradiction: (For a CM sequence first)Given two inlet/outlet pairs a—b and a’—b’ from a CM sequence such that a’ > a and b’ > b

a = an-1...a0 ; a’ = a’n-1...a’0 ; b = bn-1...b0 ; b’ = b’n-1...b’0

ai, a’i, bi, b’i ∈[0,1] for i = 0...n-1Assume these two connections share the same output link at stage k (internal blocking):

an-k-1...a0bn-1...bn-k = a’n-k-1...a’0b’n-1...b’n-k

Previous example (N = 16, n = 4 stages): a—b = an-1...a0 bn-1...b0 = 01010111a’—b’ = a’n-1...a’0 b’n-1...b’0 = 01110111k = 3; n-k-1 = 0; n-1 = 3; n-k = 1an-k-1...a0bn-1...bn-k = a0b3b2b1 = 1011 outlet at stage 3a’n-k-1...a’0b’n-1...b’n-k = a’0b’3b’2b’1 = 1011 outlet at stage 3

Page 40: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

40

Switching, Chapter 10 79

Example (Omega Network)

an-1...a0bn-1...b0 = 01010111a’n-1...a’0b’n-1...b’0 = 01110111k = 3 shared outlet at stage 3: 1011

110

111

100

101

010

011

000

001

110

111

100

101

010

011

000

001

110

111

100

101

010

011

000

001

110

111

100

101

010

011

000

001

0000000100100011010001010110011110001001101010111100110111101111

0000000100100011010001010110011110001001101010111100110111101111

Switching, Chapter 10 80

Theorem Proof II

Then:a’ – a = a’n-1...a’0 – an-1...a0

= a’n-1... a’n-k a’n-k-1 ...a’0 – an-1... an-k an-k-1 ...a0= a’n-1... a’n-k a’n-k-1 ...a’0 – an-1... an-k a’n-k-1 ...a’0= 2n-k (a’n-1...a’n-k – an-1...an-k) ≥ 2n-k

Example (decimal notation): 515 – 315 = 102 (5-3) ≥ 100Similarly:

b’ – b = b’n-1...b’0 – bn-1...b0 = b’n-1... b’n-k b’n-k-1 ...b’0 – bn-1... bn-k bn-k-1 ...b0= b’n-1... b’n-k b’n-k-1 ...b’0 – b’n-1... b’n-k bn-k-1 ...b0= 2n-k (b’n-k-1...b’0 – bn--k-1...b0) ≤ 2n-k -1

Example (decimal notation): 84352 – 84342 = 52 – 42 ≤ 102 -1Because of monotone and compact features:

a’ – a ≤ b’ – b 2n-k ≤ a’ – a ≤ b’ – b ≤ 2n-k -1 2n-k ≤ 2n-k -1 Contradiction!a — b and a’ — b’ from a CM sequence cannot share a path!

Page 41: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

41

Switching, Chapter 10 81

Theorem Proof III

Proof by contradiction: (For a CCM sequence)Choose a’ and a such that a’ < a

Then:(a’ – a) mod N = N + a’ – a

= 1a’n-1...a’0 – 0 an-1...a0 (N = 2n = 100...0) = 2n-k (1a’n-1...a’n-k – 0 an-1...an-k) ≥ 2n-k

Example: (2-7) mod 8 = 8 + (2 – 7) = 3

From previous CM sequence proof:(b’ – b) ≤ 2n-k – 1

Because of cyclic compactness:(a’ – a) mod N ≤ b’ – b2n-k ≤ (a’ – a) mod N ≤ b’ – b ≤ 2n-k – 1Contradiction!a — b and a’ — b’ from a CCM sequence cannot share a path!

Switching, Chapter 10 82

Exam: June 2003 I

The shown figure is a 8x8 Batcher network

a) Determine which of the switching elements (2x2 matrices) are sorting in increasing order (min on outlet 0 and max on outlet 1) and which are sorting in decreasing order.

b) Determine the state of the switching elements (“straight” or “cross”) of the complete network if the following inlet/outlet connections are required:

0 5, 1 2, 2 6, 3 1, 4 4, 5 7, 6 3, 7 0

Page 42: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

42

Switching, Chapter 10 83

Exam June 2003 I: Solution

a)

b)

Switching, Chapter 10 84

Exam June 2003 II

c) Add to the output of the Batcher sorting network a Benes network

Draw clearly the network topology, indicating the number of stages, the number of switching elements and the costs of the network.

d) Determine the state of the matrices in this EBN if all inlets shall be connected to the outlet with the same number (0 0, 1 1,...). Use the looping algorithm, showing all the details of the different steps (e.g., why a certain path / middle stage is chosen). Take into account that the inlets to the EBN are the outlets of the Batcher network.

Page 43: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

43

Switching, Chapter 10 85

Exam June 2003 II: Solution

c) + d)

Number of stages: 5Number of switching elements: 20Cost of the network: 80

01234567

01234567

Inlets Outlets

Switching, Chapter 10 86

References

A. Pattavina, “Switching theory”, Wiley 1998 (Available in the library).

Chapter 3 without 3.2.1.3, 3.2.1.4, 3.2.3, 3.3

Page 44: David Larrabeiti Piotr Pacyna Universidad Carlos III de Madridppacyna/switching/lecture/slides/10-ps_rearran... · David Larrabeiti Piotr Pacyna ... Universidad Carlos III de Madrid

44

Switching, Chapter 10 87

Thank you for your attention