## 1 Introduction  
The interest of industries and researchers in the application of the Internet communication paradigm in constrained networks and devices has grown to become one of the most promising developments in the Internet of the future. In particular, a great deal of effort has been focused on the integration of Wireless Sensor Networks (WSNs) and the Internet. The main interest in making WSNs part of the Internet is to allow both to interact with each other using the existing Web technologies. Therefore, the information provided by sensors could be distributed through standard Web mechanisms, and sensors would be considered like any other Web resource. From this perspective, WSNs would no longer be stand-alone networks but part of ubiquitous networks. We refer to this new approach as the Web of Things (WoT). Enabling IP in WSNs is the first step towards the realization of the WoT. In this sense, the IPv6 over Low power Personal Area Networks (6 LoWPANs) [1] protocol is an example of a lightweight IP implementation for WSNs. 6 LoWPAN enables the transmission of IPv6 packets in networks adopting the IEEE 802.15.4 standard [2]. An IETF specific work group has detailed its definition in RFC 6282 [3]. 6 LoWPAN would only provide IP connectivity but not interoperability at higher layers. In this regard, the use of Web services has been proposed [4, 5]. Web services can be developed according to the REST [6] or the SOAP [7] architectural styles. Web services complying with the REST principles are called RESTful. Many research papers have analyzed the impact that both architectures would have on WSNs. Results from [8] and [9] show that the overhead of the messages exchanged between SOAP Web services is higher than that of RESTful Web services. In fact, SOAP messages are encapsulated in the XML body, which involves a complex and expensive message processing. However, it is possible for the REST data formatting to be based on different languages, which enables the overhead to be kept low. The authors of [9] suggest that the use of SOAP should be avoided, and consider employing RESTful Web services instead. An early work considering the application of REST principles in WSNs is presented in [4]. However, it does not take into account the use of Web services to access and interact with WSN nodes, but only for discovery of devices. An IETF work group called Constrained RESTful Environments (CoRE) [10] has been created with the aim of contributing to the development and standardization of RESTful Web services for constrained networks. With this approach, the work group defined a new Web transfer protocol called Constrained Application Protocol (CoAP) [11]. CoAP seeks to apply the same application transfer paradigm and basic features of HTTP to constrained networks, while maintaining a simple design and low overhead. Unlike HTTP, CoAP uses UDP as transport protocol. This choice would enable CoAP to have a low impact on the limited bandwidth of the 802.15.4 wireless links. However, since UDP is an unreliable protocol, CoAP has to implement its own mechanisms in order to guarantee reliability to those applications that use it. Recently, many implementations of CoAP have appeared. These are Californium [12], jCoAP [13], CoAPy [14] and Libcoap [15]. However, they are not related to any WSN operating system (OS) or platform. They provide libraries and APIs written in different languages that can be used for embedding CoAP in WSN nodes or for developing applications in other environments. The use of these libraries in WSNs, however, requires that they must be adapted to the OS in use. The adaptationprocess, however, could not guarantee adequate performance or reliable execution. Considering the resource constraints of typical WSN nodes, a different approach is required. This should consider the development of a native implementation for the OS used in the WSN. This approach could yield better performance, less resource consumption and more reliable software.