Resource model
Devices expose named resources. Clients use URI paths, methods, response codes, and representations to read or change state.
Imagine a soil sensor that wakes for a few milliseconds, reports moisture, listens for a new sampling interval, and goes back to sleep. HTTP can describe the same resources, but its connection setup and verbose headers waste the radio time the device is trying to save.
CoAP starts from that everyday constraint. The protocol keeps the resource model familiar, then trims the exchange down to compact UDP messages, tokens, discovery records, and delivery choices that can be tested on a lossy link.
The Constrained Application Protocol keeps the resource model that makes HTTP easy to reason about: a client sends a request to a URI, chooses a method such as GET or PUT, and receives a response code plus a representation. The difference is the operating environment. CoAP is built for small devices and constrained networks, so it runs over UDP and keeps the base message compact.
The practical value is not that CoAP imitates the web. The value is that it lets a sensor, actuator, or local gateway expose a small resource interface without carrying a full web stack on every exchange. A temperature sensor can expose /sensors/temp. A valve controller can accept a PUT to /actuators/valve. A commissioning tool can discover resources before it writes a control rule.
For example, a cold-room node might report /temp every minute with non-confirmable readings because the next sample replaces a lost one, while a maintenance tablet sends a confirmable PUT to /defrost because a missed command changes equipment behavior. Both exchanges use the same resource model, but the message type, retry expectation, and review evidence differ. That is the core CoAP habit: keep the API small, then choose reliability per consequence.
If you only need the intuition, remember this: use CoAP when a constrained node needs REST-like request and response behavior, UDP is acceptable, and the system can make reliability choices per message.
Devices expose named resources. Clients use URI paths, methods, response codes, and representations to read or change state.
The base message is small and binary. Options encode method, URI, content format, tokens, caching, and other metadata.
CoAP avoids connection setup, but the application must choose where it needs acknowledgments, retries, security, and duplicate handling.
CoAP fits constrained request-response and local control. MQTT fits brokered telemetry streams. HTTP fits broad web and cloud integration.
A CoAP design should be reviewed as an exchange record, not just as a protocol name. The record names the resource, method, payload format, expected response, message type, security boundary, and the evidence that the exchange works under expected loss and latency.
This keeps design conversations concrete. A team can argue about whether a valve command should be confirmable, whether a temperature reading may be cached, whether a gateway may proxy the request, and whether the payload belongs in JSON, CBOR, SenML, or another representation.
/sensors/air/tempGET, PUT, or POSTCoAP has two important layers of meaning. The request-response layer says what the client wants: a method, URI options, payload, and expected response. The messaging layer says how the datagram exchange behaves: confirmable, non-confirmable, acknowledgment, reset, message ID, and token.
The message ID helps detect duplicates at the message layer. The token correlates a response with the request that caused it, which matters when several requests are in flight. A confirmable message asks for an acknowledgment and may be retransmitted if no acknowledgment arrives. A non-confirmable message avoids that exchange when loss is acceptable or the next reading will replace the old one.
Used by endpoints to match acknowledgments and suppress duplicates at the message exchange boundary.
Chosen by the client to correlate a response with the original request, especially when several requests are outstanding.
Carry method, URI path, content format, caching, observe registration, block-wise transfer, and other structured metadata.
UDP can lose, reorder, or duplicate datagrams. CoAP handles selected cases, but the application still defines acceptable consequences.
CoAP is a constrained-device application protocol for resource-oriented request and response exchanges. It keeps familiar REST ideas such as resources, methods, response codes, and representations, but carries them in compact UDP messages with explicit reliability choices.
Use CoAP when a small device or local gateway needs a lightweight resource interface and the deployment can reason about message loss, duplicate handling, caching, discovery, security, and proxy behavior. Do not choose it only because it sounds smaller than HTTP. Choose it when the exchange record proves that its resource model and failure boundaries match the system.
Key Takeaway
CoAP is the right default for constrained REST-style device exchanges only when the resource contract, reliability choice, security boundary, and runtime evidence are all explicit.
Use this next to study confirmable, non-confirmable, acknowledgment, and reset exchanges in more detail.
Use this when you need to inspect header fields, tokens, options, payload markers, and parser evidence.
Use this to connect GET, POST, PUT, DELETE, multicast, Observe, and confirmable choices to practical methods.
Use this for URI shape, response-code discipline, payload design, caching, and gateway boundaries.