Routing is the process of selecting paths for data packets to travel across networks, with routers consulting routing tables to determine the best next hop for each packet. IoT networks add unique challenges – low-power devices, lossy wireless links, and mesh topologies – requiring specialized protocols like RPL that optimize for energy efficiency and constrained memory.
3.1 Learning Objectives
By completing this routing fundamentals series, you will be able to:
Explain Routing: Describe how routing implements packet switching across interconnected networks
Analyze Router Function: Explain how routers make forwarding decisions using routing tables
Configure Routing Tables: Build routing table entries with appropriate next hops and metrics
Distinguish Route Types: Differentiate between connected, static, and dynamic routes
Apply TTL Concept: Calculate how Time-To-Live prevents routing loops and aids diagnostics
Design IoT Routing: Implement routing for constrained IoT networks using RPL and other protocols
Minimum Viable Understanding
Routing is the process of selecting paths for data packets to travel from source to destination across one or more networks; routers examine destination addresses and consult routing tables to determine the next hop.
Routing tables are the core data structure: each entry maps a destination network to a next-hop address, an outgoing interface, and a cost metric. Tables are built by static configuration or dynamic routing protocols (RIP, OSPF, BGP, RPL).
IoT routing introduces unique constraints: low-power devices, lossy wireless links, and mesh topologies require specialized protocols like RPL (IPv6 Routing Protocol for Low-Power and Lossy Networks) that optimize for energy, reliability, and constrained memory.
3.2 Introduction
Routing is fundamental to how data travels across networks, from IoT sensors through mesh networks to cloud servers. Every time a sensor reading leaves a device and arrives at a cloud dashboard, it has traversed a chain of routing decisions – each router along the path independently choosing the best next hop.
This comprehensive guide has been organized into focused chapters to help you master routing concepts progressively, from basic definitions through to IoT-specific protocols.
Sensor Squad: The Great Message Relay
Sammy the Temperature Sensor needs to send a reading to the cloud, but the cloud is far, far away! Imagine Sammy is in one corner of a huge school building, and the principal’s office (the cloud) is on the opposite side.
Sammy can’t walk there – sensors stay in place! So Sammy hands the message to Lila the Router, who is like a hallway monitor. Lila looks at her special notebook (her routing table) and says: “Messages going to the principal? I should pass them to Max in the next corridor!”
Max the Router gets the message and checks his notebook: “Principal’s office? That goes through Bella near the gym!” Bella gets it and can deliver it directly to the principal.
Here’s the cool part: None of the hallway monitors know the whole route. They only know the next step. That’s how routing works – each router just knows who to hand the message to next, like a relay race!
What if a hallway is blocked by a spilled bucket of paint? The monitors update their notebooks and find a different path. That’s why routing is so smart – it can work around problems!
For Beginners: What is Routing?
Think of routing like a postal system for data packets.
When you mail a letter, you don’t plan the exact route it takes. You put an address on it and drop it in a mailbox. At each sorting office along the way, workers look at the address and decide where to send it next. Your letter may pass through several offices before reaching its destination.
Routing in computer networks works the same way:
A data packet has a destination address (like an IP address)
Each router it encounters looks at this address
The router checks its routing table – a list that says “for destination X, send to next-hop Y”
The packet moves one hop closer to its destination
Three things to remember:
Routers are the decision-makers at each junction
Routing tables are the maps routers use to make decisions
Routing protocols are the way routers share information to keep their maps up to date
You don’t need to understand all the math and algorithms yet. Start with the concept that routing is about making hop-by-hop forwarding decisions, and the rest will build naturally.
3.3 Prerequisites
Before starting this series, you should be familiar with:
Networking Basics: Understanding fundamental networking concepts including IP addressing and packet switching
Layered Network Models: Knowledge of the OSI and TCP/IP models helps you understand where routing operates (Network Layer)
Key Concepts
Routing: The process of determining the path that network packets should follow from source to destination, typically using a routing protocol to build and maintain routing tables.
Forwarding: The act of receiving a packet on one interface and transmitting it out another interface toward the destination, based on the routing table.
Dynamic Routing Protocol: A protocol that automatically exchanges topology information between routers to build and maintain routing tables without manual configuration (e.g., OSPF, RIP, RPL).
Link-State Routing: A routing approach where each router builds a complete map of the network topology and computes shortest paths using Dijkstra’s algorithm (e.g., OSPF, IS-IS).
Distance-Vector Routing: A routing approach where each router knows only the direction and distance to destinations, sharing routing table entries with neighbors (e.g., RIP, RPL).
3.4 Chapter Organization
Recommended Reading Order
Follow these chapters in sequence for the best learning experience, or jump to specific topics as needed.
3.5 The Challenge: Finding Paths in Complex Networks
Networks can have millions of possible paths. Each router only sees its immediate neighbors, and there is no central authority that knows the complete network topology. Networks evolve continuously as links fail and devices join or leave.
The Solution: Routing protocols that collaboratively build and maintain routing tables across the network. These protocols exchange information between neighbors, compute optimal paths, and adapt to changes – all without requiring global network knowledge at any single point.
In IoT networks, this challenge is amplified by resource constraints, lossy wireless links, and the need for energy-efficient operation.
3.6 Key Routing Concepts at a Glance
The following diagram summarizes the core concepts you will encounter throughout this chapter series:
3.7 Worked Example: Tracing a Sensor Reading Across a Network
Let us walk through a concrete scenario to see how routing concepts come together in practice.
Scenario: A temperature sensor in a smart factory sends a reading (25.3 °C) to a cloud monitoring dashboard. The sensor is connected to a local mesh network, which connects through a gateway to the corporate LAN, which then routes to the internet.
Network Layout:
Device
IP Address
Role
Temperature Sensor
fd00::10
Source (6LoWPAN mesh)
Mesh Router 1
fd00::2
Intermediate (mesh network)
Border Router / Gateway
fd00::1 / 192.168.1.1
Mesh-to-LAN bridge
Corporate Router
192.168.1.254
LAN-to-Internet
Cloud Server
203.0.113.50
Destination
Step-by-Step Packet Journey:
Sensor (fd00::10) creates a packet with destination 203.0.113.50. Its routing table has a default route pointing to Mesh Router 1 (fd00::2). Hop Limit is set to 64.
Mesh Router 1 (fd00::2) receives the packet, decrements Hop Limit to 63, looks up the destination in its routing table, and forwards to the Border Router (fd00::1).
Border Router decompresses the 6LoWPAN headers to full IPv6, then performs NAT64 translation to IPv4 before forwarding to the Corporate Router at 192.168.1.254. Hop Limit / TTL is now 62.
Corporate Router has a default route pointing to its ISP. It forwards the packet onto the internet. TTL is decremented to 61.
The packet traverses several ISP routers (each decrementing TTL), following BGP-determined paths.
Cloud Server (203.0.113.50) receives the packet, extracts the sensor reading (25.3 °C), and displays it on the dashboard.
Key Observations:
Each router made an independent forwarding decision using only its local routing table
The Hop Limit / TTL decreased at every hop, preventing infinite loops
The Border Router handled protocol translation between the IoT mesh and traditional IP networks
No single device knew the complete end-to-end path
Putting Numbers to It: Packet Forwarding Latency Breakdown
Let’s calculate the total end-to-end latency for this sensor reading packet and identify bottlenecks.
Bottleneck Analysis: The two 6LoWPAN mesh hops contribute 20.4 ms (52% of total latency) despite being the first two hops. This is typical for IoT networks – the constrained wireless edge dominates end-to-end latency.
Try It: Packet Transmission Delay Calculator
Adjust the packet size and link rate to see how transmission delay changes across different network technologies. Notice how constrained IoT links (like 802.15.4 at 250 kbps) produce dramatically higher delays than wired links.
Avoid these frequently encountered mistakes when working with routing:
Confusing Routing with Forwarding: Routing is the process of building and maintaining routing tables (control plane). Forwarding is the act of moving a packet from an input interface to an output interface based on those tables (data plane). They are related but distinct operations.
Assuming Global Knowledge: No single router knows the entire network topology. Each router makes decisions based on its local routing table. Designing systems that assume centralized path knowledge will fail in distributed networks.
Ignoring TTL / Hop Limit: Forgetting to set appropriate TTL values leads to packets circulating endlessly in routing loops, consuming bandwidth and battery power on constrained IoT devices. Always verify TTL behavior during testing.
Using Static Routes in Dynamic IoT Networks: Static routes are simple and predictable, but IoT mesh networks have nodes that frequently join, leave, or move. Using only static routes means the network cannot adapt to topology changes.
Overlooking Asymmetric Paths: The path from A to B may differ from the path from B to A. This is common in IoT networks where link quality varies by direction. Always test bidirectional connectivity, not just one-way reachability.
Treating All Links as Equal Cost: In IoT networks, link quality varies dramatically. A routing metric that only counts hop count may choose a 3-hop path with terrible links over a 4-hop path with excellent links. Use composite metrics (ETX, energy, latency) for IoT routing.
3.8 Knowledge Check
Test your understanding of routing fundamentals before diving into the detailed chapters.
## Quick Navigation
Start Here: Routing Basics – Begin with fundamental concepts
For IoT Focus: IoT Routing – Jump directly to IoT-specific content
Hands-On Practice: Routing Labs and Quiz – Test your knowledge with practical exercises
Match: Routing Fundamentals Overview
Order: Sensor Reading Journey to Cloud
🏷️ Label the Diagram
Code Challenge
3.9 Summary
Routing is the backbone of all networked communication, determining how packets travel from source to destination across potentially complex, multi-hop networks. In this overview chapter, we established the following key points:
Concept
Key Takeaway
Routing vs Forwarding
Routing builds tables (control plane); forwarding uses them to move packets (data plane)
Routing Tables
Map destination networks to next-hop addresses, interfaces, and cost metrics
TTL / Hop Limit
Prevents infinite loops by limiting packet lifetime; decremented at each hop
Routing Protocols
Enable routers to share information and compute paths collaboratively (RIP, OSPF, BGP, RPL)
IoT Constraints
Low power, lossy links, limited memory, and dynamic topologies require specialized protocols like RPL
Composite Metrics
IoT routing should use metrics beyond hop count (ETX, energy, latency) for reliable operation
The six chapters in this series progressively build your understanding from basic definitions through to IoT-specific implementations. Each chapter includes worked examples, knowledge checks, and practical exercises to reinforce learning.
Decision Framework: Choosing a Routing Protocol for Your IoT Network
Use this framework to select the optimal routing protocol based on your IoT network characteristics:
Network Characteristic
RIP
OSPF
RPL
Static Routes
Scale: < 50 nodes
✓ Acceptable
⊗ Overkill
✓✓ Optimal
✓ If topology stable
Scale: 50-500 nodes
⊗ Too slow
✓✓ Optimal
✓ Good
⊗ Unmanageable
Scale: > 500 nodes
⊗ Max 15 hops
✓✓ Excellent
⊗ DODAG depth limits
⊗ Impossible
Battery-powered devices
⊗ High overhead
⊗ CPU intensive
✓✓ Designed for
✓ Zero overhead
Lossy wireless links (>10% loss)
⊗ Slow convergence
⊗ LSA flooding issues
✓✓ ETX-aware
⊗ Can’t adapt
Constrained memory (< 128 KB RAM)
✓ Low memory
⊗ Stores full topology
✓✓ DODAG only
✓✓ Minimal
Dynamic topology (frequent changes)
⊗ 30-90s convergence
✓ Sub-second
✓ 5-30s typical
⊗ Manual updates
Wired Ethernet backbone
⊗ Outdated
✓✓ Industry standard
N/A
✓ Simple setups
Mesh sensor network
⊗ Not suitable
⊗ Not suitable
✓✓ Designed for
⊗ Can’t handle mesh
Many-to-one traffic (sensors → gateway)
⊗ Inefficient
⊗ General-purpose
✓✓ DODAG optimized
⊗ Each node needs route
Legend: ✓✓ Excellent fit | ✓ Acceptable | ⊗ Poor fit | N/A Not applicable
Example Decision Path:
Scenario 1: Smart Home (15 devices, battery-powered, Wi-Fi mesh)
Scale: < 50 nodes ✓ RPL or Static
Battery-powered ✓✓ RPL
Wireless mesh ✓✓ RPL
Recommendation: RPL with ETX metric for link quality awareness
Recommendation: Static routes (LoRaWAN handles MAC-layer routing to gateway)
Scenario 4: Office Building (8 floors, 50 sensors/floor, stable deployment)
Scale: 400 nodes → Could use OSPF or RPL
Topology stable (wired backbone to floor gateways)
Budget-conscious deployment
Recommendation: Static routes from sensors to floor gateway + OSPF on wired backbone between gateways
Key Decision Factors:
Device constraints (battery, memory) → RPL if constrained, OSPF if abundant resources
Network stability → Static if rarely changes, dynamic if frequent topology updates
Traffic pattern → RPL optimal for many-to-one, OSPF for any-to-any
Convergence time requirements → OSPF fastest (<1s with BFD, seconds without), RPL moderate (5-30s), RIP slow (30-90s)
Try It: IoT Routing Protocol Selector
Select your network characteristics to get a routing protocol recommendation. This interactive tool applies the decision framework above to your specific scenario.
Begin with Routing Basics to understand what routing is and how routers make forwarding decisions. That chapter covers the fundamental distinction between routing and forwarding, introduces the concept of the routing table, and sets the foundation for everything that follows.