1
COMP 631: COMPUTER NETWORKS
Internet Routing
Jasleen Kaur
Fall 2014
2
q Both datagram and virtual-circuit based networks need to
know how to construct forwarding tables q Forwarding:
Ø Select an output port based on destination address and routing table
Ø Simple and well-defined process performed locally at a given node
Ø Forwarding table used while forwarding packets
§ eg: (network number, interface id, MAC address)
q Routing:
Ø Building the forwarding/routing table
Ø A complex, distributed algorithm problem
Ø Routing table may be a precursor to a forwarding table
§ eg: (network number, nextHopIP, CostToDestination)
Forwarding vs. Routing: Local vs. Distributed
3
q
Intra-domain routing ~ 100 routers
q
Given:
Ø Graph: where nodes are routers and edges are links
Ø Cost: associated with each link
q
Find:
Ø Lowest-cost path between any two nodes
q
Requirements:
Ø Self-healing, traffic-sensitive, scalable
Intra-domain Routing: Formulation
Need dynamic, distributed algorithms!
Two classes: based on “distance-vector” and “link-state” 4 3 6 2 1 9 1 1 D A F E B C 4 q
Each node:
Ø Constructs a vector of distances to all other nodes § Distance vector
Ø Distributes to immediate neighbors
q
Neighbors use the distributed information to update
their own distance vectors
q
This distributed exchange-update-exchange should lead
to globally consistent distance vectors (and routing
tables)
5
Distance Table Data Structure
q
Each node has its own table with a...
Ø Row for each possible destination
Ø Column for each directly-attached
adjacent node (neighbor)
q
Each table entry gives cost to reach
destination via that adjacent node
Ø Distance = Cost DE() A B C D A 1 7 6 4 B 14 8 9 11 D 5 5 4 2 Cost to Destination via" D e st in atio n "
DX(Y,Z) = distance from X to Y via Z as first hop
= c(X,Z) + minw{DZ(Y,w)}
w = {neighbors of Z} 6 DE() A B C D A 1 7 6 4 B 14 8 9 11 D 5 5 4 2 Cost to Destination via" D e st in a tio n"
Distance Table Example
DE(C,D) = c(E,D) + min w{DD(C,w)} = 2 + 2 = 4
A loop?! 7 8 1 2 2 1 A E B C D
DE(A,D) = c(E,D) + min
w{DD(A,w)}
= 2 + 3 = 5
Loop!
DE(A,B) = c(E,B) + min
w{DB(A,w)}
7
Distance Table Example
7 8 1 2 2 1 DE() A B C D A 1 7 6 4 B 14 8 9 11 D 5 5 4 2 D e st in atio n " A E B C D DE() A B C D A, 1 D, 5 D, 4 D, 2 Adjacent Node to Use, Cost" D e stin a tio n "
q The distance table
gives the routing table
Ø Just take the minimum cost per
destination
Distance Table" Routing Table"
8
Distance Vector Routing: Algorithm
q
Iterative, asynchronous – each
local iteration caused by:
Ø Local link cost change, or
Ø Message from adjacent node that its least cost path to some destination has changed
q
Distributed:
Ø Each node notifies adjacent nodes only when its least cost path to some destination changes
Ø Adjacent nodes then notify their adjacent nodes if this update changes a least cost path
wait for change in local
link cost or message from
adjacent node"
Each node:!
recompute distance table"
ifleast cost path to any
destination has changed,
9 DX Y Z Cost via D es t. Y Z 2 83 7
Distance Vector Algorithm: Example
DX(Y,Z) = c(X,Z) + min w{DZ(Y,w)} = 7 + 1 = 8
2! 1! 7! Z Y X DZ X Y Cost via X 7 ∞ Y ∞ 1 D es t. DY X Z Cost via X 2 ∞ Z ∞ 1 D es t. DX Y Z Cost via Y 2 ∞ Z ∞ 7 D es t.
DX(Z,Y) = c(X,Y) + min
w{DY(Z,w)} = 2 + 1 = 3
Time 10 DY X Z Cost via D es t. DX Y Z Cost via D es t. DZ X Y Cost via D es t.
Distance Vector Algorithm: Example
2! 1! 7! Z Y X DZ X Y Cost via X Y D es t. X 7 3 Y 9 1 DY X Z Cost via X Z D es t. X 2 8 Z 9 1 DX Y Z Cost via Y Z D es t. Y 2 8 Z 3 7 DZ X Y Cost via X 7 ∞ Y ∞ 1 D es t. DY X Z Cost via X 2 ∞ Z ∞ 1 D es t. DX Y Z Cost via Y 2 ∞ Z ∞ 7 D es t. Time
11 via DY X Z X via DZ X Y X 4 1 50 Z Y X
Distance Vector: Link Cost Changes
When a node detects a local link cost change:
The nodes updates its distance table
If the least cost path changes, the node no^fies its neighbors “Good news travels fast” 1 via DY X Z X 4 6 via DZ X Y X 50 5 via DY X Z X 1 6 via DY X Z X 1 6 DZ X Y via X 50 2 DZ X Y X 50 5 via c(X,Y)"
changes" t0 t1 t2 terminates"Algorithm" t3 50 2
1 3
How long does convergence take?
12 via DZ X Y X 50 7 DZ X Y via X 50 9
Distance Vector: Link Cost Changes
Good news travels fast, but…
“Bad news” travels slow!
The “count to infinity” problem
Routing Loop!! Does it Terminate?! 4 1 50 Z Y X 60 via DY X Z X 4 6 via DZ X Y X 50 5 via DY X Z X 60 6 via DY X Z X 60 6 DZ X Y via X 50 7 DZ X Y X 50 5 via via DY X Z X 60 8 c(X,Y)"
changes" t0 t1 t2 t3continues on…" Algorithm"
via DY X Z
X 60 8
13 via DY X Z X DZ X Y X via
The Count to Infinity Problem
The “poisoned reverse” technique
If Z routes through Y to get to X:
Then Z tells Y that Z’s distance to X is infinite
4 1 50 Z Y X via DY X Z X via DZ X Y X via DY X Z X via DZ X Y X 50 5 t-‐3 t-‐2 t-‐1 Initialization…" 4 ∞ 50 ∞ 4 51 50 5 4 ∞ 14 DZ X Y via X via DY X Z X via DZ X Y
The Count to Infinity Problem
The “poisoned reverse” technique
If Z routes through Y to get to X:
Then Z tells Y that Z’s distance to X is infinite
4 1 50 Z Y X 60 via DY X Z X 4 ∞ via DZ X Y X 50 5 via DY X Z X 60 ∞ via DY X Z X 60 ∞ X 50 61 DZ X Y via X 50 61 DZ X Y X 50 5 via c(X,Y)"
changes" t0 t1 t2 t3 terminates"Algorithm"
via DY X Z X 60 51 t4 60 51 50 ∞
(Will this completely solve the problem?)