Constrained Application Protocol, or CoAP, is an application-layer networking protocol aimed primarily at application in networks of small resource-constrained embedded devices, wireless sensor networks and similar Internet-of-Things applications – helping to enable efficient networking and Internet connectivity with low overheads.
This protocol is particularly well suited to low-power wireless sensor networks with lossy networking and embedded control and automation systems, where such systems need to be supervised or controlled remotely via standard Internet networks.
CoAP is designed to easily translate to HTTP for simplified integration with the web, while also meeting specialised requirements such as multicast support, very low overhead, and simplicity. These are valuable, important features for Internet-of-Things and machine-to-machine networks which tend to be deeply embedded and have much less memory and power available than traditional Internet-connected computers and mobile devices, meaning that efficiency and low overheads are important.
Furthermore CoAP enables embedded web services for even the most constrained devices and networks, while integrating with the web architecture and HTTP. Optimised for applications such as smart energy, home and building automation, asset tracking and cellular M2M, CoAP is emerging as an increasingly popular and important, standardised and interoperable technology in the Internet-of-Things sector.
CoAP includes several HTTP-like functionalities, but they have been fundamentally redesigned for operation in resource-constrained Internet-of-Things and embedded networks. Like HTTP, CoAP identifies resources using a universal resource identifier, and allows resources to be manipulated using HTTP-style methods such as GET, PUT, POST, and DELETE.
The protocol’s transaction layer can include four types of messages: confirmable, where acknowledgement is required, non-confirmable, where acknowledgement is not required, acknowledgement for a confirmable message, or reset, which indicates that a confirmable message is received but the information that would provide the context to allow it to be processed is missing.
CoAP makes use of two message types, requests and responses – using a simple binary header format that is not demanding to parse, and it is at this request/response layer where the REST-based communication occurs. This request/response model may be contrasted with other models such as the publish/subscribe model employed by other significant transport protocols in Internet-of-Things technologies, such as MQTT.
The base header may be followed by further options in an optimised Type-Length-Value format. CoAP is bound to UDP by default and optionally to datagram transport layer security or DTLS, meaning that CoAP can run on many common devices that support UDP or a UDP analogue, whilst providing the optional capability for secure CoAP, which mandates the use of DTLS as the underlying security protocol, providing the potential for good security in applications where authentication and security is an important requirement.
The Internet Engineering Task Force’s Constrained RESTful environments (CoRE) Working Group has done the majority of formal standardisation work with CoAP so far, with a set of IETF Requests for Comments soon to be released surrounding CoAP standards. The standardisation of CoAP by the IETF is in its final stages, and the protocol is soon entering into IETF Internet Standards documents that are aimed at standards-building to better enable the Internet of Things.
In order to make the protocol best suited to Internet-of-Things and and machine-to-machine applications, various new functionalities have been added. The CoRE working group has proposed low header overhead and low parsing complexity as key goals of the CoAP standard-building effort, along with support for the discovery of resources provided by known CoAP services, and mechanisms for simple subscription to a resource and resulting push notifications from that resource.
The mapping of CoAP with HTTP is defined, with RESTful protocol design, allowing proxies to be built to provide access to CoAP resources via HTTP in a uniform way without difficulty.
Access to CoAP resources via RESTful HTTP over TCP is particularly attractive for connecting embedded devices in consumer premises to the Internet, given the near universal availability of HTTP stacks for various diverse platforms.
The RESTful HTTP approach has found success in smaller-scale networks, particularly low-power and lossy wireless networks where message latencies are required to be within the order of seconds, for example for home automation and smart energy management networks.
As some examples of significant adoption of CoAP by major commercial players in the emerging Internet-of-Things industry, CoAP has already found success as a key enabling technology for Advanced Metering Infrastructure (AMI) applications for electricity utility companies deployed within Cisco Systems’ Field Area Network ecosystem.
Sensinode’s NanoService solution uses CoAP, together with their semantic web linking, resource directory and EXI technology, to provide end-to-end embedded web services for the Internet of Things.
If CoAP appeals as a protocol for your next IoT-enabled product or design revision – or you’re interested in any or all stages of the process and need a partner to help meet your goals – the first step is to discuss your needs with our team of experienced engineers that can help you in all steps of product design, from the idea to the finished product.
To get started, join us for an obligation-free and confidential discussion about your ideas and how we can help bring them to life – click here to contact us, or telephone 1800 810 124.
LX is an award-winning electronics design company based in Sydney, Australia. LX services include full turnkey design, electronics, hardware, software and firmware design. LX specialises in embedded systems and wireless technologies design.
Published by LX Pty Ltd for itself and the LX Group of companies, including LX Design House, LX Solutions and LX Consulting, LX Innovations.