(2020) | Learn Technology in 5 Minutes
CoAP is based on HTTP protocol and was designed by the IETF Constrained RESTful Environment (CoRE) working group.
The communication between HTTP client and server is performed by using the Representational State Transfer (REST) standard. As REST is a resource demanding standard, the lightweight RESTful interface was designed in CoAP so that resource-constrained devices in IoT networks can use RESTful services [Salman 2015]. Resources are retrieved from the server using URIs/URLs.
CoAP message exchange is done using UDP (User Datagram Protocol) with strong security measures, through the utilisation of the Datagram Transport Layer Security (DTLS) [Hanes et al 2017].
Both IPv4 and IPv6 are supported by CoAP, however IPv6 is used in IEEE 802.15.4 networks for constrained devices.
CoAP performs the two main activities of messaging and request/response [Salman 2015]
There are four types of messages defined in CoAP:
And four request/response methods:
(similar to HTTP.)
These are outlined in the diagram below.
Communication between devices in CoAP can take place using different paths, including same constrained network, different constrained network, to the Internet servers, and proxy network.
CoAP provides multicast support for messaging the group of devices using 224.0.1.187 for IPv4 and FFOX::FD for IPv6.
More information: if you’re interested, more information on CoAP protocol can be found at: http://coap.technology/.