%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#16A085', 'lineColor': '#E67E22', 'secondaryColor': '#16A085'}}}%%
graph TB
DEST["Destination: 8.8.8.8"]
subgraph ROUTES["Available Routes (sorted by prefix)"]
R24["192.168.1.0/24<br/>Prefix: 24 bits"]
R24B["192.168.2.0/24<br/>Prefix: 24 bits"]
R0["0.0.0.0/0<br/>Prefix: 0 bits"]
end
subgraph MATCH["Match Check"]
M1["8.8.8.8 in 192.168.1.0/24?<br/>NO - Different subnet"]
M2["8.8.8.8 in 192.168.2.0/24?<br/>NO - Different subnet"]
M3["8.8.8.8 in 0.0.0.0/0?<br/>YES - Default matches all"]
end
DEST --> R24 --> M1
DEST --> R24B --> M2
DEST --> R0 --> M3
M3 --> RESULT["Forward to 10.0.0.1<br/>(Default Gateway)"]
style DEST fill:#E67E22,stroke:#2C3E50,color:#fff
style R24 fill:#7F8C8D,stroke:#2C3E50,color:#fff
style R24B fill:#7F8C8D,stroke:#2C3E50,color:#fff
style R0 fill:#16A085,stroke:#2C3E50,color:#fff
style M1 fill:#7F8C8D,stroke:#2C3E50,color:#fff
style M2 fill:#7F8C8D,stroke:#2C3E50,color:#fff
style M3 fill:#16A085,stroke:#2C3E50,color:#fff
style RESULT fill:#2C3E50,stroke:#16A085,color:#fff
696 Routing Review: Advanced Configuration
This chapter focuses on practical routing configuration for production IoT deployments:
- Redundant paths for high availability
- Floating static routes for automatic failover
- Router forwarding decisions step-by-step
- Default routes for internet connectivity
These are the skills you need to configure and troubleshoot real IoT gateway routing.
If you need foundational routing concepts first, see: - Routing Review: Longest Prefix Matching - Route selection basics - Routing Review: Convergence and Loop Prevention - Protocol behavior
696.1 Learning Objectives
By the end of this chapter, you will be able to:
- Configure Redundant Paths: Set up primary and backup routes for high availability
- Implement Floating Static Routes: Use metrics for automatic failover
- Trace Forwarding Decisions: Debug router behavior step-by-step
- Design Gateway Routing: Plan routing tables for IoT deployments
696.2 Prerequisites
Required Chapters: - Routing Review: Longest Prefix Matching - Routing Review: Convergence and Loop Prevention
Technical Background: - Static route configuration - Routing table structure - Default gateway concepts
Estimated Time: 35 minutes
696.3 Redundant Path Configuration
Scenario: You’re deploying a critical industrial IoT system monitoring a chemical plant. The system must maintain 99.9% uptime to send real-time alerts about temperature and pressure anomalies. Your IoT gateway has two available paths to the cloud:
- Primary Path: Via fiber connection through Router A - 10 hops, 5ms latency, $100/month
- Backup Path: Via LTE cellular through Router B - 15 hops, 25ms latency, $500/month with per-GB charges
You need the backup path to activate automatically only when the primary fails (not for load balancing), then automatically fail back when primary recovers.
Think about: 1. How can you configure both paths so the backup stays dormant until needed? 2. What routing mechanism prevents the router from load balancing across both paths? 3. How will the router detect when to switch between paths?
Key Insight: Floating static routes solve this with metric-based priority. Configure primary route with low metric (10) and backup with high metric (100). Router installs only the lowest-metric route. When primary interface fails, primary route disappears, backup route (now lowest) automatically installs. When primary recovers, its lower metric reclaims the active slot. Typical failover time: 1-5 seconds.
Configuration:
# IoT Gateway routing configuration
# Primary route (preferred, low metric)
ip route 0.0.0.0 0.0.0.0 192.168.1.1 10
# Backup route (standby, high metric)
ip route 0.0.0.0 0.0.0.0 192.168.2.1 100Routing Table States:
Normal Operation (Primary UP):
Destination Gateway Metric Status
0.0.0.0/0 192.168.1.1 10 ACTIVE
0.0.0.0/0 192.168.2.1 100 Not installed (higher metric)
Traffic flows via Router A (fiber)
Primary Fails:
Destination Gateway Metric Status
0.0.0.0/0 192.168.2.1 100 ACTIVE
Traffic automatically switches to Router B (LTE)
Failover time: ~2 seconds
Primary Recovers:
Destination Gateway Metric Status
0.0.0.0/0 192.168.1.1 10 ACTIVE
0.0.0.0/0 192.168.2.1 100 Not installed (higher metric)
Traffic automatically fails back to Router A (fiber)
Why This Matters:
Cost Savings: - Primary fiber: Unlimited data, $100/month flat rate - Backup LTE: $500/month + $50/GB overage charges - Floating static ensures LTE only used during outages (~99 hours/year at 99.9% uptime) - Estimated LTE cost with floating static: $500-600/year (vs $6,000/year if load balanced)
Performance: - Primary: 5ms latency (optimal for real-time alerts) - Backup: 25ms latency (acceptable during emergencies) - Avoid load balancing which would degrade 50% of traffic to 25ms unnecessarily
Verify Your Understanding: - What happens if you set both routes to metric 10? (Equal-cost load balancing - backup used even when not needed) - What’s the failover time if you manually configure routes? (10-30 minutes - too slow for critical systems) - How does the router detect primary link failure? (Interface down event removes connected route, triggering backup installation)
Show Trade-Off Analysis
Floating Static Routes vs Alternatives:
| Approach | Failover Time | Config Complexity | Cost Impact | Best For |
|---|---|---|---|---|
| Floating Static | 1-5 seconds | Low (2 commands) | Optimal (backup dormant) | Simple dual-path IoT |
| Equal-Cost Load Balance | N/A (always active) | Low (2 commands) | High (backup always used) | Equal-quality paths |
| Manual Failover | 10-30 minutes | Low (1 command) | Optimal (backup dormant) | Non-critical systems |
| Dynamic Routing (OSPF+BFD) | <1 second | High (full protocol) | Optimal (backup dormant) | Enterprise networks |
Why Not Equal-Cost Load Balancing?
# WRONG: Both routes with same metric
ip route 0.0.0.0 0.0.0.0 192.168.1.1 10
ip route 0.0.0.0 0.0.0.0 192.168.2.1 10 # Same metric!
Problems:
X Router installs BOTH routes simultaneously
X Traffic split 50/50 across fiber + LTE
X Half of traffic gets 25ms latency (vs 5ms)
X LTE data charges apply to 50% of traffic ($3,000/month extra!)
X Wastes backup capacity when primary is healthyWhy Not Manual Failover?
# WRONG: Only configure primary, manually add backup during outage
ip route 0.0.0.0 0.0.0.0 192.168.1.1
When primary fails:
1. Monitoring system detects failure (5 minutes)
2. Admin receives alert (5 minutes)
3. Admin logs into gateway (5 minutes)
4. Admin runs: ip route 0.0.0.0 0.0.0.0 192.168.2.1
5. Traffic resumes via backup (30 seconds)
Total: 15-20 minutes of downtime
Problems:
X Chemical plant sensors offline for 15+ minutes
X Temperature/pressure alerts not sent to operators
X Safety systems degraded during critical window
X Violates 99.9% uptime SLA (allows only 8.7 hours/year downtime)Floating Static Route Benefits:
Automatic failover (1-5 seconds vs 15+ minutes manual)
Automatic failback when primary recovers
No routing protocol overhead (no OSPF hellos, LSAs)
Simple configuration (2 static routes)
Predictable behavior (lowest metric wins)
Cost-effective (backup dormant until needed)
Perfect for IoT gateways with dual uplinks
Real-World Industrial IoT Example:
Oil and Gas Pipeline Monitoring Gateway:
-- Primary: Fiber to operations center (10 hops, 5ms, $100/mo)
-- Backup: Satellite VSAT (25 hops, 600ms, $1,000/mo + $100/GB)
-- Configuration:
ip route 0.0.0.0 0.0.0.0 192.168.10.1 10 # Fiber (preferred)
ip route 0.0.0.0 0.0.0.0 192.168.20.1 100 # Satellite (backup)
Normal operation:
- All sensor data via fiber (5ms latency optimal for real-time)
- Satellite link idle (saves $100/GB overage charges)
Fiber outage (rare):
- Automatic failover to satellite in 2 seconds
- Critical pressure/flow alerts still reach operators
- Higher latency acceptable during emergency
- Satellite costs ~$1,200/month during outage (vs $6,000 if always active)
Fiber restoration:
- Automatic failback to fiber
- Latency returns to 5ms optimal
- Satellite link returns to standby
Key Takeaway: Floating static routes provide automatic failover with manual route simplicity - ideal for cost-sensitive IoT deployments with redundant connectivity where backup paths should remain dormant until needed. The metric-based priority ensures predictable behavior without routing protocol complexity.
696.4 Router Forwarding Decisions
696.5 Visual Reference Gallery
Explore these AI-generated visualizations that illustrate key routing concepts covered in this chapter.
Distance vector routing is the foundation of protocols like RIP and forms the basis for understanding RPL’s approach to IoT routing.
Link state routing provides faster convergence than distance vector but requires more memory, making it less suitable for constrained IoT devices.
Mesh routing enables self-healing networks essential for reliable IoT deployments in challenging environments.
DODAG construction is fundamental to RPL operation, enabling efficient many-to-one routing for IoT sensor networks.
696.6 Key Concepts
- Floating Static Route: Static route with higher metric that activates only when lower-metric route fails
- Default Route: Catch-all route (0.0.0.0/0) used for any destination without more specific match
- Connected Route: Automatically created route for subnets directly attached to router interfaces
- Static Route: Manually configured route; appropriate for small networks and critical infrastructure
- Failover: Automatic switching to backup path when primary fails
- Failback: Automatic return to primary path when it recovers
- Metric: Cost value used to prioritize routes; lower metrics preferred
696.7 Summary
Advanced routing configuration enables reliable IoT deployments:
Floating Static Routes: - Configure primary route with low metric (10) - Configure backup route with high metric (100) - Router automatically uses lowest-metric available route - Failover in 1-5 seconds; automatic failback when primary recovers - Cost-effective: backup only used during outages
Router Forwarding Decisions: 1. Check specific routes in routing table 2. If no match, use default route (0.0.0.0/0) 3. If no default route, drop packet 4. Never broadcast at Network Layer
Default Routes: - Essential for internet connectivity - Match all destinations when no specific route exists - Enable IoT sensors to reach any cloud server - Reduce routing table size dramatically
696.8 Key Takeaways
- Routing implements packet switching - packets forwarded hop-by-hop to destination
- Routers examine destination IP in each packet and consult routing table
- Three forwarding decisions: specific route, default route, or drop packet
- TTL (Time-To-Live) prevents routing loops by limiting packet lifetime
- Routing tables contain destination network, next hop, and outbound interface
- Three route types: Connected (automatic), Static (manual), Dynamic (learned)
- Routing protocols enable routers to exchange topology information and adapt to changes
- RPL protocol is designed specifically for low-power IoT networks
- Dynamic rerouting allows automatic failover when links fail
696.9 What’s Next
Having completed this comprehensive routing review, you’re prepared to explore:
Network Topologies - How physical and logical arrangements of devices affect routing decisions and network scalability
Advanced Routing Protocols - Deep dives into OSPF, BGP, and specialized IoT protocols like RPL and AODV
Network Security - Securing routing infrastructure against attacks like route hijacking, spoofing, and denial-of-service
Quality of Service (QoS) - Prioritizing critical IoT traffic and managing bandwidth allocation across routes
The routing principles covered here - metric-based selection, failover mechanisms, and protocol behavior - form the foundation for designing resilient IoT networks. When you design mesh networks with Zigbee or Thread, configure multi-WAN gateways, or troubleshoot connectivity issues, you’ll apply these routing fundamentals daily.
Interactive Tools: - Cisco Packet Tracer - Simulate routing scenarios - GNS3 - Advanced network simulator
Video Tutorials: - ARP Demonstration - Address Resolution Protocol - Routing Demonstration - Packet Tracer routing
Documentation: - RPL RFC 6550 - IoT routing protocol specification - OSPF Basics
Practice: - Run traceroute to different destinations and analyze paths - Examine routing tables on your home router - Configure static routes in Packet Tracer labs
Continue to: Wired Communication Protocols