Skip to main content

RFC 7252 - The Constrained Application Protocol (CoAP)

Published: June 2014
Status: Standards Track
Authors: Z. Shelby, K. Hartke, C. Bormann


Abstract

The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained (e.g., low-power, lossy) networks. The nodes often have 8-bit microcontrollers with small amounts of ROM and RAM, while constrained networks such as IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs) often have high packet error rates and a typical throughput of 10s of kbit/s. The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.

CoAP provides a request/response interaction model between application endpoints, supports built-in discovery of services and resources, and includes key concepts of the Web such as URIs and Internet media types. CoAP is designed to easily interface with HTTP for integration with the Web while meeting specialized requirements such as multicast support, very low overhead, and simplicity for constrained environments.


Contents



Quick Reference

What is CoAP?

CoAP (Constrained Application Protocol) is a specialized web protocol designed for Internet of Things (IoT) devices and constrained environments.

Key Features

  • Lightweight - Suitable for resource-constrained devices
  • UDP-based - Uses UDP transport with optional DTLS security
  • RESTful - HTTP-like request/response model
  • Observable Resources - Supports publish/subscribe pattern
  • Built-in Discovery - Resource and service discovery mechanisms
  • Multicast Support - Efficient device discovery

CoAP vs HTTP

FeatureHTTPCoAP
TransportTCPUDP
Header OverheadLarge (hundreds of bytes)Small (4-byte fixed)
MethodsGET/POST/PUT/DELETE...GET/POST/PUT/DELETE
Response Codes3-digit2-digit
CachingSupportedSupported
ProxyingSupportedSupported
SecurityTLSDTLS
Use CasesWeb applicationsIoT devices

Application Scenarios

  • 🏠 Smart Home - Lights, thermostats, sensors
  • 🏭 Industrial Automation - Device monitoring and control
  • Smart Grid - Energy management
  • 🏢 Building Automation - HVAC, lighting systems
  • 📡 Low-Power Networks - 6LoWPAN, LoRa, etc.