1219  CoAP Fundamentals and Architecture

Chapter Index: Constrained Application Protocol

1219.1 Overview

CoAP (Constrained Application Protocol) is a specialized web transfer protocol designed for resource-constrained IoT devices. It provides familiar RESTful semantics (GET, PUT, POST, DELETE) in a compact binary format running over UDP, enabling web-style APIs on microcontrollers with as little as 2KB RAM.

This comprehensive chapter has been organized into focused topics for easier learning. Select a topic below based on your learning goals.

1219.2 Chapter Contents

1219.2.1 Core Concepts

Chapter Description Difficulty
CoAP Introduction Why CoAP exists, comparison with HTTP and MQTT, design philosophy Beginner
Message Format 4-byte header structure, options encoding, response codes, tokens Intermediate
Message Types and Reliability CON, NON, ACK, RST messages, retransmission, exponential backoff Intermediate

1219.2.2 Advanced Features

Chapter Description Difficulty
Observe Extension Server push notifications, observer management, bandwidth savings Intermediate
Advanced Features Block-wise transfer, resource discovery, CoAP over TCP, DTLS security Advanced

1219.2.3 Design and Selection

Chapter Description Difficulty
API Design Best Practices RESTful patterns, URI conventions, content formats, security Intermediate
Decision Framework When to use CoAP vs MQTT vs HTTP, decision matrix, real examples Intermediate

1219.2.4 Hands-On Learning

Chapter Description Difficulty
CoAP Features and Labs Practical implementations, code examples, exercises Intermediate
CoAP Comprehensive Review Complete reference, all topics in depth Advanced

1219.3 Learning Paths

1219.3.1 Quick Start (1-2 hours)

  1. CoAP Introduction - Understand why CoAP exists
  2. Message Types - Learn CON vs NON selection
  3. Decision Framework - Know when to use CoAP

1219.3.2 Full Course (4-6 hours)

  1. CoAP Introduction
  2. Message Format
  3. Message Types
  4. Observe Extension
  5. Advanced Features
  6. API Design
  7. Decision Framework
  8. Features and Labs

1219.3.3 Reference Only

1219.4 Key Takeaway

CoAP is β€œHTTP for constrained devices” - it provides familiar RESTful semantics (GET, PUT, POST, DELETE on URIs) but compresses everything into a compact binary format running over UDP. Where HTTP requires hundreds of bytes of headers and a TCP connection, CoAP uses just 4 bytes of fixed header and no connection state. The protocol offers two message types: Confirmable (CON) for reliable delivery with acknowledgments, and Non-confirmable (NON) for fire-and-forget efficiency.

1219.5 Quick Comparison

Aspect CoAP HTTP MQTT
Transport UDP TCP TCP
Header Size 4 bytes 100+ bytes 2 bytes
Pattern Request-response Request-response Publish-subscribe
Broker No No Yes
Best For Constrained devices Web integration Multiple subscribers