RIP
What
Routing algorithm for traffic within a domain
Why
Easy to configure and understand
Automatic discovery and reconfiguration on changes
Good for small networks
max of 15 hops, 16=infinity
In homogenous networks, hop count as a metric is fine
Concepts
- Hop count metric
- The only notion of cost/distance is hop count
- Distance vector protocol
- "Tell your neighbours about the world"
- Each router only knows the distance and next hop to each destination
- Periodic updates:
- Broadcast entire routing table every 30s
- Route poisoning
- When a route fails, explicitly advertise it as 16 (infinity, unreachable) to inform neighbours
- Split horizon
- Do not advertise routes back to the interface they were learned from
- To prevent loops
- Hold-down timer
- Refuse new information for a failed route for X seconds, to prevent it flip-flopping
- Triggered updates
- When topology changes, send an update without waiting for the periodic 30s
Election
No election, all routers share information equally
How
- Router only knows directly connected networks in the initial routing table:
Network Next Hop Metric Interface
192.168.1.0/24 - 0 Gi0/0 (directly connected)
10.0.1.0/24 - 0 Gi0/1 (directly connected)
- Every 30s the router will send RIP updates
- In RIPv1 broadcast to
255.255.255.255 - In RIPv2 multicast to
224.0.0.9
- In RIPv1 broadcast to
RIP Update from R1:
- 192.168.1.0/24, metric 1 (directly connected, so metric 0 + 1 = 1)
- 10.0.1.0/24, metric 1
- Neighbour R2 in
10.0.1.0receives update:- Add 1 to each metric for the hop to R1
Network Next Hop Metric Interface
192.168.1.0/24 10.0.1.1 2 Gi0/0 (via R1)
10.0.1.0/24 - 0 Gi0/0 (directly connected)
172.16.1.0/24 - 0 Gi0/1 (directly connected)
- R2 will also send updates
- BUT, it will not advertise
192.168.1.0back to R1, since it learned it from there
(split-horizon)
- BUT, it will not advertise
Convergence
Initial state (T=0s):
R1 routing table:
192.168.1.0/24 directly connected metric 0
10.0.1.0/24 directly connected metric 0
R2 routing table:
10.0.1.0/24 directly connected metric 0
172.16.1.0/24 directly connected metric 0
R3 routing table:
172.16.1.0/24 directly connected metric 0
10.0.2.0/24 directly connected metric 0
After first update (T=30s):
R1 learns from R2:
172.16.1.0/24 via 10.0.1.2 (R2) metric 2
R2 learns from R1:
192.168.1.0/24 via 10.0.1.1 (R1) metric 2
R2 learns from R3:
10.0.2.0/24 via 172.16.1.2 (R3) metric 2
R3 learns from R2:
10.0.1.0/24 via 172.16.1.1 (R2) metric 2
After second update (T=60s):
R1 learns from R2:
10.0.2.0/24 via 10.0.1.2 (R2) metric 3
R3 learns from R2:
192.168.1.0/24 via 172.16.1.1 (R2) metric 3
Fully converged (T=60s+):
R1 routing table:
192.168.1.0/24 directly connected metric 0
10.0.1.0/24 directly connected metric 0
172.16.1.0/24 via 10.0.1.2 metric 2
10.0.2.0/24 via 10.0.1.2 metric 3
R2 routing table:
192.168.1.0/24 via 10.0.1.1 metric 2
10.0.1.0/24 directly connected metric 0
172.16.1.0/24 directly connected metric 0
10.0.2.0/24 via 172.16.1.2 metric 2
R3 routing table:
192.168.1.0/24 via 172.16.1.1 metric 3
10.0.1.0/24 via 172.16.1.1 metric 2
172.16.1.0/24 directly connected metric 0
10.0.2.0/24 directly connected metric 0
Link Failure
If the link between R2 and R3 were to fail:
- R2 detects the failure, as it is no longer getting periodic update from R3
- After 180 seconds (invalid timer) the route is marked as invalid and distance set to 16 (unreachable)
- Triggered update is sent to notify neighbours
- R1 receives update, disables route in table and enters hold-down timer of 180s
- After 240s (garbage collection timer), the route is completely removed