switching hardware

53
Spring 2015 © CS 438 Staff, University of Illinois 1 Switching Hardware

Upload: others

Post on 07-Jun-2022

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 1

Switching Hardware

Page 2: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 2

Where are we?

n  Understand ¡  Different ways to move through a network

(forwarding) n  Read signs at each switch (datagram) n  Follow a known path (virtual circuit) n  Carry instructions (source routing)

¡  Bridge approach to extending LAN concept n  Next: how switches are built and contention

within switches

Page 3: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 3

Switch Design

Champaign

Effingham

Springfield

Bloomington

St. Louis

Indianapolis

Chicago

How should we design Champaign to accommodate

traffic flows?

Page 4: Switching Hardware

Switch architecture

Spring 2015 © CS 438 Staff, University of Illinois 4

Cisco Catalyst 6500

Juniper EX2200

Juniper EX8200

Page 5: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 5

Switch Design

Input Port

Input Port

Input Port

Input Port

Input Port

Input Port

Output Port

Output Port

Output Port

Output Port

Output Port

Output Port

Switch Fabric

Page 6: Switching Hardware

Switch Architecture

n  Problem ¡  Connect N inputs to M

outputs n  NxM (“N by M”) switch n  Common case: N = M

n  Goals ¡  Avoid contention ¡  High throughput ¡  Good scalability

n  Near-linear size/cost growth Spring 2015 © CS 438 Staff, University of Illinois 6

Input Port

Input Port

Input Port

Input Port

Input Port

Input Port

Output Port

Output Port

Output Port

Output Port

Output Port

Output Port

Switch Fabric

Page 7: Switching Hardware

Switch high level architecture

n  Ports handle complexity ¡  Forwarding decisions at

input ports ¡  Buffering at output and

possibly input ports

n  Simple fabric (it seems…) ¡  Move packets from inputs to outputs ¡  May have a small amount of internal buffering

Spring 2015 © CS 438 Staff, University of Illinois 7

Input Port

Input Port

Input Port

Input Port

Input Port

Input Port

Output Port

Output Port

Output Port

Output Port

Output Port

Output Port

Switch Fabric

Page 8: Switching Hardware

Switch Design Goals

n  Minimize Contention ¡  Avoid contention through intelligent buffering ¡  Use output buffering when possible ¡  Apply back pressure through switch fabric ¡  Improve input buffering through non-FIFO

buffers n  Reduces head-of-line blocking

¡  Drop packets if input buffers overflow

Spring 2015 © CS 438 Staff, University of Illinois 8

Page 9: Switching Hardware

Switch Design Goals

n  Maximize Throughput ¡  Main problem is contention ¡  Need a good traffic model

n  Arrival time n  Destination port n  Packet length

¡  Telephony modeling is well understood n  Until faxes and modems

¡  Data traffic has different properties n  E.g., phone call arrivals are “Poisson”, but packet

arrivals are “heavy-tailed” Spring 2015 © CS 438 Staff, University of Illinois 9

Page 10: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 10

Contention

n  Problem ¡  Some packets may be destined for the same output port

n  Solutions ¡  One packet gets sent first ¡  Other packets get delayed or dropped

n  Delaying packets requires buffering ¡  Buffers are finite, so we may still have to drop ¡  Buffering at input ports

n  Increases, adds false contention n  Sometimes necessary

¡  Buffering at output ports ¡  Buffering inside switch

Page 11: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 11

Buffering

Waiting to buy food Waiting for

Cust. service

standard checkout lines customer service

We need “buffering”, places where people can wait before they

get service

Page 12: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 12

Output Port Buffering

Waiting to buy food

standard checkout lines customer service

Waiting for Cust. service How big should buffers be?

à Should make sure we can hold enough à But don’t want people to wait forever

Page 13: Switching Hardware

Switch Design

Spring 2015 © CS 438 Staff, University of Illinois 13

Input Port 1

Input Port 2

Input Port 3

Input Port 4

Input Port 5

Input Port 6

Output Port 1

Output Port 2

Output Port 3

Output Port 4

Output Port 5

Output Port 6

Output Queues

Add output queues to hold packets Packet remains queued here until output port available to send

Page 14: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 14

Input Port Buffering standard checkout lines customer service

Waiting for Cust. service People waiting to get

into the store

Waiting to buy food We also need buffering at the input, since processing can be slower than input rate,

or delays at output

Page 15: Switching Hardware

Switch Design

Spring 2015 © CS 438 Staff, University of Illinois 15

Input Port 1

Input Port 2

Input Port 3

Input Port 4

Input Port 5

Input Port 6

Output Port 1

Output Port 2

Output Port 3

Output Port 4

Output Port 5

Output Port 6

Input Queues

Output Queues

Add input queues to temporarily hold received packets until they can be processed Packet remains queued until input queue empties, until output queue has free slots

Page 16: Switching Hardware

Switch design: putting the pieces together

Spring 2015 © CS 438 Staff, University of Illinois 16

Input Port 1

Input Port 2

Input Port 3

Input Port 4

Input Port 5

Input Port 6

Output Port 1

Output Port 2

Output Port 3

Output Port 4

Output Port 5

Output Port 6

Input Queues

Output Queues

Interconnection Network

Page 17: Switching Hardware

Switch design: putting the pieces together

Spring 2015 © CS 438 Staff, University of Illinois 17

Input Port 1

Input Port 2

Input Port 3

Input Port 4

Input Port 5

Input Port 6

Output Port 1

Output Port 2

Output Port 3

Output Port 4

Output Port 5

Output Port 6

Input Queues

Output Queues

Interconnection Network

Packet remains queued until input queue empties and output queue 3 has free slots Packet remains queued until

output port available to send

data dst

Looks in forwarding table, finds output port 3 is associated with destination

Page 18: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 18

Contention – Head of Line Blocking

standard checkout lines customer service

cashiers are standing by! cashiers are standing by! cashiers are standing by!

People waiting to get into the store

waiting for free slots in cust. svc line “Head of line blocking”

slows throughput

Page 19: Switching Hardware

Head of Line Blocking

Spring 2015 © CS 438 Staff, University of Illinois 19

Input Port 1

Input Port 2

Input Port 3

Input Port 4

Input Port 5

Input Port 6

Output Port 1

Output Port 2

Output Port 3

Output Port 4

Output Port 5

Output Port 6

Input Queues

Output Queues

Interconnection network:

“switch fabric” 4 3 2 1

2 4 4 2

4 1 3 4

1 2 1 3

Two packets with same output port à contention

We can’t send this packet, even though it’s not contending for resources!

Page 20: Switching Hardware

Unblocking head of line blocking

n  Solution 1: No input queue ¡  Switching fabric (hopefully) keeps up with input

rate n  Solution 2: No need to always serve packet

at head of queue. Could pick any! ¡  Each input port has separate queue for each

output port n  Next question: which packet do we pick?

Spring 2015 © CS 438 Staff, University of Illinois 20

Page 21: Switching Hardware

Picking packets’ ports

Spring 2015 © CS 438 Staff, University of Illinois 21

1 3 2

4 1

4

1 4 2

Input port 1

Input port 2

Input port 3

Input port 4

4 Switching fabric

Output port 1

Output port 2

Output port 3

Output port 4

Page 22: Switching Hardware

Picking packets’ ports

n  Underlying problem for max throughput in single timestep: bipartite matching ¡  Pick max subset of edges using 1 edge per node

Spring 2015 © CS 438 Staff, University of Illinois 22

1 3 2

4 1

4

1 4 2

Input port 1

Input port 2

Input port 3

Input port 4

4 Switching fabric

Output port 1

Output port 2

Output port 3

Output port 4

Page 23: Switching Hardware

Picking packets’ ports

n  Switches may not find optimal solution: we also want ¡  Fairness ¡  Simplicity of implementation

Spring 2015 © CS 438 Staff, University of Illinois 23

1 3 2

4 1

4

1 4 2

Input port 1

Input port 2

Input port 3

Input port 4

4 Switching fabric

Output port 1

Output port 2

Output port 3

Output port 4

Page 24: Switching Hardware

What we know so far

n  Buffering masks temporary contention n  Need to carefully manage queues

¡  Head-of-line blocking problem ¡  Fairness ¡  Throughput

Spring 2015 © CS 438 Staff, University of Illinois 24

Page 25: Switching Hardware

What we know so far

n  Did we completely solve contention problem? Could a packet ever be dropped? ¡  Yes: queues can still overflow ¡  Solution 1: plan allowed packet rates in

advance – virtual circuit switching ¡  Solution 2: dynamically request rate

reduction – backpressure

Spring 2015 © CS 438 Staff, University of Illinois 25

Page 26: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 26

Contention – Back Pressure

n  Let the receiver tell the sender to slow down ¡  Propagation delay requires that the receiver

react before the buffer is full ¡  Typically used in networks with small

propagation delay

switch 1 switch 2

“no more, please”

Page 27: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 27

Contention – Back Pressure

n  Need to send backpressure before queue fills

n  So, better when propagation delay small ¡  e.g., switch fabrics ¡  e.g., Ethernet pause-based flow control (IEEE

802.3x) used to run FibreChannel over Ethernet

Switch 2 1 1 3 2 1 4 3 2

1 5 4 3

1 2 1 2 3 4 5 6 9 8 7 6 5 4

1 2 3 stop

1 2 3 4 7 6 5

stop 1 2 3 4 5

8 7 6

stop 1 2 3 4 5 6

9 8

7 Discard:

9 1 2 3 4 5 6

8 Discard: 9 Discard:

1 2 3 4 5 6 Switch

Page 28: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 28

Switch Design Goals

n  High Throughput ¡  Number of packets a switch can forward

per second n  High Scalability

¡  How many input/output ports can it connect

n  Low Cost ¡  Per port monetary costs

Page 29: Switching Hardware

Two simple fabrics

Spring 2015 © CS 438 Staff, University of Illinois 29

Two simple fabrics for very

large high-performance

switches!

Shared bus or memory: Low $, low throughput

Full mesh: High $, high throughput

Page 30: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 30

Special Purpose Switches

n  Problem ¡  Connect N inputs to M outputs

n  NxM (“N by M”) switch n  Often N = M

n  Goals ¡  High throughput

n  Best is MIN(sum of inputs, sum of outputs) ¡  Avoid contention ¡  Good scalability

n  Linear size/cost growth

Input Port

Input Port

Input Port

Input Port

Input Port

Input Port

Output Port

Output Port

Output Port

Output Port

Output Port

Output Port

Switch Fabric

Page 31: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 31

Switch Design

n  Ports handle complexity ¡  Forwarding decisions ¡  Buffering

n  Simple fabric ¡  Move packets from inputs to outputs ¡  May have a small amount of internal buffering

Input Port

Input Port

Input Port

Input Port

Input Port

Input Port

Output Port

Output Port

Output Port

Output Port

Output Port

Output Port

Switch Fabric

Page 32: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 32

Switch Design Goals

n  Throughput ¡  Main problem is contention ¡  Need a good traffic model

n  Arrival time n  Destination port n  Packet length

¡  Telephony modeling is well understood n  Until faxes and modems

¡  Modeling of data traffic is new n  Not well understood n  Will good models help?

Page 33: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 33

Switch Design Goals

n  Contention ¡  Avoid contention through intelligent buffering ¡  Use output buffering when possible ¡  Apply back pressure through switch fabric ¡  Improve input buffering through non-FIFO

buffers n  Reduces head-of-line blocking

¡  Drop packets if input buffers overflow

Page 34: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 34

Switch Design Goals

n  Scalability ¡  O(N) ports ¡  Port design complexity O(N) gives O(N2)

for entire switch ¡  Port design complexity of O(1) gives O(N)

for entire switch

Page 35: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 35

Switch Design

n  Crossbar Switches n  Banyan Networks n  Batcher Networks n  Sunshine Switch

Page 36: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 36

Crossbar Switch

n  Every input port is connected to every output port ¡  NxN

n  Output ports ¡  Complexity scales as O(N2)

Page 37: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 37

Crossbar Switch

Output Port

Output Port

Output Port

Output Port

Input Port

Input Port

Input Port

Input Port

Page 38: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 38

Knockout Switch

n  Problem ¡  Full crossbar requires each output port to handle up to N

input packets n  Assumption

¡  It is unlikely that N inputs will have packets destined for the same output port

n  Instead ¡  implement each port to handle L<N packets at the same

time n  Challenges

¡  What value of L to use ¡  Managing hotspots

Page 39: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 39

Knockout Switch

n  Output port design ¡  Packet filters

n  Recognize packets destined for a specific port ¡  Concentrator

n  Selects up to L packets from those destined for this port

n  “Knocks out” (discards) excess packets

¡  Queue n  Length L

Page 40: Switching Hardware

Knockout Switch

n  Goal ¡  Want some fairness ¡  No single input should have its packets always “knocked out”

n  Approach ¡  Essentially a “knock out” tennis tournament with

each game of 2 players (packets) chosen randomly

¡  Overall winner is selected by playing log N rounds, and keeping the winner

Spring 2015 © CS 438 Staff, University of Illinois 40

Page 41: Switching Hardware

Knockout Switch

n  Pick L from N packets at a port ¡  Output port maintains L cyclic buffers ¡  Shifter places up to L packets in one cycle ¡  Each buffer gets only one packet ¡  Output port uses round-robin between buffers ¡  Arrival order is maintained

n  Output ports scale as O(N)

Spring 2015 © CS 438 Staff, University of Illinois 41

Page 42: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 42

Knockout Switch

R R

R

D

R

R D

R 2x2

random selector

Delay unit

Choose L of N

Ex: 2 of 4

What happens if more than L

arrive?

1 2 3 4

Choice 1

Choice 2

Discard 1

3 4

1 2

3 4

Discard 1

2 3 4

Page 43: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 43

Self-Routing Fabrics

n  Idea ¡  Use source routing on “network” in switch ¡  Input port attaches output port number as

header ¡  Fabric routes packet based on output port

n  Types ¡  Banyan Network ¡  Batcher-Banyan Network ¡  Sunshine Switch

Page 44: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 44

Banyan Network

n  A network of 2x2 switches ¡  Each element routes to output 0 or 1

based on packet header ¡  A switch at stage i looks at bit i in the

header

0 1 00100

Page 45: Switching Hardware

Banyan Network

Spring 2015 © CS 438 Staff, University of Illinois 45

101

101

101

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

101

Page 46: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 46

Banyan Network

001

011

110 111

001

011

110

111

001

011

110

111

001

011

110 111

001

011

110

111

Page 47: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 47

Banyan Network

n  Perfect Shuffle ¡  N inputs requires log2N stages of N/2 switching

elements ¡  Complexity on order of N log2N

n  Collisions ¡  If two packets arrive at the same switch destined

for the same output port, a collision will occur ¡  If all packets are sorted in ascending order upon

arrival to a banyan network, no collisions will occur!

Page 48: Switching Hardware

Collision in a Banyan Network

Spring 2015 © CS 438 Staff, University of Illinois 48

001

011

110

111

001

110

001

110

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

0 1

001

110

001

011

110

010

Collision! Happens because input is unsorted

Page 49: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 49

Batcher Network

n  Performs merge sort n  A network of 2x2 switches

¡  Each element routes to output 0 or 1 based on packet header

¡  A switch at stage i looks at the whole header ¡  Two types of switches

n  Up switch ¡  Sends higher number to top output (0)

n  Down switch ¡  Sends higher number to bottom output (1)

U

D

Page 50: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 50

Batcher Network

D

D

D

U

D

D

Sort Merge

6

3

1

7

7

3

6

1

7

3

6

1

3

7

6

1

1

7

3

6

Merge

7

3

6

1

Page 51: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 51

Batcher Network

8x8 Switch

D

D

D

U

D

D

U

U

U

D

U

U

D

D

D

D

D

D

D

D

D

D

D

D

Sort inputs 0 – 3 in ascending order

Sort inputs 4 – 7 in descending order

Merge 0 – 3 with 4 – 7

Page 52: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 52

Batcher Network

n  How it really works ¡  Merger is presented with a pair of sorted lists,

one in ascending order, one in descending order ¡  First stage of merger sends packets to the

correct half of the network ¡  Second stage sends them to the correct quarter

n  Size ¡  N/2 switches per stage ¡  log2N x (1 + log2N)/2 stages ¡  Complexity = N log2

2N

Page 53: Switching Hardware

Spring 2015 © CS 438 Staff, University of Illinois 53

Batcher-Banyan Network

n  Idea ¡  Attach a batcher network back-to-back with a

banyan network ¡  Arbitrary unique permutations can be routed

without contention