Routing Algorithms and Protocols

Graduate Depth 51 in the knowledge graph I know this Set as goal
Unlocks 37 downstream topics
routing-algorithms protocols distance-vector link-state

Core Idea

Routing algorithms compute paths through a network to reach destination addresses. Distance-vector algorithms (e.g., RIP) share distances to known destinations with neighbors; link-state algorithms (e.g., OSPF) flood the entire network topology to all routers. Each approach has tradeoffs in convergence time, overhead, and scalability.

How It's Best Learned

Simulate both distance-vector and link-state protocols in a network simulator; observe how each converges after topology changes.

Common Misconceptions

Explainer

From your study of IP routing basics, you know that routers forward packets hop-by-hop toward a destination by consulting their routing tables. Routing algorithms are the mechanisms by which routers populate those tables — determining the best path to every known destination in the network. Two fundamentally different approaches exist: distance-vector and link-state.

In a distance-vector protocol, each router maintains a table of distances to every known destination and periodically shares this table with its direct neighbors. When a neighbor advertises a distance, the receiving router adds 1 (or some cost) for the link to that neighbor and updates its own table if it found a shorter route. Over many rounds of exchange, routing information propagates hop by hop until all routers converge on consistent paths. RIP (Routing Information Protocol) is the classic example. The weakness of this approach is slow convergence: if a link fails, the misinformation can bounce between neighbors in a phenomenon called "count to infinity" — routers keep advertising increasingly large (but nonexistent) distances until the protocol stabilizes.

Link-state protocols take a different approach: each router builds a complete map of the entire network. Every router floods a short advertisement describing only its directly connected links and their costs — not its full routing table. Once a router has received link-state advertisements from every other router, it runs Dijkstra's shortest-path algorithm on the complete topology to compute the optimal path to every destination. OSPF (Open Shortest Path First) is the dominant real-world example. Because every router works from the same complete map, link-state protocols converge much faster and avoid count-to-infinity problems, at the cost of more flooding overhead and more memory.

The tradeoff between the two approaches comes down to what information is shared and where computation happens. Distance-vector is simple and low-overhead but slow to react to failures. Link-state is more complex and chatty but produces faster, more accurate convergence. Modern enterprise and ISP networks almost universally prefer link-state protocols (OSPF, IS-IS) for their superior convergence properties, while distance-vector protocols (RIP) survive mainly in simpler or legacy environments.

Practice Questions 3 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsOperators and ExpressionsArithmetic Operators and Operator PrecedenceComparison Operators and Boolean TestsLogical Operators and Boolean AlgebraBoolean Algebra and Fundamental LawsCombinational Circuit DesignFlip-Flops and LatchesBinary Counters: Design and AnalysisBinary ArithmeticSubnetting and CIDR NotationIP Routing and ForwardingRouting Algorithms and Protocols

Longest path: 52 steps · 215 total prerequisite topics

Prerequisites (1)

Leads To (12)