1 Background

Population growth leads to many health diseases such as cancer, asthma, cardiovascular diseases, and various other chronic fatal diseases due to which millions of people loose lives [1]. The patients may be cured if the disease can be detected at the right time. Therefore, wireless body area networks (WBAN) are required for the continuous monitoring of the body. It is helping to improve the quality of life by not keeping patients limited to bed. WBAN is a collection of sensors on a person’s body, and a wireless channel is used to create a wireless communication connecting these sensors together. These nodes are miniaturized and observe different physiological parameters and send them to node place on-body or off-body called sink node. Further, this sink sums up the collected data and then sends it for further assessment and diagnosis. All the tiny sensor nodes have very little energy resources, so energy-efficient routing of data in WBAN is one of the important concerns. In WBAN, routing protocols have been categorized such as mobility-aware, thermal-aware, link-aware, and distance-aware from the perspective of energy, and many more [2,3,4]. Long-term sustainability of sensor devices is considered a major problem for the effective implementation of WBAN technology. The continuous monitoring of health information using the sensors deployed on the human body leads to cutback the energy of sensors which is the biggest obstacle in the communications between sensors and personal device (PD). To deal with energy efficiency in WBAN, it can be clearly understood from the literature that one of the important mechanisms is selecting the relay node (which is the intermediate node). The problem of relay node selection can be modeled as an optimization problem.

In the current era, many researchers have explored the usage of various nature-inspired metaheuristic algorithms for solving various optimization problems. Some of the work for solving the relay node selection problem using metaheuristic can be summarized as follows: Wu et al. [5] have applied PSO to selection of the relay node for minimization of energy consumption. Genetic ant colony [6], artificial bee colony [7], hybrid PSO-GA [8], PSOBAN [9], and OCER [10] have been currently explored to solve WBAN-based problems. Dhadwal et al. [11] utilized a hybrid genetic algorithm (GA) technique combined with PSO to increase the search proficiency and select the best route out of many possible routes. Ravi et al. [12] proposed GA for optimizing the trust features for body sensors. Ali et al. [13] proposed a routing technique based on bees’ algorithm to deal with energy consumption and reduce transmission time by finding the shortest path for data transmission. Kanchan and Shetty [14] proposed quantum PSO for energy utilization and network stability. Roopali [15] proposed a GA-based routing mechanism for relay selection, which is both energy-efficient and stable. Singh and Satvir [16] proposed an energy-efficient bee clustering protocol using an artificial bee colony to detect optimal cluster head and enhance energy efficiency. Mittal [17] proposed a moth flame optimization-based energy-aware routing protocol for enhancing network’s stability period. Recently, various nature-inspired metaheuristic approaches have been proposed, such as the coyote optimization algorithm [18], Black Widow Optimization Algorithm [19], New Ant Colony Optimization Algorithm [20], hybrid PSO-GA [21], and Harris hawks optimization [22]. The benefits of the proposed algorithms can be clearly seen in [23,24,25]. A comparative analysis of some of the existing techniques is shown in Table 1.

Table 1 Comparative analysis of some of the existing techniques

It can be gauged from the literature that most of the work for selecting the relay node has been using metaheuristic algorithms that have been done using traditional algorithms. Very few authors have reported the work using the latest algorithms. In this context, this paper aims to present a rigorous comparison of the three most modern metaheuristic algorithms wiz. grey wolf optimization (GWO), ant lion optimization (ALO), and PSO for selecting the relay node to aid energy efficiency for routing the data in WBAN.

As per no free lunch theorem, no algorithm is suited to solve every kind of optimization problem. Therefore, there is always a scope of improvement in the performance. This study lays down the base to model relay node selection as an optimization problem and compare the performance of three latest algorithms. This study implements GWO to solve the relay node selection problem which has not been performed yet, to the best of author’s knowledge, and compare the performance with ALO and PSO.

2 Methods

The fundamentals and algorithms for the three optimization techniques can be found in GWO [30], ALO [31], and PSO [26].

2.1 The proposed work

Energy usage and network longevity are the main two considerable challenges in WBAN as the batteries of sensor nodes, which are deployed on the human body, have to be recharged and replaced after some time. Also, the significant contemplation in WBAN is energy conservation. The deployed sensor node requires a sensible use of energy sources for the enhanced network period. All sensor nodes are transmitting information via the forwarder node to the sink. Sensor nodes select a route that has the least distance to the sink node and consumes less energy. The proposed work focused on finding the optimal route for transmitting the data.

The LEACH energy model has been used to calculate the energy LEACH [32, 33]. For the selection of optimal path, use different optimization algorithms PSO, GWO, and ALO. The proposed energy-aware routing protocol reduces the total network installation cost and the energy consumed by the whole network and sensors. The proposed algorithm will work as follows:

Input: Sensor nodes, a sink node, distance from each sensor node to sink node, distance from each sensor node to neighboring nodes, the initial energy of each sensor node, weights w1 and w2.

Output: Maximize the network lifetime and less energy consumption through the best optimal routing.

Step 1: Distance of each sensor node from the sink (dists, sink) is calculated using Eq. (1):

$$ {\mathrm{dist}}_{s,\mathrm{sink}}=\sqrt{{\left({x}_s-{x}_{\mathrm{sink}}\right)}^2+{\left({y}_s-{y}_{\mathrm{sink}}\right)}^2} $$
(1)

where xs is the source node and ys is the target node; xsink and ysink are coordinates of the sink nodes.

Step 2: Neighbor selection for communication between sensor and sink node using Eq. (2):

$$ {s}_i=\mathrm{select}\left(\mathrm{neighbours}\right) $$
(2)

Step 3: Distance from each sensor node to the neighbor node (dists, n) is calculated using Eq. (3):

$$ {\mathrm{dist}}_{s,n}=\sqrt{{\left({x}_s-{x}_n\right)}^2+{\left({y}_s-{y}_n\right)}^2} $$
(3)

where xn and yn are neighbor nodes.

Step 4: Evaluate the fitness value for all optimization algorithms by using Eq. (4):

$$ {\displaystyle \begin{array}{l}{\mathrm{fit}}_{\mathrm{func}}={w}_1\cdot {\sum}_{i=0}^n\frac{\mathrm{dist}\left(\mathrm{current}\kern0.17em \mathrm{node},\mathrm{neighbor}\kern0.17em \mathrm{of}\;i\right)}{n}+{w}_2\cdot {\sum}_{i=0}^n\frac{En\left( neighbor\kern0.17em of\;i\right)}{E\left(\mathrm{current}\kern0.17em \mathrm{node}\right)}\kern2.16em \\ {}+\left(1-{w}_1-{w}_2\right)\cdot \frac{1}{\mathrm{no}.\mathrm{of}\kern0.17em \mathrm{node}\mathrm{s}\kern0.17em \mathrm{covered}\;\mathrm{by}\;\mathrm{current}\kern0.17em \mathrm{node}}\end{array}} $$
(4)

where E(current node) and En(neighbor of i) represent the energy of the source node and neighbor node, respectively; w1 and w2 are weights of the sensor node and relay node (forwarder node) for each optimization, respectively.

Step 5: Update all the values after each iteration.

Step 6: Repeat step 4 until the maximum iterations reach.

Step 7: Compare the result of all the three optimization algorithms and find the best one.

Step 8: End.

The main goal of the proposed work is to minimize energy consumption, the route selection for transmitting the data from source to sink node. This proposed work has tried to observe using optimization in the w1and w2 that are two weights and the importance of distance and energy. The leftover energy of a node is calculated by subtracting the total energy consumed from the initial energy of that particular node. Following assumptions for the selection of optimal path, use different optimization algorithms PSO, ALO, and GWO.

PSO

  • Using PSO, the forwarder node for routing has been selected based on the criteria which have the maximum energy and least distance to the source as compared to the other nodes in the network.

  • Route find from the source to the next neighbor is the P_best and route from the source to the sink is the G_best.

ALO

  • In ALO-based routing source node (ant lion), choose the path for transmitting the data in such a way that minimizes the cost of energy consumption and selects the next neighbor with minimum distance to the sink.

GWO

  • In GWO-based routing, it considers that the forwarder node that is represented by m is the routing search agent (wolves).

  • To impersonate the wolves’ position in GWO, as the nodes are static, it is not feasible to change the position. \( \overrightarrow{FN} \) represents the position in the 2-dimensional space that represents the position of the nodes, by taking the closest node to the best position (α location).

Fitness of all these three optimization algorithms has been calculated using Eq. (4) for each iteration, and finally, fitness values are compared to all these optimization algorithms, and the best optimized routing algorithm is found.

2.2 Methodology

2.2.1 The designed model

The IEEE 802.15.6 WBAN technology has emerged as a sub-category of wireless sensor network technology for a variety of applications such as patient monitoring system, sleep staging, diagnosis-treatment system, and control of sensors. In this paper, WBAN healthcare architecture can split into three levels as follows:

Level 1

Intra-WBAN communication: Level 1 describes the network connection between the nodes and their particular communication within the range of 2 m in and around the human body. In this level, the data is forwarded to a personal device by sensor nodes. The details of the various level in the proposed work are shown in Fig. 1.

Fig. 1
figure 1

Proposed architecture for WBAN

Level 2

Inter-WBAN communication: At this level, the communication is established between the PD and the access points. It controls and monitors the operation of WBAN nodes. PD is liable to take a number of tasks, and it provides an interface to the medical center and to the user. It interconnects WBAN with a variety of networks that can be easily accessed both in everyday life and cellular networks.

Level 3

Beyond WBAN communication: This includes the medical server, which is accessed via the internet, the connection between level 2 and gateway along with PD. A healthcare contributor runs a service that automatically gathers data from individual patients, integrates the data into a patient’s medical record, processes them, and issues proposals, if necessary. The information which can be used for the patient’s treatment stores in level 3.

2.2.2 The network model

In the network model, a WBAN is formed which has eight sensor nodes (SN) and one sink node. Each sensor node performs different tasks: SN1 used for electrocardiogram, SN2 used for blood pressure, SN3 used for temperature, SN4 used for glucose, SN5 used for electromyogram, SN6 used for lactic acid, SN7 used for motion, and SN8 used for electromyogram according to the sensor node deployment in the body as shown in Fig. 2. The details of the simulation parameters have been listed in Table 2. The network topology can be made by the following assumption:

  • Each sensor node is immovable.

  • A bi-directional link is established between the network, employing that the sensor node SN1 (as a transmitter node) interacts with sensor node SN2 (as receiver node) as well as sensor SN2 (transmitter node) can also communicate with sensor SN1 (receiver node).

  • Each sensor node’s energy is equally distributed.

  • In the established network, each sensor node knows the distance from its neighboring node and also the distance from its sink node.

Fig. 2
figure 2

Wireless body area network model of a patient

Table 2 Simulation parameters for the proposed WBAN model

2.2.3 The energy model

All WBAN nodes consume a lot of energy. The total consuming energy of sensor node is the sum of sensing energy, transient energy, processing energy, and transmission energy. It has been found from the literature that there are many energy models for the optimization technique. For the current study, the first-order energy model is proposed from Eq. (5) to Eq. (8):

$$ {En}_{\mathrm{trans}}\left(k,d\right)={En}_{\mathrm{Trans}-\mathrm{elec}}(k)+{En}_{\mathrm{Trans}-\mathrm{amp}\left(k,d\right)} $$
$$ {En}_{\mathrm{trans}}\left(k,d\right)={En}_{\mathrm{trans}-\mathrm{elec}}\times k+{En}_{\mathrm{amp}}\times k\times {d}^2 $$
(5)
$$ {En}_{\mathrm{rec}}(k)={En}_{\mathrm{rec}-\mathrm{elec}}(k){En}_{\mathrm{rec}}(k) $$
(6)
$$ {En}_{\mathrm{rec}}(k)={En}_{\mathrm{rec}-\mathrm{elec}}\times k $$
$$ {En}_{\mathrm{rec}}(k)={En}_{\mathrm{rec}-\mathrm{elec}}\times k $$
(7)

where

$$ k\ \mathrm{is}\ \mathrm{the}\ \mathrm{packet}\ \mathrm{size} $$
$$ d\ \mathrm{is}\ \mathrm{the}\ \mathrm{distance}\ \mathrm{between}\ \mathrm{the}\ \mathrm{transmitter}\ \mathrm{and}\ \mathrm{the}\ \mathrm{receiver} $$
$$ {En}_{\mathrm{trans}}\ \mathrm{is}\ \mathrm{the}\ \mathrm{energy}\ \mathrm{which}\ \mathrm{is}\ \mathrm{consumed}\ \mathrm{during}\ \mathrm{transmission} $$
$$ {En}_{\mathrm{rec}}\ \mathrm{is}\ \mathrm{the}\ \mathrm{recipient}^{\prime}\mathrm{s}\ \mathrm{energy}\ \mathrm{consumption} $$

EnTrans − elecand Enrec − elec are the energy needed to run the transmitter and receiver electronic circuits.

$$ {En}_{\mathrm{amp}}\ \mathrm{is}\ \mathrm{the}\ \mathrm{energy}\ \mathrm{required}\ \mathrm{for}\ \mathrm{the}\ \mathrm{amplifier}\ \mathrm{circuit} $$

EnTrans − amp(k, d) is the energy needed to run the transmitter amplifier circuit

Enelec is the energy required by the electronic circuitry

In the energy model, path loss coefficient parameter ‘n’ is added, because the communication medium is the human body which contributes attenuation to the energy model. Therefore, consumption of energy is calculated using Eq. (8):

$$ {En}_{\mathrm{trans}}\left(k,d\right)={En}_{\mathrm{elec}}\times k+{En}_{\mathrm{amp}}\times n\times k\times {d}^2 $$
(8)

2.2.4 The path loss model

There are many substances embodied like varied thickness, dielectric constant, and characteristics of impedance because the human body is partially conductive. Due to the communication protocol which is adopted by the nodes, they can respond to a high loss because of the operating frequency band. In WBAN, for the purpose of communication, Bluetooth, MICS, IEEE 802.15.6 (UWB), and ZigBee are standards that are in use. Due to the frequency and distance, the attenuation that occurs in the level of the power at the receiving end is the path loss. In between the environment of the transmitter and the receiver, path loss includes the consequences which are linked with distance and interaction of the wave propagation with the physical objects. Path loss is computed in dB (decibel). The following are the mathematical equations from Eq. (9) to Eq. (11) for calculating the path loss:

$$ P{\mathrm{Loss}}_1=P{\mathrm{Loss}}_0+10{\log}_{10}\left(\frac{d_1}{d_0}\right) $$
(9)
$$ P{\mathrm{Loss}}_0=10{\log}_{10}\left(\frac{4\pi {d}_0}{\uplambda}\right) $$
(10)
$$ P{\mathrm{Loss}}_1=10{\log}_{10}\left(\frac{4\pi {d}_0}{\uplambda}\right)+10{\log}_{10}\left(\frac{d_1}{d_0}\right) $$
(11)

PLoss is the path loss

d1 is the distance between the transmitter and the receiver

d0 is the threshold distance value we have taken in our work as 0.1 [34].

λ is the wavelength of the propagating wave, we have taken the value 0.125 m [35].

3 Results

The execution of the proposed study is evaluated using the simulation tool MATLAB (Matrix Laboratory) and by judging the different performance parameters such as network lifetime, throughput, residual energy, and path loss.

As clearly shown in Table 3, the GWO achieves a significantly higher rate of throughput (about 2754 packets per 8000 rounds) relative to the protocols ALO (about 2255 packets per 8000 rounds) and PSO (about 1750 packets per 8000 rounds). The relay nodes are selected according to the fitness function, which in turn helps to save energy in every round. 4.0 J of total maximum energy is allocated among all WBAN nodes present. The findings of the simulation reveal that the GWO-based protocol uses less energy up to 72% of the simulation period. The GWO-based protocol that the author conducted is found to be more effective in terms of power consumption and the sustainability of WBAN.

Table 3 The comparison between various parameters for PSO, ALO and GWO

The various values for different parameters have been found by comparing the optimized algorithm for the selection of the best route. For the current study, the size of the network is 0.9 m × 1.7 m considered, and initially, the energy given to each node is 0.5 J along with the results for 8000 runs.

3.1 Network lifetime

Figure 3 shows when a route is selected based on GWO absorb 7.5% of energy in contrast to PSO and ALO. In PSO, the first node dies after 2100 rounds, while in ALO and GWO, it dies after 1200 and 4350 rounds. Also, Fig. 3 displays that the total network lifetime of PSO, ALO, and GWO is 7600, 7550, and 7632 rounds, respectively.

Fig. 3
figure 3

Network lifetime for PSO, ALO, and GWO for WBAN

From Fig. 3, it is evident that GWO has a better network lifetime in comparison to ALO and PSO, as the foremost node perishes much later than ALO and PSO. It is because, in GWO, the transmission takes place only when the nodes have high residual energy and are least distance.

3.2 Throughput

Figure 4 and Table 3 show that the GWO sends more packets to the body coordinator, i.e., sink, due to the increased network lifetime. The total packets sent are 3000 and the received packets using PSO are 1750, while for ALO and GWO, they are 2255 and 2754 respectively. The protocol GWO attains a massive increase in the throughput rate, as evident in Fig. 4 as ALO and PSO.

Fig. 4
figure 4

Throughput for PSO, ALO, and GWO for WBAN

3.3 Residual energy

Figure 5 and Table 3 show that the total energy consumption decreased by 23% as compared to PSO and 16% compared to ALO. The proposed GWO protocol employs the scheme of a relay node according to the fitness function and finds a route which is selected to contribute to much greater energy savings. The simulation results also indicate greater energy conservation, in comparison with ALO and PSO, which in turn facilitates the network longevity.

Fig. 5
figure 5

Residual energy for PSO, ALO, and GWO for WBAN

3.4 Path loss

Figure 6 and Table 3 show that for GWO, path loss reduces because the route select is more optimal as compared to PSO and ALO. The number of alive nodes is least the cumulative path loss.

Fig. 6
figure 6

Path loss for PSO, ALO, and GWO for WBAN

4 Discussions

4.1 Network lifetime

The total lifetime of a network when a network is operational till the death of the last node is called network lifetime. The proposed new fitness function for selecting the best route for transmitting the data plays an essential role in minimizing energy consumption. It has been found that for GWO (as shown in Fig. 3), the absorption of energy is 7.5% as well as the first node dies after 4350 rounds and the total network lifetime of GWO is 7632 rounds, respectively. These experimental results show that the GWO is better than the other algorithms inspired by nature, resulting in a longer lifetime of the network. GWO is a social hierarchy to save the best solutions that have been obtained so far during the iteration. That is why each node’s network lifetime can survive longer in the WBAN network scenario.

4.2 Throughput

The actual volume of packets successfully obtained at the sink is called throughput. In WBAN, the data transmission is critical and important and it requires that minimum packets are dropped and more data packets are received at the receiver end, which means high throughput. The high number of packets received for GWO is due to increased network lifetime in GWO as compared to other ones. Grey wolves are able to acknowledge and encircle the place of the prey. The alpha generally guides the hunt. The delta and beta may also be engaged in hunting from occasionally. Therefore, GWO saving the first three highest options to date and forcing the other search agents (including the omegas) to update their positions according to the best search agents. By updating the first three best positions (the alpha (α), beta (β), and delta (δ)) to mimic, the path and the optimum distance from the node to the sink can be found.

4.3 Residual energy

The difference between the initial energy of a node and the energy consumed for sending the packets is called residual energy. Basically, it is the remaining energy after the operator.

For transmitting packets to sink, the algorithms (POS, ALO, and GWO) use different routes and in each round for transmitting packets to saving energy that is restricted overloading to a particular route. In the case of GWO, stability period and network lifetime are more which increased the throughput and minimized the energy consumption.

4.4 Path loss

Path loss is a power loss while transferring data from the transmitting to the receiving biosensor node, and this will help in depicting the vital role in the design and analysis of the link. The path loss coefficient used for this work is 3.38 dB, while 4.1 dB for standard deviation.

From Table 4, it is evident that the proposed algorithm has a better network lifetime in comparison to other existing algorithms for WBAN problem. Since the proposed GWO ability to explore in the search space is much greater than PSO, GA, artificial bee colony, ant colony algorithm, and hPSO-GA, it optimizes the fitness function more effectively and detects the shortest path rapidly, within the WBAN for data transmission.

Table 4 Comparative analysis of the proposed algorithm with existing in WBAN problem

5 Conclusions

Energy efficiency is considered as one of the major challenges for the successful deployment of WBAN. To deal with energy efficiency, one of the important mechanisms is selecting the relay node, which can be modeled as an optimization problem. This paper presents a rigorous analysis of the three latest metaheuristic algorithms wiz. GWO, ALO, and PSO on the basis of residual energy, throughput, network lifetime, and path loss. It can be clearly gauged from the results obtained that the GWO algorithm outperforms ALO and PSO due to the social hierarchy and concept of hunting mechanism for finding the optimal solutions.

In the future, work can be further extended to propose the hybrid version of the algorithms to increase its performance for selecting the relay node. Work can also be done to reduce the computation time complexity of the algorithms.