Protocols
Saved & recent

CoAP

Also called: Constrained Application Protocol, CoAP over UDP

CoAP is a compact application protocol designed for constrained devices and networks. It exposes resources through methods such as GET and PUT, with response codes and options. The base RFC 7252 protocol uses UDP and includes its own message acknowledgment machinery. RFC 8323 separately defines operation over TCP, TLS and WebSockets.

For example, a controller sends a confirmable GET for a greenhouse’s humidity resource over UDP. If the reading is ready, the device can return 2.05 Content inside the acknowledgment. Otherwise it can acknowledge receipt and send the result separately. An acknowledgment therefore need not mean the application result is already available. CoAP resembles HTTP’s resource model but has its own wire format.

Related
UDP, HTTP, Concise Binary Object Representation
Further reading
controller sensor endpoint CON GET /humidity ACK · 2.05 Content humidity · 62% piggybacked result separate response example CON GET /humidity empty ACK · receipt only later response · 2.05 Content CoAP over UDP
In the UDP form of CoAP, the sensor may return a piggybacked result in its ACK. In the alternate flow an empty ACK confirms receipt, while the result arrives later. Additional response acknowledgment details are omitted.

View in the full Protocols collection