## 5 Energy Optimization Approach Based on MAC/Routing Cross-Layer (EOAMRCL)
### Clusters Formation Phase (Network Layer)
By leveraging the GWO algorithm for optimal cluster head selection, we ensure that the chosen CHs are not only energy-rich but also strategically positioned to minimize intra-cluster and inter-cluster communication distances. This reduces the energy required for data transmission within clusters and from CHs to the base station. The MAC layer uses this clustering information to schedule sleep and active periods, further conserving energy by reducing idle listening. The routing protocol then utilizes the cluster structure to establish efficient routes, ensuring data are transmitted through the most energy-efficient paths. This synergy between clustering and routing, enabled by cross-layer design, significantly enhances the network's energy efficiency and performance. Figure 7: Cross-layer transmission phase. ## 6 Simulation Results

In this section, we compare the efficiency of EOAMRCL to peer protocols: EEUC [45], DWEHC [46], and CGA-GWO [35]. Additionally, we provide a comparison of GWO with other optimization techniques in the context of WSN clustering implementations. In order to perform simulation, we created many network configurations with hundreds of randomly placed sensor nodes. Each result represents the average of twenty separate simulations. ### Simulation Tools and Environment

The simulations were conducted on a high-performance computing system equipped with an Intel Core i7 processor, 16 GB RAM, and a Windows 10 operating system. MATLAB was utilized as the primary simulation environment for the development, implementation, and testing of our proposed EOAMRCL protocol. This environment provided the necessary flexibility for algorithm development and performance analysis. We executed MATLAB scripts to simulate various network scenarios, implement the EOAMRCL protocol, and collect performance metrics. This comprehensive setup ensured a robust and accurate simulation of our proposed protocol. ### Radio Energy Model

In the simulation section, we employed the same first-order radio model for energy consumption presented in [47]. In this concept, a radio transmits L-bit data to a receiver situated a distance of \(d\) meters from it by dissipating an amount of energy \(E_{TX}(L,d)\). A sensor node's radio has to use \(E_{RX}(L)\) energy in order to receive an L-bit message. The multi-path (\(\varepsilon_{fs}\)) channel is utilized in short-distance transmission; the free space (\(\varepsilon_{mp}\)) channel is used when the distance between two nodes or between a node and the SB is higher than a certain distance \(d_{0}\). Radios can use the least amount of energy required to reach their intended receivers. To prevent unwanted transmissions, the radios have the capability to be switched into sleep mode. Equation (10) presents the amount of energy needed to transmit a packet of \(L\) bits across a distance d [47]:

\[E_{TX}=\left\{ \begin{aligned} & L*E_{\text{elec}}(L,d)+L* \varepsilon_{fs}*d^{2},\,d<d_{0}\\ & L*E_{\text{elec}}(L,d)+L*\varepsilon_{mp}*d^{4},\,d\geq d_{0} \end{aligned} \right., \tag{10}\]

where the following is true:

* \(E_{TX}\) represents the energy expended by the transmitter across a \(d\)-meter distance in order to send a packet of L bits;
* \(\text{E}_{\text{elec}}(\text{L},\text{d})\) is the energy needed to transfer a single bit over \(d\) meters, both ways. * L is the transmission packet's size. The distance at which the amplification factors begin to shift is known as \(d_{0}\): \[d_{0}=\sqrt{\frac{\varepsilon_{fs}}{\varepsilon_{mp}}}\] (11)

For the receiver to receive a packet of \(L\) bits, energy \(E_{RX}(L)\) must be consumed as follows:

\[E_{RX}(L)=L*E_{\text{elec}} \tag{12}\]

### Simulation Parameters

The selection of simulation parameters in Table 4 aims to create a realistic and comprehensive environment for evaluating the clustering protocols.