Hi, dear!
Good day to you!
Today I will share with you what is CoAP.
What is CoAP
CoAP, the full name is Constrained Application Protocol, is designed for resource-constrained devices (such as sensor nodes) and networks (such as NB-loT and LoRa).
CoAP is developed from HTTP. CoAP also works in request/response mode. The client initiates a request and the server responds. Compared with HTTP, CoAP considers both the optimization of data packet length and reliable communication.

Features of CoAP
The header is compressed, the packet format is simple, and the message can be very short. The smallest CoAP message has only four bytes. The transport layer uses the UDP protocol to reduce network overheads, and COAP supports multicast.
To compensate for the unreliability of UDP transmission, CoAP has a message retransmission mechanism.
CoAP does not support persistent connection and does not have heartbeat messages. When there is no service, the device does not need to send messages to external systems.
Poor real-time performance: The device needs to be woken up before performing services.
Summer
Compared with MQTT, CoAP does not need to maintain a persistent connection and does not need to send heartbeat messages. Therefore, CoAP is more suitable for devices that require the sleep/wake mechanism in IoT scenarios. The device can stay in hibernation mode for long periods of time, saving battery power, and a single battery can last 10 years or more. Currently, solutions such as smart water meters, smart electricity meters, smart agriculture, and smart parking use the CoAP protocol.
Thanks for reading!



