## 2 Background  
Advantages and drawbacks of WSN virtualizations are described in [5, 6, 9] and have been outlined in the previous section. The foundations of the WSN virtualization implementation to be detailed in the coming sections are described in the following paragraphs. nSOM is a middleware architecture that virtualizes a WSN node capabilities so that any tiny application could be run in such nodes. Moreover, such tiny applications might virtualize new capabilities in the node that is hosting them, extending the catalog of its available functionalities. It has been designed for constrained devices and targets as objectives low memory and processor footprint utilization. The core elements in nSOM (as the service registry manager or the context manager) comply with the SOA principles, decoupling what an entity is able to do from the specific way the entity is implemented. The above mentioned tiny applications might also act as service providers and/or service consumers, interoperating with other tiny applications or nSOM core elements running in other nodes in the network. Thus, nSOM enables a WSN to provide a virtual set of SOA services for accessing nodes capabilities, hiding the physical deployment of nodes and tiny applications that actually carry the set out. nSOM also supports the publish/subscribe messaging scheme, which is more efficient for WSNs when used in event-driven applications. In such applications, significant events are detected and triggered by monitoring entities (WSN nodes), which become events publishers, and are consumed by entities that process and provide a proper response to the specific event, which become events subscribers. This approach reduces the amount of messages throughout the network as they are generated and transmitted over the WSN only when an event is required to be triggered. Publish/subscribe paradigm utilizes an initial overhead when the publishers are announced and the subscribers subscribe to the publishers. The benefits from publish/subscribe messaging approach in WSN have been highlighted in [10]: devices and systems from different providers are readily integrated, publishers and subscribers are decoupled (all must agree on the same message format), the network is scalable and its efficiency is higher. Working with the opposite approach would imply that applications poll the monitoring entities from time to time looking for environmental changes by using a prominent network overhead, which usually is not a practical solution. The nSOM specification describes a protocol for supporting inter-node communications that includes messages for the publish/subscribe approach, similar to those in MQTT protocol as described in [10], but complying with the nSOM architecture principles. IoT-A also invests on virtualizing a physical device by means of a double approach: creating a digital representation of the physical device (so called virtual device) that includes how to address it, how to map internal registers, _etc._, and modeling its resources as SOA compliant services. The resources of similar devices might be modeled with the same set of services, encouraging reutilization. Furthermore, the way any application accesses a resource is decoupled from the intrinsic complexity of the device, allowing applications from different domains share the same set of devices. REST is nowadays a worldwide accepted SOA technology that can be used to support the IoT spread. The REST model proposes that cooperating entities might share resources; it is likely that an entity offers a resource and other entities might want to operate on it (get a copy of the resource, modify it, create it, remove it, _etc._). The set of available operations is limited and unique for all the resources. The semantic of each operation is also predefined. That is the reason why it is also said that REST can be regarded as a ROA approach. All those characteristics define an easy set of rules for entities interoperation, making REST a lightweight SOA technology.