programming scheduling algorithms for input-queued switches

26
1 Programming scheduling algorithms for Input-Queued switches Class on Switching technologies for data centers 2020/21 Paolo Giaccone Telecommunication Network Group Dept. of Electronics and Telecommunication Politecnico di Torino http://www.tlc-networks.polito.it

Upload: others

Post on 20-Dec-2021

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Programming scheduling algorithms for Input-Queued switches

1

Programming scheduling algorithms for Input-Queued

switchesClass on

Switching technologies for data centers2020/21

Paolo Giaccone

Telecommunication Network GroupDept. of Electronics and Telecommunication

Politecnico di Torinohttp://www.tlc-networks.polito.it

Page 2: Programming scheduling algorithms for Input-Queued switches

2

Basic router architecture

Control Plane

Datapathper-packet processing

SwitchingForwardingTable

Routing table

Routing protocols

Page 3: Programming scheduling algorithms for Input-Queued switches

3

S F

LC

LC

LC

LC

CP

S F

IP

IP

IP

IP

CP

OP

OP

OP

OP

Hardware architecture

physical structure logical structure

Page 4: Programming scheduling algorithms for Input-Queued switches

4

Hardware architecture

Main elementsØ line cards

§ support input/output transmissions§ adapt packets to the internal format of the switching fabric§ support data link protocols§ In most architectures

• store packets• classify packets• schedule packets• support security

Ø switching fabric§ transfers packets from input ports to output ports

Page 5: Programming scheduling algorithms for Input-Queued switches

5

Ø control processor/network processor§ runs routing protocols§ computes and stores routing tables§ manages the overall system§ sometimes

• store packets• classify packets• schedule packets• support security

Ø forwarding engines§ inspect packet headers§ compute the packet destination (lookup)

• Searching routing or forwarding (cache) tables§ rewrite packet headers

Hardware architecture

Page 6: Programming scheduling algorithms for Input-Queued switches

Cell-based routers

Ø ISM: Input-Segmentation Module

Ø ORM: Output-Reassembly Module

Ø packet: variable-size data unit

Ø cell: fixed-size data unit

6

Cell switch (fabric) ORM1

ORMN

1

ISM

N

ISM

packets cells cells packets

Page 7: Programming scheduling algorithms for Input-Queued switches

7

Switching fabric

Ø Our assumptions:§ bufferless

• to reduce internal hardware complexity§ non-blocking

• given a non-conflicting set of inputs/outputs, it is always possible to connect inputs with outputs

Page 8: Programming scheduling algorithms for Input-Queued switches

8

Switching fabric

Ø Examples:§ bus§ shared memory§ crossbar§ multi-stage

• rearrangeable Clos network • Benes network • Batcher-Banyan network (self-routing)

Ø Switching constraints§ at most one cell for each input and for each output

can be transferred

1234

1 2 3 4outputs

inpu

ts

Page 9: Programming scheduling algorithms for Input-Queued switches

9

IQ switches with VOQ

Output N

Input 11

N

Output 1

Input N1

N

scheduler

switching fabric

Note: from now on, we always assume VOQ at the switch inputs

input constraints

output constraints

Page 10: Programming scheduling algorithms for Input-Queued switches

10

Scheduling in IQ switches

Ø Scheduling can be modeled as a matching problem in a bipartite graph§ the edge from node i to node j refers to packets

at input i and directed to output j§ the weight of the edge can be

• binary (not empty/empty queue)• queue length• HOL cell waiting time, or cell age• some other metric indicating the priority

of the HOL cell to be served

Page 11: Programming scheduling algorithms for Input-Queued switches

11

Scheduling in IQ switches

5

Graph G Matching M1

2

3

4

3

4

2

54

8

2

5

4

4

8

1

2

3

4

1

2

3

4

1

2

3

4

Graph Matching

inputs outputs

scheduler

Page 12: Programming scheduling algorithms for Input-Queued switches

12

Maximum Weight Matching

Ø Maximum Weight Matching (MWM) § among all the possible N! matchings, selects the one

with the highest weight (sum of the queue lengths)• MWM is generally not unique

§ optimal in terms of performance • maximum throughput and minimum delay

§ too complex to be implemented in hardware at high speed

• the best MWM algorithm requires O(N3) iterations, and cannot be implemented efficiently, since it is based on a flow augmentation path algorithm

Page 13: Programming scheduling algorithms for Input-Queued switches

13

Maximum Size Matching

Ø Maximum Size Matching (MSM) § among all the possible matchings, selects the one

with the highest number of edges/packets (like MWM with binary edge weights)

• MSM is generally not unique§ the best MSM algorithm requires O(N2.5) iterations,

and cannot be implemented efficiently, since it is based on a flow augmentation path algorithm

Page 14: Programming scheduling algorithms for Input-Queued switches

14

Maximum Size Matching

Ø MSM maximizes the instantaneous throughput

Ø MSM may not yield 100% throughput§ short term decisions can be inefficient

in the long term § non-binary edge weights allow MWM

to maximize the long-term throughput

Page 15: Programming scheduling algorithms for Input-Queued switches

15

Approximations of MSM and MWM

Ø Motivation§ strong interest in scheduling algorithms with

• very low complexity• high performance

Ø Usually§ implementable schedulers (low complexity)

Þ low throughput, long delays§ theoretical schedulers (high complexity)

Þ high throughput, short delays

Page 16: Programming scheduling algorithms for Input-Queued switches

Programming the scheduling algorithm

Ø Input data structure:int VOQ[N][N] § VOQ[i][j] is the # of enqueued packets from

input i to output j Ø Output data structure:

int matching[N]§ matching[i]=j means that input i is

connected to output j§ matching[i]=-1 means that input i is not

connected 16

Page 17: Programming scheduling algorithms for Input-Queued switches

Programming the scheduling algorithm

Ø Auxiliary data structureboolean output_reserved[N]§ output_reserved[j]=true iff output j has

been already matched with some inputØ Initializefor (i=0; i<N; i++) {

matching[i]=-1; // input i not connected

output_reserved[i]=false; // output i available

}

17

Page 18: Programming scheduling algorithms for Input-Queued switches

Programming the scheduling algorithm

Ø Scheduling approximating the MSMfor (i=0; i<N; i++) {// for each input

for (j=0; j<N; j++) {// for each output

if ((VOQ[i][j])>0 && (output_reserved[j]==false)) { // check if the VOQ is not empty and the corresponding output is yet available

matching[i]=j; // input i not connected

output_reserved[j]=true; // reserve output j

break; // consider next input

}}

} 18

Page 19: Programming scheduling algorithms for Input-Queued switches

Other programming variants

Ø the code for approximating the MSM can be modified § to give higher priority to longest queues or to

other metrics§ to support priority-based policies§ to support multicast traffic

• requires some minor modifications

19

Page 20: Programming scheduling algorithms for Input-Queued switches

20

Routers and switches

Ø IP routers deal with variable-size packets Ø Hardware switching fabrics often deal

with fixed-size cells

Question:§ how to integrate an hardware switching fabric

within an IP router?

Page 21: Programming scheduling algorithms for Input-Queued switches

21

Router based on an IQ cell switch: cell-mode

switching fabric

IQ cell switch1 ISM

N ISM

ORM1

ORMN

Page 22: Programming scheduling algorithms for Input-Queued switches

22

Cell-mode scheduling

Ø Scheduling algorithms work at cell level§ pros:

• 100% throughput achievable§ cons:

• interleaving of packets at the outputs of the switching fabric

Page 23: Programming scheduling algorithms for Input-Queued switches

23

Router based on an IQ cell switch: packet-mode

switching fabric

IQ cell switch1 ISM

N ISM

ORM1

ORMN

NO packet interleaving

if packet-mode

Page 24: Programming scheduling algorithms for Input-Queued switches

24

Router based on an IQ cell switch: packet-mode

switching fabric

IQ cell switch1 ISM

N ISM

ORM1

ORMN

NO packet interleaving

if packet-mode

ORMs can be removed

Page 25: Programming scheduling algorithms for Input-Queued switches

25

Packet-mode scheduling

Ø Rule: packets transferred as trains of cells§ when an input starts transferring the first cell

of a packet comprising k cells, it continues to transfer in the following k-1 time slots

Ø Pros:§ no interleaving of packets at the outputs§ easy extension of traditional schedulers

Ø Cons:§ starvation due to long packets

• inherent in packet systems without preemption• negligible for high speed rates

Page 26: Programming scheduling algorithms for Input-Queued switches

Programming packet mode

Ø simple variant of scheduler for IQ switch§ block the matching[i]=j until the last cell of the

packet• e.g., using a binary flag

§ compute the matching on only the unblocked input and output pairs• i.e., on a subset of the rows and columns of

VOQ

26