19-Link State-07-10-2024
19-Link State-07-10-2024
ANUSHA N
22-3 UNICAST ROUTING PROTOCOLS
22.4
Figure 22.13 Popular routing protocols
Routing Information
protocol Open shortest path Border gateway
first protocol
22.5
Routing Requires Knowing Network
6
Link State Routing
• Link state routing is a technique in which each router shares
the knowledge of its neighborhood with every other router in the
internetwork.
The three keys to understand the Link State Routing
algorithm:
• Knowledge about the neighborhood: Instead of sending its
routing table, a router sends the information about its
neighborhood only. A router broadcast its identities and cost of
the directly attached links to other routers.
• Flooding: Each router sends the information to every other
router on the internetwork. This process is known as Flooding.
Every router that receives the packet sends the copies to all its
neighbors. Finally, each and every router receives a copy of the
same information.
• Information sharing: A router sends the information to every
other router only when the change occurs in the information.
22.7
Link State Routing
Link State Routing has two phases:
Reliable Flooding
• Initial state: Each node knows the cost of its neighbors.
• Final state: Each node knows the entire graph.
Route Calculation
• Each node uses Dijkstra's algorithm on the graph to calculate the optimal routes
to all nodes.
• The Link state routing algorithm is also known as Dijkstra's algorithm which is used
to find the shortest path from one node to every other node in the network.
• The Dijkstra's algorithm is an iterative, and it has the property that after kth
iteration of the algorithm, the least cost paths are well known for k destination
nodes.
22.8
Figure 22.20 Concept of link state routing
22.9
Figure 22.21 Link state knowledge
22.10
Figure 22.22 Dijkstra algorithm
22.11
Figure 22.23 Example of formation of shortest path tree
22.12
Table 22.2 Routing table for node A
22.13
Figure 22.24 Areas in an autonomous system
22.14
A Link State Routing Algorithm
Dijkstra’s algorithm Notation:
◼ net topology, link costs ◼ c(i,j): link cost from node i
known to all nodes to j. cost infinite if not direct
– accomplished via “link neighbors
state broadcast”
◼ D(v): current value of cost
– all nodes have same info of path from source to dest.
◼ computes least cost paths V
from one node (‘source”) to
◼ p(v): predecessor node
all other nodes
along path from source to v,
– gives routing table for that is next v
that node
◼ iterative: after k iterations,
◼ N: set of nodes whose least
cost path definitively known
know least cost path to k
dest.’s
Dijkstra’s Algorithm
1 Initialization:
2 N = {A}
3 for all nodes v
4 if v adjacent to A
5 then D(v) = c(A,v)
6 else D(v) = infty
7
8 Loop
9 find w not in N such that D(w) is a minimum
10 add w to N
11 update D(v) for all v adjacent to w and not in N:
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N
Dijkstra’s Algorithm: An Example
Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F)
0 A 2,A 5,A 1,A infinity infinity
1 AD 2,A 4,D 2,D infinity
2 ADE 2,A 3,E 4,E
3 ADEB 3,E 4,E
4 ADEBC 4,E
5 ADEBCF
B 3 C
2 5
A 2 1 F
3
1 2
D E
1
Dijkstra’s Algorithm: Discussion
Algorithm complexity: n nodes
◼ each iteration: need to check all nodes, w, not in N
◼ n*(n+1)/2 comparisons: O(n**2)
◼ more efficient implementations possible: O(nlogn)
Oscillations possible:
◼ e.g., link cost = amount of carried traffic
1 A A A A
1+e 2+e 0 0 2+e 2+e 0
D 0 0 B D 1+e 1 B D B D 1+e 1 B
0 0
0 e 0 0 1 1+e 0 e
1
C C C C
1
e
… recompute … recompute … recompute
initially
routing