Documente Academic
Documente Profesional
Documente Cultură
Connecting devices
Connecting devices
Networking devices
Internetworking devices
Hub/ Repeater L1
Bridge/ Switch L2
Router L3
IEEE 802
10111101 10111101
10111101 01110101
10111101 10111101
10111101 01110101
10111101 10111101
10111101 01110101
00:0E:35:64:E9:E 7
netid
hostid
IPv4 addr
10111101 11000000
10111101 00100100
10111101 01111101
10111101 00010010
192.36.125.18
Routing vs bridging
Bridging - forwarding on layer 2
A MAC address/ID has a flat structure
many nodes -> large forwarding tables broadcast reaches all nodes
Simple to configure and manage, cheaper Loops detected by spanning tree protocol
Routing is more difficult to configure Loops detected by routing protocols and TTL decrementation
4
Packet forwarding Not only IPv4: IPv6, MPLS, Bridging/VLAN, Tunneling,... Filter packets Metering/Shaping/Policing Compute routes: build forwarding table In the background: routing In real-time: forwarding
Access lists
Classifier
Lookup
Metering
Shaping
Router Components
CPU module Control Processor Routing Engine CPU Routing Table Memory Execute routing protocols, compute routing table, configure line cards...
Input buffering, waiting for access to output port... Line cards Examine headers, Memory routing decision... Packet Processing MAC External links
Line Card
Line Card
Fast path
Line Card
Line Card
Fast path If line cards can determine outgoing port Slow path Control processor must determine outgoing port
7
Line Card
Line Card
Line Card
Every packet goes twice over the shared bus Constrained by Bus and memory bandwidth (per byte cost) And CPU cycles (per packet cost)
8
Multiple simultaneous transfers over the backplane Specialized hardware: ASICs (Application Specific IC) Wirespeed at 100 Gb/s and beyond
9
Crossbar Architecture
controller input ports switching fabric 1
Space division approach Switched interconnection between input and output Centralized controller
coordinates input-output ports activates paths between ports
2 . . . N
. . .
. . .
input ports
output ports
Relies on time division internal data path is shared Address, control, and data lines and a bus protocol Granularity
Packet granularity: simple, but may result in delay problems Block granularity: more overhead, but avoids long delays
. . .
11
Netid Netid
31 32
destination IP address
12
...
00*
01*
10*
11*
000*
011*
110*
0010
0110
0111
13
00*
01*
10*
11*
a
14
g f e d c b a
TCAM layout
Route lookup in one memory access Prefixes ordered by length First match first Contents need to be sorted
24-bit prefixes 32-bit prefixes 31-bit prefixes
8-bit prefixes
16
Packet classification
Map a packet to a class Class defined by filters, usually a 5-tuple:
<source IP, destination IP, source port, destination port, protocol>
Applications:
Firewall & NAT Blocking Accounting Policy routing QoSmetering, policing, DiffServ marking, ...
17
Cisco 12816
Port density examples 30xOC-192 (10 Gb/s) ports 120xOC-48 (2.5 Gb/s) ports 15x10 Gigabit Ethernet ports 60x1 Gigabit Ethernet ports
Capacity: 1.28 Tb/s Power: 4.7 kW 19
6ft
2ft
18
Cisco CRS-1
CISCO's current flagship: Carrier- Routing System 3-stage multi-stage switching plane >50% of cost Trie prefix lookup 7.5kW Each slot has 40Gbps 32Tbps raw bandwidth Distributed RP Several Logical Routers Optical_Electric transitions: O-E-O-E-O-E-O
19
Juniper Routers
M-series Shipping started 1998 M5, M10, M20, M40e, M160, M320 8xOC-192 or 32xOC-48 ports in a M160 T-series Shipping started 2002 T320, T640 32xOC-192 or 128xOC-48 ports in a T640
2.5ft Juniper M160
20
3ft
21
Juniper J-series
J-series Routers used in labs Emulates M/T series Full routing software
22
23
QPI
Multi-core CPUs: (Intel Nehalem) 8 cores, 16 with 'Hyper-threading' Multi-channel: each network card has 8 DMA queues NUMA: Non-local memory (many memory banks) Inter-processor bus: QPI 2.4GHz ~76 GB/s Memory: 1066 DDR3 68 GB/s x3 channels I/O Bus: PCI-E gen2 x1 ~4GB/s: x16 ~64GB/s
24
Homework 4
4a) Write a report on how forwarding works 4b) Make a programming assignment in C
Part 1: Print out IPv4 destination address Part 2: Make an IPv4 forwarding lookup
25
27
You will also get a mail Submit solution electronically, or on paper lab assistants or course leader before the deadline. Append a receipt that you passed both forwarding and forwarding2 test of Kattis.
29
30
Forwarding: Details
Ethernet decoding Check Ethernet header length Check ethernet destination address Dispatch on payload type for IPv4. IP header sanity checks IP header length checks (check buffer length vs hdr-len field vs total length field). IP packets containing IP options should be relayed without action. Check IP header version Check checksum Forwarding FIB lookup for outgoing interface and nexthop/ directed connected host TTL check, decrementation and checksum recalculation
31
32
Memory
n n+1 n+2 n+3
Register 0A0B0C0D
0A 0B 0C 0D BigEndian
33
Therefore, in portable code, if you transfer binary numbers between nodes, always translate between host-byte order and network-byte order. BSD has the following help functions:
htonl, ntohl (4-byte numbers) htons, ntohs (2-byte numbers)
34
Alignment
Datastructuresmustbealignedinmemorywhenaccessedas severalbytes. Inparticular2byte,4byte,8bytenumbersmustbealignedon wordboundaries
Otherwiseabuserroroccurs(inseriouscases,egSPARC) Oraperformancedegradation(asinx86)
35
Alignment example
Memory 99 100 101 102 103 104 105 0A0B0C0D 0A 0B 0C 0D
OK
BUS ERROR!
36