0% found this document useful (0 votes)
24 views

Outline: Peter Steenkiste Departments of Computer Science and Electrical and Computer Engineering How Do Routers Works?

Routers use ICMP (Internet Control Message Protocol) messages to communicate errors and control information between devices on the network. Routers find the best path to send packets by using routing protocols like RIP, OSPF, and BGP. Routers have line cards that handle incoming and outgoing traffic using switching hardware to quickly route packets on their path.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Outline: Peter Steenkiste Departments of Computer Science and Electrical and Computer Engineering How Do Routers Works?

Routers use ICMP (Internet Control Message Protocol) messages to communicate errors and control information between devices on the network. Routers find the best path to send packets by using routing protocols like RIP, OSPF, and BGP. Routers have line cards that handle incoming and outgoing traffic using switching hardware to quickly route packets on their path.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

2/16/2008

Outline

15-441 Computer Networking z ICMP


Lecture 10 – Routers and Routing
z How do Routers Works?
Peter Steenkiste
Departments of Computer Science and z Routing
Electrical and Computer Engineering
z Distance vector
15-441 Networking, Spring 2008
http://www.cs.cmu.edu/~dga/15-441/S08
1 2 2

Internet Control Message


Protocol (ICMP) IP MTU Discovery with ICMP
z Short messages used to send error & other control MTU =
information 2000 host
router
z Examples router MTU = 1500
host
» Ping request / response MTU = 4000
– Can use to check whether remote host reachable
z Typically
yp y send series of p
packets from one host to another
» Destination
D i i unreachable
h bl
– Indicates how packet got & why couldn’t go further z Typically, all will follow same route
» Flow control » Routes remain stable for minutes at a time
– Slow down packet delivery rate z Makes sense to determine path MTU before sending real packets
» Redirect
z Operation
– Suggest alternate routing path for future messages
» Router solicitation / advertisement » Send max-sized packet with “do not fragment” flag set
– Helps newly connected host discover local router » If encounters problem, ICMP message will be returned
» Timeout – “Destination unreachable: Fragmentation needed”
– Packet exceeded maximum hop limit – Usually indicates MTU encountered
3 3 4 4

IP MTU Discovery with ICMP IP MTU Discovery with ICMP

ICMP ICMP
Frag. Needed Frag. Needed
MTU = 2000 MTU = MTU = 1500 MTU =
2000 host 2000 host
router router
router
t MTU = 1500 router
t MTU = 1500
host host
MTU = 4000 MTU = 4000

Length = 4000, Don’t Fragment Length = 2000, Don’t Fragment

IP IP
Packet Packet

5 5 6 6

1
2/16/2008

IP MTU Discovery with ICMP Outline

MTU =
2000
router
host z ICMP
router MTU = 1500
host
MTU = 4000
z How do Routers Works?
Length = 1500, Don’t Fragment

IP
Packet z Routing

» When successful, no reply at IP level


– “No news is good news”
z Distance vector
» Higher level protocol might have some form of
acknowledgement
7 7 8 8

Router Architecture: Key Functions Router Physical Layout


z Run routing algorithms/protocol (RIP, OSPF, BGP)
» Done by routing processor Juniper T series
z Switching datagrams from incoming to outgoing link
» Common case handled by line cards
Crossbar
Line Card
Line Card

Linecards
output port

L
Line Card

input port
Cisco 12000

Switch

9 9 10 10

Line Cards Line Card: Input Port

z Often uses special purpose hardware (e.g.


ASICs)

z Network interface cards


Decentralized switching:
Physical layer:
z Process common case (fast-path) packets
z Fast path (common-case) processing bit-level reception
» Decrement TTL, update checksum, forward
» Decrement TTL Data link layer: packet

» Recompute checksum e.g., Ethernet z Given datagram dest., lookup output port
using routing table in input port memory
» Forward to next hop line card
z Queue needed if datagrams arrive faster than
– Forwarding engine forwarding rate into switch fabric

11 11 12 12

2
2/16/2008

Line Card: Output Port Router Processor

z Runs routing protocol and downloads


forwarding table to forwarding engines
z Performs “slow” path processing
» ICMP error messages
» IP option processing
» Fragmentation
z Queuing required when datagrams arrive from fabric
faster than the line transmission rate » Packets destined to router

13 13 14 14

Three Types of Switching Fabrics Switching Via a Memory


First generation routers Æ looked like PCs
z Packet copied by system’s (single) CPU
z Speed limited by memory bandwidth (2 bus
crossings per datagram)
Input Memory Output
P t
Port P t
Port

System Bus

Modern routers
• Input port processor performs lookup, copy into memory
• Cisco Catalyst 8500

15 15 16 16

Switching Via an Interconnection


Switching Via a Bus Network
z Datagram from input port z Overcome bus bandwidth
memory to output port limitations
memory via a shared bus z Crossbar provides full NxN
interconnect
z Bus contention: switching
» Expensive
speed
p limited by
y bus
bandwidth z Banyan networks & other
interconnection nets initially
z 1 Gbps bus, Cisco 1900: developed to connect
sufficient speed for access processors in multiprocessor
and enterprise routers (not » Typically less capable than
complete crossbar
regional or backbone)
z Cisco 12000: switches Gbps
through the interconnection
network
17 17 18 18

3
2/16/2008

Buffering Outline

z Suppose we have N inputs and M outputs z ICMP


»Multiple packets for same output Æ
output contention z How do Routers Works?
»Switching
Switching fabric may force different
inputs to wait Æ Switch contention
z Routing
z Solution – buffer packets when/where
needed: input, switch, or output
z What happens when these buffers fill up? z Distance vector
»Packets are THROWN AWAY!! This
is where packet loss comes from
19 19 20 20

IP Forwarding versus Routing Graph Model


z Represent each router as node
z The Story So Far… z Direct link between routers represented by edge
» IP addresses are structure to reflect
Router
» Symmetric links ⇒ undirected graph
Internet structure
z Edge “cost” c(x,y) denotes measure of difficulty of using link
» IP packet headers carry these addresses » delay, $ cost, or congestion level
» When Packet Arrives at Router
z Task
– Examine header to determine intended » Determine least cost path from every node to every other node
destination
– Path cost d(x,y)
E = sum
3
of link costs C
– Look up in table to determine next hop in 1

path F 1
2
– Send packet out appropriate port 6
1
z How do we generate the forwarding table? A 4
3 D

B
21 21 22 22

Routes from Node A Ways to Compute Shortest Paths


Forwarding Table for A E C z Centralized
3 1
Dest Cost Next
» Collect graph structure in one place
Hop 1
2 F » Use standard graph algorithm
A 0 A 6
1 » Disseminate routing tables
B 4 B
3 D
C 6 E A 4
D 7 B B z Link-state
E 2 E » Every node collects complete graph structure
F 5 E » Each computes shortest paths from it
» Each generates own routing table
z Properties
» Some set of shortest paths forms tree z Distance-vector
– Shortest path spanning tree » No one has copy of graph
» Solution not unique » Nodes construct their own tables iteratively
– E.g., A-E-F-C-D also has cost 7 » Each sends information about its table to neighbors
23 23 24 24

4
2/16/2008

Outline Distance-Vector Method


Initial Table for A
Dest Cost Next E 3 C
1
z ICMP Hop
A 0 A 1
2 F
B 4 B 6
1
z How do Routers Works? C ∞ –
3 D
D ∞ – A 4

E 2 E B
z Routing F 6 F

z Idea: At any time, have cost/next hop of best known path to


destination
z Distance vector
» Use cost ∞ when no path is known
z Initially
» Only have entries for directly connected nodes
25 25 26 26

Distance-Vector Update Algorithm


z
d(z,y)
c(x,z) z Bellman-Ford algorithm
z Repeat
y
x
d(x y)
d(x,y)
For every node x
z Update(x,y,z) For every neighbor z
d ← c(x,z) + d(z,y) # Cost of path from x to y with first hop z For every destination y
if d < d(x,y)
d(x,y) ← Update(x,y,z)
# Found better path
z Until converge
return d,z # Updated cost / next hop

else
return d(x,y), nexthop(x,y) # Existing cost / next hop
27 27 28 28

Start Iteration #1
Optimum 1-hop paths Optimum 2-hop paths
Table for A Table for B Table for A Table for B
E 3 C E 3 C
Dst Cst Hop Dst Cst Hop 1 Dst Cst Hop Dst Cst Hop 1
A 0 A A 4 A 1 A 0 A A 4 A 1
2 F 2 F
B 4 B B 0 B B 4 B B 0 B
6 6
C ∞ – C ∞ – 1 C 7 F C 2 F 1
D ∞ – D 3 D 3 D D 7 B D 3 D 3 D
A 4 A 4
E 2 E E ∞ – E 2 E E 4 F
B B
F 6 F F 1 F F 5 E F 1 F
Table for C Table for D Table for E Table for F Table for C Table for D Table for E Table for F
Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop
A ∞ – A ∞ – A 2 A A 6 A A 7 F A 7 B A 2 A A 5 B
B ∞ – B 3 B B ∞ – B 1 B B 2 F B 3 B B 4 F B 1 B
C 0 C C 1 C C ∞ – C 1 C C 0 C C 1 C C 4 F C 1 C
D 1 D D 0 D D ∞ – D ∞ – D 1 D D 0 D D ∞ – D 2 C
E ∞ – E ∞ – E 0 E E 3 E E 4 F E ∞ – E 0 E E 3 E
F 1 F F ∞ – F 3 F F 0 F F 1 F F 2 C F 3 F F 0 F
29 29 30 30

5
2/16/2008

Distance Vector: Link Cost


Iteration #2 Changes
Optimum 3-hop paths
Link cost changes:
Table for A Table for B
E C 1
Dst Cst Hop Dst Cst Hop 3 1 • Node detects local link cost change Y
4 1
A 0 A A 4 A • Updates distance table
X
1
2 F Z
B 4 B B 0 B
6 • If cost change in least cost path, notify 50
C 6 E C 2 F 1 neighbors
D 7 B D 3 D 3 D
A 4
E 2 E E 4 F algorithm
B
terminates
F 5 E F 1 F
“good
Table for C Table for D Table for E Table for F
Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop news
A 6 F A 7 B A 2 A A 5 B travels
B 2 F B 3 B B 4 F B 1 B
fast”
C 0 C C 1 C C 4 F C 1 C
D 1 D D 0 D D 5 F D 2 C
E 4 F E 5 C E 0 E E 3 E
F 1 F F 2 C F 3 F F 0 F
31 31 32 32

Distance Vector: Link Cost


Changes Distance Vector: Split Horizon
Link cost changes: If Z routes through Y to get to X : 60
60 Y
• Good news travels fast Y • No need for Z to tell Y about its route to X 4 1
4 1
X Z
• Bad news travels slow - X Z • Z does not advertise its route to X back to Y 50
“count to infinity” problem! 50

algorithm
algorithm terminates
continues
on! ? ? ?

33 33 34 34

Distance Vector: Poison Reverse Poison Reverse Failures


If Z routes through Y to get to X : 60 Table for A Table for B Table for D Table for F
Y Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop
• Z tells Y its (Z’s) distance to X is infinite (so Y won’t 4 1
∞1
C 7 F C 8 A C 9 B C 1 C
route to X via Z) X Z
50 Table for A
Forced
Table for F F C
• Eliminates some possible timeouts with split horizon Dst Cst Hop Forced
Dst Cst Hop
6
Update Update
• Will this completely solve count to infinity problem? C ∞ – C ∞ – A
1
algorithm Table for A
4
terminates Dst Cst Hop Better
1
Route B
C 13 D D
Table for B
Forced
Dst Cst Hop z Iterations don’t converge
Update
C 14 A
z “Count to infinity”
Table for D
Forced z Solution
Dst Cst Hop
Update
C 15 B » Make “infinity” smaller
Table for A •
Dst Cst Hop Forced » What is upper bound on

Update
• maximum path length?
35 35 C 19 D
36 36

6
2/16/2008

Routing Information Protocol


(RIP) RIP Updates
z Initial
z Earliest IP routing protocol (1982 BSD) » When router first starts, asks for copy of table for
» Current standard is version 2 (RFC 1723) every neighbor
z Features » Uses it to iteratively generate own table
» Every link has cost 1 z Periodic
» “Infinity” = 16 » Every 30 seconds, router sends copy of its table to
– Limits to networks where everything reachable within each neighbor
15 hops
» Neighbors use to iteratively update their tables
z Sending Updates
» Every router listens for updates on UDP port 520
z Triggered
» RIP message can contain entries for up to 25 table » When every entry changes, send copy of entry to
entries neighbors
– Except for one causing update (split horizon rule)
» Neighbors use to update their tables
37 37 38 38

RIP Staleness / Oscillation


Control

z Small Infinity
» Count to infinity doesn’t take very long
z Route Timer
» Every route has timeout limit of 180 seconds
– Reached when haven’t received update from next
hop for 6 periods
» If not updated, set to infinity
» Soft-state refresh Æ important concept!!!
z Behavior
» When router or link fails, can take minutes to
stabilize
39 39

You might also like