## 1 Introduction  
We are witness to an unprecedented and rapid evolution in electronics, wireless communication and miniaturisation technologies. This has contributed significantly to reducing the production costs of electronic products and embedded devices, thereby increasing the number of them in the Internet era. Nowadays, it is possible to acquire a personal computer from 9 dollars [1], something unachievable a few years ago. These devices are usually devices connected to the Internet with capabilities to sense and actuate over the physical world, paradigm also known as the Internet of Things (IoT) [2]. According to various research reports [3], the number of connected devices is predicted to reach anywhere from 20 to 50 billion by 2020. This huge growth has to be necessarily supported by standard mechanisms and protocols [4], otherwise it will result in multiple vertical silos for multiple applications, complicating the IoT adoptions. Many IoT devices are designed to be working for long periods and are battery-powered since they can be deployed in environments where there may not be electricity (e.g., environmental monitoring). To reduce the power consumption and production costs, these devices have limitations in term of storage, processing and networking. Therefore, applying current standard ways to intercommunicate systems and exchange information such as web services is a non-viable task in most cases. Moreover, one of the main challenges in the moment of designing an IoT application is the vendor lock-in issues derived of using multiple platforms without a common backbone standard. The Internet Engineering Task Force (IETF) has taken into account the aforementioned problems and has contributed with many standards intended to reduce the gap between resource-constrained devices and powerful ones and connect these devices directly to the Internet. One of its results is the IPv6 over Low power Wireless Personal Area Networks (6 LoWPAN) [5], which enables the transmission of IPv6 packets on top of IEEE 802.15.4 networks. IPv6 packet sizes are much larger than those in IEEE 802.15.4 networks, and mechanisms for compression/decompression are needed to enable IPv6 use in constrained networks. Routing is also a challenge in constrained networks since they have special features such as limited radio range, large number of nodes and limited resources. A IPv6 Routing Protocol for Low-Power and Lossy Networks (RPL) [6] was also released by the IETF to solve the routing issues in constrained networks. The IETF also created the Constrained RESTful Environments (CoRE) working group to bring REST web services to constrained devices, releasing the Constrained Application Protocol (CoAP) [7]. Despite the improvements of the latest protocols for the IoT, IoT applications are still designed to be coupled to final devices, which means that applications do not adapt to the continuous changes in the underlying infrastructure. In the case of inclusion of new devices to these applications or even their disconnection due to battery consumption, it is still necessary to reconfigure these applications and devices to adapt to these changes and to be part of the system. In the IoT where the number of devices grows in a unprecedented way and devices are very volatile, these limitations drag out its expansion. For instance, in environmental monitoring, device-decoupled applications could display over-the-fly measurements from sensors deployed based on the users' needs. Moreover, IoT applications are personalised, i.e., the underlying IoT infrastructure can be designed to work with certain end users. This greatly increases the complexity in the application development. For instance, imagine a personalised application for more than one hundred end users. The development for all the personalised logic can represent a higher development effort than the whole architecture itself. Last but not least, end users can be part of different IoT applications in separate scenarios.