0% found this document useful (0 votes)
17 views5 pages

Link State Protocol

Link-state routing is a dynamic protocol where routers maintain a complete network topology by sharing link-state information, allowing them to independently compute the shortest paths using Dijkstra’s algorithm. Key characteristics include global network knowledge, event-driven updates, and the use of Link-State Advertisements (LSAs) to build a synchronized link-state database. While it offers advantages like accurate routing and fast convergence, it demands high resources and can be complex to manage, especially in large networks.

Uploaded by

Jithin S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views5 pages

Link State Protocol

Link-state routing is a dynamic protocol where routers maintain a complete network topology by sharing link-state information, allowing them to independently compute the shortest paths using Dijkstra’s algorithm. Key characteristics include global network knowledge, event-driven updates, and the use of Link-State Advertisements (LSAs) to build a synchronized link-state database. While it offers advantages like accurate routing and fast convergence, it demands high resources and can be complex to manage, especially in large networks.

Uploaded by

Jithin S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Link-State Routing

Definition

• Link-state routing is a dynamic routing protocol mechanism where each router in a network
maintains a complete, up-to-date map (or topology database) of the network by collecting
and sharing information about the state of its directly connected links (e.g., cost, status) with
all other routers, enabling them to independently calculate the shortest paths to all
destinations using an algorithm like Dijkstra’s Shortest Path First (SPF).

Core Concept

• Unlike distance-vector routing (e.g., RIP), which shares only next-hop information, link-state
routing involves routers flooding their link-state information across the network, allowing
every router to build an identical topological view and compute optimal routes based on
metrics such as cost, bandwidth, or delay.

Key Characteristics

• Global Network Knowledge: Each router knows the entire network topology, not just its
neighbors, providing a holistic view for routing decisions.

• Link-State Database: Routers maintain a synchronized database containing link states (e.g.,
connected neighbors, link costs, and status like up/down).

• Event-Driven Updates: Updates are sent only when a link’s state changes (e.g., failure or cost
change), not periodically, reducing unnecessary traffic compared to distance-vector
protocols.

• Shortest Path Computation: Uses Dijkstra’s SPF algorithm to determine the least-cost path
from the router to all destinations.

Components of Link-State Routing

• Link-State Advertisements (LSAs):

o Packets containing information about a router’s links, including neighboring routers,


link costs, and status.

o Example: “Router A is connected to Router B with cost 10, status: up.”

• Link-State Database:

o A table or graph stored in each router, compiled from LSAs, representing the network
topology.

• Routing Table:

o Derived from the link-state database after running the SPF algorithm, listing the best
next hop for each destination.

• SPF Tree:

o A tree structure generated by Dijkstra’s algorithm, with the router as the root and
shortest paths to all other nodes as branches.

Detailed Operation of Link-State Routing


• Step 1: Link-State Discovery:

o Each router identifies its directly connected neighbors and the state of its links (e.g.,
cost, up/down status) using a protocol-specific hello mechanism.

o Example: Router A sends hello packets via its interfaces and discovers Router B (cost
10) and Router C (cost 20).

• Step 2: Link-State Advertisement (LSA) Generation:

o The router creates LSAs containing details of its links, including neighbor IDs, link
costs, and status, and assigns a sequence number to track updates.

o Example: Router A generates an LSA: “A-B: cost 10, A-C: cost 20, Sequence #1.”

• Step 3: Flooding LSAs:

o The router floods its LSAs to all other routers in the network through a reliable
dissemination process, ensuring every router receives the update; routers forward
LSAs to their neighbors except the one from which it was received.

o Example: Router A sends its LSA to B and C; B forwards it to its neighbors, and so on,
until all routers have it.

• Step 4: Building the Link-State Database:

o Each router collects LSAs from all routers, verifies their authenticity and sequence
numbers (to avoid duplicates or outdated info), and constructs a synchronized
topological map of the network.

o Example: Router D receives LSAs from A, B, and C, building a database showing A-B
(10), A-C (20), B-D (15), etc.

• Step 5: Shortest Path Calculation:

o Using Dijkstra’s SPF algorithm, each router computes the shortest path from itself (as
the root) to every other router or network, based on cumulative link costs, creating
an SPF tree.

o Example: Router A calculates: A → B (cost 10), A → C (cost 20), A → B → D (cost 10 +


15 = 25).

• Step 6: Routing Table Construction:

o From the SPF tree, the router populates its routing table with the next hop and total
cost for each destination.

o Example: Router A’s table: Destination B → Next Hop B (cost 10), Destination D →
Next Hop B (cost 25).

• Step 7: Handling Updates:

o When a link state changes (e.g., failure of A-B link), the affected router generates a
new LSA with an incremented sequence number, floods it, and all routers update
their databases and recalculate routes.
o Example: If A-B fails, Router A sends LSA “A-B: down, Sequence #2”; all routers adjust
paths (e.g., A → D via C).

Dijkstra’s SPF Algorithm (Simplified Explanation)

• Purpose: Finds the shortest path from a source router to all destinations.

• Steps:

1. Start with the source router as the root; set its cost to 0, others to infinity.

2. Add neighbors to a tentative list with their direct link costs.

3. Select the node with the lowest cost from the tentative list, mark it permanent, and
update costs to its neighbors if a shorter path is found via this node.

4. Repeat until all nodes are permanent.

• Example:

o Topology: A-B (10), A-C (20), B-D (15), C-D (5).

o From A: A (0), B (10), C (20), D via B (25), D via C (20 + 5 = 25); final shortest path to D
is 25 via C.

Example Scenario

• Network: Four routers (A, B, C, D).

o Links: A-B (cost 10), A-C (20), B-C (5), B-D (15), C-D (5).

• Process:

o Router A sends LSA: “A-B: 10, A-C: 20.”

o Router B sends LSA: “B-A: 10, B-C: 5, B-D: 15.”

o Router C sends LSA: “C-A: 20, C-B: 5, C-D: 5.”

o Router D sends LSA: “D-B: 15, D-C: 5.”

o All routers flood LSAs, build identical databases.

o Router A’s SPF calculation:

▪ A → B: 10.

▪ A → C: 20 (direct) or via B (10 + 5 = 15, shorter).

▪ A → D: via B (10 + 15 = 25) or via C (15 + 5 = 20, shorter).

o Routing Table for A:

▪ B → B (10), C → B (15), D → B (20 via C).

Diagram Descriptions

• Diagram 1: Network Topology:

o Four routers (A, B, C, D) as circles.


o Lines connecting: A-B (label: cost 10), A-C (20), B-C (5), B-D (15), C-D (5).

o Arrows showing LSA flooding (e.g., A → B, A → C).

• Diagram 2: Link-State Database:

o Table for Router A:

▪ Link | Cost | Status

▪ A-B | 10 | Up

▪ A-C | 20 | Up

▪ B-C | 5 | Up

▪ B-D | 15 | Up

▪ C-D | 5 | Up

• Diagram 3: SPF Tree for Router A:

o Tree with A as root:

▪ Branch 1: A → B (10).

▪ Branch 2: A → B → C (15).

▪ Branch 3: A → B → C → D (20).

Advantages of Link-State Routing

• Accurate Routing: Global topology knowledge ensures precise shortest-path calculations,


reducing suboptimal routes.

• Fast Convergence: Event-driven updates allow quick adaptation to network changes (e.g.,
link failures), minimizing downtime.

• Scalability in Smaller Networks: Works well in moderately sized networks with fewer routers
due to detailed topology tracking.

• Loop Prevention: SPF algorithm avoids loops by calculating paths from a single, consistent
database.

Disadvantages of Link-State Routing

• High Resource Demand: Requires significant memory and CPU power to store the database
and run SPF calculations, especially in large networks.

• Flooding Overhead: Initial LSA flooding and updates can temporarily consume bandwidth,
particularly in unstable networks.

• Complexity: More complex to implement and manage compared to distance-vector


protocols like RIP.

• Scalability Limits: In very large networks, the database size and computation time grow,
necessitating hierarchical designs (e.g., OSPF areas).

Popular Link-State Protocols


• OSPF (Open Shortest Path First):

o Widely used in IP networks, supports IPv4 and IPv6, uses areas for scalability, and
employs LSAs with types (e.g., Router LSA, Network LSA).

• IS-IS (Intermediate System to Intermediate System):

o Similar to OSPF, used in ISP backbones, operates at Layer 2, and supports large-scale
networks with a hierarchical structure.

Comparison with Distance-Vector Routing

• Link-State:

o Shares full topology, uses SPF, event-driven, faster convergence, higher resource use.

• Distance-Vector:

o Shares only next-hop info, uses Bellman-Ford, periodic updates, slower convergence,
simpler but prone to loops.

Relation to Packet Forwarding (Classful Context)

• In classful addressing (e.g., 192.168.1.0/24), link-state routing enhances packet forwarding


by dynamically updating routes based on link costs rather than static class-based tables,
though it operates independently of addressing schemes (classful or classless).

• Example: Router A forwards a packet from 10.1.2.3 to 192.168.1.10 using an SPF-derived


path, regardless of classful boundaries.

Additional Notes

• Sequence Numbers: Prevent processing of outdated LSAs; higher numbers indicate newer
updates.

• Hello Packets: Periodic messages to detect neighbors and verify link status.

• Area Concept (in OSPF): Divides large networks into smaller domains to reduce database size
and computation overhead.

You might also like