## 2 Related Work
### Contribution of the Opportunistic Computing
#### 3.1.2 Opportunistic Computing Implementation in ASAwoO Web of Things Platform  
In project ASAwoO, we designed and developed a disruption-tolerant RESTful support for the WoT [31]. In this opportunistic computing implementation, resources offered by physical objects are identified by URIs and accessed through stateless services. Service requests and responses are forwarded using the \"store-carry-and-forward\" principle. This communication support provides a complete service invocation model, allowing to perform unicast, anycast, multicast and broadcast service invocations using either HTTP or CoAP, which makes it particularly suited for the WoT. It is compliant with the six constraints--the sixth one is optional--defined by the REST architecture style for performance, scalability and simplicity purposes. Indeed, it does not maintain any session state, and implements a loosely-coupled client/server architecture where resources offered by physical objects are accessible through well defined service interfaces. By implementing the \"store-carry-and-forward\" principle, it makes it possible to store service responses in the cache of clients and of intermediate nodes, but also the service requests that have been sent in the network. Intermediate hosts equipped with this communication system can also act as proxies, and can respond on behalf of a server if they have the response in their local cache, when this one is still valid. Such an approach improves the performance and the scalability of the system, because it naturally performs load balancing and data caching on intermediate hosts, and thus fulfills both the \"system layering\" requirement and the \"response cacheablilty\" requirement promoted by the RESTful architecture style. Finally, as WoT applications can be partially or fully developed in Javascript, a part of the application can be executed on the client side, thus allowing it to be compliant with REST optional \"code-on-demand\" constraint, and to reduce the computation load on the physical objects. As with most disruption-tolerant communication systems, our system implements a multiple copy forwarding strategy. It can thus take advantage of these message transmission models to increase the message delivery probability and to reduce the response time in a WoT context. For instance, several sensors can simultaneously be invoked using a multicast transmission model without naming them explicitly. All the responses returned by these sensors will be transmitted to the client. The system we have developed allows to invoke services using the HTTP and CoAP application-level protocols. The application-level messages (i.e., HTTP and CoAP messages) can be encapsulated in UDP datagrams, in TCP segments or in messages of a given disruption-tolerant communication system in order to be transmitted to their destination. Different wireless technologies (e.g., Bluetooth, Wi-Fi, and ZigBee) can be employed to communicate with physical objects. As shown in Figure 3, this system is implemented by two main elements, namely an HTTP/CoAP proxy and a DTN adapter. The HTTP/CoAP proxy makes it possible for standard HTTP and CoAP clients and servers to send and receive service requests and responses using disruption-tolerant communication  
Figure 2: Opportunistic Sensing in a crop monitoring scenario. (**A**) A sensor query is emitted by gateway G. (**B**) Tractor A carries the query to sensor S. (**C**) Another tractor B forwards sensor data back to G.  
techniques. Thanks to this proxy, programmers can develop HTTP and CoAP WoT applications using regular HTTP and CoAP, libraries. Moreover, standard HTTP and CoAP servers do not need to be modified. This proxy can also invoke remote REST services using Internet-legacy routing protocols (i.e., TCP/IP). The HTTP/CoAP proxy is a common element shared between all the implementations. As for the DTN adapter, it binds the proxy and the disruption-tolerant communication system in charge of forwarding messages in the network.