IoT devices cannot use standard internet protocols directly because they lack the memory, power, and bandwidth that HTTP and TCP assume. Instead, IoT relies on a specialized protocol stack: 6LoWPAN compresses IPv6 headers so tiny sensors can have internet addresses, CoAP provides RESTful communication over UDP with minimal overhead, and MQTT enables scalable publish-subscribe messaging through a broker. Choosing the right protocol for each layer – link, network, transport, and application – is the single most impactful design decision for power consumption, reliability, and scalability.
Learning Objectives
By the end of this section, you will be able to:
Explain why traditional internet protocols need adaptation for IoT constraints
Identify protocols at each layer of the IoT protocol stack
Differentiate IPv4 and IPv6 for IoT addressing requirements
Describe the role of 6LoWPAN in enabling IPv6 on constrained networks
Compare CoAP and MQTT application protocols by overhead and communication pattern
Map protocols to the TCP/IP layer model accurately
Select appropriate protocols for different IoT deployment scenarios
In 60 Seconds
IoT devices use specialised protocol stacks because standard TCP/HTTP assumes plentiful memory, power, and bandwidth. 6LoWPAN compresses IPv6 headers for tiny sensors, CoAP provides RESTful messaging over UDP, and MQTT enables scalable pub-sub via a broker — each solving a different constraint at a different layer.
20.1 Prerequisites
Before diving into this chapter, you should be familiar with:
Networking Basics for IoT: Understanding of fundamental networking concepts, TCP/IP stack, and protocol layers provides the foundation for learning about specialized IoT protocols
Layered Models: Fundamentals: Knowledge of the OSI and TCP/IP layered models is essential for understanding where each IoT protocol fits in the stack (application, transport, network, link layers)
IoT Protocols: Fundamentals: Basic understanding of why IoT requires specialized protocols helps contextualize the specific protocols covered in this overview chapter
Sensor Squad: How Do IoT Devices Talk to Each Other?
Meet the Sensor Squad!
Sammy the Temperature Sensor wants to tell the cloud that the kitchen is getting too hot. But Sammy is tiny – he only has a small battery and a weak radio. He can’t shout across the whole internet like a big computer can!
The Language Layers Analogy:
Imagine the Sensor Squad members are pen pals in different countries. To send a letter, they need:
A language to write in (Application layer) – Sammy writes in “CoAP” because it uses short words. Lila the Light Sensor prefers “MQTT” because she can send messages to a bulletin board that many people read.
An envelope style (Transport layer) – Sammy uses a postcard (UDP) because it’s quick and light. Lila uses a tracked package (TCP) because she wants to be sure it arrives.
An address (Network layer) – Every sensor gets a special number called an IPv6 address. But the address is too long for tiny Sammy, so 6LoWPAN shrinks it to fit on a tiny envelope!
A delivery truck (Link layer) – Wi-Fi, Bluetooth, or Zigbee are the different “trucks” that carry the letters.
Max’s Motion Tip: “Think of protocols like languages. Just like you pick Spanish or French depending on who you’re talking to, we sensors pick CoAP or MQTT depending on whether we need speed or reliability!”
Bella’s Button Fact: “A regular web page uses about 700 bytes just for the header. CoAP uses only 4 bytes – that’s like writing a full address on one tiny sticky note instead of a whole page!”
Try This at Home: Open a browser and visit any website. That used HTTP – a protocol with BIG headers. Now imagine your tiny watch trying to do that a thousand times a day on a coin battery. That’s why we need special IoT protocols!
For Beginners: What Are IoT Protocols and Why Do They Matter?
Real-World Analogy: Think of IoT protocols as the rules of the road for data. Just as traffic rules vary between a busy highway (TCP/HTTP) and a quiet neighborhood bike path (UDP/CoAP), different types of network traffic need different rules.
Why can’t IoT devices just use regular internet protocols?
Traditional protocols like HTTP were designed for powerful computers with constant electricity, gigabytes of memory, and fast wired connections. IoT devices face the opposite reality:
Resource
Desktop Computer
IoT Sensor
Memory
8-64 GB
32-256 KB
Processor
3-5 GHz
16-240 MHz
Power
Always plugged in
Coin cell battery (years)
Connection
Reliable Ethernet/Wi-Fi
Lossy wireless (10-40% loss)
Because of these constraints, IoT uses lightweight alternatives:
CoAP instead of HTTP – same RESTful style, but 10x less overhead
MQTT instead of email-style messaging – publish-subscribe pattern that works well with intermittent connections
6LoWPAN instead of raw IPv6 – compresses 40-byte headers down to just 2-7 bytes
UDP instead of TCP – no handshake overhead, perfect for simple sensor readings
The key insight: Every byte you save in protocol overhead translates directly to longer battery life and more data capacity on constrained wireless links.
Putting Numbers to It
For a soil sensor sending a 4-byte temperature reading every 10 minutes (144 messages/day), protocol overhead dramatically impacts battery life:
Battery impact (250 kbps radio, 20 mA TX, 5 µA sleep, 2000 mAh battery):
HTTP stack: \(\frac{108 \times 8 \times 144}{250{,}000} = 0.50\) sec TX/day → 0.003 mAh + 0.12 mAh sleep = 0.123 mAh/day → 44.5 years
CoAP stack: \(\frac{26 \times 8 \times 144}{250{,}000} = 0.12\) sec TX/day → 0.0007 mAh + 0.12 mAh sleep = 0.121 mAh/day → 45.3 years
At this low frequency, sleep current dominates. But at 10-second intervals (8640 messages/day), CoAP yields 40.5 years vs HTTP’s 26.3 years — a 54% improvement from protocol efficiency alone.
20.2 Chapter Overview
IoT protocols form the communication backbone that enables billions of connected devices to exchange data reliably and efficiently. Unlike traditional internet protocols designed for desktop computers and servers, IoT protocols must operate within severe constraints: limited memory (kilobytes, not gigabytes), low processing power (MHz, not GHz), battery operation (years, not hours), and unreliable wireless links (10-40% packet loss).
20.2.1 IoT Protocol Stack Architecture
The following diagram shows how IoT protocols map to the familiar TCP/IP layer model, highlighting the lightweight alternatives at each layer:
This comprehensive guide is organized into six focused chapters, each addressing a critical aspect of IoT protocol design and selection:
Test your understanding of IoT protocol fundamentals before diving into the detailed chapters.
20.4
Inline Check: Protocol Layer Placement
Common Pitfalls
Mistake 1: Using HTTP for battery-powered devices. HTTP headers can exceed 700 bytes per request. For a sensor sending 20 bytes of data, that is 97% overhead. Use CoAP (4-byte header) or MQTT (2-byte fixed header) instead.
Mistake 2: Choosing MQTT when you need request/response. MQTT excels at publish-subscribe but is awkward for request/response patterns (you must simulate them with paired topics). If your device needs to query a server and get a direct reply, CoAP’s GET/PUT/POST/DELETE methods are a better fit.
Mistake 3: Ignoring transport-layer impact. TCP’s three-way handshake requires 1.5 round trips (SYN, SYN-ACK, ACK) before any data is sent. On a network with 500ms round-trip time, that is 750 ms of latency and extra power consumption before a single byte of application data is transmitted. UDP-based protocols (CoAP) avoid this entirely.
Mistake 4: Assuming IPv4 is sufficient for IoT. IPv4 provides ~4.3 billion addresses – already exhausted. With projections of 25+ billion IoT devices, IPv6’s 340 undecillion addresses are not optional; they are essential. Design for IPv6 from day one.
Mistake 5: Forgetting about 6LoWPAN fragmentation. If your application data plus compressed headers exceed the 127-byte 802.15.4 frame limit, 6LoWPAN must fragment across multiple frames. Each fragment increases the chance of packet loss. Design payloads to fit in a single frame whenever possible.
20.5 Videos
Protocol Stack Overview
Protocol Stack Overview
Lesson 4 — foundational networking concepts used across IoT protocols.
Application Protocols in Context
Application Protocols in Context
Lesson 4 — MQTT vs CoAP vs HTTP vs AMQP and when to use each.
When to use CoAP (Constrained Application Protocol):
Criterion
Assessment
Reason
Device power
Battery-operated (years)
4-byte header + UDP = minimal overhead
Communication pattern
Request-response
RESTful GET/PUT/POST/DELETE fits direct queries
Network type
Lossy mesh (802.15.4)
UDP with CON messages handles loss efficiently
Payload size
Small (< 1 KB)
Efficient for sensor readings
Subscriber count
Few (1-3 endpoints)
Direct addressing avoids broker overhead
Example use case: Soil moisture sensor queried by local gateway every 15 minutes.
When to use MQTT (Message Queue Telemetry Transport):
Criterion
Assessment
Reason
Device power
Mains or rechargeable
TCP connection overhead acceptable
Communication pattern
Publish-subscribe
One-to-many data distribution
Network type
Reliable (Wi-Fi, Ethernet)
TCP performs well without frequent retransmissions
Payload size
Variable (bytes to KB)
2-byte header scales with larger messages
Subscriber count
Many (10+ dashboards)
Broker efficiently fans out to subscribers
Example use case: Factory temperature sensors streaming to dashboard, analytics, and alert systems.
When to use HTTP (Hypertext Transfer Protocol):
Criterion
Assessment
Reason
Device power
Mains-powered gateway
Large header overhead (100-200 bytes) doesn’t matter
Communication pattern
Cloud integration
Standard REST APIs for enterprise systems
Network type
High-bandwidth (Wi-Fi, Ethernet)
Works well with reliable, fast connections
Payload size
Large (KB to MB)
Overhead negligible for firmware/images
Integration need
Web services
Universal tooling and libraries
Example use case: IoT gateway aggregating 100 sensors and pushing data to cloud via REST API.
Decision tree: Start with power budget → If battery (years), choose CoAP. If mains-powered → Check subscriber count. If many subscribers → choose MQTT. If web API integration → choose HTTP. If request-response with few endpoints → choose CoAP.
Hybrid approach: Many real-world systems use CoAP from sensors to gateway, then MQTT from gateway to cloud, combining the efficiency of CoAP for constrained devices with the scalability of MQTT for cloud integration.
Try It: Protocol Overhead Calculator
Adjust the parameters below to see how protocol choice affects overhead efficiency and estimated battery life for a constrained IoT sensor.
This overview chapter introduced the IoT protocol landscape and the fundamental challenge: traditional internet protocols are too heavy for constrained devices. Here are the essential points to carry forward:
Takeaway
Details
IoT needs specialized protocols
HTTP/TCP assume abundant resources; IoT devices have KB of memory, MHz processors, and coin-cell batteries
The stack has four layers
Application (CoAP, MQTT), Transport (UDP, TCP), Network (IPv6, 6LoWPAN), Link (802.15.4, BLE, LoRa, Wi-Fi)
CoAP = lightweight REST
4-byte header, UDP-based, request/response – ideal for battery-powered devices with infrequent communication
MQTT = scalable pub/sub
2-byte fixed header, TCP-based, broker-mediated – ideal for thousands of devices publishing telemetry
6LoWPAN is essential
Compresses 40-byte IPv6 headers to 2-7 bytes, making IP-based communication possible on 127-byte frames
Protocol choice = battery life
Selecting CoAP over HTTP can extend battery life by 10x or more due to reduced overhead and no TCP handshake
One-sentence summary: IoT protocol selection is not about finding the “best” protocol – it is about matching each layer’s protocol to your specific constraints of power, bandwidth, latency, and scale.
20.9 What’s Next?
Start your journey through IoT protocols with Introduction to IoT Protocols to understand why traditional internet protocols need adaptation for resource-constrained devices.