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

Election

No election, all routers share information equally

How

  1. 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)
  1. Every 30s the router will send RIP updates
    1. In RIPv1 broadcast to 255.255.255.255
    2. In RIPv2 multicast to 224.0.0.9
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
  1. Neighbour R2 in 10.0.1.0 receives update:
    1. 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)
  1. R2 will also send updates
    1. BUT, it will not advertise 192.168.1.0 back to R1, since it learned it from there
      (split-horizon)

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

If the link between R2 and R3 were to fail:

  1. R2 detects the failure, as it is no longer getting periodic update from R3
  2. After 180 seconds (invalid timer) the route is marked as invalid and distance set to 16 (unreachable)
  3. Triggered update is sent to notify neighbours
  4. R1 receives update, disables route in table and enters hold-down timer of 180s
  5. After 240s (garbage collection timer), the route is completely removed