Routing in Data Networks: Eytan Modiano
Routing in Data Networks: Eytan Modiano
Eytan Modiano
Eytan Modiano
Slide 1
Routing
• Must choose routes for various origin destination pairs (O/D pairs)
or for various sessions
Eytan Modiano
Slide 2
Routing is a global problem
Eytan Modiano
Slide 3
Shortest Path routing
• The length of the route is the sum of the costs along the route
Eytan Modiano
Slide 4
Directed graphs (digraphs)
2 N = {1,2,3,4}
1
3
4 A = {(1,2), (2,1),(1,4),
(4,2), (4,3),(3,2)}
• Directed walk: (4,2,1,4,3,2)
• Data networks are best represented with digraphs, although typically links
tend to be bi-directional (cost may differ in each direction)
– For simplicity we will use bi-directional links of equal costs in our examples
Eytan Modiano
Slide 5
Bellman Ford algorithm
• Finds the shortest paths, from a given source node, say node 1, to all
other nodes.
• General idea:
Eytan Modiano
Slide 6
Bellman Ford - example
Eytan Modiano
Slide 7
• Each node (i) regularly updates the values of Di using the update equation
– Each node maintains the values of dij to its neighbors, as well as values of Dj
received from its neighbors
– Uses those to compute Di and send new value of Di to its neighbors
Eytan Modiano
Slide 8
Slow reaction to link failures
– It will take nearly 100 iterations before node 2 converges on the correct route
to node 1
• Possible solutions:
– Propagate route information as well
– Wait before rerouting along a path with increasing cost
Node next to failed link should announce D=infinity for some time to prevent loops
Eytan Modiano
Slide 9
Instability
Destination
1
1
D =3
2 3 3+ ε 8 1 2
D =5
3
1 2 2+ ε D4 = 6
3 1
7
D5 = 6
1 1+ ε
D6 = 6
4 6
1 ε D7 = 5+2ε
1
5 D = 3+ ε
8
ε
Assume d is equal to the flow on (i,j) Note that D6 = D + 0
ij 5
Destination
1 D =3
2
1
2 4+ ε 2 8 1 D3 = 3
D =3
4
3+ ε 1
1
3 1 D5 = 3
7
D =3
2+ ε 6
D7 = 3
4 1 6
1 1+ ε
D8 = 2
1
5
ε
Assume d ij is equal to the flow on (i,j) Note that D 2
• Find the shortest path from a given source node to all other nodes
– Requires non-negative arc weights
– Stage k+1: Given k closest nodes to the source node, find k+1st.
• Key observation: the path to the k+1st closest nodes includes only nodes
from among the k closest nodes
Find node w∉M which has the next least cost distance to the source node
Add w to M
Update distances: Dn = min [ Dn, Dw + dwn] (for all nodes n ∉M)
– Notice that the update of Dn need only be done for nodes not already in M and
that the update only requires the computation of a new distance by going
through the newly added node w.
Eytan Modiano
Slide 12
Dijkstra example
Eytan Modiano
Slide 13
Dijkstra’s algorithm implementation
Eytan Modiano
Slide 14
Routing in the Internet
• Interior protocols
– Typically use shortest path algorithms
Distance vector - based on distributed Bellman-ford
link state protocols - Based on “distributed” Dijkstra’s
Eytan Modiano
Slide 15
Distance vector protocols
• Examples:
– Routing information protocols (RIP)
Metric used is hop-count (dij=1)
Routing information exchanged every 30 seconds
Eytan Modiano
Slide 16
Link State Protocols
Eytan Modiano
Slide 17
Inter-Domain routing
• Options:
– Distance-vector routing
Exterior Gateway Protocol (EGP)
Border Gateway Protocol (BGP)
• Issues
– What cost “metric” to use for Distance-Vector routing
Policy issues: Network provider A may not want B’s packets routed through
its network or two network providers may have an agreement
Cost issues: Network providers may charge each other for dlivery of packets
Eytan Modiano
Slide 18
Bridges, Routers and Gateways
Eytan Modiano
Slide 19
Bridges, routers and gateways
Small company
Another provider’s
Frame Relay
IP Backbone
Ethernet A Router
Bridge
Ethernet B
Gateway
Gateway Service
provider’s
ATM
backbone
ATM switches
(routers)
Eytan Modiano
Slide 20