Transcript General

Switching
2004Oct
Principles of Communication Networks
1
What is it all about?

How do we move traffic from one part of the network to another?

Connect end-systems to switches, and switches to each other

Data arriving to an input port of a switch have to be moved to
one or more of the output ports
2004Oct
Principles of Communication Networks
2
Outline

switching - general

Packet switching




General
Type of switches
Switch generations
Buffer placement

Port mappers

Buffer Placement

Dropping policies
2004Oct
Principles of Communication Networks
3
Types of switching elements

Telephone switches


Datagram routers


switch datagrams
ATM switches

2004Oct
switch samples
switch ATM cells
Principles of Communication Networks
4
Classification

Packet vs. circuit switches


packets have headers and samples don’t
Connectionless vs. connection oriented



connection oriented switches need a call setup
setup is handled in control plane by switch controller
connectionless switches deal with self-contained datagrams
Packet
switch
Circuit
switch
2004Oct
Connectionless
(router)
Internet router
Connection-oriented
(switching system)
ATM switching system
Telephone switching
system
Principles of Communication Networks
5
Other switching element functions

Participate in routing algorithms


Resolve contention for output trunks


scheduling
Admission control

2004Oct
to build routing tables
to guarantee resources to certain streams
Principles of Communication Networks
6
Requirements

Capacity of a switch is the maximum rate at which it can move
information, assuming all data paths are simultaneously active

Primary goal: maximize capacity


Circuit switch must reject call if can’t find a path for samples
from input to output


2004Oct
goal: minimize call blocking
Packet switch must reject a packet if it can’t find a buffer to store
it awaiting access to output trunk


subject to cost and reliability constraints
goal: minimize packet loss
Don’t reorder packets
Principles of Communication Networks
7
Outline

switching - general

Packet switching




General
Type of switches
Switch generations
Buffer placement

Port mappers

Buffer Placement

Dropping policies
2004Oct
Principles of Communication Networks
8
Packet switching

In a circuit switch, path of a sample is determined at time of
connection establishment

No need for a sample header--position in frame is enough

In a packet switch, packets carry a destination field

Need to look up destination port on-the-fly

IP Datagram


ATM Cell, MPLS frame


2004Oct
lookup based on entire destination address
lookup based on VCI/VPI or MPLS label
Other than that, very similar
Principles of Communication Networks
9
Blocking in packet switches

Can have both internal and output blocking

Internal


no path to output
Output

trunk unavailable

Unlike a circuit switch, cannot predict if packets will block (why?)

If packet is blocked, must either buffer or drop it
2004Oct
Principles of Communication Networks
10
Dealing with blocking

Overprovisioning


Buffers


if switch fabric doesn’t have buffers, prevent packet from entering
until path is available
Parallel switch fabrics

2004Oct
at input or output (or both)
Backpressure


internal links much faster than inputs (speedup)
increases effective switching capacity
Principles of Communication Networks
11
Repeaters, bridges, routers, and gateways

Repeaters: at physical level

Bridges: at datalink level (based on MAC addresses) (L2)


Routers: at network level (L3)



treat entire network as a single hop
e.g., mail gateways and transcoders
Gain functionality at the expense of forwarding speed

2004Oct
participate in routing protocols
Application level gateways: at application level (L7)


discover attached stations by listening
for best performance, push functionality as low as possible
Principles of Communication Networks
12
Outline

switching - general

Packet switching




General
Type of switches
Switch generations
Buffer placement

Port mappers

Buffer Placement

Dropping policies
2004Oct
Principles of Communication Networks
13
Three generations of packet switches

Different trade-offs between cost and performance

Represent evolution in switching capacity, rather than in
technology


2004Oct
With same technology, a later generation switch achieves greater
capacity, but at greater cost
All three generations are represented in current products
Principles of Communication Networks
14
First generation switch
computer
CPU
queues in memory
linecard
linecard
linecard

Old Ethernet switches and cheap packet routers

Software router, e.g., Linux/FreeBSD boxes

Bottleneck can be CPU, host-adaptor or I/O bus, depending
2004Oct
Principles of Communication Networks
15
Second generation switch
computer
bus
front end processors
or line cards

Port mapping intelligence in line cards

ATM switch guarantees hit in lookup cache
2004Oct
Principles of Communication Networks
16
Third generation switches

Bottleneck in second generation switch is the bus (or ring)

Third generation switch provides parallel paths (fabric)
OLC
ILC
IN
ILC
ILC
2004Oct
NxN
packet
switch
fabric
OLC
OUT
OLC
Principles of Communication Networks
17
Third generation (contd.)

Features



2004Oct
self-routing fabric
output buffer is a point of contention
 unless we arbitrate access to fabric
potential for unlimited scaling, as long as we can resolve contention
for output buffer
Principles of Communication Networks
18
Outline

switching - general

Packet switching



General
Type of switches
Switch generations

Port mappers

Buffer Placement

Dropping policies
2004Oct
Principles of Communication Networks
19
Port mappers

Look up output port based on destination address

Easy for VCI: just use a table

Harder for datagrams:


2004Oct
need to find longest prefix match
 e.g. packet with address 128.32.1.20
 entries: (128.32.*, 3), (128.32.1.*, 4), (128.32.1.20, 2)
A standard solution: trie
Principles of Communication Networks
20
Tries
root
(10.*)
10
128
32
54
32
4
1
120
(32.*)
25
(128.32.25.*)
(128.54.4.*)
100
(128.32.1.120) (128.32.1.100)

Some ways to improve performance


2004Oct
cache recently used addresses in a CAM
move common entries up to a higher level (match longer strings)
Principles of Communication Networks
21
Outline

switching - general

Packet switching



General
Type of switches
Switch generations

Port mappers

Buffer Placement

Dropping policies
2004Oct
Principles of Communication Networks
22
Buffering

All packet switches need buffers to match input rate to service
rate


Where should we place buffers?



2004Oct
or cause heavy packet loses
input
output
in the fabric
Principles of Communication Networks
23
Input buffering (input queueing)
queues
buffer
control
NxN
switch
inputs
queues
buffer
control
queues
buffer
control
outputs
arbitrator

No speedup in buffers or trunks (unlike output queued switch)

Needs arbiter

Problem: head of line blocking

2004Oct
with randomly distributed packets, utilization at most 58.6%
Principles of Communication Networks
24
Dealing with HOL blocking

Per-output queues at inputs (VOQ)

Arbiter must choose one of the input ports for each output port

How to select?

Parallel Iterated Matching

inputs tell arbiter which outputs they are interested in
 output selects one of the inputs
 some inputs may get more than one grant, others may get none
 if >1 grant, input picks one at random, and tells output
 losing inputs and outputs try again
Used in DEC Autonet 2 switch, McKeown’s iSLIP, and more.

2004Oct
Principles of Communication Networks
27
Output queueing
inputs
NxN
switch
fabric
outputs

Don’t suffer from head-of-line blocking

But output buffers need to run much faster than trunk speed

Can reduce some of the cost by using the knockout principle


2004Oct
unlikely that all N inputs will have packets for the same output
drop extra packets, fairly distributing losses among inputs
Principles of Communication Networks
28
Buffered fabric

Buffers in each switch element

Pros



Cons


2004Oct
Speed up is only as much as fan-in
Hardware backpressure reduces buffer requirements
costly (unless using single-chip switches)
scheduling is hard
Principles of Communication Networks
29
Buffered crossbar

What happens if packets at two inputs both want to go to same
output?

Can defer one at an input buffer

Or, buffer crosspoints
2004Oct
Principles of Communication Networks
30
Hybrid solutions

Buffers at more than one point

Becomes hard to analyze and manage

But common in practice
2004Oct
Principles of Communication Networks
31
Multicasting

Useful to do this in hardware

Assume portmapper knows list of outputs

Incoming packet must be copied to these output ports

Two subproblems


2004Oct
generating and distributing copies
ATM VCI/MPLS label translation for the copies
Principles of Communication Networks
32
Generating and distributing copies

Either implicit or explicit

Implicit




Explicit






2004Oct
suitable for bus-based, ring-based, crossbar, or broadcast switches
multiple outputs enabled after placing packet on shared bus
used in Paris and Datapath switches
need to copy a packet at switch elements
use a copy network
place # of copies in tag
element copies to both outputs and decrements count on one of them
collect copies at outputs
Both schemes increase blocking probability
Principles of Communication Networks
33
Outline

switching - general

Packet switching




General
Type of switches
Switch generations
Buffer placement

Port mappers

Buffer Placement

Dropping policies
2004Oct
Principles of Communication Networks
34
Packet dropping

Packets that cannot be served immediately are buffered

Full buffers => packet drop strategy

Packet losses happen almost always from best-effort
connections (why?)

Shouldn’t drop packets unless imperative?

2004Oct
packet drop wastes resources (why?)
Principles of Communication Networks
35
Classification of drop strategies
1. Degree of aggregation
2. Drop priorities
3. Early or late
4. Drop position
2004Oct
Principles of Communication Networks
36
1. Degree of aggregation

Degree of discrimination in selecting a packet to drop

E.g. in vanilla FIFO, all packets are in the same class

Instead, can classify packets and drop packets selectively

The finer the classification the better the protection
2004Oct
Principles of Communication Networks
37
2. Drop priorities

Drop lower-priority packets first

How to choose?



2004Oct
endpoint marks packets
regulator marks packets
congestion loss priority (CLP) bit in packet header
Principles of Communication Networks
38
CLP bit: pros and cons

Pros



Cons


2004Oct
if network has spare capacity, all traffic is carried
during congestion, load is automatically shed
separating priorities within a single connection is hard
what prevents all packets being marked as high priority?
Principles of Communication Networks
39
3. Early vs. late drop

Early drop => drop even if space is available



Early random drop


2004Oct
signals endpoints to reduce rate
cooperative sources get lower overall delays, uncooperative
sources get severe packet loss
drop arriving packet with fixed drop probability if queue length
exceeds threshold
intuition: misbehaving sources more likely to send packets and see
packet losses
Principles of Communication Networks
40
3. Early vs. late drop: RED

Random early detection (RED) makes three improvements

Metric is moving average of queue lengths



Packet drop probability is a function of mean queue length


small bursts pass through unharmed
only affects sustained overloads
prevents severe reaction to mild overload
Can mark packets instead of dropping them

allows sources to detect network state without losses

RED improves performance of a network of cooperating TCP sources

No bias against bursty sources

Controls queue length regardless of endpoint cooperation
2004Oct
Principles of Communication Networks
41
4. Drop position

Can drop a packet from head, tail, or random position in the
queue

Tail



Head


2004Oct
easy
default approach
harder
lets source detect loss earlier
Principles of Communication Networks
42
4. Drop position (contd.)

Random



2004Oct
hardest
if no aggregation, hurts hogs most
unlikely to make it to real routers
Principles of Communication Networks
43