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

Routing in Data Networks: Eytan Modiano

This document summarizes key concepts about routing in data networks: 1) Routing must choose paths between origin-destination pairs of nodes, which can be done on a per-packet basis (datagram routing) or per-session basis (virtual circuit routing). Static routing prearranges paths. 2) Routing is a global problem - individual sessions may prefer different optimal paths that can overload links when combined. 3) Shortest path routing uses link costs like length or congestion to find the lowest-cost path, with algorithms like Bellman-Ford and Dijkstra. 4) Distributed routing requires nodes to continuously update routing tables to reflect network changes using the Bellman-Ford

Uploaded by

saahil480
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Routing in Data Networks: Eytan Modiano

This document summarizes key concepts about routing in data networks: 1) Routing must choose paths between origin-destination pairs of nodes, which can be done on a per-packet basis (datagram routing) or per-session basis (virtual circuit routing). Static routing prearranges paths. 2) Routing is a global problem - individual sessions may prefer different optimal paths that can overload links when combined. 3) Shortest path routing uses link costs like length or congestion to find the lowest-cost path, with algorithms like Bellman-Ford and Dijkstra. 4) Distributed routing requires nodes to continuously update routing tables to reflect network changes using the Bellman-Ford

Uploaded by

saahil480
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Lecture 20

Routing in Data Networks

Eytan Modiano

Eytan Modiano
Slide 1
Routing

• Must choose routes for various origin destination pairs (O/D pairs)
or for various sessions

– Datagram routing: route chosen on a packet by packet basis

Using datagram routing is an easy way to split paths

– Virtual circuit routing: route chosen a session by session basis

– Static routing: route chosen in a prearranged way based on O/D pairs

Eytan Modiano
Slide 2
Routing is a global problem

5 units 5 units 10 units 15 units

Either session Both sessions


alone is best must split their
routed through traffic between
center path, but two paths.
All links both cannot All links
have go through have
capacity center. capacity
10 units 10 units

• Static routing is not desirable


• Datagam routing is a natural way to split the traffic
– How?

Eytan Modiano
Slide 3
Shortest Path routing

• Each link has a cost that reflects


– The length of the link
– Delay on the link
– Congestion
– $$ cost
• Cost may change with time

• The length of the route is the sum of the costs along the route

• The shortest path is the path with minimum length

• Shortest Path algorithms


– Bellman-Ford: centralized and distributed versions
– Dijkstra’s algorithm
– Many others

Eytan Modiano
Slide 4
Directed graphs (digraphs)

• A directed graph (digraph) G = (N,A) is a finite nonempty set of nodes N and


a set of ordered node pairs A called directed arcs.

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)

• Directed path: (4,2,1)

• Directed cycle: (4,2,1,4)

• 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:

– First find the shortest single arc path,


– Then the shortest path of at most two arcs, etc.
– Let dij=∞ if (i,j) is not an arc.

• Let Di(h) be the shortest distance from 1 to i using at most h arcs.


– Di(1) = d1i ; i≠1 D1(1) = 0
– Di(h+1) = min {j} [Dj(h) + dji] ;i≠1 D1(h+1) = 0

• If all weights are positive, algorithm terminates in N-1 steps.

Eytan Modiano
Slide 6
Bellman Ford - example

Eytan Modiano

Slide 7

Distributed Bellman Ford

• Link costs may change over time


– Changes in traffic conditions
– Link failures
– Mobility

• Each node maintains its own routing table


– Need to update table regularly to reflect changes in network

• Let Di be the shortest distance from node i to the destination

– Di = min {j} [Dj + dij] : update equation

• 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

– If no changes occur in the network, algorithm will converge to shortest paths in


no more than N steps

Eytan Modiano
Slide 8
Slow reaction to link failures

• Start with D3=1 and D2=100 1


– After one iteration node 2 receives D3=1 and 3 2
D2 = min [1+1, 100] = 2 1
1 100
• In practice, link lengths occasionally change 1
– Suppose link between 3 and 1fails (I.e., d31=infinity)
– Node 3 will update D3 = d32 + D2 = 3
– In the next step node 2 will update: D2 = d23+D3 = 4

– 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

As routes change due to traffic conditions, they affect the


Loadings on the links, hence routes may oscillate
Eytan Modiano
Slide 10
Instability

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

now has a counter clockwise shortest path

• Having a bias independent of flow in the arc distances helps to


prevent this problem.

• Asynchronous updates also helps.


Eytan Modiano
Slide 11
Dijkstra's algorithm

• Find the shortest path from a given source node to all other nodes
– Requires non-negative arc weights

• Algorithm works in stages:

– Stage k: the k closest nodes to the source have been found

– 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

• Let M be the set of nodes already incorporated by the algorithm


– Start with Dn = dsn for all n (Dn = shortest path distance from node n to the
source node
– Repeat until M=N

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

• Centralized version: Single node gets topology information and


computes the routes
– Routes can then be broadcast to the rest of the network

• Distributed version: each node i broadcasts {dij all j} to all nodes


of the network; all nodes can then calculate shortest paths to each
other node

– Open Shortest Path First (OSPF) protocol used in the internet

Eytan Modiano
Slide 14
Routing in the Internet

• Autonomous systems (AS)


– Internet is divided into AS’s each under the control of a single
authority
• Routing protocol can be classified in two categories
– Interior protocols - operate within an AS
– Exterior protocols - operate between AS’s

• 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

• Based on distributed Bellman-Ford


– Nodes exchange routing table information with their neighbors

• Examples:
– Routing information protocols (RIP)
Metric used is hop-count (dij=1)
Routing information exchanged every 30 seconds

– Interior Gateway Routing Protocol (IGRP)


CISCO proprietary
Metric takes load into account
Dij ~ 1/(µ−λ) (estimate delay through link)

Update every 90 seconds


Multi-path routing capability

Eytan Modiano
Slide 16
Link State Protocols

• Based on Dijkstra’s Shortest path algorithm


– Avoids loops
– Routers monitor the state of their outgoing links
– Routers broadcast the state of their links within the AS
– Every node knows the status of all links and can calculate all routes
using dijkstra’s algorithm
Nonetheless, nodes only send packet to the next node along the route with
the packets destination address. The next node will look-up the address in
the routing table

• Example: Open Shortest Path First (OSPF) commonly used in the


internet

• Link State protocols typically generate less “control” traffic than


Distance-vector

Eytan Modiano
Slide 17
Inter-Domain routing

• Used to route packets across different AS’s

• Options:

– Static routing - manually configured routes

– 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

• A Bridge is used to connect multiple LAN segments


– Layer 2 routing (Ethernet)
– Does not know IP address
– Varying levels of sophistication
Simple bridges just forward packets
smart bridges start looking like routers

• A Router is used to route connect between different networks using


network layer address
– Within or between Autonomous Systems
– Using same protocol (e.g., IP, ATM)

• A Gateway connects between networks using different protocols


– Protocol conversion
– Address resolution

• These definitions are often mixed and seem to evolve!

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

You might also like