What is Distance Vector , Link-State Routing, Path-Vector Routing ?
Distance Vector Routing:
Distance Vector Routing involves routers exchanging information about the distances to different destinations in terms of hop counts or some other metric. Each router maintains a routing table that contains entries for various destinations and their associated costs. Routers periodically exchange their routing tables with their neighboring routers and update their tables accordingly.
Example:
Imagine a network with four routers: A, B, C, and D. The initial routing tables might look like this:
A: [B:1, C:3, D:7]
B: [A:1, C:2, D:4]
C: [A:3, B:2, D:5]
D: [A:7, B:4, C:5]
Here, the numbers represent the costs (hop counts) to reach the respective destinations. Router A's table indicates that the cost to reach router B is 1 hop, to reach router C is 3 hops, and to reach router D is 7 hops.
As routers exchange their tables, they adjust their entries based on received information. For instance, if router B updates its table to show that its cost to reach router D is now 3 hops, router A will update its table accordingly.
Link-State Routing:
Link-State Routing involves routers exchanging information about the state of their links with other routers. This information is then used to create a network map, and algorithms like Dijkstra's algorithm are applied to find the shortest paths.
Example:
Let's consider a small network with routers A, B, and C, connected as follows:
A -- (2) -- B -- (3) -- C
Router A knows that it's directly connected to B with a cost of 2, and B is connected to C with a cost of 3.
Router B, upon receiving A's link-state information, knows that it's connected to A with a cost of 2 and also has a link to C with a cost of 3. Similarly, router C learns about its connections to B with a cost of 3.
Using this link-state information, routers can construct a network map and apply Dijkstra's algorithm to find the shortest paths. In this case, the shortest path from A to C is A -> B -> C with a total cost of 5.
Path-Vector Routing:
Path-Vector Routing combines the concept of distance vector and link-state routing, where routers not only maintain information about distances but also store the actual paths to destinations.
Example:
Consider a network of autonomous systems (AS) in the context of the Border Gateway Protocol (BGP). Each AS represents a collection of routers managed by a single organization. ASes exchange path information about IP prefixes (address ranges) using BGP.
Imagine AS A and AS B connected through two possible paths:
A -> X -> B (AS X is a transit AS)
A -> Y -> B (AS Y is a different transit AS)
AS A announces its path to reach a certain IP prefix to AS B, along with the associated ASes in the path.
If AS A chooses the path A -> X -> B, it will send a BGP update to AS B indicating the path (A, X, B). AS B will then add its own AS to the path and propagate it further.
Path-Vector Routing in BGP enables complex policy decisions, load balancing, and routing across different autonomous systems on the internet.
Comments
Post a Comment