Use Cases, Deployment Patterns, and Comprehensive Review
NoteLearning Objectives
By the end of this chapter, you will be able to:
Apply protocol selection knowledge to real-world IoT scenarios
Analyze deployment decisions for smart agriculture, home, and industrial applications
Understand protocol trade-offs through cost-benefit analysis
Evaluate protocol stacks for specific requirements
Demonstrate mastery through comprehensive quiz scenarios
661.1 Protocol Use Cases by Industry
Understanding how protocols are applied in real-world scenarios helps cement theoretical knowledge.
661.1.1 Protocol Comparison by Use Case
Use Case
Best Protocol Combo
Why?
Battery Life
Typical Setup
Smart home thermostat
Wi-Fi + MQTT/TCP
Always powered, reliable cloud updates needed
N/A (mains)
ESP32 to Wi-Fi router to MQTT broker to mobile app
Temperature sensor (building)
802.15.4/Thread + CoAP/UDP
Battery-powered, frequent readings, reliable mesh
3-5 years
Thread sensor to border router to CoAP server
Soil moisture (agriculture)
LoRaWAN + CoAP
Long range, infrequent readings, 10-year battery
5-10 years
Sensor to LoRa gateway to network server to app
Asset tracker (shipping)
Cellular NB-IoT + MQTT
Global coverage, periodic GPS updates
1-3 years
GPS tracker to cellular tower to MQTT cloud
Wearable fitness tracker
BLE + proprietary
Ultra-low power, close to phone
5-7 days
Watch to smartphone app to cloud
Industrial machine monitor
Ethernet/Wi-Fi + MQTT
Mains powered, real-time alerts, high reliability
N/A (mains)
PLC to Wi-Fi AP to MQTT broker to SCADA
Smart parking sensor
LoRaWAN or NB-IoT + CoAP
Long range in city, infrequent updates
5-10 years
Parking sensor to gateway to server to mobile app
Video doorbell
Wi-Fi + HTTP/WebSocket
High bandwidth, mains powered, real-time streaming
N/A (mains)
Camera to Wi-Fi to cloud to mobile app (push)
Environmental monitoring (remote)
LoRaWAN + CoAP
Extreme range, solar powered, rare updates
Solar+battery
Weather station to gateway (10km) to server
Smart light bulb
Zigbee/Thread + CoAP
Mesh networking, low latency control
N/A (mains)
Bulb to hub to mobile app
Key Insight: Notice how power source and range dominate the decision. Battery-powered + long-range almost always means LPWAN (LoRaWAN/NB-IoT), while mains-powered + short-range allows Wi-Fi with TCP-based protocols.
661.2 Detailed Example: Smart Agriculture System
Scenario: Monitor soil moisture across 50-hectare farm, with readings every 15 minutes, running on solar + battery for 5 years.
661.2.1 Decision Process
Power constraint: Solar + battery - rules out Wi-Fi (too power-hungry for 24/7 operation)
Range requirement: 50 hectares approximately 500m x 1000m - rules out BLE (30m range)
Data frequency: Every 15 minutes = 96 messages/day - compatible with LoRaWAN duty cycle limits
Payload size: Soil moisture + battery voltage + sensor ID = ~20 bytes - fits LoRaWAN
Infrastructure: Can install 1-2 LoRa gateways for whole farm - economical
661.2.2 Best Choice: LoRaWAN + CoAP
Transport: LoRaWAN (physical + MAC layer)
Application: CoAP NON messages (best-effort, one missed reading OK)
Fallback: CoAP CON for critical alerts (irrigation valve failure)
661.2.3 Why NOT alternatives
Wi-Fi + MQTT: Range requires 20+ Wi-Fi APs ($2000+), power consumption reduces solar battery life to 1-2 years
Figure 661.1: Gateway protocol translation from CoAP/UDP to HTTPS and MQTT
{fig-alt=“Gateway architecture showing sensors using CoAP over 6LoWPAN connecting to a gateway that translates to HTTPS REST API and MQTT broker for cloud connectivity”}
661.3.1 CoAP-HTTP Proxy Pattern
The CoAP-HTTP proxy is a standard pattern for IoT gateways:
RESTful mapping: CoAP and HTTP both use REST, enabling direct method mapping (CoAP GET/PUT/POST to HTTP GET/PUT/POST) and URI translation (/sensor/temp)
Transport translation: Gateway terminates UDP from sensors, initiates TCP to cloud
Security translation: DTLS (for CoAP over UDP) translates to TLS (for HTTP over TCP)
Efficiency preservation: Sensors use lightweight CoAP (4-byte header), cloud uses HTTP (compatible with web infrastructure)
Many edge gateways (e.g., AWS IoT Greengrass, Azure IoT Edge) include built-in CoAP-HTTP proxies for this exact use case.
661.4 Comprehensive Review Questions
Test your understanding of IoT protocols with these comprehensive scenarios.
NoteQuiz: Protocol Stack Layers
Question: Which layers are part of the standard IoT protocol stack? (Select ALL that apply)
Explanation: The IoT protocol stack typically follows a simplified 5-layer model based on TCP/IP: (1) Physical Layer defines radio characteristics (IEEE 802.15.4, LoRa, Bluetooth LE, NB-IoT), (2) Data Link Layer handles MAC protocols, (3) Network Layer provides addressing and routing (IPv6, 6LoWPAN for adaptation, RPL for routing), (4) Transport Layer manages end-to-end communication (UDP, TCP, DTLS), (5) Application Layer defines IoT-specific protocols (CoAP, MQTT, HTTP). Options B and D reference OSI model layers that are not explicitly present in the simplified IoT/TCP-IP stack. TLS/DTLS operate at the transport layer, and SIP/RTP are not standard IoT protocols.
NoteQuiz: Protocol Overhead Efficiency
Question: When comparing protocol overhead for transmitting a 4-byte temperature reading, arrange these protocol stacks in order from MOST efficient to LEAST efficient payload ratio:
Explanation: For a 4-byte payload, total overhead analysis reveals: CoAP/UDP/6LoWPAN = 39 bytes overhead (4/43 = 9.3% payload efficiency), MQTT/TCP/6LoWPAN = 94 bytes overhead (4/98 = 4.1% efficiency), HTTP/TCP/IPv4 = 162 bytes overhead (4/166 = 2.4% efficiency). CoAP achieves 4x better efficiency than MQTT and nearly 4x better than HTTP. This dramatic difference stems from: (1) UDP vs TCP transport (8 vs 20 bytes), (2) Compact CoAP header (4 bytes vs 2 bytes MQTT, but TCP adds 18 bytes), (3) No HTTP text headers. For tiny IoT sensor readings, header overhead dominates packet size, making protocol selection critical for battery life and bandwidth efficiency.
NoteQuiz: Industrial Monitoring Scenario
Question: A factory deploys 200 vibration sensors on machinery, transmitting 16-byte FFT signatures every 5 seconds for predictive maintenance. The network uses IEEE 802.15.4 with 15% packet loss due to metal structures. The maintenance dashboard requires data within 3 seconds for anomaly alerts. Comparing protocols: CoAP with confirmable messages (4-byte header, exponential backoff max 1.5s), MQTT with QoS 1 (2-byte header, TCP retransmission ~200ms), which protocol better meets reliability and latency requirements?
Explanation: For high-frequency, reliability-critical industrial monitoring with 15% packet loss, MQTT QoS 1 provides superior performance: (1) TCP retransmission: Lost packets retransmitted within ~200ms (1 RTT) vs CoAP’s exponential backoff (250ms, 500ms, 1000ms, 1500ms), (2) Connection state: TCP maintains sequence numbers and ACKs for efficient recovery, (3) Latency under loss: MQTT averages 600ms including retries vs CoAP averaging 1.2s, (4) 3-second requirement: Both meet requirement, but MQTT has 2x margin. While CoAP’s confirmable messages provide reliability, the exponential backoff delay in lossy environments makes it unsuitable for frequent transmissions with tight latency requirements.
NoteQuiz: Protocol Encapsulation Order
Question: An IoT device needs to integrate multiple protocols in its stack for end-to-end communication: IEEE 802.15.4 physical layer, IPv6 addressing, UDP transport, and CoAP application protocol. What is the correct order of protocol encapsulation when transmitting sensor data from the device?
Explanation: Protocol encapsulation follows the standard top-down stack order during transmission: (1) Application Layer: CoAP formats sensor data with 4-byte header (e.g., GET /temperature), (2) Transport Layer: UDP adds 8-byte header with source/destination ports, (3) Network Layer: IPv6 adds 40-byte header with source/destination addresses, (4) Adaptation Layer: 6LoWPAN compresses IPv6 header from 40 to 2-6 bytes using context-based compression, fragments if needed for 127-byte 802.15.4 frame limit, (5) Data Link Layer: 802.15.4 MAC adds frame headers/trailers, (6) Physical Layer: 802.15.4 PHY transmits bits over 2.4 GHz radio. The key insight is that 6LoWPAN operates after IPv6 encapsulation to compress the already-formed IPv6 header.
NoteQuiz: 6LoWPAN Applicability
Question: A logistics company tracks shipping containers with GPS/cellular IoT devices reporting location every 15 minutes. Devices use NB-IoT (Narrowband IoT) cellular connectivity with IPv6 addressing. The application sends 20-byte JSON payloads to a cloud server. Should the system use 6LoWPAN compression, and why or why not?
Explanation: 6LoWPAN is not applicable for NB-IoT because: (1) Network architecture: 6LoWPAN provides an adaptation layer specifically for IEEE 802.15.4 (127-byte frames) and Bluetooth LE networks that cannot natively handle IPv6’s 1280-byte MTU, (2) NB-IoT design: NB-IoT cellular technology already supports native IPv6 with standard IP stack, no adaptation needed, (3) MTU handling: NB-IoT handles standard IPv6 MTU (1280-1500 bytes) without fragmentation at adaptation layer, (4) Header compression: NB-IoT may use RoHC (Robust Header Compression) at cellular layer, but this is different from 6LoWPAN. Think of 6LoWPAN as “training wheels” for IPv6 on very constrained networks; NB-IoT is a “full-sized bicycle” that doesn’t need them.
NoteQuiz: LoRaWAN vs IP Stack
Question: A wildlife tracking collar uses LoRaWAN for long-range communication (10 km) with extremely limited bandwidth (50 kbps) and power budget (2x AA batteries, 5-year life). The collar sends 12-byte GPS coordinates every 2 hours. Comparing protocol options: (A) HTTP/TCP/IPv4, (B) MQTT/TCP/IPv6, (C) CoAP/UDP/IPv6, (D) Custom binary over LoRaWAN MAC, which protocol stack is most appropriate?
Explanation: For LPWAN technologies like LoRaWAN, IP-based protocols are often inappropriate: (1) Network topology: LoRaWAN uses star topology (devices to gateway to network server), not mesh networking that requires IP routing, (2) Built-in features: LoRaWAN MAC layer provides device addressing (DevAddr), AES-128 encryption, frame acknowledgments, and adaptive data rate, (3) Overhead analysis: IP stack (IPv6 40 bytes + UDP 8 bytes + CoAP 4 bytes = 52 bytes) would exceed 12-byte payload size by 4.3x, devastating for limited LoRaWAN airtime, (4) Battery impact: Transmitting 64 bytes vs 12 bytes = 5.3x more energy. Custom binary protocol directly uses LoRaWAN MAC: 12-byte payload + 13-byte LoRaWAN header = 25 bytes total vs 64+ bytes with IP stack.
NoteQuiz: IPv6 Address Allocation
Question: A city deploys 50,000 smart streetlights using IPv6 with 6LoWPAN over IEEE 802.15.4 mesh network. Each light controller has 32 KB RAM (RFC 7228 Class 2 device). The network architect must configure addressing. IPv6 provides 2^128 addresses (340 undecillion). The city is allocated a /32 prefix from its ISP. How should address allocation be structured to support current lights plus 10x future growth while enabling efficient routing?
Explanation: IPv6 best practice uses /64 subnets for several critical reasons: (1) Address abundance: /32 prefix provides 2^(64-32) = 2^32 = 4.3 billion /64 subnets, each containing 2^64 = 18.4 quintillion addresses. For 50,000 lights across ~100 neighborhoods = 500 lights/neighborhood, allocating one /64 per neighborhood uses only 100 subnets (0.000002% of available), (2) SLAAC compatibility: /64 enables Stateless Address Autoconfiguration where devices generate interface identifiers (last 64 bits) from MAC addresses (EUI-64) or random generation (RFC 7217), eliminating DHCPv6 servers, (3) Routing efficiency: Hierarchical addressing (City /32 to Neighborhood /64 to Device /128) enables route aggregation, reducing routing table size.
NoteQuiz: Protocol Stack Function
Question: A smart factory implements an IoT protocol stack with these components: IEEE 802.15.4 (Physical), 802.15.4 MAC (Data Link), 6LoWPAN (Adaptation), IPv6 (Network), RPL (Routing), UDP (Transport), CoAP (Application), DTLS (Security). Engineers must troubleshoot packet loss. Which statements correctly describe the function of each layer in this stack? (Select ALL that apply)
Explanation: Understanding layer responsibilities is critical for IoT debugging: (B) Correct: RPL (RFC 6550) builds and maintains Destination-Oriented Directed Acyclic Graph (DODAG) routing topology for mesh networks, operating at Network layer to compute routes between nodes. (C) Correct: DTLS (Datagram TLS, RFC 6347) provides confidentiality, integrity, and authentication for UDP-based protocols like CoAP, operating at Transport layer. (D) Correct: 6LoWPAN (RFC 4944, 6282) is an Adaptation layer between Data Link (802.15.4 MAC) and Network (IPv6), performing header compression and fragmentation/reassembly for IPv6 over 802.15.4. (E) Correct: CoAP (RFC 7252) is Application layer protocol providing RESTful methods over UDP port 5683 (5684 for CoAPS). (A) Incorrect: 6LoWPAN doesn’t replace IPv6; it enables IPv6 over constrained links by compressing the IPv6 header, not replacing it.
661.5 Visual Reference Gallery
NoteAI-Generated Figure Variants for IoT Protocols Overview
These AI-generated SVG figures provide alternative visual representations of IoT protocol concepts. Each figure uses the IEEE color palette for consistency.
IoT Protocol Stack
Figure 661.2: IoT Protocol Stack: Layered view of protocols used in IoT communication.
Real-World Protocol Patterns: - Smart agriculture: LoRaWAN + CoAP for long range, low power - Smart home: Zigbee/Thread + CoAP for mesh reliability - Fleet tracking: NB-IoT + MQTT for global cellular coverage - Industrial: Wi-Fi/Ethernet + MQTT for high bandwidth, reliability
Gateway Translation: - CoAP-HTTP proxy bridges constrained and cloud networks - Preserve RESTful semantics across translation - DTLS to TLS for security translation
Cost-Benefit Analysis: - Consider 5-year total cost (hardware + infrastructure + subscriptions) - Battery replacement costs can exceed hardware savings - LoRaWAN gateway ($500 one-time) vs NB-IoT ($5/device/year)
Protocol Selection Summary: - Battery + Long range = LoRaWAN/NB-IoT + CoAP - Mains + Short range = Wi-Fi + MQTT - Mesh + Home = Zigbee/Thread + CoAP - Mobile + Global = Cellular + MQTT
Best Practices: - Use IPv6 for addressing (future-proof) - Use 6LoWPAN for 802.15.4 networks (essential compression) - Use CoAP for sensor-to-gateway (constrained) - Use MQTT for gateway-to-cloud (scalable) - Consider hybrid architectures for optimal efficiency
The IoT protocol landscape is diverse and layered, with each protocol optimized for specific constraints and use cases. Successful IoT deployments select protocols appropriate to device capabilities and application requirements.
661.8 What’s Next?
Return to IoT Protocols Overview for links to related chapters, or continue to the next topic in the networking curriculum.