Scenario: A smart building has three routing paths from a temperature sensor cluster (192.168.10.0/24) to the central building management system (BMS). You need to determine which route the routing protocol will select.
Given:
| Path A |
2 |
100 Mbps |
5 ms |
99.9% |
| Path B |
3 |
1 Gbps |
2 ms |
99.99% |
| Path C |
4 |
10 Mbps |
15 ms |
95% |
Step 1: Calculate RIP metric (hop count only)
RIP selects lowest hop count:
- Path A: 2 hops (WINNER for RIP)
- Path B: 3 hops
- Path C: 4 hops
Step 2: Calculate OSPF cost (bandwidth-based)
OSPF Cost = Reference Bandwidth / Link Bandwidth (minimum cost = 1)
Reference bandwidth = 100 Mbps (Cisco default)
Path A cost = 100/100 = 1 per hop x 2 hops = 2 total
Path B cost = 100/1000 = 0.1 -> rounds up to 1 per hop x 3 hops = 3 total
Path C cost = 100/10 = 10 per hop x 4 hops = 40 total
Note: OSPF costs are integers (minimum 1). With a 100 Mbps reference bandwidth, any link at or above 100 Mbps gets cost 1. To differentiate Gigabit from 100 Mbps links, increase the reference bandwidth (e.g., auto-cost reference-bandwidth 10000 for 10 Gbps). With a 10 Gbps reference:
Path A cost = 10000/100 = 100 per hop x 2 = 200 total
Path B cost = 10000/1000 = 10 per hop x 3 = 30 total (WINNER for OSPF)
Path C cost = 10000/10 = 1000 per hop x 4 = 4000 total
Step 3: Calculate RPL ETX metric (for IoT with lossy links)
ETX (Expected Transmission Count) = 1 / (delivery_rate x ack_rate)
Assuming symmetric links (delivery = ack rate):
Path A: ETX per hop = 1/(0.999 x 0.999) = 1.002
Total ETX = 1.002 x 2 = 2.004
Path B: ETX per hop = 1/(0.9999 x 0.9999) = 1.0002
Total ETX = 1.0002 x 3 = 3.001
Path C: ETX per hop = 1/(0.95 x 0.95) = 1.108
Total ETX = 1.108 x 4 = 4.432
Step 4: Compare protocol selections
| RIP |
Hop count |
Path A (2 hops) |
Fewest hops regardless of speed |
| OSPF |
Bandwidth cost |
Path B (cost 30)* |
Highest bandwidth path |
| RPL |
ETX |
Path A (2.004) |
Best reliability x hop balance |
*With 10 Gbps reference bandwidth. With the 100 Mbps default, OSPF selects Path A (cost 2) since 100 Mbps and 1 Gbps links both get cost 1.
Key Insight: Protocol selection dramatically affects routing behavior. For battery-powered IoT sensors on lossy wireless links, RPL’s ETX metric often chooses better paths than traditional hop count or bandwidth metrics.
ETX (Expected Transmission Count) quantifies how many transmissions are needed to successfully deliver one packet.
\[\text{ETX} = \frac{1}{p_{\text{fwd}} \times p_{\text{ack}}}\]
where \(p_{\text{fwd}}\) is forward delivery probability and \(p_{\text{ack}}\) is ACK delivery probability.
For a multi-hop path, cumulative ETX is:
\[\text{ETX}_{\text{total}} = \sum_{i=1}^{n} \text{ETX}_i\]
For example, a 3-hop path with link qualities 95%, 98%, 90%:
\[\begin{align*}
\text{ETX}_1 &= 1/(0.95 \times 0.95) = 1.108 \\
\text{ETX}_2 &= 1/(0.98 \times 0.98) = 1.041 \\
\text{ETX}_3 &= 1/(0.90 \times 0.90) = 1.235 \\
\text{ETX}_{\text{total}} &= 1.108 + 1.041 + 1.235 = 3.384
\end{align*}\]
This means you need an average of 3.384 transmission attempts to successfully deliver one packet end-to-end. Compare this to a 2-hop path with 99% links: \(ETX = 1/(0.99 \times 0.99) \times 2 = 1.020 \times 2 = 2.04\). Fewer hops with better quality wins.