Routing Algo
Routing Algo
Routing
UNICAST ROUTING PROTOCOLS
In distance vector routing, each node shares its routing table with its immediate
neighbors periodically (30s) and when there is a change.
Updating in distance vector routing
Problem with distance vector routing
In link state routing, if each node in the domain has the entire
topology of the domain—the list of nodes and links, how they
are connected including the type, cost (metric), and the condition
of the links (up or down)—the node can use the Dijkstra
algorithm to build a routing table.
Concept of link state routing
Building Routing Tables
Creation of the states of the links by each
node, called the link state packets (LSP)
Dissemination of LSPs to every other
routers, called flooding (efficiently)
Formation of a shortest path tree for each
node
Calculation of a routing table based on the
shortest path tree
Creation of LSP
• LSP data: E.g. the node ID, the list of links, a
sequence number, and age.
• LSP Generation
– When there is a change in the topology of
the domain
– On a periodic basis
• There is no actual need for this type of LSP,
normally 60 minutes or 2 hours
Dijkstra algorithm
Example of formation of shortest path
tree
Forming shortest path three for router A in a graph
Areas in an autonomous system
Types of links
Point-to-point link
Transient link
Stub link
PATH VECTOR
ROUTING
Distance vector and link state routing are both interior routing
protocols.
They can be used inside an autonomous system. Both of these
routing protocols become intractable when the domain of
operation becomes large.
Distance vector routing is subject to instability if there is
more than a few hops in the domain of operation.
Link state routing needs a huge amount of resources to calculate
routing tables. It also creates heavy traffic because of flooding.
There is a need for a third routing protocol which we call path
vector routing.
Initial routing tables in path vector routing
Stabilized tables for three autonomous
systems
Internal and external BGP
sessions
In unicasting, the router forwards the received packet through only one of its
interfaces.
Multicasting
In multicasting, the router may forward the received packet through several of
its interfaces.
Exercise
1. Consider a network with five nodes, N1 to N5, as shown below.
The network uses a Distance Vector Routing protocol. Once the routes have stabilized, the
distance vectors at different nodes are as following. N1: (0, 1, 7, 8, 4)
N2: (1, 0, 6, 7, 3) N3: (7, 6, 0, 2, 6) N4: (8, 7, 2, 0, 4) N5: (4, 3, 6, 4, 0)
Each distance vector is the distance of the best known path at the instance to nodes, N1 to
N5, where the distance to itself is 0. Also, all links are symmetric and the cost is identical in
both directions. In each round, all nodes exchange their distance vectors with their
respective neighbors. Then all nodes update their distance vectors. In between two rounds,
any change in cost of a link will cause the two incident nodes to change only that entry in
their distance vectors. The cost of link N2-N3 reduces to 2(in both directions). After the next
round of updates, what will be the new distance vector at node, N3.
(A) (3, 2, 0, 2, 5)
(B) (3, 2, 0, 2, 6)
(C) (7, 2, 0, 2, 5)
(D) (7, 2, 0, 2, 6)
Exercise
1. Consider a network with five nodes, N1 to N5, as shown below.
The network uses a Distance Vector Routing protocol. Once the routes have stabilized, the
distance vectors at different nodes are as following. N1: (0, 1, 7, 8, 4)
N2: (1, 0, 6, 7, 3) N3: (7, 6, 0, 2, 6) N4: (8, 7, 2, 0, 4) N5: (4, 3, 6, 4, 0)
Each distance vector is the distance of the best known path at the instance to nodes, N1 to
N5, where the distance to itself is 0. Also, all links are symmetric and the cost is identical in
both directions. In each round, all nodes exchange their distance vectors with their
respective neighbors. Then all nodes update their distance vectors. In between two rounds,
any change in cost of a link will cause the two incident nodes to change only that entry in
their distance vectors. 52. The cost of link N2-N3 reduces to 2(in both directions). After the
next round of updates, what will be the new distance vector at node, N3.
(A) (3, 2, 0, 2, 5)
(B) (3, 2, 0, 2, 6)
(C) (7, 2, 0, 2, 5) N3: (7, 2, 0, 2, 6)
(D) (7, 2, 0, 2, 6) N3 knows (1,0,2,7,3) from N2 and (8,7,2,0,4) from N4.
N3: (3,2,0,2,5)
Exercise
2. Consider the same data as given in previous question.
After the update in the previous question, the link N1-N2 goes down. N2 will
reflect this change immediately in its distance vector as cost, infinite. After the
NEXT ROUND of update, what will be cost to N1 in the distance vector of N3?
(A) 3
(B) 9
(C) 10
(D) Infinite
Exercise
2. Consider the same data as given in previous question.
After the update in the previous question, the link N1-N2 goes down. N2 will
reflect this change immediately in its distance vector as cost, infinite. After the
NEXT ROUND of update, what will be cost to N1 in the distance vector of N3?
(A) 3
N1: (0,infinity,3,8,4)
(B) 9 N2: (infinity,0,2,4,3)
N3: (3,2,0,2,5)
(C) 10 N4: (8,4,2,0,4)
N5: (4,3,5,4,0)
(D) Infinite After the next round of exchange, N3 knows
the distance vector (infinity,0,2,4,3) from N2
and (8,4,2,0,4) from N4.
So N3 will update its distance vector to
(10,2,0,2,5).