A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Routing Algorithms and Protocols

Graduate Depth 82 in the knowledge graph ☐ I know this ☆ Set as goal
41topics build on this
339prerequisites beneath it
See this on the map →
IP Routing and ForwardingNetwork Topologies and Architectures→→Anycast NetworkingBellman-Ford Algorithm and Distance-Vector Routing+10 more
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

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Subnetting and CIDR Notation → IP Routing and Forwarding → Routing Algorithms and Protocols

Longest path: 83 steps · 339 total prerequisite topics

Prerequisites (2)

Leads To (12)