0
0
Computer Networksknowledge~10 mins

Distance vector routing (RIP) in Computer Networks - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Distance vector routing (RIP)
Start: Each router knows distance to neighbors
Send distance vector to neighbors
Receive distance vectors from neighbors
Update own routing table if shorter path found
Repeat periodically or on change
Converged
Routers share their distance info with neighbors, update routes if better paths found, and repeat until all have best paths.
Execution Sample
Computer Networks
Router A distance vector: {B:1, C:4}
Router B distance vector: {A:1, C:2}
Router C distance vector: {A:4, B:2}

Router A receives B's vector and updates routes
Shows routers exchanging distance info and updating routing tables based on neighbors' data.
Analysis Table
StepRouterReceived FromDistance Vector ReceivedRouting Table BeforeRouting Table AfterUpdate Made?
1AB{A:1, C:2}{B:1, C:4}{B:1, C:3}Yes (C updated from 4 to 3 via B)
2BA{B:1, C:4}{A:1, C:2}{A:1, C:2}No (no shorter path)
3CB{A:1, C:2}{A:4, B:2}{A:3, B:2}Yes (A updated from 4 to 3 via B)
4AC{A:4, B:2}{B:1, C:3}{B:1, C:3}No (no shorter path)
5BC{A:4, B:2}{A:1, C:2}{A:1, C:2}No (no shorter path)
6CA{B:1, C:4}{A:3, B:2}{A:3, B:2}No (no shorter path)
7-----Converged: no updates in last exchanges
💡 Routing tables converge when no updates occur after exchanges.
State Tracker
RouterStartAfter Step 1After Step 3After Step 6Final
A Routing Table{B:1, C:4}{B:1, C:3}{B:1, C:3}{B:1, C:3}{B:1, C:3}
B Routing Table{A:1, C:2}{A:1, C:2}{A:1, C:2}{A:1, C:2}{A:1, C:2}
C Routing Table{A:4, B:2}{A:4, B:2}{A:3, B:2}{A:3, B:2}{A:3, B:2}
Key Insights - 3 Insights
Why does Router A update its distance to C from 4 to 3 after receiving B's vector?
Because Router B reports a distance to C as 2, and Router A knows distance to B is 1, so total 1+2=3 is shorter than 4. See execution_table step 1.
Why does Router B not update its routing table after receiving A's vector?
Router B already has the shortest distances to neighbors, so no shorter path is found. See execution_table step 2 where no update is made.
What causes the routing tables to stop updating?
When no router finds a shorter path after exchanging vectors, the tables converge and updates stop. See execution_table step 7.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 1, what is Router A's distance to C after update?
A4
B2
C3
D1
💡 Hint
Check the 'Routing Table After' column for Router A at step 1.
At which step does Router C update its distance to A?
AStep 1
BStep 3
CStep 5
DStep 6
💡 Hint
Look for Router C's updates in the 'Update Made?' column in execution_table.
If Router B's distance to C changed from 2 to 1, how would Router A's distance to C change after step 1?
AChange to 2
BStay 3
CChange to 1
DChange to 4
💡 Hint
Calculate new distance as distance to B (1) + B's distance to C (1) = 2, check execution_table step 1 logic.
Concept Snapshot
Distance Vector Routing (RIP):
- Each router shares its distance vector with neighbors.
- Routers update routes if a shorter path is found via neighbors.
- Updates repeat periodically until no changes occur (convergence).
- Uses hop count as distance metric, max 15 hops.
- Simple, but can be slow to converge in large networks.
Full Transcript
Distance vector routing works by routers sharing their known distances to all destinations with their neighbors. Each router starts knowing only the distance to its immediate neighbors. When a router receives distance vectors from neighbors, it checks if it can reach any destination with fewer hops by going through that neighbor. If yes, it updates its routing table with the shorter path. This process repeats periodically or when changes occur, until all routers have the shortest paths and no updates happen anymore, called convergence. For example, Router A initially thinks C is 4 hops away, but after hearing from Router B that B can reach C in 2 hops, and since A is 1 hop from B, A updates its distance to C to 3 hops. This exchange continues until no router can improve its routes. RIP uses hop count as the distance metric and limits max hops to 15 to avoid routing loops.