15 RoutingDV
15 RoutingDV
3 2
B
packets queued (stored)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
[after Rexford]
Inside a Router Line Cards
(Interface Cards, Adaptors)
control plane Interfacing
to/from link
Processor • physical link
data plane
• switching fabric
Packet handling
Transmit
Receive
Line card Line card
• packet forwarding
• decrement 8me-to-live lookup
• buffer management
Switching
Line card
Fabric
Line card • link scheduling
• packet filtering
• rate limi8ng
Line card Line card
• packet marking to/from switch
• measurement
[Rexford] [Rexford]
Deliver packets inside router Line card Line card “Loopback” interface Line card Line card
v 3 w
2 5
Routers need to know two things Graph: G = {N, E} u 2 1 z
3
1. which router to use to reach a destination prefix
N = set of nodes = {u, v, w, x, y, z} 1
y 2
2. which outgoing interface to use to reach that router x
1
u z E = set of edges/links =
{(u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z)}
12.34.158.0/24
c(u,v) = cost of link (u,v), assume full-duplex (bidirectional)
• e.g., c(w, z) = 5
interface along router z that can • cost could always be manually assigned, e.g., based on price
the path to z reach destination • or could be hop count, or inversely related to bandwidth, reliability
• or could be dynamic, e.g., proportionally related to congestion
How does a router construct its routing table?
Cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)
How does a router know which is the next hop towards
a destination? What is the least-cost path between node u and z?
Use a routing protocol to propagate (and update)
reachability information Routing algorithm: algorithm that finds least-cost path
[after Rexford]
• dynamic:
Global or distributed, local information? routes change more quickly
periodic update in response to link cost changes
• global: all routers have complete topology
• and link cost information
• “link state” algorithms
D[x,y] = min{c(x,y) + D[y,y], c(x,z) + D[z,y]} D[x,z] = min{c(x,y) + D[y,z], c(x,z) + D[z,z]}
= min{2+0 , 7+1} = 2 = min{2+1 , 7+0} = 3
Distributed DVA Implementation l10
x’s table cost to cost to cost to Each node i: 5
v
3
w
x y z x y z 2 5
x y z • knows the cost to each neighbor l1
l4 l8
x 0 2 7 x 0 2 3 • keeps entries of L table for local links u l3 2 l5 l 1 z
x 0 2 3 l2 3 7
from
from
y 2 0 1 1
y 2 0 1 l6 2
z ∞∞ ∞ z 7 1 0 x y
z 3 1 0 row of tables D and H 1
y’s table cost to cost to cost to • sends i-th row of table D as route update from i
x y z y
x y z x y z 2 1 • upon receiving a route update from another node,
x ∞∞ ∞ 0 2 7
x x 0 2 3 x z i recomputes its routing table (row i of D and H)
from
y 7
from
from
2 0 1 y 2 0 1 y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0 Example:
z’s table cost to cost to cost to • u’s link table: [l1, l2]
x y z x y z x y z • u’s routing table:
• u’s route update/distance vector:
x ∞ ∞∞ x 0 2 7 x 0 2 3
from
dest dest
from
y y 2 0 1 u v w x y z u v w x y z
from
y 2 0 1
∞ ∞∞
z z 3 1 0 z 3 1 0 D 0 2 3 1 2 4 D 0 2 3 1 2 4
7 1 0
time H l0 l1 l2 l2 l2 l2
Route Updates Routing Loop
Even statically assigned link cost can change over Problems with distributed DVA: A
∞
1
/ B 1
time, e.g., when a link goes down (breaks) • bouncing effect, when there’s alternate
path, e.g., between A and D: when AB 1 1 C
Each node: breaks, A and D (to B) count to 11 before D
Design question: how does a /
1
E 1
router communicate changes settling on ADEB ∞
waits for change in local link in link cost to other routers? • counting to ∞, when there’s no alternate path, e.g.,
cost or message from neighbor
• when cost increases (“bad between B, C, and E (to A or D) when both AB and DE break
news”) send on-demand/ • leads to: routing loop
recomputes distance estimates triggered updates
• cost decreases (“good Cause of routing loop (in 3 variations):
if distance to any destination news”) travel slowly with • inconsistent routing tables
has increased, notify neighbors periodic updates, with • route updates do not reflect reality
or send periodic update random periods
• routers do not know when they are in their neighbor’s path to
Design principle: soft-state a destination
10
Routing Loop E D C
1
B // A
Loop-free Routing
1 1 1 t1 1 ∞
Heuristics (not solution) to alleviate routing loop in Solutions to routing loop:
distributed distance vector algorithm: time B C D E • diffusing computation (DUAL)
• triggered updates t0 1 2 3 2 • path finding/source tracing
• split horizon (with poisonous reverse): t1 ∞
3 2 3 2
• link reversal
don’t advertise reachability t2 ∞
3 ∞
4 3 ∞
4
∞
5 ∞
4 ∞
5 ∞ • path vector
(or advertise ∞) to next-hop neighbor t3 4
t4 ∞
5 ∞
6 ∞
5 10
6
• path hold-down, route poisoning: Cost to A,
t5 7 ∞
11 6 11
7 10
6
don’t switch path for n rounds or with n = 2:
t6 7 12
11 8 11
7 10
8
advertise ∞ if cost has been
t7 9 8 9 8
going up for n rounds
t8 9 10 9 10
t9 11 10 11 10
All heuristics rely on counting to ∞ to t10 11 12 11 10
detect loop, but differ in convergence time t11 11 12 11 10
Distributed DVA Deployment History Jaffe-Moss Algorithm
• Early days: GGP, HELLO, Fuzzball (ARPANET, early Internet)
Observations:
• 1988 (standardized): RIP (routed)
• v1: 30 secs periodic update with triggered updates and split horizon with
1. for each destination, nodes on the network form a
poisonous reverse directed spanning tree rooted at the destination
• v2 (1993): supports CIDR 2. loops occur in BF algorithm only after link cost
• 1988: IGRP (cisco): Interior Gateway Routing Protocol increases (incl. going to ∞)
• v1: split horizon, with path hold-down (n=2)
D: network diameter
ILS: Incremental Link-State dest A B C D E
1 1 C
d: max degree of a node ( N)
JM: Jaffe-Moss metric 0 1 2 1 2 D E 1
x: # nodes affected by failure; 1
path A BA CBA DA EDA
worst case, e.g., on network partition, x = N