# SOLIOT--Decentralized Data Control and Interactions for IoT
## 6 Mapping and Interaction Model
### Protocol Bindings
#### 6.3.1 CoAP for State-Based SOLIOT Interactions  
As stated, CoAP follows a similar approach as HTTP but with smaller messages. Methods, header and status codes are easily mapped to their HTTP counterparts while the counter direction is more limited. Similar to HTTP, CoAP is request/response-based protocol, relying on resources and supporting RESTful interactions. However, instead of TCP, CoAP uses UDP as transport protocol. Consequently, TLS is not supported. Instead, the Datagram Transport Layer Security (DTLS) protocol can be used [41]. A first mapping of LDP interactions to CoAP has been created by [PERSON] et al. [27]. Extending this mapping to SOLID functionalities serves as the foundation of the SOLIOT CoAP \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline  & **HTTP** & **MQTT** & **CoAP** \\ \hline Interaction Type (P1) & Synchronous, request/response & Asynchronous, publish/subscribe & Synchronous, request/response \\ \hline Interaction Announcement (P2) & Allow and WAC-Allow Headers announce available operations & TD Affordance & TD Affordance, WoT CoAP Binding \\ \hline Resource Discovery & Link Header, HATEOAS & Topics under solid/\# & /.well-known/solitor HATEOAS \\ \hline Operations (P3) & RESTful CRUD/SPARQL & Event notifications & RESTful CRUD \\ \hline Server-Client Coupling (P4) & Decoupled, optionally coupled through Web Sockets & decoupled & Central Message Broker \\ \hline Efforts at device-side (P5) & High (HTTP protocol stack) & low & low \\ \hline Bandwidth (P6) & High & Low to medium & low \\ \hline Energy consumption (P7) & High & Low to medium & low \\ \hline Latency (P8) & Low priority & Real-time Control & near Real-time \\ \hline Media Types (P9) & Turtle, JSON-LD, binary etc. & JSON-LD & JSON-LD \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Protocol Bindings: SOLIOT in MQTT and CoAP. protocol binding explained in this section. The binding itself is outlined through a comparison of interaction patterns (cf. Table 4), a translation of SOLID header definitions (cf. Table 5), and a discussion on the different interpretations of the message body interpretation. Table 4 distinguishes the different interaction intentions relevant to an IoT scenario as explained in our example. Some of the thereby included patterns (subscriptions, notifications, alarms) are not part of the core SOLID use case. Still, as for instance [PERSON] et al. (2017) or [PERSON] et al. (2019) outline, a limited request/response approach is not sufficient. The design of the table reflects this insight, therefore also containing white spaces. These white spaces (e.g., row 'invoke functions') can be relevant for further specifications and therefore have been kept intentionally in the tables. Obviously, the amount of protocol methods is lower for CoAP. As [PERSON] et al. (2017) suggested, the replacement of the HTTP HEAD, OPTIONS, and PATCH headers can be expressed through query parameters. While one can argue that the core CRUD operations are still natively possible through the given CoAP methods (get, put, post, delete), the mandatory requirement for HEAD and OPTION support in SOLID makes a compromise necessary. As CoAP's main intention is the reduction of resource consumption, several critical requirements of an IoT system must be disregarded. For instance, the limitation of the protocol headers enforces the expression of several information points in the message body, increasing the integration effort at the client. The CoAP headers are significantly different then the originally used ones through the HTTP binding. CoAP headers are encoded as numbers to reduce the message size. Important headers, for instance 'Accept' ('17') or 'Content-Type' (called Content-Format: '12'), are registered at IANA. In addition, common media types are globally defined as well ('41': 'application/xml', '50': 'application/json'). SOLIOT promotes the usage of the reserved media type code '432': 'application/td+json' for Thing Descriptions.