## 3 Related Works  
As previously anticipated, various studies have discussed the application of CoAP in WSNs. In this section we give details about these works. Previous work by the authors [34] motivated the choice of the REST architecture and the adoption of the CoAP protocol. We also suggest modifications to an early format of the protocol and discuss possible problems of its implementation. The authors of [16] presented a CoAP implementation for Contiki. The aim of this implementation was to achieve high-energy efficiency by leveraging a radio duty cycling mechanism. The implementation has been evaluated in a multi-hop network. The collected results have shown that energy consumption is lower when using a radio duty cycle but leads to in a worsening of the latency performance. In [20], the authors report a simple comparison of CoAP and HTTP in terms of energy consumption. This work also describes the design of a gateway used to connect a CoAP based WSN to an external IP network that uses HTTP. In [22], the authors of [20] compared the performance of CoAP to that of HTTP. The evaluation was carried out on the basis of energy consumption and  
Figure 3: Architecture of a CoAP-based Wireless Sensor Network (WSN). The proxy enables integration between the WSN and external networks that use HTTP. response time. In particular, energy consumption was evaluated by means of simulation. The response time was measured in a real WSN. Both experiments were conducted considering a client querying an embedded server to obtain temperature and humidity values. The energy consumed was measured according to the variation of the interarrival packet time. The response time was calculated for the case where the server was at a distance of 1-hop and 2-hop from the client. The results obtained show that CoAP yields a better performance in both the evaluation parameters considered by the authors. A study on network sensor deployment [21] used CoAP and HTTP as data transport protocol for sensor network reprogramming. Both protocols were evaluated over a duty cycled radio layer. Results were obtained through simulation and show that CoAP and HTTP provide similar results. In [35], the authors present a framework for M2M communications using CoAP. They also present an improved publish/subscribe mechanism also based in CoAP. Both solutions are evaluated showing the advantage of using CoAP instead of HTTP. The authors of [36] give an overview of the current CoAP implementations and present the results of an interoperability meeting organized by the European Telecommunications Standards Institute (ETSI). In [17], the authors present a CoAP implementation for TinyOS and the implementation of a compression mechanism of the XML format. A performance evaluation was carried out considering the CoAP request success probability as a function of the request rate of the client node. Furthermore, the authors report results from an evaluation of the memory occupation of the TinyOS components used in their implementation. Finally, the authors proved the efficiency of the XML compression scheme by studying its processing-time. As previously commented, this CoAP implementation was developed on top of an unsupported and limited 6 LoWPAN implementation named 6 lowpancli [37]. In particular, as pointed out in [18, 19], 6 lowpancli provides only basic functionalities of 6 LoWPAN. 6 Lowpancli doesn't support any type of neighbor discovery mechanism, it is completely static and requires manual configuration. As reported in [18, 19] the support for mesh network is not provided and when a packet with different destination address is received, it is just dropped. The results of a performance evaluation done in [18] show that 6 lowpancli does not perform well in terms of energy consumption and latency. Thereby, its limitation would affect any implementation build on top of it. As previously mentioned, CoapBlip is currently included in the latest distribution of TinyOS. The authors of CoapBlip present its design in [15].