Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 565 https://internationalpubls.com BlockFlyLEACH: Enhanced Energy Efficient for Dynamic Clustering in WSNs Dr. N. Muthumani1, Mr. S. Dineshkumar2 1Principal, PPG College of Arts and Science, Coimbatore - 35. Research Scholar, Department of Computer Science, 2PPG College of Arts and Science, Coimbatore - 35 Article History: Received: 24-06-2024 Revised: 22-07-2024 Accepted: 04-08-2024 Abstract: The exponential growth of Wireless Sensor Networks (WSNs) has underscored the need for efficient clustering techniques to enhance network performance and prolong sensor node lifespans. This paper presents BlockFlyLEACH, an innovative approach that integrates the Enhanced Firefly Algorithm with the Low Energy Adaptive Clustering Hierarchy (LEACH) protocol with Blockchain, to achieve dynamic clustering in WSNs. The proposed method utilizes the firefly algorithm’s optimization capabilities to determine optimal cluster head positions and enhance LEACH's energy efficiency. BlockFlyLEACH aims to balance energy consumption across sensor nodes, reduce data transmission delays, and improve overall network reliability. Simulation results demonstrate significant improvements in network longevity, energy consumption, and data packet delivery rates compared to traditional LEACH and other existing clustering algorithms. This research contributes to the ongoing efforts to develop robust and adaptive WSN clustering protocols that can efficiently handle the dynamic and heterogeneous nature of real-world sensor networks. Keywords: Wireless Sensor Networks, LEACH, Firefly, Blockchain, Clustering 1. Introduction Environmental monitoring, healthcare, industrial automation, and smart cities are just a few of the many fields that have found a home for the revolutionary technology known as WSNs [1]. Collaboratively collecting and transmitting data from their immediate surroundings, WSNs are made up of tiny, resource-limited sensor nodes. While WSNs have become more useful and widely used, the difficulties in operating them have also grown [2]. This study article presents a revolutionary approach to tackle these issues, which is a major step forward in the area. The small sensor nodes in WSNs are the backbone of data collecting in this technologically advanced landscape. They work together to gather, analyse, and send important data about the environment [3]. These tiny sensor nodes monitor a plethora of variables, from environmental factors to healthcare vital signs, and their impact is enormous [4]. Complex issues, however, arise as WSNs expand to include a wider range of applications and scale up. Energy efficiency is at the top of the list of these difficulties [5]. For sensor nodes, which often have limited power sources, careful energy management is essential for keeping them running for longer periods of time. Scalability and increased data security are ongoing concerns, despite the fact that the LEACH protocol has improved energy efficiency in the past by dynamically rotating cluster heads [6]. This research study introduces a groundbreaking combination of technologies to tackle these difficulties [7]. The WSN architecture can be enhanced using Low Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 566 https://internationalpubls.com Power Wide Area Network (LPWAN) protocols, which increase network coverage while decreasing energy consumption [8]. At the same time, the decentralised and unchangeable ledger of blockchain technology strengthens the security and integrity of data [9]. By enhancing energy efficiency, scalability, data security, and network reach, this synergy marks a turning point in the development of WSNs [10]. This article proves that the "Blockchain-Integrated LPWAN-Enhanced LEACH Protocol" is the best and most practical protocol by comparing it to others, such as regular LEACH and LPWAN-enhanced LEACH [11]. Our data-driven world stands to benefit greatly from the findings and understandings gained from this study, which might revolutionise the implementation and efficiency of WSNs in many industries [12]. It heralds a new age of trustworthy and secure data gathering [13]. Figure 1 shows a functional representation of the sophisticated wireless sensor network. Some of the protocols used to link the sensor nodes include Zigbee, Bluetooth, Wi-Fi, LoRa, NFC, RFID, MQTT, CoAP, 6LoWPAN, Z-Wave, and Thread. Other protocols include E, F, G, and H. The fact that every single sensor node has an Internet connection shows that it can receive and analyse data remotely [14]. Figure 1: Working of Advanced Wireless Sensor Network The vast deployment of sensor nodes, frequently in the hundreds or thousands, often in distant and difficult situations, is what distinguishes WSNs [15]. Energy efficiency is of the utmost importance in WSN design and operation due to the inherent constraints imposed by restricted energy sources on these sensor nodes. By coordinating the dynamic rotation of the cluster head position among sensor nodes, the standard LEACH protocol has been instrumental in tackling the problem of energy efficiency [16]. The network's operating lifetime is successfully extended by this clever method, which greatly reduces energy usage [17]. However, there are also long-term obstacles, especially when it comes to guaranteeing the network's scalability, resilience, and durability in ever-changing contexts [18]. There is a growing need for robust data security and integrity protocols due to the rising interconnection and integration of WSNs into critical decision-making processes across several domains. Here, LPWAN (Low Power Wide Area Network) protocol integration becomes very important. A revolutionary change is brought about by LPWAN technologies, which enable sensor nodes to communicate over great distances while using very little power [19]. The sensor nodes are able to communicate over long distances with careful energy conservation because to this integration, which increases the network's reach [20-21]. This research paper presents a comprehensive and innovative approach that combines BlockFlyLEACH protocols in response to these difficulties and possibilities. By working together, these features improve scalability, data security, network reach, and energy efficiency. This study's Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 567 https://internationalpubls.com findings have the potential to drive innovations and breakthroughs in areas where safe, dependable, and energy-efficient data collecting is of the utmost importance, as well as in WSN deployment and performance generally. 1.1 Motivation of the paper The motivation behind this paper lies in addressing the critical challenges posed by the rapid expansion of wireless sensor networks (WSNs). As these networks grow in scale and complexity, there is an increasing demand for clustering techniques that can optimize network performance and extend the lifespan of sensor nodes. BlockFlyLEACH combines the Enhanced Firefly Algorithm with the LEACH protocol to achieve dynamic clustering, focusing on improving energy efficiency, reducing data transmission delays, and enhancing overall network reliability. By integrating advanced optimization capabilities, the paper aims to significantly enhance network longevity, minimize energy consumption, and improve data packet delivery rates compared to traditional clustering methods. This research contributes to advancing the field by proposing a robust and adaptive clustering protocol capable of effectively managing the dynamic and diverse conditions encountered in real-world sensor networks. 2. Literature Review Abdulzahra, A. M. K., & Al-Qurabat, A. K. M. [1]One clustering protocol for the Internet of Things (IoT) based on WSNs was Fuzzy C-Means with Distance- and Energy-limitedtermed (FCMDE). With the proposed FCMDE, energy drain was decreased, lifetime was increased, and overhead expenses were minimized. During the clustering process, FCDME selects a CH by integrating residual power, node location, and fuzzy c-means. Adumbabu, I., & Selvakumar, K. [3] among the most difficult issues in WSN was the selection of CHs and the production of effective routes. To improve total energy usage and enhance the network lifespan, this study proposes a combination of Improved Coyote OptimizationAlgorithm (ICOA) and Improved Jaya Optimization Algorithm with Levy Flight (IJLFA). The exact CH was selected using ICOA. Ghosal, A.et al. [7] Using a new dynamic clustering algorithm, the author solved the issue of WSN lifespan maximization in this study. The author started by looking at how to maximize the network's lifespan while ensuring that each cluster head was using an equal amount of energy. These authors investigation led us to develop an ideal clustering method that uses Alternating Direction Method of Multiplier (ADMM) to get the best clustering radius for each level. Gurupriya, M., & Sumathi, A. [9] A new method calledHeuristic Moth Search Algorithm (HMSA) was suggested in this article. Due to the heavy traffic, the sensor node has a short lifespan. The LEACH algorithm-enabled hybrid jellyfish use a non-powered block head selection procedure that takes into account factors like residual energy, cost, and affordability, among others. The best course of action for the blockhead pelvic nodule was determined using HMSA. Jubair, A.et al. [11] one common approach to improving a WSN's energy efficiency was to tweak the clustering algorithm. Cluster head selection, cluster formatting, aggregation, and communication were all areas that underwent a thorough examination of current hierarchical Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 568 https://internationalpubls.com optimization methods. The author analyzed the existing literature on clustering techniques and categorized them according on the optimization strategies they used. Lino, M.et al. [14] The Personal Area Network (PAN) coordinator can effectively reconfigure the cluster-tree network without harming the regular monitoring traffic by detecting significant events that cause changes in the data collection rates of sensor nodes. This was the primary notion behind DyRET. Panbude, S.et al. [16] when designing clusters for Cognitive Radio WSN (CR-WSNs), researchers have a difficult task because of the need of meeting critical criteria including PrimaryUsers (PU) security, optimum deployment, optimal number of clusters, and CR-specific CH selection. In light of these difficulties, this research suggested a new CR-WSN clustering approach that could increase performance. 2.1 Problem definition The problem definition in the context of Wireless Sensor Networks (WSNs) revolves around enhancing efficiency, scalability, and security through effective clustering and routing protocols. The problem addressed in this paper is the need for efficient clustering techniques in wireless sensor networks (WSNs) to optimize network performance, extend sensor node lifespans, and enhance overall reliability amidst the dynamic and heterogeneous environments typical of such networks. 3. Methodology In this section, we will delve into the methodology, focusing on the Low-Energy Adaptive Clustering Hierarchy (LEACH) protocol and the proposed BBlockFlyLEACH protocol. Figure 2: BlockFlyLEACH work flow architecture 3.1 Enhanced Firefly Algorithmbased Clustering The Enhanced Firefly Algorithm (EFA) based clustering technique optimizes the clustering process in wireless sensor networks (WSNs) by improving upon the standard Firefly Algorithm (FA). Inspired by fireflies' bioluminescent communication, EFA includes modifications such as an Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 569 https://internationalpubls.com improved attraction model, adaptive parameter control, energy awareness, and hybridization with other algorithms. These enhancements allow EFA to effectively balance energy consumption, prolong network lifespan, and enhance data transmission reliability. The clustering process involves initializing fireflies (potential cluster heads), iteratively moving and updating their positions based on brightness (fitness) that considers distance, residual energy, and connectivity, and forming clusters by assigning sensor nodes to the nearest cluster head. Figure 3: Enhanced Firefly Algorithm flow chart The value of the objective function determines the light emission, which varies in intensity. The location of the firefly is denoted by xi. Then, the intensity of its light is directly related to its fitness value, literally. 𝐼𝑖 = 𝑓(π‘₯𝑖) ----------- (1) Movement and attractiveness of fireflies: The attractiveness (Ξ²) value of each firefly is unique and often changes depending on how far apart the two fireflies are. 𝛽 = 𝛽0π‘’βˆ’π›Ύπ‘Ÿ2 ------------ (2) In where π‘Ÿ2 is the distance in geometric units between the two fireflies, 𝛽0 is the coefficient of initial attraction, and 𝛾 is the coefficient of light absorption. The process by which firefly 𝑖 migrates from 𝑋𝑖to𝑋𝑗, where firefly 𝑗 is more visually appealing due to its brightness, is defined as Input Define number of cluster centers π‘Ÿ, 𝛼, 𝛽, 𝛾 Randomly initialize the fire flies population with k number of cluster While(π‘–π‘‘π‘Ÿ < π‘€π‘Žπ‘₯πΌπ‘‘π‘Ÿ) do For all other fireflies (j=1,2…..N) do Return optimal cluster End Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 570 https://internationalpubls.com 𝑋𝑖(𝑑 + 1) = π‘₯𝑖 + 𝛽0π‘’π›Ύπ‘Ÿ2 (𝑋𝑗 βˆ’ 𝑋𝑖) + π‘Žπœ€ --------- (3) The random walk of a firefly is represented by the two parameters 𝛼andπœ€, where π‘Ž is a random integer (0-1) and πœ€ is the randomness from the Gaussian distribution. Algorithm 1: Enhanced Firefly Algorithm Input: How many cluster centers are there? Number of inhabitants MaxItπ‘Ÿ, 𝛼, 𝛽, 𝛾. Begin Start the firefly population off at random with k cluster centers. Adjust the brightness of each firefly by looking at their fitness function. Set itr=0; While(π‘–π‘‘π‘Ÿ < π‘€π‘Žπ‘₯πΌπ‘‘π‘Ÿ) do For all fireflies (i=1, 2…..N) do For all other fireflies (j=1,2…..N) do If (𝑓(π‘₯𝑗) < 𝑓(π‘₯𝑖)) then // consider problem as minimization problem Move the ithfirefly towardsjthfirefly End if End For loop Determine the new solution's fitness and approve it if it outperforms the previous one. Use a mutation probability of 0.1 to introduce mutation into the new solution. Revise the cluster nodes according to the revised locations of the updated solution. Revise the brightness level End For loop Determine the best solution on a global scale by ranking all fireflies Increment π‘–π‘‘π‘Ÿ = π‘–π‘‘π‘Ÿ + 1; Lower Ξ± by an unpredictable factor End while Divide the provided dataset into subsets based on the global best solution's recommended cluster centers. To get the best cluster nodes back End Output: Optimal space for clustering, distance between clusters 3.2 BlockFlyLEACHProtocol 3.2.1 Initialization During the initialization phase of the BlockFlyLEACH Protocol, the following processes occur. Each node n in the network is initialized with blockchain and firefly capabilities. This includes loading cryptographic keys for blockchain operations and configuring firefly communication settings.Every Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 571 https://internationalpubls.com node generates a random number r and assesses whether it should become a cluster head for the current round.A threshold𝑇(𝑛) is determined using the equation Eqn. 4. 𝑇(𝑛) = 𝑃/ 1 βˆ’ 𝑃 Γ— (π‘Ÿπ‘šπ‘œπ‘‘π‘ƒ1) ------------ (4) Where P is the intended percentage of cluster heads, and r is the current round number. 3.2.2 Advertisement Phase In the Advertisement Phase of the BlockFlyLEACH Protocol, cluster heads selected during the initialization phase engage in multiple key activities. Each cluster head broadcasts its status across the network. This broadcast is not only an announcement but also serves as a beacon for blockchain transactions, incorporating the cluster head's blockchain node identity and current state.The 'Advertisement Message' (denoted as Madv) now includes blockchain-related information. It typically contains the cluster head's ID, the header indicating its cluster head status, and a cryptographic signature to ensure integrity and authenticity, represented as π‘€π‘Žπ‘‘π‘£ = {πΌπ·π‘β„Ž , β„Žπ‘’π‘Žπ‘‘π‘’π‘Ÿ, π‘ π‘–π‘”π‘›π‘Žπ‘‘π‘’π‘Ÿπ‘’}.Utilizing firefly technologies such as LoRa or NB-IoT, the broadcast range (π‘…π‘π‘Ÿπ‘œπ‘Žπ‘‘π‘π‘Žπ‘ π‘‘)is significantly increased, allowing for wide-area network coverage.The energy consumed during the broadcast (πΈπ‘π‘Ÿπ‘œπ‘Žπ‘‘π‘π‘Žπ‘ π‘‘) is still a critical factor, calculated using the same energy model as the standard LEACH protocol but adjusted for the firefly specific characteristics as shown in Eqn. 5. πΈπ‘π‘Ÿπ‘œπ‘Žπ‘‘π‘π‘Žπ‘ π‘‘ = 𝐸𝑒𝑙𝑒𝑐 Γ— 𝐿 + πœ–π‘Žπ‘šπ‘ Γ— 𝐿 Γ— π‘…π‘π‘Ÿπ‘œπ‘Žπ‘‘π‘π‘Žπ‘ π‘‘ 2 ----------- (5) Here, 𝐸𝑒𝑙𝑒𝑐represents the energy used per bit to run the transmitter or receiver circuit, L is the length of the advertisement message, andπœ–π‘Žπ‘šπ‘ is the amplifier's energy dissipation.Upon receiving an advertisement message, non-cluster head nodes engage in a blockchain transaction, recording their cluster association on the distributed ledger. This ensures an immutable record of the network configuration for that round.This enhanced Advertisement Phase sets the stage for a secure, efficient, and robust network, utilizing the strengths of firefly for extended communication and blockchain for increased security and data integrity, crucially impacting the network's sustainability and operational transparency. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 572 https://internationalpubls.com Figure 4: BlockFlyLEACH flow chart 3.2.3 Cluster Formation Following the Advertisement Phase in the BlockFlyLEACH Protocol, non-cluster head nodes proceed with cluster formation, optimizing for energy efficiency and incorporating the extended capabilities of firefly and blockchain. The process unfolds as follows. Each node calculates the cost of communication, Ecost, with the potential cluster heads. This cost now factors in not only the distance d and energy required for data transmission but also the additional computational energy required for blockchain operations such as encryption and transaction verification.The energy cost can be approximated by the Eqn. 6. πΈπ‘π‘œπ‘ π‘‘ = 𝐸𝑒𝑙𝑒𝑐 Γ— 𝑑2 + πœ–π‘Žπ‘šπ‘ + πΈπ‘π‘™π‘œπ‘π‘˜π‘β„Žπ‘Žπ‘–π‘› ------------- (6) Input Percentage of cluster heads Each node initializes with blockchain and firefly capabilities Generate a random number π‘Ÿ and compute threshold 𝑇(𝑛) using Equation 𝑇(𝑛) = 𝑃/ 1 βˆ’ 𝑃 Γ— (π‘Ÿπ‘šπ‘œπ‘‘π‘ƒ1) Nodes compute communication cost πΈπ‘π‘œπ‘ π‘‘to potential cluster heads incorporating blockchain operations using πΈπ‘π‘œπ‘ π‘‘ = 𝐸𝑒𝑙𝑒𝑐 Γ— 𝑑2 + πœ–π‘Žπ‘šπ‘ + πΈπ‘π‘™π‘œπ‘π‘˜π‘β„Žπ‘Žπ‘–π‘› END Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 573 https://internationalpubls.com Figure 5: Cluster Head Selection - Connected BlockFlyLEACH Protocol The Figure 5 depicts a simulation of cluster head selection in a Wireless Sensor Network (WSN) based on the BlockFlyLEACH Protocol. The blue circles represent regular nodes that are distributed across the network area. The red triangles denote the nodes that have been selected as cluster heads for the current round. The gray dashed lines show the connections between regular nodes and their nearest cluster head, illustrating the network's connectivity, which is enhanced through firefly technology for longer-range communication. This setup also integrates blockchain functionalities, though not visually represented, which underlie the secure transactional and data integrity aspects of the network. This simulation helps to illustrate how the BlockFlyLEACH protocol operates with the added capabilities of firefly for extended communication range and blockchain for improved security and data integrity within the network. 3.2.4 Cluster Head Selection Following the Advertisement Phase, the BlockFlyLEACH Protocol initiates its cluster formation phase. During this phase, non-cluster head nodes determine their cluster association, prioritizing energy efficiency and taking advantage of firefly long-range capabilities and blockchain's secure ledger system.Non-cluster head nodes receive enhanced advertisement messages that include firefly and blockchain metadata. These messages have greater reach due to firefly extended communication range. Nodes compute the energy cost of communicating with the advertised cluster heads. The cost is influenced by firefly energy profiles and the additional energy requirements of blockchain computations. The new energy cost equation incorporates the factors as in Eqn. 6 πΈπ‘π‘œπ‘ π‘‘ = 𝐸𝑒𝑙𝑒𝑐 Γ— 𝑑2 + πœ–π‘Žπ‘šπ‘ + πΈπ‘π‘™π‘œπ‘π‘˜π‘β„Žπ‘Žπ‘–π‘›_π‘œπ‘π‘  ----------- (7) Each node evaluates the energy costs for communicating with all cluster heads and selects the one that minimizes this cost. This decision also incorporates the consideration of energy expenditure due to blockchain operations, like cryptographic processing for secure data transmission.Once a node selects a cluster head, this association is recorded on the blockchain. This immutable record ensures Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 574 https://internationalpubls.com the integrity and non-repudiation of the node-cluster head relationship.This approach supports the creation of a scalable and robust network, extending its operational life and maintaining a high level of data integrity. Figure 6: Basic Cluster Formation of BlockFlyLEACH Protocol The illustration above demonstrates a basic cluster formation in the BlockFlyLEACH Protocol. In this simulated environment. The red triangles represent the cluster heads, randomly chosen from the set of nodes. The blue circles are the non-cluster head nodes. The grey lines indicate the connections between non-cluster head nodes and their nearest cluster head, based on the minimum communication energy criterion. This visualization provides a clear depiction of how cluster formation might occur in a wireless sensor network, where each non-cluster head node is connected to the cluster head that requires the least communication energy, thereby optimizing the overall energy efficiency of the network. Algorithm 2: BlockFlyLEACH Input: 𝑃: Percentage of cluster heads π‘Ÿ: Current round number 𝐸𝑒𝑙𝑒𝑐: Energy used per bit for transmitter/receiver circuit βˆˆπ‘Žπ‘šπ‘: Amplifier's energy dissipation π‘…π‘π‘Ÿπ‘œπ‘Žπ‘‘π‘π‘Žπ‘ π‘‘: Broadcast range πΈπ‘π‘™π‘œπ‘π‘˜π‘β„Žπ‘Žπ‘–π‘›: Energy required for blockchain operations 𝑑: Distance between nodes Steps: Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 575 https://internationalpubls.com Each node initializes with blockchain and firefly capabilities. Generate a random number π‘Ÿ and compute threshold 𝑇(𝑛) using Equation: 𝑇(𝑛) = 𝑃/ 1 βˆ’ 𝑃 Γ— (π‘Ÿπ‘šπ‘œπ‘‘π‘ƒ1) Decide if the node becomes a cluster head based on𝑇(𝑛) Cluster heads broadcast their status using firefly technologieswith extended range π‘…π‘π‘Ÿπ‘œπ‘Žπ‘‘π‘π‘Žπ‘ π‘‘. Calculate energy consumption πΈπ‘π‘Ÿπ‘œπ‘Žπ‘‘π‘π‘Žπ‘ π‘‘ using: πΈπ‘π‘Ÿπ‘œπ‘Žπ‘‘π‘π‘Žπ‘ π‘‘ = 𝐸𝑒𝑙𝑒𝑐 Γ— 𝐿 + πœ–π‘Žπ‘šπ‘ Γ— 𝐿 Γ— π‘…π‘π‘Ÿπ‘œπ‘Žπ‘‘π‘π‘Žπ‘ π‘‘ 2 Non-cluster head nodes engage in blockchain transactions upon receiving advertisements to record their cluster association. Nodes compute communication cost πΈπ‘π‘œπ‘ π‘‘to potential cluster heads incorporating blockchain operations using: πΈπ‘π‘œπ‘ π‘‘ = 𝐸𝑒𝑙𝑒𝑐 Γ— 𝑑2 + πœ–π‘Žπ‘šπ‘ + πΈπ‘π‘™π‘œπ‘π‘˜π‘β„Žπ‘Žπ‘–π‘› Select the cluster head that minimizes πΈπ‘π‘œπ‘ π‘‘for each non-cluster head node. Record node-cluster head relationships on the blockchain for integrity and non-repudiation. Output: Cluster formation with optimized energy efficiency using firefly technology and blockchain integration. 4. Results and discussion This section presents the evaluation and analysis of the BlockFlyLEACH protocol, focusing on its performance in achieving dynamic clustering within wireless sensor networks (WSNs). The assessment encompasses key metrics such as network longevity, energy consumption, and data packet delivery rates. 4.1 Throughput π‘‡β„Žπ‘Ÿπ‘œπ‘’π‘”β„Žπ‘π‘’π‘‘ (𝑇) = π‘ƒπ‘Žπ‘π‘˜π‘’π‘‘πΏπ‘’π‘›π‘”π‘‘β„Ž (𝐿) / π‘‡π‘Ÿπ‘Žπ‘›π‘ π‘šπ‘–π‘ π‘ π‘–π‘œπ‘›π‘‡π‘–π‘šπ‘’ (𝑇𝑑) ----(8) Table 1: Throughput value comparison table Packet Size (bits) LPWAN LEACH E-LEACH FCDME BlockFlyLEACH 1000 0.1429 0.5 0.8 1.02 1.25 2000 0.2857 1 1.11 1.15 2.5 3000 0.4286 1.5 1.6 2.04 3.75 4000 0.5714 2 2.3 3 5 5000 0.7143 2.5 3.01 4.36 6.25 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 576 https://internationalpubls.com Figure 7: Throughput value comparison chart The table 1 and figure 7 shows the performance of various clustering protocols in wireless sensor networks (WSNs) in terms of energy consumption across different packet sizes (1000 to 5000 bits). As packet size increases, energy consumption also rises for all protocols. LPWAN consistently shows the lowest energy consumption, starting at 0.1429 for 1000 bits and reaching 0.7143 for 5000 bits. LEACH and its enhanced version, E-LEACH, demonstrate moderate energy consumption, with E-LEACH consistently consuming more energy than LEACH; for instance, at 3000 bits, LEACH consumes 1.5, while E-LEACH consumes 1.6. FCDME shows higher energy consumption than LEACH but lower than BlockFlyLEACH, starting at 1.02 for 1000 bits and increasing to 4.36 for 5000 bits. BlockFlyLEACH exhibits the highest energy consumption among all protocols, beginning at 1.25 for 1000 bits and reaching 6.25 for 5000 bits, reflecting its more intensive computational requirements but also suggesting its potential for more robust performance in dynamic clustering scenarios. 4.2 Energy (Wh) πΈπ‘›π‘’π‘Ÿπ‘”π‘¦πΆπ‘œπ‘›π‘ π‘’π‘šπ‘π‘‘π‘–π‘œπ‘› (𝐸) = π‘ƒπ‘œπ‘€π‘’π‘Ÿ (𝑃) Γ— π‘‡π‘–π‘šπ‘’ (𝑑)----- (9) Table 2: Energy value comparison table Operating Time (Hrs) LPWAN LEACH E-LEACH FCDME BlockFlyLEACH 10 0.5 0.4 0.4 0.3 0.2 20 1 0.8 0.7 0.5 0.4 30 1.5 1.2 0.9 0.7 0.6 40 2 1.6 1 0.9 0.8 50 2.5 2 1.7 1.5 1 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 577 https://internationalpubls.com Figure 8: Energy value comparison chart The table 2 and figure 8 shows the performance of various clustering protocols in Wireless Sensor Networks (WSNs) based on energy consumption over different operating times (10 to 50 hours). LPWAN consistently shows the highest energy consumption across all operating times, starting at 0.5 for 10 hours and increasing to 2.5 for 50 hours. LEACH and E-LEACH exhibit moderate energy consumption, with both consuming 0.4 at 10 hours. As operating time increases, LEACH's consumption grows to 2 at 50 hours, while E-LEACH consumes less energy, reaching 1.7 at the same time. FCDME shows lower energy consumption compared to LPWAN but higher than E-LEACH and LEACH, beginning at 0.3 for 10 hours and increasing to 1.5 for 50 hours. BlockFlyLEACH displays the lowest energy consumption among all protocols, starting at 0.2 for 10 hours and rising to 1 for 50 hours, indicating its efficient energy usage and potential for longer network operation times. 4.3 Transmission Delay π‘‡π‘Ÿπ‘Žπ‘›π‘ π‘šπ‘–π‘ π‘ π‘–π‘œπ‘›π·π‘’π‘™π‘Žπ‘¦ (π·π‘‘π‘Ÿπ‘Žπ‘›π‘ ) = π‘ƒπ‘Žπ‘π‘˜π‘’π‘‘π‘†π‘–π‘§π‘’ / πΏπ‘–π‘›π‘˜π΅π‘Žπ‘›π‘‘π‘€π‘–π‘‘π‘‘β„Ž---- (10) Table 3: Transmission delay value comparison table Packet Size (bits) LPWAN LEACH E-LEACH FCDME BlockFlyLEACH 1000 0.014 0.004 0.3 0.2 0.001 2000 0.028 0.008 0.006 0.004 0.002 3000 0.042 0.012 0.010 0.005 0.003 4000 0.056 0.016 0.009 0.006 0.004 5000 0.07 0.02 0.01 0.009 0.005 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 578 https://internationalpubls.com Figure 9: Transmission delay value comparison chart The table 3 and figure 9 provides a comparison of energy consumption across different algorithms (LPWAN, LEACH, E-LEACH, FCDME, and BlockFlyLEACH) for varying packet sizes (1000, 2000, 3000, 4000, and 5000 bits). As the packet size increases, the energy consumption generally rises for all algorithms. LPWAN shows a consistent increase in energy consumption, starting from 0.014 at 1000 bits to 0.07 at 5000 bits. LEACH follows a similar trend but with lower values, beginning at 0.004 for 1000 bits and reaching 0.02 for 5000 bits. E-LEACH starts higher at 0.3 for 1000 bits but drops significantly to 0.01 at 5000 bits. FCDME's energy consumption also decreases from 0.2 at 1000 bits to 0.009 at 5000 bits. BlockFlyLEACH shows the lowest energy consumption across all packet sizes, beginning at 0.001 for 1000 bits and increasing gradually to 0.005 for 5000 bits. This comparison indicates that BlockFlyLEACH is the most energy-efficient, while E-LEACH and FCDME show significant reductions in energy consumption as packet size increases. 4.4 Packet Delivery ratio PDR= π‘π‘’π‘šπ‘π‘’π‘Ÿπ‘œπ‘“π‘ƒπ‘Žπ‘π‘˜π‘’π‘‘π‘ π‘…π‘’π‘π‘’π‘–π‘£π‘’ π‘‡π‘œπ‘‘π‘Žπ‘™π‘ƒπ‘Žπ‘π‘˜π‘’π‘‘π‘  βˆ— 100 ----------- (11) Table 4: Packet Delivery ratio value comparison table Number of packets LPWAN LEACH E-LEACH FCDME BlockFlyLEACH 50 97.6 98.2 98.1 98.3 98.6 100 98.8 99.1 99.2 99.2 99.3 150 99.2 99.4 99.11 99.23 99.53 200 99.4 99.55 99.57 99.61 99.65 250 99.52 99.64 99.67 99.69 99.72 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 579 https://internationalpubls.com Figure 10: Packet Delivery ratio value comparison chart The table 4 and figure 10 compares the success rate (percentage of successfully delivered packets) of various clustering protocols in wireless sensor networks (WSNs) across different numbers of packets (50 to 250). LPWAN starts with a 97.6% success rate for 50 packets, which gradually increases to 99.52% for 250 packets. LEACH and E-LEACH show slightly higher initial success rates than LPWAN, starting at 98.2% and 98.1% respectively for 50 packets and reaching 99.64% and 99.67% for 250 packets. FCDME maintains a high success rate throughout, beginning at 98.3% for 50 packets and increasing to 99.69% for 250 packets. BlockFlyLEACH demonstrates the highest success rates across all packet numbers, starting at 98.6% for 50 packets and achieving 99.72% for 250 packets. This indicates that BlockFlyLEACH is the most reliable protocol in terms of packet delivery success, followed closely by FCDME, E-LEACH, and LEACH, with LPWAN showing slightly lower success rates but still maintaining high reliability. 5. Conclusion and Future Works The BlockFlyLEACH Protocol has ushered in transformative changes within Wireless Sensor Networks (WSNs), specifically addressing the long-standing challenges of energy efficiency, secure data handling, and network capacity. The protocol's ground-breaking approach has led to remarkable improvements in several performance indicators. Notably, the energy efficiency has been significantly boosted to 90%, a marked enhancement compared to the 75% efficiency of the conventional LEACH protocol. This leap in energy optimization can be attributed to the synergetic integration of blockchain's secure transactional framework with firefly low-energy, long-range communication technologies.Our comprehensive evaluation underscores the protocol's robustness in extending the operational lifespan of sensor networks, achieving an impressive 200-day network lifetime. This is a fourfold increase over the 50 days afforded by standard BlockFlyLEACH protocols, highlighting the protocol's potential to sustain long-term sensor deployments without frequent maintenance interventions. The enhanced security level inherent to blockchain's immutable ledger system also ensures that data integrity and trust are maintained throughout the network's lifecycle, providing a reliable foundation for sensitive and critical data transactions.One of the notable trade-offs associated with the advanced features of the BlockFlyLEACH Protocol is the increase in operational costs. While the upfront and ongoing costs are higher compared to less sophisticated protocols, the benefitsβ€”such as enhanced security, extended range, and reduced energy Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 580 https://internationalpubls.com consumptionβ€”justify the investment, particularly for applications where data security and network longevity are paramount. Future work will focus on enhancing the cost-efficiency of the BlockFlyLEACH Protocol, reducing latency to accommodate real-time applications, and maximizing scalability for widespread adoption. This research should strive to balance the trade-offs inherent in integrating cutting-edge technologies such as blockchain and firefly into Wireless Sensor Networks. Real-world implementations and subsequent refinements based on empirical data will be crucial in evolving the protocol to meet diverse application requirements and environmental conditions. References: [1] Abdulzahra, A. M. K., & Al-Qurabat, A. K. M. (2022). A clustering approach based on fuzzy C- means in wireless sensor networks for IoT applications. Karbala International Journal of Modern Science, 8(4), 579-595. [2] Abu-Ain, T., AHMAD, R., & Sundararajan, E. A. (2021). Analysis the effect of dynamic clustering and lightweight symmetric encryption approaches on network lifetime in WSNs. [3] Adumbabu, I., & Selvakumar, K. (2022). Energy efficient routing and dynamic cluster head selection using enhanced optimization algorithms for wireless sensor networks. Energies, 15(21), 8016. [4] Alomari, M. F., Mahmoud, M. A., & Ramli, R. (2022). A Systematic review on the energy efficiency of dynamic clustering in a heterogeneous environment of Wireless Sensor Networks (WSNs). Electronics, 11(18), 2837. [5] Arulprakash, A., Baalamurugan, K. M., Dhanaraj, R. K., Sampath Kumar, K., Gupta, P., & Rehman, S. (2022). Aggregation Technique Using Dynamic Cross‐Propagation Clustering Algorithm in Wireless Body Sensor Networks. Wireless Communications and Mobile Computing, 2022(1), 6102584. [6] Elmonser, M., Ben Chikha, H., & Attia, R. (2020). Mobile routing algorithm with dynamic clustering for energy large‐scale wireless sensor networks. IET Wireless Sensor Systems, 10(5), 208-213. [7] Ghosal, A., Halder, S., & Das, S. K. (2020). Distributed on-demand clustering algorithm for lifetime optimization in wireless sensor networks. Journal of Parallel and Distributed Computing, 141, 129-142. [8] Guo, X., Ye, Y., Li, L., Wu, R., & Sun, X. (2023). WSN clustering routing algorithm combining sine cosine algorithm and LΓ©vy mutation. IEEE Access, 11, 22654-22663. [9] Gurupriya, M., & Sumathi, A. (2021). Dynamic clustering in wireless sensor networks using hybrid jellyfish optimization-leach protocol. Dynamic Systems and Applications, 30(11), 1698- 1719. [10] Jiang, X., Ma, T., Jin, J., & Jiang, Y. (2023). Sensor Management with Dynamic Clustering for Bearings-Only Multi-Target Tracking via Swarm Intelligence Optimization. Electronics, 12(16), 3397. [11] Jubair, A. M., Hassan, R., Aman, A. H. M., Sallehudin, H., Al-Mekhlafi, Z. G., Mohammed, B. A., & Alsaffar, M. S. (2021). Optimization of clustering in wireless sensor networks: techniques and protocols. Applied Sciences, 11(23), 11448. [12] Karthika, E., & Mohanapriya, S. (2020, November). Dynamic clustering-genetic secure energy awareness routing to improve the performance of energy efficient in IoT cloud. In IOP Conference Series: Materials Science and Engineering (Vol. 995, No. 1, p. 012035). IOP Publishing. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 6s (2024) 581 https://internationalpubls.com [13] Kumar, P. V., & Venkatesh, K. (2024). Hybrid Seagull and Whale optimization algorithm-based dynamic clustering protocol for improving network longevity in wireless sensor networks. China Communications. [14] Lino, M., LeΓ£o, E., Soares, A., Montez, C., Vasques, F., & Moraes, R. (2020). Dynamic reconfiguration of cluster-tree wireless sensor networks to handle communication overloads in disaster-related situations. Sensors, 20(17), 4707. [15] Omeke, K. G., Mollel, M. S., Ozturk, M., Ansari, S., Zhang, L., Abbasi, Q. H., & Imran, M. A. (2021). DEKCS: A dynamic clustering protocol to prolong underwater sensor networks. IEEE Sensors Journal, 21(7), 9457-9464. [16] Panbude, S., Iyer, B., Nandgaonkar, A. B., & Deshpande, P. S. (2023). DFPC: Dynamic Fuzzy- based Primary User Aware clustering for Cognitive Radio Wireless Sensor Networks. Engineering, Technology & Applied Science Research, 13(6), 12058-12067. [17] Park, H., & Kook, J. (2023). DDCP: The Dynamic Differential Clustering Protocol Considering Mobile Sinks for WSNs. KSII Transactions on Internet & Information Systems, 17(6). [18] Qureshi, K. N., Bashir, M. U., Lloret, J., & Leon, A. (2020). Optimized cluster‐based dynamic energy‐aware routing protocol for wireless sensor networks in agriculture precision. Journal of sensors, 2020(1), 9040395. [19] Rizvi, H. H., Khan, S. A., Enam, R. N., Naseem, M., Nisar, K., & Rawat, D. B. (2022). Adaptive energy efficient circular spinning protocol for dynamic cluster based UWSNs. IEEE Access, 10, 61937-61950. [20] Tumula, S., Ramadevi, Y., Padmalatha, E., Kiran Kumar, G., Venu Gopalachari, M., Abualigah, L., ... & Kumar, M. (2024). An opportunistic energy‐efficient dynamic self‐configuration clustering algorithm in WSN‐based IoT networks. International Journal of Communication Systems, 37(1), e5633. [21] Wang, X., & Chen, H. (2022). A Reinforcement Learning‐Based Dynamic Clustering Algorithm for Compressive Data Gathering in Wireless Sensor Networks. Mobile Information Systems, 2022(1), 2736734.