router internals
DESCRIPTION
Router Internals. CS 4251: Computer Networking II Nick Feamster Spring 2008. Today’s Lecture. The design of big, fast routers Design constraints Speed Size Power consumption Components Algorithms Lookups and packet processing (classification, etc.) Packet queueing Switch arbitration. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/1.jpg)
Router Internals
CS 4251: Computer Networking IINick FeamsterSpring 2008
![Page 2: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/2.jpg)
2
Today’s Lecture
• The design of big, fast routers• Design constraints
– Speed– Size– Power consumption
• Components• Algorithms
– Lookups and packet processing (classification, etc.)– Packet queueing– Switch arbitration
![Page 3: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/3.jpg)
3
What’s In A Router
• Interfaces– Input/output of packets
• Switching fabric– Moving packets from input to output
• Software– Routing– Packet processing– Scheduling– Etc.
![Page 4: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/4.jpg)
4
What a Router Chassis Looks Like
Cisco CRS-1 Juniper M320
6ft
19”
2ft
Capacity: 1.2Tb/s Power: 10.4kWWeight: 0.5 TonCost: $500k
3ft
2ft
17”
Capacity: 320 Gb/s Power: 3.1kW
![Page 5: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/5.jpg)
5
What a Router Line Card Looks Like
1-Port OC48 (2.5 Gb/s)(for Juniper M40)
4-Port 10 GigE(for Cisco CRS-1)
Power: about 150 Watts 21in
2in
10in
![Page 6: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/6.jpg)
6
Big, Fast Routers: Why Bother?
• Faster link bandwidths• Increasing demands• Larger network size (hosts, routers, users)
![Page 7: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/7.jpg)
7
Summary of Routing Functionality
• Router gets packet• Looks at packet header for destination• Looks up routing table for output interface• Modifies header (ttl, IP header checksum)• Passes packet to output interface
![Page 8: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/8.jpg)
8
Generic Router Architecture
LookupIP Address
UpdateHeader
Header ProcessingData Hdr Data Hdr
1M prefixesOff-chip DRAM
AddressTable
AddressTable
IP Address Next Hop
QueuePacket
BufferMemory
BufferMemory
1M packetsOff-chip DRAM
Question: What is the difference between this architecture and that in today’s paper?
![Page 9: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/9.jpg)
9
Innovation #1: Each Line Card Has the Routing Tables
• Prevents central table from becoming a bottleneck at high speeds
• Complication: Must update forwarding tables on the fly. – How does the BBN router update tables without
slowing the forwarding engines?
![Page 10: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/10.jpg)
10
Generic Router ArchitectureLookup
IP AddressUpdateHeader
Header Processing
AddressTable
AddressTable
LookupIP Address
UpdateHeader
Header Processing
AddressTable
AddressTable
LookupIP Address
UpdateHeader
Header Processing
AddressTable
AddressTable
Data Hdr
Data Hdr
Data Hdr
BufferManager
BufferMemory
BufferMemory
BufferManager
BufferMemory
BufferMemory
BufferManager
BufferMemory
BufferMemory
Data Hdr
Data Hdr
Data Hdr
Interconnection Fabric
![Page 11: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/11.jpg)
11
RouteTableCPU Buffer
Memory
LineInterface
MAC
LineInterface
MAC
LineInterface
MAC
Typically <0.5Gb/s aggregate capacity
Shared Bus
Line Interface
CPU
Memory
First Generation Routers
Off-chip Buffer
![Page 12: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/12.jpg)
12
RouteTableCPU
LineCard
BufferMemory
LineCard
MAC
BufferMemory
LineCard
MAC
BufferMemory
FwdingCache
FwdingCache
FwdingCache
MAC
BufferMemory
Typically <5Gb/s aggregate capacity
Second Generation Routers
![Page 13: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/13.jpg)
13
Third Generation Routers
LineCard
MAC
LocalBuffer
Memory
CPUCard
LineCard
MAC
LocalBuffer
Memory
“Crossbar”: Switched Backplane
Line Interface
CPUMemory Fwding
Table
RoutingTable
FwdingTable
Typically <50Gb/s aggregate capacity
![Page 14: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/14.jpg)
14
Innovation #2: Switched Backplane• Every input port has a connection to every output port
• During each timeslot, each input connected to zero or one outputs
• Advantage: Exploits parallelism• Disadvantage: Need scheduling algorithm
![Page 15: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/15.jpg)
15
Other Goal: Utilization
• “100% Throughput”: no packets experience head-of-line blocking
• Does the previous scheme achieve 100% throughput?
• What if the crossbar could have a “speedup”?
Key result: Given a crossbar with 2x speedup, any maximal matching can achieve 100% throughput.
![Page 16: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/16.jpg)
16
Head-of-Line Blocking
Output 1
Output 2
Output 3
Input 1
Input 2
Input 3
Problem: The packet at the front of the queue experiences contention for the output queue, blocking all packets behind it.
Maximum throughput in such a switch: 2 – sqrt(2)
![Page 17: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/17.jpg)
17
Combined Input-Output Queueing
• Advantages– Easy to build
• 100% can be achieved with limited speedup
• Disadvantages– Harder to design algorithms
• Two congestion points• Flow control at
destination
input interfaces output interfaces
Crossbar
![Page 18: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/18.jpg)
18
Solution: Virtual Output Queues
• Maintain N virtual queues at each input– one per output
Output 1
Output 2
Output 3
Input 1
Input 2
Input 3
![Page 19: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/19.jpg)
19
Router Components and Functions
• Route processor– Routing– Installing forwarding tables– Management
• Line cards– Packet processing and classification– Packet forwarding
• Switched bus (“Crossbar”)– Scheduling
![Page 20: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/20.jpg)
20
Crossbar Switching
• Conceptually: N inputs, N outputs– Actually, inputs are also outputs
• In each timeslot, one-to-one mapping between inputs and outputs.
• Goal: Maximal matching
L11(n)
LN1(n)
Traffic Demands Bipartite Match
MaximumWeight Match
*
( )( ) argmax( ( ) ( ))T
S nS n L n S n
![Page 21: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/21.jpg)
21
Early Crossbar Scheduling Algorithm• Wavefront algorithm
Problems: Fairness, speed, …
![Page 22: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/22.jpg)
22
Alternatives to the Wavefront Scheduler
• PIM: Parallel Iterative Matching– Request: Each input sends requests to all outputs for which it
has packets– Grant: Output selects an input at random and grants– Accept: Input selects from its received grants
• Problem: Matching may not be maximal• Solution: Run several times
• Problem: Matching may not be “fair”• Solution: Grant/accept in round robin instead of random
![Page 23: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/23.jpg)
23
Processing: Fast Path vs. Slow Path
• Optimize for common case– BBN router: 85 instructions for fast-path code– Fits entirely in L1 cache
• Non-common cases handled on slow path– Route cache misses– Errors (e.g., ICMP time exceeded)– IP options– Fragmented packets– Mullticast packets
![Page 24: Router Internals](https://reader035.vdocument.in/reader035/viewer/2022062314/56813ad6550346895da31327/html5/thumbnails/24.jpg)
24
Recent Trends: Programmability
• NetFPGA: 4-port interface card, plugs into PCI bus(Stanford)– Customizable forwarding– Appearance of many
virtual interfaces (with VLAN tags)
• Programmability with Network processors(Washington U.)
LineCards
PEs
Switch