A Trusted Routing Scheme Using Blockchain and Reinforcement Learning for Wireless Sensor Networks
Abstract
:1. Introduction
- (i)
- The first is the distributed ledger which contains all the transactions on the blockchain. The contents of these transactions include the address of the receiver of the transaction, the amount of the transfer, the timestamp, the smart contract code, the execution result of the smart contract, etc. The transaction ledger is completed jointly by multiple nodes in different places. Each node in the blockchain keeps a complete ledger, so that no ledger information can be tampered. While all of the nodes can participate in monitoring the legality of transactions.
- (ii)
- The second is the asymmetric encryption and authorization technology. The transaction information stored on the blockchain is public, but the account identity information is highly encrypted and can only be accessed under the authorization of the data owner, thus ensuring the security of data and personal privacy.
- (iii)
- The third part, called consensus mechanism, is how all accounting nodes reach consensus to determine the effectiveness of a blockchain transaction, which is a means of preventing tampering. Some common consensus algorithms including proof of work (PoW), proof of stake (PoS), proof of authority (PoA), delegated proof of stake (DPoS) and proof of capacity (PoC) are discussed in [27,28]. We introduce three mainstream blockchain consensus mechanisms relevant to our work:
- PoW: Bitcoin, Dogecoin and Litecoin are among the digital currencies based on the PoW consensus mechanism. PoW algorithm relies on the node to carry out mathematical operations to find a random number and obtain the accounting right. A malicious node needs more than 51 percent of the network’s computing power to take control of the blockchain network. Compared with other consensus mechanisms, the resource consumption of the PoW blockchain is high and the supervision is weak. At the same time, every time a PoW consensus is reached, the whole network needs to participate in the operation, which has low performance and efficiency.
- PoS: The main idea of the PoS consensus mechanism is that the difficulty of obtaining the accounting right of a node is inversely proportional to the stake held by the node. According to the proportion and time of coins taken by each node, the difficulty of mining coins can be reduced in the same proportion so as to speed up the speed of finding random numbers. The greater the stake, the greater the privilege, the greater the responsibility to generate the block and the power to generate more revenue.
- PoA: PoA is an improved algorithm of PoS that uses the verified identity of the nodes to replace the role of the stake rather than the monetary value. In a PoA blockchain, the transaction and the block are validated by an approved node (called a validator) without a huge computational overhead of a mining process. The validator must authenticate on the blockchain and the qualification is hard to acquire which means the validator will not have a motive for acting on their own interests. Even if there is a malicious validator, it will be kicked out by other validators’ votes. In this way, the PoA blockchain becomes safer and cheaper.
- (iv)
- The last technical element is the smart contract, which is based on the trusted and non-tampering data and can automatically execute the predefined codes by a blockchain miner [29]. The execution result of the smart contract updates the ledger status on the blockchain network. These changes cannot be falsified or tampered with once they are confirmed by a specific consensus mechanism because the content has been agreed upon in the blockchain network.
2. Related Work
2.1. Traditional Trusted Routing Schemes
2.2. Blockchain-Based Routing Schemes
2.3. Reinforcement Learning Algorithms in Routing Schemes
3. Approach
3.1. Threat Model
3.2. Blockchain-Based Network Architecture
- Validator: The validators are the pre-authenticated nodes of the blockchain, which have advanced authorization and are responsible for the verification work in the PoA blockchain. In our system, each server node is a validator with higher rights in the PoA blockchain and has a unique blockchain address. Their specific tasks include executing smart contracts, verifying blockchain transactions, and releasing blocks on the blockchain. A new validator can be added by the authenticated validators election with more than 50% of the votes. Even if there is a malicious validator, it can only attack one of the contiguous blocks at most, during which time the malicious validator can be kicked out by other validator votes.
- Minion: The minions are less-privileged nodes and cannot perform the verification work as validators in the PoA blockchain. In our system, each routing node is also a minion and has fewer rights in the PoA blockchain and it has a unique blockchain address, too. They can initiate token contracts, trigger some contract functions, and query the transaction information on the blockchain.
3.3. Blockchain Network Procedure
Algorithm 1 Procedure of registering a node. |
1: Mapping : →; 2: Mapping : →0 1; 3: while do /* The contract is waiting for a contract caller to trigger */ Input: Contract Caller’s Blockchain Address ; Contract Caller’s Physical Address ; Output: Registration Result r; 4: ; 5: if = 1 then 6: ; 7: else 8: = ; 9: = 1; 10: ; 11: end if 12: end while |
- (i)
- We initialize the number of packets in as p and in as q, i.e., = p and = q. First, transmits n unit data packets to . In the traditional routing network, will send back an acknowledgement (ACK) to confirm that the packets have been received and the token balances should be and . Meanwhile, each routing node performs routing scheduling based on the routing information released by neighbor routing nodes in the traditional routing network. However, if is a malicious routing node, it can deny the routing process to its neighbor routing nodes, such that the token balances for its neighbor routing nodes will be and , so such these schemes cannot guarantee the trustworthiness between the routing nodes.
- (ii)
- In our scheme, we put the process of validating the routing process on the blockchain network and all the routing nodes get the relevant routing information from the blockchain network instead of their neighbor routing nodes. After the packets are transmitted, trigger the “transfer” function on the token contract to indicate the state change including the information of the amount n of tokens sent to to the blockchain network. Then the token amount n is released on the token contract. While trigger the “confirm” function on the token contract to confirm the amount of the received packets to the blockchain network. The number is based on the amount of the packets actually received in the routing network.
- (iii)
- Then the token contract checks whether n equals , and if , the token balances for and end with and . If , the token balances for and remain and . The whole token transaction is confirmed by the PoA consensus of the server nodes, i.e., only the validation of more than half of the authenticated server nodes can allow a server node to upload the transaction to the blockchain network. We stipulated that the whole transaction process should be completed within one time slot. The unconfirmed transactions are cancelled and a failed transaction is not recorded in the blockchain without affecting the routing information.
3.4. RLBC Routing Algorithm
Algorithm 2 Reinforcement learning and blockchain based (RLBC) routing algorithm. |
Input: Environment E; Action Space ; Initial State ; Reward Discount ; Learning Rate ; Output: Policy ; 1: (x,a) = 0, P(x,a) = ; 2: x = ; 3: for … do 4: a = (x); 5: r = reward by routing action a; 6: = next state by routing action a; 7: = (); 8: (x,a) = (x,a) + (r+(,) − (x,a)); 9: (x) = arg (x,)(x,); 10: x = ; 11: end for |
3.5. Security Analysis
- PoA consensus mechanism: The blockchain network is based on a consensus mechanism called PoA (proof of authority), and only the validation of more than half of the authenticated server nodes can allow a server node to upload the transaction and update the routing information. Therefore, any information on the blockchain cannot be tampered with by individuals.
- Transaction traceability: The server nodes record the transactions on the blockchain, including the transaction of releasing token contract, the transaction of routing node running functions on the contract, the transaction of transferring tokens. All the information about these transactions is recorded on the blocks and can be traceable across the blockchain network.
- Routing information source: Different from the traditional routing network, in our scheme, all the routing nodes get the relevant routing information from the blockchain network instead of its neighbor routing nodes. In this way, the routing information obtained by the whole network routing nodes is consistent and not determined by individuals.
- Avoid the single point attacks: Our blockchain-based routing scheduling scheme does not require a trusted third-party central authority to manage routing information. The single point attack is prevented by the authentication of the transaction by multiple server nodes.
- No double-spending: The codes of our token contract specifies that each routing node address maps to only one address at each time slot, and that the routing node will not initiate token transactions to two other routing nodes at the same time slot.
- Self-adaptability: In the proposed routing scheduling scheme, the routing link with malicious nodes will not generate routing transactions. The reward value r of the routing link is very low based on our RLBC routing algorithm and the learning model will adaptively select the routing link of normal nodes.
4. Experimental Analysis and Evaluation
4.1. Testing Setting
- (i)
- A malicious node releases a fake low (10% of the true amount) queue length information, but it transmits packets to other routing nodes.
- (ii)
- A malicious node releases the true queue length information, but it doesn’t transmit any packet to other routing nodes.
- (iii)
- A malicious node releases a fake low queue length information and it doesn’t transmit any packet to other routing nodes.
4.2. Effectiveness
Simulation Results
4.3. Efficiency
4.3.1. Token Transaction Latency
4.3.2. Token Transaction Energy Consumption
4.3.3. Token Transaction Throughput
5. Conclusions and Future Work
Author Contributions
Funding
Conflicts of Interest
References
- Yick, J.; Mukherjee, B.; Ghosal, D. Wireless sensor network survey. Comput. Netw. 2008, 52, 2292–2330. [Google Scholar] [CrossRef]
- Ren, J.; Yue, S.; Zhang, D.; Zhang, Y.; Cao, J. Joint Channel Assignment and Stochastic Energy Management for RF-Powered OFDMA WSNs. IEEE Trans. Veh. Technol. 2018. [Google Scholar] [CrossRef]
- Ren, J.; Zhang, Y.; Deng, R.; Zhang, N.; Zhang, D.; Shen, X. Joint channel access and sampling rate control in energy harvesting cognitive radio sensor networks. IEEE Trans. Emerg. Top. Comput. 2016. [Google Scholar] [CrossRef]
- Zhang, D.; Chen, Z.; Zhou, H.; Chen, L.; Shen, X.S. Energy-balanced cooperative transmission based on relay selection and power control in energy harvesting wireless sensor network. Comput. Netw. 2016, 104, 189–197. [Google Scholar] [CrossRef]
- Zhang, D.; Chen, Z.; Awad, M.K.; Zhang, N.; Zhou, H.; Shen, X.S. Utility-optimal resource management and allocation algorithm for energy harvesting cognitive radio sensor networks. IEEE J. Sel. Areas Commun. 2016, 34, 3552–3565. [Google Scholar] [CrossRef]
- Kumar, N.; Singh, Y. Routing protocols in wireless sensor networks. In Handbook of Research on Advanced Wireless Sensor Network Applications, Protocols, and Architectures; IGI Global: Hershey, PA, USA, 2017; pp. 86–128. [Google Scholar]
- Perrig, A.; Stankovic, J.; Wagner, D. Security in wireless sensor networks. Commun. ACM 2004, 47, 53–57. [Google Scholar] [CrossRef]
- Xu, C.; Ren, J.; Zhang, D.; Zhang, Y.; Qin, Z.; Ren, K. GANobfuscator: Mitigating Information Leakage under GAN via Differential Privacy. IEEE Trans. Inf. Forensics Secur. 2019. [Google Scholar] [CrossRef]
- Tang, W.; Zhang, K.; Ren, J.; Zhang, Y.; Shen, X.S. Flexible and Efficient Authenticated Key Agreement Scheme for BANs Based on Physiological Features. IEEE Trans. Mob. Comput. 2018. [Google Scholar] [CrossRef]
- Jiao, Z.; Zhang, B.; Li, C.; Mouftah, H.T. Backpressure-based routing and scheduling protocols for wireless multihop networks: A survey. IEEE Wirel. Commun. 2016, 23, 102–110. [Google Scholar] [CrossRef]
- Liu, Y.; Dong, M.; Ota, K.; Liu, A. ActiveTrust: secure and trustable routing in wireless sensor networks. IEEE Trans. Inf. Forensics Secur. 2016, 11, 2013–2027. [Google Scholar] [CrossRef]
- Al-Shurman, M.; Yoo, S.M.; Park, S. Black hole attack in mobile ad hoc networks. In Proceedings of the ACM 42nd Annual Southeast Regional Conference, Huntsville, AL, USA, 2–3 April 2004; pp. 96–97. [Google Scholar]
- Wang, C.; Jia, X.Y.; Lin, Q. Trust based secure routing algorithm for wireless sensor networks. J. Commun. 2008, 29, 105–112. [Google Scholar]
- Nagarathna, K.; Kiran, Y.; Mallapur, J.D.; Hiremath, S. Trust based secured routing in wireless multimedia sensor networks. In Proceedings of the 2012 IEEE Fourth International Conference on Computational Intelligence, Communication Systems and Networks, Phuket, Thailand, 24–26 July 2012; pp. 53–58. [Google Scholar]
- Li, X.; Lyu, M.R.; Liu, J. A trust model based routing protocol for secure ad hoc networks. In Proceedings of the 2004 IEEE Aerospace Conference Proceedings (IEEE Cat. No.04TH8720), Big Sky, MT, USA, 6–13 March 2004; Volume 2, pp. 1286–1295. [Google Scholar]
- Lu, Z.; Sagduyu, Y.E.; Li, J.H. Securing the backpressure algorithm for wireless networks. IEEE Trans. Mob. Comput. 2017, 16, 1136–1148. [Google Scholar] [CrossRef]
- Sirisala, N.; Bindu, C.S. Recommendations Based QoS Trust Aggregation and Routing in Mobile Adhoc Networks. Int. J. Commun. Netw. Inf. Secur. 2016, 8, 215. [Google Scholar]
- Venkataraman, R.; Moeller, S.; Krishnamachari, B.; Rao, T.R. Trust–based backpressure routing in wireless sensor networks. Int. J. Sens. Netw. 2015, 17, 27–39. [Google Scholar] [CrossRef]
- Tang, J.; Liu, A.; Ming, Z.; Tian, W. An Aggregate Signature Based Trust Routing for Data Gathering in Sensor Networks. Secur. Commun. Netw. 2018, 2018, 6328504. [Google Scholar] [CrossRef]
- Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. Available online: https://bitcoin.org/bitcoin.pdf (accessed on 25 February 2019).
- Ali, S.; Wang, G.; Bhuiyan, M.Z.A.; Jiang, H. Secure Data Provenance in Cloud-Centric Internet of Things via Blockchain Smart Contracts. In Proceedings of the 2018 IEEE SmartWorld, Ubiquitous Intelligence & Computing, Advanced & Trusted Computing, Scalable Computing & Communications, Cloud & Big Data Computing, Internet of People and Smart City Innovation (SmartWorld/SCALCOM/UIC/ ATC/CBDCom/IOP/SCI), Guangzhou, China, 8–12 October 2018; pp. 991–998. [Google Scholar]
- Zheng, Z.; Xie, S. Blockchain Challenges and Opportunities: A Survey. Int. J. Web Grid Serv. 2018, 14, 352–375. [Google Scholar] [CrossRef]
- Pieroni, A.; Scarpato, N.; Di Nunzio, L.; Fallucchi, F.; Raso, M. Smarter city: smart energy grid based on blockchain technology. Int. J. Adv. Sci. Eng. Inf. Technol. 2018, 8, 298–306. [Google Scholar] [CrossRef]
- Gómez-Arevalillo, A.D.L.R.; Papadimitratos, P. Blockchain-based public key infrastructure for inter-domain secure routing. In Proceedings of the International Workshop on Open Problems in Network Security (iNetSec), Rome, Italy, 30–31 May 2017; pp. 20–38. [Google Scholar]
- Li, J.; Liang, G.; Liu, T. A Novel Multi-link Integrated Factor Algorithm Considering Node Trust Degree for Blockchain-based Communication. KSII Trans. Internet Inf. Syst. 2017, 11. [Google Scholar] [CrossRef]
- Ramezan, G.; Leung, C. A Blockchain-Based Contractual Routing Protocol for the Internet of Things Using Smart Contracts. Wirel. Commun. Mob. Comput. 2018, 2018, 4029591. [Google Scholar] [CrossRef]
- Angrish, A.; Craver, B.; Hasan, M.; Starly, B. A Case Study for Blockchain in Manufacturing: “FabRec”: A Prototype for Peer-to-Peer Network of Manufacturing Nodes. arXiv, 2018; arXiv:1804.01083. [Google Scholar] [CrossRef]
- Bach, L.; Mihaljevic, B.; Zagar, M. Comparative analysis of blockchain consensus algorithms. In Proceedings of the 2018 IEEE 41st International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO), Opatija, Croatia, 21–25 May 2018; pp. 1545–1550. [Google Scholar]
- Buterin, V. A Next-Generation Smart Contract and Decentralized Application Platform. Available online: http://blockchainlab.com/pdf (accessed on 25 February 2019).
- Boyan, J.A.; Littman, M.L. Packet routing in dynamically changing networks: A reinforcement learning approach. In Proceedings of the 6th International Conference on Neural Information Processing Systems (NIPS’93), Denver, CO, USA, 29 November–2 December 1994; pp. 671–678. [Google Scholar]
- Subramanian, D.; Druschel, P.; Chen, J. Ants and reinforcement learning: A case study in routing in dynamic networks. In Proceedings of the Fifteenth International Joint Conference on Artifical Intelligence (IJCAI’97), Nagoya, Japan, 23–29 August 1997; pp. 832–839. [Google Scholar]
- Al-Rawi, H.A.A.; Ming, A.N.; Yau, K.L.A. Application of reinforcement learning to routing in distributed wireless networks: A review. Artif. Intell. Rev. 2015, 43, 381–416. [Google Scholar] [CrossRef]
- Gupta, Y.; Bhargava, L. Reinforcement Learning based Routing for Cognitive Network on Chip. In Proceedings of the International Conference on Information and Communication Technology for Competitive Strategies, Udaipur, India, 4–5 March 2016. [Google Scholar]
- Gao, J.; Shen, Y.; Ito, M.; Shiratori, N. Multi-Agent Q-Learning Aided Backpressure Routing Algorithm for Delay Reduction. arXiv, 2017; arXiv:1708.06926. [Google Scholar]
- Sutton, R.S.; Barto, A.G. Reinforcement Learning: An Introduction; MIT Press: Cambridge, MA, USA, 2018. [Google Scholar]
- Cui, Y.; Yeh, E.M.; Liu, R. Enhancing the delay performance of dynamic backpressure algorithms. IEEE/ACM Trans. Netw. 2016, 24, 954–967. [Google Scholar] [CrossRef]
- Mayadunna, H.; De Silva, S.L.; Wedage, I.; Pabasara, S.; Rupasinghe, L.; Liyanapathirana, C.; Kesavan, K.; Nawarathna, C.; Sampath, K.K. Improving trusted routing by identifying malicious nodes in a MANET using reinforcement learning. In Proceedings of the 2017 IEEE Seventeenth International Conference on Advances in ICT for Emerging Regions (ICTer), Colombo, Sri Lanka, 6–9 September 2017; pp. 1–8. [Google Scholar]
- Ling, X.; Wang, J.; Bouchoucha, T.; Levy, B.C.; Ding, Z. Blockchain Radio Access Network (B-RAN): Towards Decentralized Secure Radio Access Paradigm. IEEE Access 2019, 7, 9714–9723. [Google Scholar] [CrossRef]
- Xu, Y.; Wang, G.; Yang, J.; Ren, J.; Zhang, Y.; Zhang, C. Towards Secure Network Computing Services for Lightweight Clients Using Blockchain. Wirel. Commun. Mob. Comput. 2018, 2018, 2051693. [Google Scholar] [CrossRef]
- Xu, Y.; Ren, J.; Wang, G.; Zhang, C.; Yang, J.; Zhang, Y. A Blockchain-based Non-Repudiation Network Computing Service Scheme for Industrial IoT. IEEE Trans. Ind. Inform. 2019. [Google Scholar] [CrossRef]
- Ali, S.; Wang, G.; White, B.; Cottrell, R.L. A blockchain-based decentralized data storage and access framework for pinger. In Proceedings of the 2018 17th IEEE International Conference on Trust, Security and Privacy in Computing and Communications, New York, NY, USA, 1–3 August 2018. [Google Scholar]
- Ren, Y.; Liu, Y.; Ji, S.; Sangaiah, A.K.; Wang, J. Incentive Mechanism of Data Storage Based on Blockchain for Wireless Sensor Networks. Mob. Inf. Syst. 2018, 2018, 6874158. [Google Scholar] [CrossRef]
Parameter Name | Server Node | Terminal Node | Routing Node |
---|---|---|---|
CPU | 2.6 GHz | 1.2 GHz | 580 MHz |
RAM | 16 GB | 1 GB | 32 MB |
Storage | 1 TB | 16 GB | 256 MB |
Network | 1000 Mb | 100 Mb | 100 Mb |
OS | Ubuntu Server 16.04 | Raspbian 4.14 | OpenWRT 15.05 |
© 2019 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 (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Yang, J.; He, S.; Xu, Y.; Chen, L.; Ren, J. A Trusted Routing Scheme Using Blockchain and Reinforcement Learning for Wireless Sensor Networks. Sensors 2019, 19, 970. https://doi.org/10.3390/s19040970
Yang J, He S, Xu Y, Chen L, Ren J. A Trusted Routing Scheme Using Blockchain and Reinforcement Learning for Wireless Sensor Networks. Sensors. 2019; 19(4):970. https://doi.org/10.3390/s19040970
Chicago/Turabian StyleYang, Jidian, Shiwen He, Yang Xu, Linweiya Chen, and Ju Ren. 2019. "A Trusted Routing Scheme Using Blockchain and Reinforcement Learning for Wireless Sensor Networks" Sensors 19, no. 4: 970. https://doi.org/10.3390/s19040970
APA StyleYang, J., He, S., Xu, Y., Chen, L., & Ren, J. (2019). A Trusted Routing Scheme Using Blockchain and Reinforcement Learning for Wireless Sensor Networks. Sensors, 19(4), 970. https://doi.org/10.3390/s19040970