Skip to main content
Log in

A blockchain and stacked machine learning approach for malicious nodes’ detection in internet of things

  • Published:
Peer-to-Peer Networking and Applications Aims and scope Submit manuscript

Abstract

The Internet of Things (IoT) network is extremely useful in many different fields, such as smart cities, the military, healthcare, business, and agriculture, among others. The security of IoT networks has long been a major concern. The nodes of the IoT network are openly accessible and are mostly deployed in hostile environments. Therefore, they are easily exposed to different attacks. It is important to identify malicious nodes and attacks present in the network. The majority of traditional IoT security mechanisms are either centralized or rely on third parties. Thus, they are vulnerable to a single point of failure. Moreover, Machine Learning (ML) based attack detection approaches have low detection accuracy and performance as compared to the deep learning approaches. Besides, the single learner algorithms have intrinsic limitations that directly impact the attack detection systems’ performance. To address the aforementioned issues, a Blockchain Ensemble stacked Machine Learning (BEML) approach has been proposed in this article. The BEML approach is made up of three modules: blockchain, InterPlanetary File System (IPFS) and attack detector. The blockchain module registers network nodes, authenticates data analysts, revokes network nodes, and stores data hashes and credentials’ information of nodes in a secure way. The IPFS module stores the data and generates a unique hash against it. Later on, the hash is used to access and download data from the IPFS. In the third module, the raw data is processed, normalized and balanced using the MinMax scalar and Synthetic Minority Oversampling Technique (SMOTE). Moreover, the single learner ML algorithms: linear discriminant analysis, decision tree, perceptron and ridge, are combined in such a way that they compensate for the weaknesses of each other and result in a stacked ML model. The resulting model has better performance and detection accuracy as compared to the single learner algorithms. This stacked ML model is used to detect and classify the Denial of Service (DoS) attacks present in the network. Based on the predicted attacks, the malicious nodes are identified and their registration is revoked from the network. Finally, for evaluating the the proposed BEML approach’s efficiency, simulations are performed. The results, theoretical analysis and formal security analysis indicate that the BEML approach effectively stores data, efficiently detects attacks and ensures the security of the IoT network.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14

Similar content being viewed by others

Data and material

Not applicable.

References

  1. Kumar P, Kumar R, Srivastava G, Gupta GP, Tripathi R, Gadekallu TR, Xiong NN (2021) PPSF: a privacy-preserving and secure framework using blockchain-based machine-learning for IoT-driven smart cities. IEEE Trans Netw Sci Eng 8(3):2326–2341

    Article  Google Scholar 

  2. Azam I, Javaid N, Ahmad A, Abdul W, Almogren A, Alamri A (2017) Balanced load distribution with energy hole avoidance in underwater WSNs. IEEE Access 5:15206–15221

    Article  Google Scholar 

  3. Javaid N, Hussain SM, Ullah I, Noor MA, Abdul W, Almogren A, Alamri A (2017) Demand side management in nearly zero energy buildings using heuristic optimizations. Energies 10(8):1131

    Article  Google Scholar 

  4. Cui Z, Fei XUE, Zhang S, Cai X, Cao Y, Zhang W, Chen J (2020) A hybrid blockchain-based identity authentication scheme for multi-WSN. IEEE Trans Serv Comput 13(2):241–251

    Google Scholar 

  5. Kumar R, Swarnkar M, Singal G, Kumar N (2021) IoT Network Traffic Classification Using Machine Learning Algorithms: An Experimental Analysis. IEEE Internet Things J 9(2):989–1008

    Article  Google Scholar 

  6. Memon RA, Li JP, Ahmed J, Nazeer MI, Ismail M, Ali K (2020) Cloud-based vs. blockchain-based IoT: a comparative survey and way forward. Front Inf Technol Electron Eng 21(4):563-586

  7. Gai K, Guo J, Zhu L, Yu S (2020) Blockchain meets cloud computing: a survey. IEEE Communications Surveys & Tutorials 22(3):2009–2030

    Article  Google Scholar 

  8. Khalid A, Iftikhar MS, Almogren A, Khalid R, Afzal MK, Javaid N (2021) A blockchain based incentive provisioning scheme for traffic event validation and information storage in VANETs. Inf Process Manag 58(2):102464

    Article  Google Scholar 

  9. Nouman M, Qasim U, Nasir H, Almasoud A, Imran M, Javaid N (2023) Malicious Node Detection using Machine Learning and Distributed Data Storage using Blockchain in WSNs. IEEE Access

  10. Sadiq A, Javed MU, Khalid R, Almogren A, Shafiq M, Javaid N (2020) Blockchain based data and energy trading in internet of electric vehicles. IEEE Access 9:7000–7020

    Article  Google Scholar 

  11. Ding X, Guo J, Li D, Wu W (2020) An incentive mechanism for building a secure blockchain-based internet of things. IEEE Trans Netw Sci Eng 8(1):477–487

    Article  MathSciNet  Google Scholar 

  12. Amjad S, Abbas S, Abubaker Z, Alsharif MH, Jahid A, Javaid N (2022) Blockchain based authentication and cluster head selection using DDR-LEACH in internet of sensor things. Sensors 22(5):1972

    Article  Google Scholar 

  13. Guo S, Hu X, Guo S, Qiu X, Qi F (2019) Blockchain meets edge computing: A distributed and trusted authentication system. IEEE Trans Industr Inf 16(3):1972–1983

    Article  Google Scholar 

  14. Ferrag MA, Derdour M, Mukherjee M, Derhab A, Maglaras L, Janicke H (2018) Blockchain technologies for the internet of things: Research issues and challenges. IEEE Internet Things J 6(2):2188–2204

    Article  Google Scholar 

  15. Cui Z, Fei XUE, Zhang S, Cai X, Cao Y, Zhang W, Chen J (2020) A hybrid blockchain-based identity authentication scheme for multi-WSN. IEEE Trans Serv Comput 13(2):241–251

    Google Scholar 

  16. Tian Y, Li T, Xiong J, Bhuiyan MZA, Ma J, Peng C (2021) A blockchain-based machine learning framework for edge services in IIoT. IEEE Trans Industr Inf 18(3):1918–1929

    Article  Google Scholar 

  17. Shen M, Tang X, Zhu L, Du X, Guizani M (2019) Privacy-preserving support vector machine training over blockchain-based encrypted IoT data in smart cities. IEEE Internet Things J 6(5):7702–7712

    Article  Google Scholar 

  18. Abdelmoumin G, Rawat DB, Rahman A (2021) On the performance of machine learning models for anomaly-based intelligent intrusion detection systems for the internet of things. IEEE Internet Things J 9(6):4280–4290

    Article  Google Scholar 

  19. Arif A, Alghamdi TA, Khan ZA, Javaid N (2022) Towards efficient energy utilization using big data analytics in smart cities for electricity theft detection. Big Data Res 27:100285

    Article  Google Scholar 

  20. Bandara E, Tosh D, Foytik P, Shetty S, Ranasinghe N, De Zoysa K (2021) Tikiri-Towards a lightweight blockchain for IoT. Futur Gener Comput Syst 119:154–165

    Article  Google Scholar 

  21. Honar Pajooh H, Rashid M, Alam F, Demidenko S (2021) Hyperledger fabric blockchain for securing the edge internet of things. Sensors 21(2):359

    Article  Google Scholar 

  22. Satamraju KP (2020) Proof of concept of scalable integration of internet of things and blockchain in healthcare. Sensors 20(5):1389

    Article  Google Scholar 

  23. Singh R, Dwivedi AD, Srivastava G (2020) Internet of things based blockchain for temperature monitoring and counterfeit pharmaceutical prevention. Sensors 20(14):3951

    Article  Google Scholar 

  24. Xu C, Qu Y, Luan TH, Eklund PW, Xiang Y, Gao L (2021) A lightweight and attack-proof bidirectional blockchain paradigm for Internet of Things. IEEE Internet Things J 9(6):4371–4384

    Article  Google Scholar 

  25. Xu X, Zhao H, Yao H, Wang S (2020) A blockchain-enabled energy-efficient data collection system for UAV-assisted IoT. IEEE Internet Things J 8(4):2431–2443

    Article  Google Scholar 

  26. Khalaf OI, Abdulsahib GM (2021) Optimized dynamic storage of data (ODSD) in IoT based on blockchain for wireless sensor networks. Peer-to-Peer Netw Appl 14(5):2858–2873

    Article  Google Scholar 

  27. Goyat R, Kumar G, Saha R, Conti M, Rai MK, Thomas R, Hoon-Kim T (2020) Blockchain-based data storage with privacy and authentication in internet-of-things. IEEE Internet Things J

  28. Ahmed A, Abdullah S, Bukhsh M, Ahmad I, Mushtaq Z (2022) An energy-efficient data aggregation mechanism for IoT secured by blockchain. IEEE Access 10:11404–11419

    Article  Google Scholar 

  29. Ibrahim RF, Abu Al-Haija Q, Ahmad A (2022) DDoS attack prevention for Internet of Thing devices using Ethereum blockchain technology. Sensors 22(18):6806

    Article  Google Scholar 

  30. Shafiq M, Tian Z, Bashir AK, Du X, Guizani M (2020) CorrAUC: a malicious bot-IoT traffic detection method in IoT network using machine-learning techniques. IEEE Internet Things J 8(5):3242–3254

    Article  Google Scholar 

  31. Aboelwafa MM, Seddik KG, Eldefrawy MH, Gadallah Y, Gidlund M (2020) A machine-learning-based technique for false data injection attacks detection in industrial IoT. IEEE Internet Things J 7(9):8462–8471

    Article  Google Scholar 

  32. Makkar A, Garg S, Kumar N, Hossain MS, Ghoneim A, Alrashoud M (2020) An efficient spam detection technique for IoT devices using machine learning. IEEE Trans Industr Inf 17(2):903–912

    Article  Google Scholar 

  33. Liu L, Xu X, Liu Y, Ma Z, Peng J (2021) A detection framework against CPMA attack based on trust evaluation and machine learning in IoT network. IEEE Internet Things J 8(20):15249–15258

    Article  Google Scholar 

  34. Al-Haija QA, Saleh E, Alnabhan M (2021) Detecting port scan attacks using logistic regression. In 2021 4th International symposium on advanced electrical and communication technologies (ISAECT) (pp. 1-5). IEEE

  35. Gadekallu TR, Manoj MK, Kumar N, Hakak S, Bhattacharya S (2021) Blockchain-based attack detection on machine learning algorithms for IoT-based e-health applications. IEEE Internet Things Mag 4(3):30–33

    Article  Google Scholar 

  36. Tian Y, Li T, Xiong J, Bhuiyan MZA, Ma J, Peng C (2021) A blockchain-based machine learning framework for edge services in IIoT. IEEE Trans Industr Inf 18(3):1918–1929

    Article  Google Scholar 

  37. Zhao Y, Yang X, Yu Y, Qin B, Du X, Guizani M (2021) Blockchain-Based Auditable Privacy-Preserving Data Classification for Internet of Things. IEEE Internet Things J 9(4):2468–2484

    Article  Google Scholar 

  38. Jamil F, Kahng HK, Kim S, Kim DH (2021) Towards secure fitness framework based on IoT-enabled blockchain network integrated with machine learning algorithms. Sensors 21(5):1640

    Article  Google Scholar 

  39. Kaur M, Gupta S, Kumar D, Raboaca MS, Goyal SB, Verma C (2023) IPFS: An Off-Chain Storage Solution for Blockchain. In Proceedings of International Conference on Recent Innovations in Computing: ICRIC 2022, Volume 1 (pp. 513-525). Singapore: Springer Nature Singapore

  40. Jamal A, Javed MU, Alrajeh N, Bouk SH, Javaid N (2023) Blockchain based reputation management, data storage and distributed revocation in vehicular energy networks in smart health care systems. Cluster Computing 1-13

  41. Al-Haija QA, Alnabhan M, Saleh E, Al-Omari M (2023) Applications of blockchain technology for improving security in the internet of things (IoT). In Blockchain Technology Solutions for the Security of Iot-Based Healthcare Systems (pp. 199-221). Academic Press

  42. Albulayhi K, Al-Haija QA (2022) Security and Privacy Challenges in Blockchain Application. In The Data-Driven Blockchain Ecosystem (pp. 207-226). CRC Press

  43. Almomani I, Al-Kasasbeh B, Al-Akhras M (2016) WSN-DS: A dataset for intrusion detection systems in wireless sensor networks. J Sens

  44. Darwish L, Nassr M, Ghosna F, Fardoun HM, Voronkova DK, Anbar M (2023) Malicious Node Detection in Wireless Sensor Networks: Comparative Study. In 2023 5th International Youth Conference on Radio Electronics, Electrical and Power Engineering (REEPE) (Vol. 5, pp. 1-5). IEEE

  45. Chandra AL (2018) Perceptron Learning Algorithm: A graphical explanation of why it works ... Perceptron Learning Algorithm: A Graphical Explanation Of Why It Works. https://towardsdatascience.com/perceptron-learning-algorithm-d5db0deab975 [Last Accessed: November 2, 2022]

  46. Behera B, Kumaravelan G (2020) Performance evaluation of machine learning algorithms in biomedical document classification. Perform Eval 29(5):5704–5716

    Google Scholar 

  47. Saputra MFA, Widiyaningtyas T, Wibawa AP (2018) Illiteracy classification using K means-Naïve Bayes algorithm. JOIV Int J Inform Vis 2(3):153-158

  48. Arif A, Javaid N, Aldegheishem A, Alrajeh N (2021) Big data analytics for identifying electricity theft using machine learning approaches in microgrids for smart communities. Concur Comput Pract Exp 33(17):e6316

    Article  Google Scholar 

  49. Dilmi S, Ladjal M (2021) A novel approach for water quality classification based on the integration of deep learning and feature extraction techniques. Chemom Intell Lab Syst 214:104329

    Article  Google Scholar 

  50. He L, Yang Z, Zhao Z, Lin H, Li Y (2013) Extracting drug-drug interaction from the biomedical literature using a stacked generalization-based approach. PLoS ONE 8(6):e65814

    Article  Google Scholar 

  51. https://www.web3.university/tracks/create-a-smart-contract/what-is-gas-and-how-is-it-used [Last Accessed: September 6, 2022]

  52. Yahaya AS, Javaid N, Zeadally S, Farooq H (2022) Blockchain based optimized data storage with secure communication for Internet of Vehicles considering active, passive, and double spending attacks. Veh Commun 37:100502

    Google Scholar 

  53. Javaid N, Qasim U, Yahaya AS, Alkhammash EH, Hadjouni M (2022) Non-technical losses detection using autoencoder and bidirectional gated recurrent unit to secure smart grids. IEEE Access

  54. Asif M, Nazeer O, Javaid N, Alkhammash EH, Hadjouni M (2022) Data Augmentation Using BiWGAN, Feature Extraction and Classification by Hybrid 2DCNN and BiLSTM to Detect Non-Technical Losses in Smart Grids. IEEE Access 10:27467–27483

    Article  Google Scholar 

  55. Wang W, Song J, Xu G, Li Y, Wang H, Su C (2020) Contractward: Automated vulnerability detection models for ethereum smart contracts. IEEE Trans Netw Sci Eng 8(2):1133–1144

    Article  Google Scholar 

  56. Praitheeshan P, Pan L, Yu J, Liu J, Doss R (2019) Security analysis methods on ethereum smart contract vulnerabilities: a survey. arXiv preprint arXiv:1908.08605

Download references

Acknowledgements

This work was supported by King Saud University, Riyadh, Saudi Arabia, through Researchers Supporting Project number (RSP2023R184).

Funding

This work was supported by King Saud University, Riyadh, Saudi Arabia, through Researchers Supporting Project number (RSP2023R184).

Author information

Authors and Affiliations

Authors

Contributions

Original draft: S.M.B. and M.U.J.; Supervision: N.J.; Conceptualization: N.J. and M.U.J.; Simulations: S.M.B. and N.J.; Revision: S.M.B., N.J. and A.A.; Proofreading: N.J., A.A. and M.J.; Funding: A.A.

Corresponding authors

Correspondence to Ahmad Almogren or Nadeem Javaid.

Ethics declarations

Ethical approval

Not applicable.

Competing interests

Authors declare no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Musa Baig, S., Javed, M.U., Almogren, A. et al. A blockchain and stacked machine learning approach for malicious nodes’ detection in internet of things. Peer-to-Peer Netw. Appl. 16, 2811–2832 (2023). https://doi.org/10.1007/s12083-023-01554-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s12083-023-01554-1

Keywords

Navigation