Application and Transport LayersMost of the traffic that crosses the Internet nowadays is carried at the application layer by HTTP over TCP. However, the verbosity and complexity of native HTTP make it unsuitable for a straight deployment on constrained IoT devices. For such an environment, in fact, the human-readable format of HTTP, which has been one of the reasons of its success in traditional networks, turns out to be a limiting factor due to the large amount of heavily correlated (and, hence, redundant) data. Moreover, HTTP typically relies upon the TCP transport protocol that, however, does not scale well on constrained devices, yielding poor performance for small data flows in lossy environments.The CoAP protocol overcomes these difficulties by proposing a binary format transported over UDP, handling only the retransmissions strictly required to provide a reliable service. Moreover, CoAP can easily interoperate with HTTP because: (i) it supports the ReST methods of HTTP (GET, PUT, POST, and DELETE), (ii) there is a one-to-one correspondence between the response codes of the two protocols, and (iii) the CoAP options can support a wide range of HTTP usage scenarios.