23  IoT Protocols: Stack Architecture

Key Concepts
  • Protocol Stack: A vertical arrangement of networking protocols where each layer provides services to the layer above and uses services from the layer below
  • PHY Layer: The Physical layer; converts bits to radio signals or electrical pulses and defines modulation, frequency, and data rate
  • MAC Layer: Medium Access Control; governs when a device is allowed to transmit to avoid collisions on a shared channel
  • Network Layer: Handles addressing and routing of packets across multiple hops; IPv6 and 6LoWPAN operate here
  • Transport Layer: Provides end-to-end reliability and flow control; UDP and TCP are the main options in IoT
  • Application Layer: The topmost layer; defines message formats and semantics; MQTT, CoAP, and AMQP operate here
  • Cross-Layer Optimisation: Techniques that share information between non-adjacent layers to improve performance, at the cost of violating strict layering

23.1 In 60 Seconds

The IoT protocol stack maps protocols across five layers: Physical (Sub-GHz/2.4 GHz radio), Data Link (802.15.4, BLE, LoRaWAN, Wi-Fi), Network (IPv6, 6LoWPAN, RPL), Transport (UDP, TCP, DTLS), and Application (CoAP, MQTT, HTTP). Each layer addresses specific IoT constraints such as limited bandwidth, power, and memory, and selecting the right combination at each layer determines your system’s range, reliability, and efficiency.

Learning Objectives

By the end of this section, you will be able to:

  • Describe the IoT Protocol Stack: Explain each layer’s role from physical through application
  • Classify Protocols by Layer: Assign IoT protocols to their correct stack position and justify IoT-specific adaptations
  • Compare Protocol Categories: Differentiate protocols by communication pattern, transport mechanism, and network function
  • Apply Decision Trees: Select appropriate protocols for deployment scenarios using systematic decision frameworks
  • Map to TCP/IP Model: Align IoT protocols with the standard TCP/IP layer model

A protocol stack is like a layer cake where each layer has a specific job. The bottom layer handles the physical radio signal, the middle layers handle addressing and routing, and the top layer handles your actual application data. Understanding how these layers fit together helps you see why IoT systems are built the way they are.

“Let me walk you through my entire protocol stack,” said Sammy the Sensor. “At the very bottom, my radio operates at 2.4 GHz – that is the Physical layer. Above that, I use IEEE 802.15.4 for my Data Link layer, which handles how I share the radio channel.”

“Then comes the Network layer,” continued Max the Microcontroller. “Sammy uses IPv6 with 6LoWPAN compression to squeeze those big 40-byte headers into just 6 bytes. RPL routing helps his messages hop through the mesh to reach the gateway.”

Lila the LED pointed to the Transport layer. “UDP keeps things lightweight – only 8 bytes of overhead. TCP would add 20+ bytes and need a handshake first. For a battery sensor sending 4 bytes of data, UDP is the obvious choice.”

“And at the top, the Application layer,” said Bella the Battery. “CoAP for constrained devices like Sammy, MQTT for always-on devices like Lila. Each layer in the stack was designed with IoT constraints in mind – limited power, limited memory, limited bandwidth. The whole stack works together to get tiny sensor readings from the field to the cloud as efficiently as possible!”

23.2 Prerequisites

Before diving into this chapter, you should be familiar with:

23.3 How It Works: Building the IoT Protocol Stack Layer by Layer

Think of the IoT protocol stack like building a house from foundation to roof:

  1. Physical Layer (Foundation): The radio waves carrying bits through the air. Like the ground your house sits on, it determines what frequencies you use (2.4 GHz Wi-Fi or Sub-GHz LoRa) and how fast bits flow (250 kbps 802.15.4 vs 1 Gbps Wi-Fi).

  2. Data Link Layer (Framing): Organizes bits into frames with addresses. Like the walls dividing rooms, this layer uses MAC addresses to identify devices and handles collision avoidance (CSMA/CA for 802.15.4, time-slotting for BLE).

  3. Network Layer (Routing): Gets packets from source to destination across multiple hops. Like roads connecting houses in a neighborhood, IPv6 provides global addressing and RPL routing finds paths through mesh networks.

  4. Transport Layer (Reliability): Ensures data arrives correctly. Like delivery confirmation for packages, UDP provides fast unreliable delivery while TCP guarantees ordered arrival at the cost of overhead.

  5. Application Layer (User Services): The protocols your IoT application actually uses. Like the furniture and appliances in your house, this is where CoAP provides REST-like sensor access and MQTT handles telemetry pub/sub.

Key Insight: Each layer adds a header (overhead). A 4-byte sensor reading can require 56 bytes total with IPv6/UDP/CoAP, or just 14 bytes with 6LoWPAN compression – that is why layer-by-layer optimization matters for battery life.

Protocol overhead accumulates across all layers of the stack.

For a 4-byte sensor payload without compression: - IPv6 header: 40 bytes - UDP header: 8 bytes - CoAP header: 4 bytes - Total overhead: \(40 + 8 + 4 = 52\) bytes - Total packet: \(52 + 4 = 56\) bytes - Efficiency: \(\frac{4}{56} = 7.1\%\) (93% is overhead!)

With 6LoWPAN compression: - 6LoWPAN compressed IPv6: 2 bytes (inline context) - UDP compressed: 4 bytes (port compression) - CoAP header: 4 bytes - Total overhead: \(2 + 4 + 4 = 10\) bytes - Total packet: \(10 + 4 = 14\) bytes - Efficiency: \(\frac{4}{14} = 28.6\%\) (4× better)

For a battery sensor transmitting 1,000 messages/day, 6LoWPAN saves \((56 - 14) \times 1{,}000 = 42{,}000\) bytes/day. Over a year, that is \(42{,}000 \times 365 \approx 15.3\) MB saved per sensor. At 250 kbps (802.15.4), this reduces radio-on time by roughly 8 minutes per year – a modest saving per transmission that compounds significantly across thousands of devices and multi-year deployments.

Try It: Protocol Overhead Calculator

Adjust the payload size, network-layer compression, and messages per day to see how protocol overhead affects total data volume and payload efficiency.

23.4 IoT Protocol Stack

Complete IoT protocol stack showing five layers with specific protocols at each layer: Application Layer (CoAP, MQTT, HTTP) in orange for user-facing services, Transport Layer (UDP, TCP, DTLS) in teal providing end-to-end communication, Network Layer (IPv6, 6LoWPAN, RPL) in navy for routing and addressing, Data Link Layer (802.15.4, BLE, LoRaWAN, Wi-Fi) in teal for frame transmission, and Physical Layer (Sub-GHz Radio, 2.4 GHz Radio) in gray for wireless transmission, demonstrating complete protocol stack from radio waves to application data
Figure 23.1: IoT Protocol Stack Detail

This variant helps you select protocols based on your deployment scenario:

IoT protocol stack selection decision tree guiding choice of protocols at each layer based on deployment scenario including constrained device mesh, cellular wide-area, and gateway-based architectures with recommended protocol combinations

This decision tree guides you through common IoT deployment scenarios to recommended protocol stacks.

IoT protocol stack showing layers from physical to application: Physical layer with radios, Link layer with BLE/Zigbee/LoRa, Network layer with IPv6/6LoWPAN, Transport with UDP/TCP, and Application with CoAP/MQTT/HTTP
Figure 23.2: Main IoT protocols across different layers

23.5 Protocol Categories by Layer

Layer-by-Layer Protocol Breakdown

Application Layer (What applications use): - CoAP: RESTful for constrained devices (UDP-based) - MQTT: Publish-subscribe messaging (TCP-based) - HTTP: Web APIs (via gateways, not directly on sensors) - AMQP: Enterprise messaging - XMPP: Extensible messaging (less common for IoT)

Transport Layer (How data is transported): - UDP: Connectionless, lightweight, unreliable - TCP: Connection-oriented, reliable, higher overhead - DTLS: Secure UDP (TLS for datagrams)

Overview of common networking protocols used in IoT including TCP/IP, UDP, MQTT, CoAP, HTTP, and their relationships in the protocol stack
Figure 23.3: Common networking protocols for IoT applications
Glossary of common IoT and networking acronyms including MQTT, CoAP, HTTP, TCP, UDP, IPv6, 6LoWPAN, BLE, LoRaWAN with brief definitions
Figure 23.4: Common IoT protocol acronyms and terminology

Network Layer (How packets are routed): - IPv6: 128-bit addresses (IoT standard) - IPv4: 32-bit addresses (legacy, exhausted) - ICMPv6: Network diagnostics - RPL: Routing for low-power lossy networks

Adaptation Layer (How protocols adapt to constraints): - 6LoWPAN: IPv6 header compression for 802.15.4 - Thread: IPv6-based mesh (uses 6LoWPAN)

Internet protocol suite showing TCP/IP model with Application, Transport, Internet, and Network Access layers mapped to common IoT protocols
Figure 23.5: Internet protocols stack for IoT applications

Data Link Layer (How devices access medium): - IEEE 802.15.4: Low-power wireless (Zigbee, Thread) - Bluetooth LE: Short-range personal area network - LoRaWAN: Long-range, low-power WAN - Wi-Fi (802.11): Local area network - Cellular (NB-IoT, LTE-M): Wide area network

Physical Layer (How bits are transmitted): - Radio: 2.4 GHz (Wi-Fi, BLE, Zigbee), Sub-GHz (LoRa, Z-Wave) - Wired: Ethernet, I2C, SPI, RS-232

23.6 Protocol Comparison Tables

23.6.1 Application Layer Protocols

Protocol Header Size Transport Pattern Best For
CoAP 4 bytes UDP Request-Response Battery devices, M2M
MQTT 2 bytes TCP Publish-Subscribe Telemetry, dashboards
HTTP 200+ bytes TCP Request-Response Web APIs, gateways
AMQP Variable TCP Queue-based Enterprise messaging

23.6.2 Transport Layer Protocols

Protocol Connection Reliability Overhead Power Security
UDP Connectionless Best-effort 8 bytes Low None (add DTLS)
TCP Connection-oriented Guaranteed 20+ bytes High None (add TLS)
DTLS Connectionless Best-effort 13+ bytes Medium Built-in
TLS Connection-oriented Guaranteed 5-40 bytes High Built-in

23.6.3 Network Layer Protocols

Protocol Address Size Header Size Compression IoT Suitability
IPv4 32 bits 20 bytes None Limited (NAT)
IPv6 128 bits 40 bytes Via 6LoWPAN Excellent
6LoWPAN 128 bits 2-7 bytes Yes Essential for 802.15.4

23.7 Understanding Check: IoT Protocol Stack Selection

Scenario: You’re deploying 500 battery-powered soil moisture sensors across a 200-acre farm. Each sensor uses an IEEE 802.15.4 radio and has 32KB RAM. Sensors must transmit 50-byte readings every 30 minutes to a cloud server for 5+ years without battery replacement.

Think about:

  1. Why would using HTTP over TCP add 10-20 extra packets per reading compared to CoAP over UDP?
  2. What happens to your 50-byte payload when you try to fit it inside an 802.15.4 frame with a 40-byte IPv6 header?

Key Insight: CoAP/UDP/6LoWPAN compression reduces the protocol overhead from 48 bytes (IPv6 40 bytes + UDP 8 bytes) to just 6 bytes (6LoWPAN compressed). This means:

Why CoAP Stack Wins:

Protocol efficiency decision tree for 50-byte sensor reading showing three paths: CoAP/UDP/6LoWPAN results in 54 bytes total fitting in single 802.15.4 frame with 5-10 year battery life in teal, MQTT/TCP/IPv6 requires 94+ bytes causing fragmentation with 2-3 year battery life in orange, HTTP/TCP requires 200+ bytes causing major fragmentation with months battery life in gray, demonstrating CoAP's efficiency advantage for constrained IoT devices
Figure 23.6: CoAP Protocol Efficiency Comparison

Why 6LoWPAN is essential:

  • 802.15.4 MTU = 127 bytes
  • IPv6 header = 40 bytes (before compression)
  • 6LoWPAN compresses IPv6 header to 2-7 bytes
  • Without 6LoWPAN, no room for application data!

Why CoAP over MQTT:

For 50-byte sensor reading:

CoAP (UDP):
- 4-byte header + 50-byte payload = 54 bytes
- No connection setup (UDP)
- Confirmable mode for reliability
- Perfect for infrequent readings

MQTT (TCP):
- Requires TCP connection (3-way handshake = 3 packets)
- TCP header per packet (20 bytes)
- MQTT CONNECT sequence (multiple packets)
- Keep-alive overhead
- Better for continuous streaming, not periodic readings

RAM Comparison:

Protocol    RAM Required    32KB Fit?
CoAP        2-10 KB         Yes
MQTT        10-30 KB        Tight
HTTP        50-100 KB       No
AMQP        100+ KB         No

Why other options fail:

A - HTTP/TCP/IPv4:

  • HTTP headers are text-based, ~200-500 bytes
  • TCP requires connection state memory
  • IPv4 has no header compression for 802.15.4
  • Won’t fit in 127-byte MTU without fragmentation

C - MQTT/TCP/IPv6:

  • MQTT is efficient but TCP overhead for infrequent messages
  • IPv6 without 6LoWPAN = 40-byte header (too large)
  • TCP connection maintenance drains battery

D - AMQP/TCP/IPv4:

  • Enterprise protocol, not designed for constrained devices
  • Complex protocol = large code footprint
  • TCP overhead same problems as MQTT

Scenario: A steel mill deploys 500 temperature sensors monitoring blast furnaces. Each sensor transmits 4-byte readings every second (43.2 million readings/day total). A central control room needs to display data on multiple dashboards, log all readings, and trigger alarms when temperatures exceed thresholds—all with <2 second latency.

Think about:

  1. How many TCP connections would 500 HTTP sensors create/destroy per day sending individual requests every second?
  2. Why does having 3 different subscribers (dashboard, logger, alarm system) make publish-subscribe more efficient than request-response?

Key Insight: MQTT’s persistent connections reduce network overhead by 75% compared to per-request protocols:

MQTT Wins Because:

1. Persistent TCP Connection:

CoAP/HTTP (per-message overhead):
Each message: DNS lookup + TCP handshake + Request + Response
500 sensors x 4 packets = 2,000 packets/second overhead!

MQTT (persistent connection):
Initial: Connect once per sensor (500 connections)
Ongoing: PUBLISH packet only (2-byte header + payload)
500 sensors x 1 packet = 500 packets/second (75% reduction)

2. Pub/Sub Pattern:

MQTT publish-subscribe architecture showing 500 sensors (Sensor 1, 2, ...500) publishing temperature data through central MQTT broker in navy to three subscribers in orange: Dashboard subscribing to all temperatures via sensors/temp/# wildcard, Data Logger subscribing to all sensor data via sensors/# wildcard, and Alert System subscribing to Line 1 sensors only via sensors/temp/line1/+ wildcard, demonstrating one-to-many data distribution pattern
Figure 23.7: MQTT Publish-Subscribe Pattern

Topics:

  • sensors/temp/line1/machine001
  • sensors/temp/line1/machine002

Subscribers can use wildcards:

  • Dashboard: sensors/temp/# (all temperatures)
  • Line1 alerts: sensors/temp/line1/+ (line1 only)

3. QoS Levels:

QoS 0 (At most once): Fire-and-forget (lowest overhead)
  - Perfect for high-frequency sensor data
  - Missing one reading out of 86,400/day is acceptable

QoS 1 (At least once): Acknowledged delivery
  - For critical alerts
  - Slightly more overhead

Performance Comparison:

Performance comparison for 500 messages per second showing protocol efficiency: MQTT achieves lowest overhead at 25 KB/sec with 500 packets in teal marked as winner, CoAP requires 30 KB/sec with 2000 packets in orange as good alternative, HTTP consumes 250 KB/sec with 2000+ packets in gray showing 10x more bandwidth usage, demonstrating MQTT's efficiency for high-frequency IoT telemetry
Figure 23.8: Protocol Performance Comparison

Verify Your Understanding:

  • Calculate: If each sensor sends 43,200 readings/day, how many total packet transmissions occur with HTTP request-response vs MQTT persistent connection?
  • Why does MQTT’s topic-based routing (sensors/temp/#) eliminate the need for application-level filtering that HTTP would require?

Scenario: A city IT department deploys 10,000 parking sensors across downtown. Each sensor reports status changes (occupied/vacant) ~5 times/day plus monthly battery level. Sensors use NB-IoT cellular ($0.50/MB data). The city already has REST API infrastructure for their web portal and mobile app, but needs to minimize cellular data costs for 5-year sensor deployment.

Think about:

  1. What’s the total cost difference over 5 years between 500-byte HTTP requests and 50-byte CoAP messages at $0.50/MB for 10,000 sensors?
  2. How does a CoAP-to-HTTP gateway let you keep constrained protocols on sensors while maintaining REST API compatibility?

Key Insight: CoAP with HTTP proxy reduces cellular data costs by $900,000 over 5 years while maintaining REST API compatibility:

Why CoAP + Proxy Architecture Wins:

Architecture:

CoAP-HTTP proxy gateway architecture for 10,000 parking sensors showing sensors (1, 2, ...10,000) in teal sending CoAP GET/POST requests over NB-IoT to central CoAP-HTTP Proxy Gateway in navy, which translates to HTTP REST API for City Cloud Backend in orange, which serves three applications: Parking App, Revenue System, and Analytics, enabling protocol translation while maintaining REST API compatibility
Figure 23.9: CoAP-HTTP Proxy Architecture

Benefits:

1. Sensor Side (CoAP):
   - Minimal code footprint (~10KB vs ~50KB for HTTP)
   - Low power (UDP, no TCP handshake)
   - Small messages (4-byte header vs 300+ for HTTP)
   - Perfect for NB-IoT's bursty nature

2. Backend Side (Proxy):
   - Translates CoAP to HTTP seamlessly
   - Existing REST APIs unchanged
   - Single point of protocol translation
   - Can add caching, aggregation

Cost Analysis (10,000 sensors, 5 years):

                    CoAP+Proxy    HTTP Direct    MQTT
Sensor RAM          16 KB         64 KB          32 KB
Sensor cost         $15           $25            $20
Data/msg            ~50 bytes     ~500 bytes     ~60 bytes
Monthly data        1 MB          10 MB          1.2 MB
NB-IoT cost/month   $0.50         $2.00          $0.60
Backend change      Proxy ($500)  None           Broker ($2K)

5-Year TCO:
Sensors:            $150,000      $250,000       $200,000
Connectivity:       $300,000      $1,200,000     $360,000
Backend:            $500          $0             $2,000
------------------------------------------------------------
TOTAL:              $450,500      $1,450,000     $562,000

23.9 Worked Example: Total Protocol Stack Cost for 10,000-Device Fleet

When selecting a protocol stack, engineers often focus on individual protocol features but overlook the cumulative cost across all five layers. This worked example compares the total cost of ownership for three common IoT protocol stacks deployed at scale.

Scenario: A utility company deploys 10,000 smart water meters across a metropolitan area. Each meter transmits a 16-byte consumption reading every hour (24 readings/day). Meters must operate for 10 years on a single battery and survive outdoor conditions (-20 to 55 C).

23.9.1 Stack A: LoRaWAN + UDP + CoAP (LPWAN Optimized)

Physical:     LoRa radio (SX1276, $3.50/unit)
Data Link:    LoRaWAN Class A (free spectrum)
Network:      IPv6/6LoWPAN (no per-device cost)
Transport:    UDP (8-byte header)
Application:  CoAP (4-byte header)

Per-message overhead: 8 + 4 = 12 bytes + 16 payload = 28 bytes
Daily data: 28 bytes x 24 = 672 bytes/device
Monthly data: 20 KB/device
Gateway cost: 25 gateways x $1,500 = $37,500
Spectrum cost: $0 (unlicensed ISM band)
Battery life: 12+ years (Class A sleep mode)

23.9.2 Stack B: NB-IoT + UDP + CoAP (Cellular IoT)

Physical:     NB-IoT modem (BC95, $5.50/unit)
Data Link:    NB-IoT (licensed spectrum)
Network:      IPv6 (carrier-managed)
Transport:    UDP (8-byte header)
Application:  CoAP (4-byte header)

Per-message overhead: 12 bytes + 16 payload = 28 bytes
Daily data: 672 bytes/device (same as Stack A)
Monthly data: 20 KB/device
Gateway cost: $0 (uses existing cellular infrastructure)
Spectrum cost: $0.30/device/month (carrier plan)
Battery life: 10+ years (eDRX + PSM)

23.9.3 Stack C: Wi-Fi + TCP + MQTT (High-Bandwidth)

Physical:     Wi-Fi radio (ESP32, $2.50/unit)
Data Link:    802.11n (2.4 GHz)
Network:      IPv4 (NAT, DHCP)
Transport:    TCP (20-byte header + handshake)
Application:  MQTT (2-byte header + CONNECT overhead)

Per-message overhead: 20 + 2 + TCP keep-alive = ~60 bytes + 16 payload = 76 bytes
Daily data: 76 bytes x 24 + TCP overhead = ~2.5 KB/device
Monthly data: 75 KB/device
Gateway cost: 500 APs x $200 = $100,000 (outdoor-rated)
Spectrum cost: $0 (unlicensed)
Battery life: 6-12 months (no sleep mode for outdoor meters)

23.9.4 10-Year Total Cost of Ownership Comparison

Cost Category Stack A (LoRaWAN) Stack B (NB-IoT) Stack C (Wi-Fi)
Radio modules (10K units) $35,000 $55,000 $25,000
Gateway/infrastructure $37,500 $0 $100,000
Spectrum/connectivity (10yr) $0 $360,000 $0
Battery replacement (10yr) $0 $0 $900,000 (9 replacements)
Server/broker $5,000 $5,000 $12,000
10-Year Total $77,500 $420,000 $1,037,000
Cost per device per year $0.78 $4.20 $10.37

Key Insight: The protocol stack selection for this scenario is dominated by battery cost (Stack C) and connectivity fees (Stack B), not radio module cost. LoRaWAN’s free spectrum and ultra-low power consumption produce a 10-year TCO that is 5.4x cheaper than NB-IoT and 13.4x cheaper than Wi-Fi. However, NB-IoT wins if the deployment area lacks LoRaWAN gateway coverage and the utility prefers outsourcing network infrastructure to a carrier. Stack selection is ultimately a business decision, not just a technical one.

Try It: Fleet TCO Calculator

Adjust the fleet size and deployment duration to compare total cost of ownership across the three protocol stacks.


23.10 Concept Check

Quick self-test (answers at the end):

  1. Which layer is responsible for converting bits into radio waves?
  2. What does 6LoWPAN compress IPv6 headers from (bytes) to (bytes)?
  3. Why would you choose UDP over TCP for battery-powered sensors?
  4. At which layer does MQTT operate?
Answers
  1. Physical layer - handles the actual radio transmission
  2. From 40 bytes (uncompressed IPv6) to 2-7 bytes (6LoWPAN IPHC compressed)
  3. UDP avoids TCP’s connection overhead (handshake, keep-alive) which drains batteries
  4. Application layer - MQTT runs on top of TCP transport

23.11 Concept Relationships

Builds Upon:

Enables:

Related Concepts:

  • 6LoWPAN adaptation layer bridges constrained networks to IPv6
  • Protocol overhead compounds across layers (40+8+4 bytes before payload)
  • Hybrid protocol stacks combine different choices per layer for optimal performance

23.12 See Also

Protocol Deep Dives:

Link Layer Technologies:

Hands-On:

23.13 Try It Yourself

Hands-on exercise to explore protocol layers:

  1. Install Wireshark on your computer (free download from wireshark.org)
  2. Capture local network traffic for 60 seconds while browsing the web
  3. Filter for HTTP traffic using display filter: http
  4. Inspect a packet - expand each protocol layer in the middle pane
  5. Observe the stack:
    • Ethernet frame (Data Link)
    • IPv4 or IPv6 packet (Network)
    • TCP segment (Transport)
    • HTTP request/response (Application)

What to notice: Each layer adds its own header. A simple HTTP GET request might have 14 + 20 + 20 + 100 = 154 bytes of headers before any actual web page data.

Challenge: Filter for IoT protocols on your home network if you have smart devices: - mdns - device discovery traffic - mqtt - if you have MQTT devices - coap - if you have CoAP devices

Common Pitfalls

Zigbee spans PHY, MAC, network, and application layers in one specification. LoRaWAN defines PHY and MAC but leaves the application layer open. Fix: always check which layers a protocol covers before comparing it to another protocol.

TCP’s retransmission and flow control are designed for wired networks. On lossy wireless links, TCP’s congestion control misinterprets packet loss as network congestion and throttles throughput unnecessarily. Fix: use UDP with application-layer retransmission (e.g., CoAP) for constrained IoT links.

Encoding sensor calibration offsets in the MAC header or embedding routing decisions in application payloads creates brittle, hard-to-maintain systems. Fix: assign each responsibility to the correct layer and resist the temptation to shortcut across layer boundaries.

The MAC layer controls radio sleep schedules. A misconfigured MAC that wakes the radio too frequently can drain a battery in days instead of years. Fix: profile radio active time at the MAC layer separately from application-layer activity.

23.14 Summary

This chapter explored the IoT protocol stack architecture in detail:

  • The IoT protocol stack spans from physical layer (radio/wired) through adaptation (6LoWPAN), network (IPv6), transport (UDP/TCP), to application (CoAP/MQTT) layers
  • Application layer protocols differ in their communication patterns: CoAP uses request-response (RESTful), MQTT uses publish-subscribe with a broker
  • Transport layer choices depend on reliability requirements: UDP for low-power battery devices, TCP for reliable streaming
  • Network layer uses IPv6 for massive address space; 6LoWPAN compression is essential for 802.15.4 networks
  • Data link layer options range from short-range (BLE, 802.15.4) to long-range (LoRaWAN, NB-IoT)
  • Protocol selection depends on deployment constraints: battery life, range, data rate, and reliability requirements

23.15 Knowledge Check

23.16 What’s Next

Direction Chapter Focus
Next Protocol Scenarios & Interview System design scenarios, technical interview questions, and troubleshooting
Previous IoT Protocols: Introduction Why IoT needs specialized protocols
Hands-On IoT Protocols: Labs and Selection Hands-on protocol implementation and selection frameworks

Deep Dives:

Application Protocols:

Network Layer:

Link Layer Technologies:

Foundational Concepts:

Learning: