Distance vector, link state and path vector
Three ways to learn a path
Distance-vector, link-state and path-vector describe different kinds of routing information. In a simple distance-vector model, neighbors advertise their distance to destinations. Link-state routers exchange descriptions of links and compute paths from a topology database. BGP carries prefix reachability and path attributes, including AS_PATH; policy matters as well as the path. These are models, not interchangeable packet formats.
Distance vector: compare neighbor reports
Use the four-node undirected graph below. Numbers are invented positive link costs, not RIP metrics. D represents a destination at cost zero. After learning stable distances, B reports 2 and C reports 1 to A. A adds its own outgoing cost: via B costs 1 + 2 = 3; via C costs 5 + 1 = 6. A chooses B. This is the basic additive distance-vector idea. RIP uses hop count instead: 1–15 is reachable, and 16 is its unreachable metric. EIGRP belongs to the distance-vector family but uses DUAL and a different metric system.
A --1-- B --2-- D| |5 1| |+------ C ------+Link state: calculate from the graph
In the same graph, A can compute the cost of each path to D from a consistent link-state database. The path A–B–D costs 3 and A–C–D costs 6. A shortest-path calculation chooses the first. OSPF and IS-IS use link-state techniques; their topology scope, message formats and detailed rules differ. A router need not know all links across the entire Internet. In a multi-area design, what it knows depends on its area and protocol rules.
Path vector: policy and AS paths
Now consider a separate fictional BGP example. AS 64512 receives two eligible routes to 203.0.113.0/24. One has AS_PATH 64513 64514 and local preference 100; the other has AS_PATH 64515 64516 64514 and local preference 200. Under the stated simplified policy, the higher local preference wins, even with a longer AS path. Local preference is assigned within the receiving AS; do not assume an external neighbor sets it. AS_PATH normally helps detect inter-AS loops: a route containing the receiver’s own ASN is rejected under ordinary loop-checking rules. BGP does not advertise an entire physical topology.
Compare the evidence, not just the answer
Distance-vector and link-state calculations can select the same path while relying on different information. Path-vector selection can prefer another route because of policy. Practice: change A–C cost from 5 to 1. Its total via C becomes 2, compared with 3 via B; under either additive shortest-path model A selects C. This exercise assumes complete, stable information, symmetric links and no equal-cost tie; it does not simulate RIP, OSPF, EIGRP or BGP message exchange.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Distance vector, link state and path vector — knowledge check
Apply dynamic routing concepts to fictional domains and graphs.
B advertises distance 2 to D and A–B costs 1. What is A’s candidate distance via B?
What does a link-state router use for its shortest-path calculation?
What does a RIP metric of 16 mean?
Two eligible BGP routes have local preferences 100 and 200. Under the lesson policy, which wins?
A–C becomes 1 and C–D is 1; A–B–D costs 3. Which next hop minimizes additive cost?