Distributed Ledger as a Service: A Web 3.0-Oriented Architecture
Abstract
:1. Introduction
- The need for lightweight communication protocols designed for machine-to-machine (M2M) data traffic patterns. In the early years of IoT, many manufacturers developed their own Physical and Data-link Layer protocols, resulting in devices that were not interoperable with those produced by other manufacturers.
- The data generated by IoT devices are usually stored and processed by additional devices. The most common approach is to process data in a fog computing environment and to store them in a cloud-based database, a service typically provided by private companies. However, this creates a potential trust issue since these companies could potentially tamper with the registered data.
- As shown in Figure 1, data are recorded in a chain of blocks, where each block contains the hash of the previous one. A block typically consists of a header with the necessary metadata and a series of messages to be registered.
- The consensus mechanism requires the payment of a fee before publishing a message. There are many different schemes, but usually, specialized nodes, called miners, generate blocks and append them to the chain. They select valid messages received through a gossiping protocol and collect a percentage of the fee as a reward for successful publication.
- The design of an original architectural framework capable of addressing the challenges associated with the DLTaaS paradigm for WoT domains. In detail, it involves the characterization of each module and the related communication interfaces. The framework also includes a data classification mechanism that is coupled with granular access policies, which makes it easier to retrieve data for applications while ensuring overall privacy.
- Technological mapping over widely available technologies, such as IOTA, MQTT, and MQTT-SN, by specifying the primitives and data format.
- The design of an integrated communication protocol.
- A performance evaluation conducted for different scenarios, pointing out the gains achievable in terms of overall latency and throughput.
- Section 2: A high-level description of the selected software technologies for communication (MQTT and MQTT-SN) and storage (IOTA and Channels).
- Section 3: The definition of a modular and secure architecture that enables the system to be adapted to various application requirements, including mobility. This includes the design of a communication protocol for delivering data and signaling events.
- Section 4: A low-level numerical simulation of the most relevant metrics and a general performance analysis of the proposed framework in order point out the possible achievable advantages and address future developments.
2. Overview of Adopted Technologies
2.1. MQTT
2.1.1. Publish/Subscribe Model
- Single-level wildcard “+” (U+002B): It matches a single level and can be used multiple times within a single usage. For example, the string root/+/parent1/+ represents any topic starting with root, followed by any single-level string, then the level parent1, and ends with any single-level string.
- Multi-level wildcard “#” (U+0023): It matches any number of levels, including the parent and any subsequent child levels. For instance, the string root/parent1/# represents the topic root/parent1 and all of its child topics.
- Publisher: generates messages, labels them with the topic, and sends them to the Broker.
- Subscriber: subscribes to the topic by communicating it to the Broker, from which it receives messages that belong to it.
2.1.2. Pseudo-Primitives
- Type (4 bits): This field specifies the type of Control Packet being used.
- Flags (4 bits): The Flags field is a set of options that vary depending on the type of Control Packet.
- Remaining Length (8 bits): This field is an unsigned integer that indicates the length of the Control Packet beyond the Fixed Header, including the Variable Header and Payload, if present.
- Session: After establishing a network connection between a client and a Broker, the client sends a CONNECT (1) packet to the Broker to initiate an MQTT session. The client can indicate its willingness to use an authentication method, and in such cases, an exchange of AUTH (15) packets occurs between the client and the Broker. Once this phase is completed, the Broker sends a CONNACK (2) packet to the client, and the connection is established. To close a session, either the client or the Broker can send a DISCONNECT (14) packet.
- Publication: These functions involve sending data from the client to the Broker and subsequently disseminating it to subscribers. Depending on the Flags field in the Fixed Header, a publication can have three levels of Quality of Service (QoS). Level 0, or “At most once delivery”, involves simply sending a PUBLISH (3) packet to the recipient. With level 1, or “At least once delivery”, the sender retransmits the PUBLISH packet until it receives a PUBACK (4) packet within a specified time limit. Level 2, or “Exactly once delivery”, limits the number of retransmissions by using the PUBREC (5), PUBREL (6), and PUBCOMP (7) packets between the sender and recipient.
- Subscription: To subscribe to one or more topics, a client sends a SUBSCRIBE (8) packet to the Broker. The subscription process is considered complete upon receiving a SUBACK (9) packet. Likewise, to unsubscribe, there is an exchange of UNSUBSCRIBE (10) and UNSUBACK (11) packets.
- Activity check: The Broker can send a PINGREQ (12) packet to check the status of a client in case of inactivity. The client is expected to respond with a PINGRESP (13) packet. These packets are also used in the MQTT-SN variant to activate client devices in a low-power state.
2.1.3. MQTT-SN
- MQTT-SN Gateway: This is crucial to the protocol’s operation and can either be integrated into the Broker or be a standalone device. It serves as an interface between clients and the Broker, translating messages received from one protocol version to another.
- MQTT-SN Forwarder: This is useful whenever clients are not on the same Data-link Layer network as the Gateway. The packets in transit are not modified but only encapsulated in an IP packet if received by the client and decapsulated if the opposite occurs.
2.2. IOTA
- Guidelines for the protocol definition are published in a whitepaper.
- Research specifications and software are defined almost independently on Devnet.
- The protocol and its complete implementation are released for use on the Mainnet.
2.2.1. Tangle
- Genesis (in blue): a message published when the Tangle is created to distribute the system’s cryptocurrency for the first time.
- Referenced message (in green): a message that has already been published and referenced by others, with its hash included in their headers.
- Tip (in red): messages that have been published but not yet referenced by others.
- New (in black): a message that has yet to be published and must reference at least two randomly chosen tips.
2.2.2. Fee-Less Consensus and Coordinator
2.2.3. IOTA 2.0
- Network: This Layer is responsible for handling protocols related to P2P mechanisms, including peer discovery, neighbor selection, and message exchange using a gossip protocol.
- Communication: In this Layer, protocols are implemented to control the emission rate of messages, to prevent congestion, and to support Tangle-related mechanisms that ensure a shared, consistent, and immutable view of the registered data.
- Application: This encompasses mandatory applications for currency transfer and consensus. Additionally, nodes can host dApps that are installed by their operators. One example of such a dApp is Streams, which will be discussed in more detail in Section 2.2.4.
2.2.4. Channels
- Author: responsible for creating the channel, defining its structure, and managing read and/or write access for each branch.
- Subscriber: any user who has access to at least one branch of a channel created by someone else; if they have write access, subscribers can also act as publishers for a branch.
3. Proposed System Characterization
3.1. Architecture
- IoT Area: This area encompasses various IoT devices, such as sensors and actuators that generate and exchange data. It also includes a fog computing module to process data before publishing them to interested devices and on the Tangle.
- DLT Area: This area consists of a node running IOTA software, responsible for publishing data on the Tangle and processing it via Channels. Additionally, it implements a recovery mechanism in case that node experiences temporary unavailability.
3.1.1. IoT Area
- IoT devices: Heterogeneous sensors that gather measurements and actuators that respond accordingly. These devices are typically battery-powered and use Data-link Layer protocols, making it necessary to use MQTT-SN.
- MQTT-SN Gateway: An essential component to enable IoT devices to communicate via MQTT-SN.
- Fog Processing Unit (Fog PU): Responsible for processing and organizing data from IoT devices in a manner that can be used by actuators at any site in the system. Additionally, it provides data to the DLT Area to be further published on the Tangle.
3.1.2. DLT Area
- IOTA Node: This element represents the unique interface with the IOTA P2P network, responsible for receiving processed data from the local site, encapsulating them in Channels packets, and publishing them as messages on the Tangle. It also employs MQTT to signal the IOTA Cache, ensuring its proper functioning.
- IOTA Cache: This element stores the local processed data until receiving a notification of successful publication from the IOTA Node. This function is particularly valuable in case of the momentary unavailability of the IOTA Node, where the IOTA Cache forwards all pending data to it as soon as it reconnects.
3.2. Communication Protocol
3.3. Multi-Tier Broker
- The site subtopic is developed as:
- If a Broker receives a subscription request for a topic related to a different site, it accepts the request and then acts as a client by sending the same subscription request to the Broker at the higher level.
- Each Broker saves the publish messages it receives from the lower level and, acting as a client, forwards them to the higher level’s Broker.
- Device subscribes to topic T via Local Broker .
- Local Broker subscribes to topic T via Aggregation Broker , since the site agg2/loc1 does not match its own.
- Aggregation Broker subscribes to topic T via the Central Broker , since the group agg2 does not match its own.
- Fog PU publishes the processed data of device on topic T via Local Broker .
- Local Broker forwards the publish message to Aggregation Broker as a client.
- Aggregation Broker in turn forwards the publish message to the Central Broker as a client.
- The Central Broker notifies Aggregation Broker subscribed to T.
- Aggregation Broker forwards the notify message to Local Broker subscribed to T.
- Local Broker forwards the notify message to device subscribed to T.
3.4. Overall Communication Protocol Design
- Sensor: Identified by the pair [z1, d1], it periodically publishes its measurements, which are of type t1. For clarity and brevity, we assume:
- Actuator: Identified by the pair [z1, d2], it acts asynchronously, and the output of its actions is of type t2. Again, we assume:
3.4.1. Sensed Data Publishing Phase
- The sensor transmits the data to be published on root/device/s1 to the MQTT-SN Gateway using its Data-link Layer communication protocol.
- The MQTT-SN Gateway acts on behalf of the sensor and sends data to the Broker on root/device/s1.
- The Broker forwards data to the Fog PU.
- After processing data published by the sensor, the Fog PU sends the processed data to the Broker on root/fog/s1.
- The Broker forwards the processed data to both the IOTA Node and the IOTA Cache.
- The IOTA Node encapsulates the processed data in a Channels packet and publishes it on the Tangle.
- The IOTA Node sends a notification of the publication on root/node/z1/tangle.
- The Broker forwards the notification to the IOTA Cache, which in turn proceeds to delete the previously stored processed data.
3.4.2. Actuator Response Phase
- 4.
- As previously stated, the Fog PU forwards the processed sensor data to the Broker on root/fog/s1.
- 9.
- The same processed data carried by message 5 are also forwarded by the Broker to the actuator, but the MQTT-SN Gateway intercepts these data.
- 10.
- The MQTT-SN Gateway transmits the processed data to the actuator on root/fog/s1 using its Data-link Layer communication protocol.
3.4.3. IOTA Node Unavailability Management Phase
- During the disconnection, the Fog PU sends multiple processed data to the Broker on the respective root/fog/d0 topics.
- The Broker forwards the processed data to both the IOTA Node and the IOTA Cache, but the former does not receive them due to the disconnection that occurred.
- Once the IOTA Node reconnects, it sends a notification on root/node/z1/active to the Broker.
- The Broker forwards the notification to the IOTA Cache.
- The IOTA Cache sends the pending processed data on root/cache/z1/pending to the Broker.
- The Broker forwards the pending processed data to the IOTA Node.
- The IOTA Node encapsulates each entry in the pending processed data message into Channels packets, which are then published on the Tangle.
- After successfully publishing the Channels packets, the IOTA Node sends a notification on root/node/z1/tangle.
- The Broker forwards the notification to the IOTA Cache, which in turn deletes the processed data associated with the Channels packets.
4. Performance Evaluation
4.1. System-Level Simulation
4.1.1. Scenario Characterization
4.1.2. End-to-End Publishing Latency and Throughput
4.2. Qualitative Evaluation
4.2.1. Scalability
4.2.2. Security
4.2.3. Availability
4.2.4. Interoperability
4.2.5. Mobility Support
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Evans, D. The Internet of Things: How the Next Evolution of the Internet Is Changing Everything; CISCO White paper; CISCO: San Jose, CA, USA, 2011. [Google Scholar]
- Higginbotham, S.; Pesce, M. Internet of Everything: Macro & Micro. IEEE Spectr. 2021, 58, 22–23. [Google Scholar]
- Web of Things (WoT) Architecture 1.1. Available online: https://www.w3.org/TR/wot-architecture (accessed on 17 May 2023).
- Heuer, J.; Hund, J.; Pfaff, O. Toward the Web of Things: Applying Web Technologies to the Physical World. Computer 2015, 48, 34–42. [Google Scholar] [CrossRef]
- HTTP Documentation. Available online: https://httpwg.org/specs (accessed on 17 May 2023).
- The Constrained Application Protocol (CoAP). Available online: https://datatracker.ietf.org/doc/html/rfc7252 (accessed on 17 May 2023).
- Bormann, C.; Castellani, A.P.; Shelby, Z. CoAP: An Application Protocol for Billions of Tiny Internet Nodes. IEEE Internet Comput. 2012, 16, 62–67. [Google Scholar] [CrossRef]
- Naik, N. Choice of effective messaging protocols for IoT systems: MQTT, CoAP, AMQP and HTTP. In Proceedings of the IEEE International Systems Engineering Symposium (ISSE), Vienna, Austria, 11–13 October 2017; pp. 1–7. [Google Scholar]
- Vinoski, S. Advanced Message Queuing Protocol. IEEE Internet Comput. 2006, 10, 87–89. [Google Scholar] [CrossRef] [Green Version]
- The Simple Text Oriented Messaging Protocol. Available online: http://stomp.github.io/stomp-specification-1.2.html (accessed on 8 July 2023).
- MQTT Specification. Available online: https://mqtt.org/mqtt-specification (accessed on 17 May 2023).
- Gomez, C.; Arcia-Moret, A.; Crowcroft, J. TCP in the Internet of Things: From Ostracism to Prominence. IEEE Internet Comput. 2018, 22, 29–41. [Google Scholar] [CrossRef]
- Al-Fuqaha, A.; Guizani, M.; Mohammadi, M.; Aledhari, M.; Ayyash, M. Internet of Things: A Survey on Enabling Technologies, Protocols, and Applications. IEEE Commun. Surv. Tutor. 2015, 17, 2347–2376. [Google Scholar] [CrossRef]
- Uy, N.Q.; Nam, V.H. A comparison of AMQP and MQTT protocols for Internet of Things. In Proceedings of the 6th NAFOSTED Conference on Information and Computer Science (NICS), Hanoi, Vietnam, 12–13 December 2019; pp. 292–297. [Google Scholar]
- Sadawi, A.A.; Hassan, M.S.; Ndiaye, M. A Survey on the Integration of Blockchain With IoT to Enhance Performance and Eliminate Challenges. IEEE Access 2021, 9, 54478–54497. [Google Scholar] [CrossRef]
- Shammar, E.A.; Zahary, A.T.; Al-Shargabi, A.A. A Survey of IoT and Blockchain Integration: Security Perspective. IEEE Access 2021, 9, 156114–156150. [Google Scholar] [CrossRef]
- Ullah, Z.; Raza, B.; Shah, H.; Khan, S.; Waheed, A. Towards Blockchain-Based Secure Storage and Trusted Data Sharing Scheme for IoT Environment. IEEE Access 2022, 9, 36978–36994. [Google Scholar] [CrossRef]
- Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System; Bitcoin Whitepaper; United States Sentencing Commission: Washington, DC, USA, 2008.
- Alrubei, S.; Ball, E.; Rigelsford, J. Securing IoT-Blockchain Applications through Honesty-Based Distributed Proof of Authority Consensus Algorithm. In Proceedings of the 2021 International Conference on Cyber Situational Awareness, Data Analytics and Assessment (CyberSA), Online Event, 17 June 2021. [Google Scholar]
- Bonadio, A.; Chiti, F.; Fantacci, R.; Vespri, V. An integrated framework for blockchain inspired fog communications and computing in internet of vehicles. J. Ambient. Intell. Humaniz. Comput. 2020, 11, 755–762. [Google Scholar] [CrossRef]
- Ferrag, M.A.; Shu, L. The Performance Evaluation of Blockchain-Based Security and Privacy Systems for the Internet of Things: A Tutorial. IEEE Internet Things J. 2021, 8, 17236–17260. [Google Scholar] [CrossRef]
- Number of Blockchain Wallet Users 2022/2023: Breakdowns, Timelines, and Predictions. Available online: https://www.financesonline.com/number-of-blockchain-wallet-users (accessed on 17 May 2023).
- Hello Future|Hedera. Available online: https://hedera.com (accessed on 17 May 2023).
- Home|IOTA. Available online: https://www.iota.org (accessed on 17 May 2023).
- IOTA 2.0 Research Specifications. Available online: https://wiki.iota.org/IOTA-2.0-Research-Specifications/Preface (accessed on 17 May 2023).
- GoShimmer Protocol Specification. Available online: https://wiki.iota.org/goshimmer/protocol_specification/components/overview (accessed on 17 May 2023).
- Final Alpha Release for IOTA Streams. Available online: https://blog.iota.org/final-alpha-release-for-iota-streams-5a4cfeca506c (accessed on 17 May 2023).
- Streams Software Documentation. Available online: https://wiki.iota.org/streams/welcome (accessed on 17 May 2023).
- Kurdi, H.; Thayananthan, V. A Multi-Tier MQTT Architecture with Multiple Brokers Based on Fog Computing for Securing Industrial IoT. Appl. Sci. 2022, 12, 7173. [Google Scholar] [CrossRef]
- IOTA 2022: Year of the Ecosystem. Available online: https://blog.iota.org/2022-a-year-in-review-a-year-in-preview (accessed on 17 May 2023).
- OMNeT++ Discrete Event Simulator. Available online: https://omnetpp.org (accessed on 17 May 2023).
- Varga, A. Using the OMNeT++ discrete event simulation system in education. IEEE Trans. Educ. 1999, 42, 11. [Google Scholar] [CrossRef]
- TangleSim. Available online: https://github.com/richardg93/TangleSim (accessed on 17 May 2023).
- Yousaf, F.Z.; Bredel, M.; Schaller, S.; Schneider, F. NFV and SDN - Key Technology Enablers for 5G Networks. IEEE J. Sel. Areas Commun. 2017, 35, 2468–2478. [Google Scholar] [CrossRef] [Green Version]
- Rost, P.; Mannweiler, C.; Michalopoulos, D.S.; Sartori, C.; Sciancalepore, V.; Sastry, N.; Holland, O.; Tayade, S.; Han, B.; Bega, D.; et al. Network Slicing to Enable Scalability and Flexibility in 5G Mobile Networks. IEEE Commun. Mag. 2017, 55, 72–79. [Google Scholar] [CrossRef] [Green Version]
- Ordonez-Lucena, J.; Ameigeiras, P.; Lopez, D.; Ramos-Munoz, J.J.; Lorca, J.; Folgueira, J. Network Slicing for 5G with SDN/NFV: Concepts, Architectures, and Challenges. IEEE Commun. Mag. 2017, 55, 80–87. [Google Scholar] [CrossRef] [Green Version]
publish(string topicURI, int QoS) |
This primitive is used by clients who wish to publish information. It is directed to the Broker and specifies the topic to which the information pertains, as well as the desired QoS level. |
notify(string topicURI, int QoS) |
This primitive is exclusively utilized by the Broker and is sent to subscribers of a particular topic to forward them a publish associated with it. It specifies the topic of the publish and the QoS level selected by the subscriber during subscription. |
subscribe(string topicURI, int QoS=NULL) |
This primitive is used by clients who wish to subscribe to a topic to receive notifies. It is directed to the Broker, and if QoS is not specified, the notifies are forwarded to the client with the same QoS level as the associated publish. |
Announce |
Published by the channel’s author upon its creation, this message signals the start of the channel and includes its identifier and other parameters. |
Keyload |
This message is published by the author of the channel, and it is used to create a new branch; for this purpose, it contains a list of its chains with their subscribers and publishers. |
SignedPacket |
Sent by channel publishers, these messages contain the actual data that have to be signed and may be encrypted. |
Sequence |
This message is added to the sequencing branch whenever a data packet is published. It contains a reference to the packet indicating its branch, its chain, and its position within it. |
Topic | Publisher | Subscriber |
---|---|---|
root/device/x | IoT device | Fog PU |
root/fog/x | Fog PU | IoT device(s), IOTA Node, IOTA Cache |
root/node/site/tangle | IOTA Node | IOTA Cache |
root/node/site/active | IOTA Node | IOTA Cache |
root/cache/site/pending | IOTA Cache | IOTA Node |
Topic | Publisher | Subscriber |
---|---|---|
root/device/s1 | Sensor | Fog PU |
root/device/a2 | Actuator | Fog PU |
root/fog/s1 | Fog PU | Actuator, IOTA Node, IOTA Cache |
root/fog/a2 | Fog PU | IOTA Node, IOTA Cache |
root/node/z1/tangle | IOTA Node | IOTA Cache |
root/node/z1/active | IOTA Node | IOTA Cache |
root/cache/z1/pending | IOTA Cache | IOTA Node |
Name | Value(s) | Meaning |
---|---|---|
channelDelay | 0.5 ms | Time necessary to transmit a message between a couple of nodes over a link: it includes the channel delay and the delay introduced by a specific Data-link Layer technology. |
iotaNode.powTime | 100 ms | Time required by the IOTA Node to perform the lightweight Proof of Work (PoW). |
* .elaborationDelay | 2 ms | Time required by each node to process a message and perform the necessary actions upon its reception. |
numSources | [] | Number of IoT sources. |
numBrokers | [] | Number of load-balanced Brokers. |
brokers[*].serviceTime | [5 ms, 6 ms, 7 ms] | Message service time for each Broker FIFO queue. |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Chiti, F.; Gandini, G. Distributed Ledger as a Service: A Web 3.0-Oriented Architecture. J. Sens. Actuator Netw. 2023, 12, 57. https://doi.org/10.3390/jsan12040057
Chiti F, Gandini G. Distributed Ledger as a Service: A Web 3.0-Oriented Architecture. Journal of Sensor and Actuator Networks. 2023; 12(4):57. https://doi.org/10.3390/jsan12040057
Chicago/Turabian StyleChiti, Francesco, and Giorgio Gandini. 2023. "Distributed Ledger as a Service: A Web 3.0-Oriented Architecture" Journal of Sensor and Actuator Networks 12, no. 4: 57. https://doi.org/10.3390/jsan12040057
APA StyleChiti, F., & Gandini, G. (2023). Distributed Ledger as a Service: A Web 3.0-Oriented Architecture. Journal of Sensor and Actuator Networks, 12(4), 57. https://doi.org/10.3390/jsan12040057