Top Banner
CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)
58

CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Dec 29, 2015

Download

Documents

Ashley Palmer
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

CS 552 Computer Networks

IP forwarding

Fall 2005

Rich Martin(Slides from D. Culler and N. McKeown)

Page 2: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Outline

• Where IP routers sit in the network• What IP routers look like• What do IP routers do?• Some details:

– The internals of a “best-effort” router• Lookup, buffering and switching

– The internals of a “QoS” router

Page 3: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Outline (next time)

• The way routers are really built.• Evolution of their internal workings.• What limits their performance.• The way the network is built today

Page 4: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Outline

• Where IP routers sit in the network• What IP routers look like• What do IP routers do?• Some details:

– The internals of a “best-effort” router• Lookup, buffering and switching

– The internals of a “QoS” router

• Can optics help?

Page 5: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

The Internet is a mesh of routers (in theory)

The Internet Core

IP Core router

IP Edge Router

Page 6: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

What do they look like?

Access routerse.g. ISDN, ADSL

Core routere.g. OC48c POS

Core ATM switch

Page 7: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Basic Architectural Componentsof an IP Router

Control Plane

Datapath”per-packet processingSwitching

ForwardingTable

Routing Table

Routing Protocols

Page 8: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Per-packet processing in an IP Router

1. Accept packet arriving on an incoming link.

2. Lookup packet destination address in the forwarding table, to identify outgoing port(s).

3. Manipulate packet header: e.g., decrement TTL, update header checksum.

4. Send packet to the outgoing port(s).

5. Buffer packet in the queue.

6. Transmit packet onto outgoing link.

Page 9: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

A General Switch Model

Cross-bar

InputBuffer

Control

OutputPorts

Input Receiver Transmiter

Ports

Routing, Scheduling

OutputBuffer

Interconnect

Page 10: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

IP Switch Model

2. Interconnect 3. EgressForwardin

gTable

ForwardingDecision

1. Ingress

Forwarding

Table

ForwardingDecision

Forwarding

Table

ForwardingDecision

Page 11: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Forwarding Engine

header

payload

Packet

Router

Destination Address

Outgoing Port

Dest-network PortForwarding Table

Routing Lookup Data Structure

65.0.0.0/8

128.9.0.0/16

149.12.0.0/19

3

1

7

Page 12: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

The Search Operation is not a Direct Lookup

(Incoming port, label)

Ad

dre

ss

MemoryD

ata

(Outgoing port, label)

IP addresses: 32 bits long 4G entries

Page 13: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

The Search Operation is also not an Exact Match Search

• Hashing • Balanced binary search trees

Exact match search: search for a key in a collection of keys of the same length.

Relatively well studied data structures:

Page 14: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

0 224 232-1

128.9.0.0/16

65.0.0.0

142.12.0.0/19

65.0.0.0/8

65.255.255.255

Example Forwarding Table

Destination IP Prefix Outgoing Port

65.0.0.0/8 3

128.9.0.0/16 1

142.12.0.0/19 7

IP prefix: 0-32 bits

Prefix length

128.9.16.14

Page 15: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Prefixes can Overlap

128.9.16.0/21 128.9.172.0/21

128.9.176.0/24

Routing lookup: Find the longest matching prefix (the most specific route) among all prefixes that match the destination address.

0 232-1

128.9.0.0/16142.12.0.0/1965.0.0.0/8

128.9.16.14

Longest matching prefix

Page 16: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

8

32

24

Prefixes

Pre

fix L

en

gth

128.9.0.0/16142.12.0.0/19

65.0.0.0/8

Difficulty of Longest Prefix Match

128.9.16.14

128.9.172.0/21

128.9.176.0/24

128.9.16.0/21

Page 17: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Lookup Rate Required

12540.0OC768c2002-03

31.2510.0OC192c2000-01

7.812.5OC48c1999-00

1.940.622OC12c1998-99

40B packets (Mpps)

Line-rate (Gbps)

LineYear

DRAM: 50-80 ns, SRAM: 5-10 ns

31.25 Mpps 33 ns

Page 18: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

0

10000

20000

30000

40000

50000

60000

70000

80000

90000

100000

Size of the Forwarding Table

Source: http://www.telstra.net/ops/bgptable.html

95 96 97 98 99 00Year

Num

ber

of

Pre

fixes

10,000/year

Page 19: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Types of Internal Interconnects

Io

I1

I2

I3

Io I1 I2 I3

O0

Oi

O2

O3

RAMphase

O0

Oi

O2

O3

DoutDin

Io

I1

I2

I3

addr

1. Multiplexers 2. Tri-State Devices

3. Shared Memory

Page 20: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Where do packets go post output port selection? Two basic techniques

Input Queueing Output Queueing

Usually a non-blockingswitch fabric (e.g. crossbar)

Usually a fast bus

Page 21: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Shared Memory Bandwidth

SharedMemory

200 byte bus

5ns SRAM

1

2

N

• 5ns per memory operation• Two memory operations per packet• Therefore, up to 160Gb/s• In practice, closer to 80Gb/s

Page 22: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Input buffered swtich

• Independent routing logic per input– FSM

• Scheduler logic arbitrates each output– priority, FIFO, random

• Head-of-line blocking problem

Cross-bar

OutputPorts

Input Ports

Scheduling

R0

R1

R2

R3

Internconnect

Page 23: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Input QueueingHead of Line Blocking

Dela

y

Load58.6% 100%

Page 24: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Head of Line Blocking

Page 25: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

(Virtual) Output Buffered Switch

• How would you build a shared pool?

Control

OutputPorts

Input Ports

OutputPorts

OutputPorts

OutputPorts

R0

R1

R2

R3

N buffers per input

Page 26: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Solving HOL with Input QueueingVirtual output queues

Page 27: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Input QueueingVirtual Output Queues

Dela

y

Load100%

Page 28: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Output scheduling

• n independent arbitration problems?– static priority, random, round-robin

• simplifications due to routing algorithm?• general case is max bipartite matching

Cross-bar

OutputPorts

R0

R1

R2

R3

O0

O1

O2

InputBuffers

Page 29: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Finding a maximum size match

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

A

B

C

D

E

F

1

2

3

4

5

6

Inputs Outputs

Requests

Page 30: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Network flows and bipartite matching

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

of size 1.

A 1

Sources

Sinkt

B

C

D

E

F

2

3

4

5

6

Page 31: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Network flows and bipartite matching

A 1

B

C

D

E

F

2

3

4

5

6

Maximum Size Matching:

Page 32: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

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– Too Slow in Practice

• But gives nice theory and upper bound

Page 33: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Arbitration

– Maximal Matches– Wavefront Arbiter (WFA)– Parallel Iterative Matching (PIM)– iSLIP

Page 34: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

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.

Page 35: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Example of Maximal Size Matching

A 1

B

C

D

E

F

2

3

4

5

6

A 1

B

C

D

E

F

2

3

4

5

6

Maximal Size Matching

Maximum Size Matching

A

B

C

D

E

F

1

2

3

4

5

6

Page 36: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

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.

Page 37: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Routing Strategies?

• Architecture of the middle of the switch? – Wavefront– Slip/PIM– Butterfly/Benes networks

• Goal in each case is a conflict-free schedule of inputs to outputs given the output is already determined

Page 38: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Wave Front Arbiter(Tamir)

Requests Match

1

2

3

4

1

2

3

4

1

2

3

4

1

2

3

4

Page 39: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Wave Front Arbiter

Requests Match

Page 40: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Wavefront ArbitersProperties

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

• Always finds maximal match.• Usually requires mechanism to prevent inputs

from getting preferential service.– What the 50Gbs router does:

• Scramble (permute) inputs each cycle

Page 41: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Parallel Iterative Matching

1234

1234

1: Requests

1234

1234

2: Grant

1234

1234

3: Accept/Match

selection

1234

1234

selection

1234

1234

#1

#2

Itera

tion

:

1234

1234

Page 42: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

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.

Page 43: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Parallel Iterative Matching

PIM with a single iteration

Page 44: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Parallel Iterative Matching

PIM with 4 iterations

Output Queuing

Page 45: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

iSLIP

1

2

3

4

1

2

3

4

1: Requests

1

2

3

4

1

2

3

43: Accept/Match

1

2

3

4

1

2

3

4

#1

#2

1

2

3

4

1

2

3

4

1

2

3

4

1

2

3

4

1

2

3

4

1

2

3

42: Grant

12

3

4

Page 46: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

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.

Page 47: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

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.

Page 48: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

iSLIP

iSLIP with 4 iterations

FIFO

Output Buffering

Page 49: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

iSLIPImplementation

Grant

Grant

Grant

Accept

Accept

Accept

1

2

N

1

2

N

State

N

N

N

Decision

log2N

log2N

log2N

Page 50: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Alternative Switching

• Crossbars are expensive• Alternative networks can match inputs to

outputs:– Ring– Tree– K-ary N-cubes – Multi-stage logarithmic networks

• Each cell has constant number of inputs and outputs

Page 51: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Example: Butterfly

000

001

010011

100

101

110111

000

001

010011

100

101

110111

Butter fly Network

split on MSB

split on LSB

Page 52: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Butterfly

Inputs

Outputs

A “Butterfly”

Page 53: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Benes Network

Butterfly #1 Butterfly #2

Page 54: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Benes networks

• Any permutation has a conflict free route– Useful property– Offline computation is difficult

• Can route to random node in middle, then to destination – Conflicts are unlikely under uniform traffic– What about conflicts?

Page 55: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Sorting Networks

• Bitonic sorter recursively merges sorted sublists.• Can switch by sorting on destination.

– additional components needed for conflict resolution

125

615

09

34

138

111

72

1410

515

612

40

93

811

113

142

107

56

1215

94

30

18

1113

1410

72

59

46

312

015

141

108

117

132

35

04

912

615

1411

1310

71

82

03

45

69

1215

1413

1110

87

21

014

313

411

510

68

79

212

115

06

37

24

15

814

913

1112

1015

02

13

46

57

811

910

1214

1315

01

23

45

67

89

1011

1213

1415

minmaxmaxmin

512

156

09

43

813

111

27

1410

Page 56: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Flow Control

• What do you do when push comes to shove?– ethernet: collision detection and retry after delay– FDDI, token ring: arbitration token– TCP/WAN: buffer, drop, adjust rate– any solution must adjust to output rate

• Link-level flow control

Data

Ready

Page 57: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Link Flow Control Examples

• Short Links

• long links– several flits on the wire

Source

Destination

Data

Req

Ready/AckF/E F/E

Page 58: CS 552 Computer Networks IP forwarding Fall 2005 Rich Martin (Slides from D. Culler and N. McKeown)

Smoothing the flow

• How much slack do you need to maximize bandwidth?

LowMark

HighMark

Empty

Full

Stop

Go

Incoming Phits

Outgoing Phits

Flow-control Symbols