1 Introduction

Wireless Body Area Networks has already been a most promising technique in short range communications [1] which is widely implemented in the fields of medical care, sports training and consumer electronic [2]. In general, a WBAN consists of one coordinator and many sensor nodes usually forming a star topology. These sensor nodes are responsible for monitoring some certain parameters about human body like glucose level, ECG, blood pressure, etc. The coordinator acts as a sink to collect all the information attained from the sensor nodes and communicate it to the users or remote servers for further processing.

In order to monitor some certain metrics values about human body or fulfil some certain tasks, sensor nodes are usually placed in the environment around the WBAN users or on the skin of body, some even implanted. These specific deployment conditions indicate that sensor nodes in WBANs has to be very small, simple and non-invasive for the human body. As a consequence, limited to the size of the sensor nodes, most of them are battery-driven and lack energy to function for a long time compared with the coordinator in the network. However, Frequent battery replacement or recharging is not a realistic way to overcome the energy shortage of sensor nodes since it may need a surgery to the WBANs users who has implanted sensor nodes. Therefore, prolonging the network lifetime to avoid frequent battery replacement/recharging is a very crucial issue for WBANs.

In IEEE 802.15.6 [3], which is a dedicated protocol to specify the communication of WBANs in physical layer and MAC layer, two-hop tree topology is the extension to the basic star topology. A typical WBAN system structure is depicted in Fig. 1. In the works [4,5,6,7], the authors use analytical model and numerical simulation to prove that using relay-aided two-hop transmission in some cases can effectively improve the reliability and energy efficiency of WBANs which can contribute to prolonging the network lifetime. That is to say, rationally utilizing the combination of direct transmission and cooperative transmission to sensor nodes in WBANs can improve lifetime performance of the whole network. Hence, an appropriate relay mechanism which specifies transmission strategy and relay selection scheme for sensor nodes is of great importance for WBANs to prolong the network lifetime.

Fig. 1
figure 1

A typical network topology defined in IEEE 802.15.6 standard

In this paper, based on the framework specified in IEEE 802.15.6 protocol, an adaptive energy-aware relay mechanism is proposed to improve the network lifetime of WBANs. The proposed mechanism considers the energy-level of each node in the network to adaptively adjust the topology of the network via relay allocation in order to conserve the nodes which lack energy, and, as a result, balances the energy consumption in the network so as to improve the network lifetime. The proposed mechanism employs no more than two-hop transmissions and forms a two-hop tree topology which is totally compatible with IEEE 802.15.6 protocol. Two stages are contained in the mechanism,that is initialization phase and update phase. Herein, update phase which fulfils relay adjustment can be invoked in two different methods, which are enquiry method and report method, to precisely change the relay strategy referring to the real-time varying conditions in the network. Specifically speaking, enquiry method is conducted at the side of the coordinator periodically while report method is started by the sensor node whose residual energy is below a certain limitation threshold. By adjustment, energy consumption distribution are changed to a more balanced situation where the sensor nodes with sufficient energy cost more energy than the ones short for energy. Herein, the adjustment procedure adopts our previous work on relay selection (Lifetime Maximization Relay Selection Scheme short for LMRSS) [8].

The simulation results demonstrate that the proposed relay mechanism can effectively improve the network lifetime comparing with the original star topology strategy and related relay proposals in WBANs. Further, in order to imitate human body movement, we design a simulation scenario where one sensor node has the ability to move and the results indicate that our proposed mechanism is capable of supporting mobility of sensor nodes and the network performance still excels over comparing methods.

The rest of this paper are organized as follows. Section 2 consists of related works. Brief reviews of relay mechanism in IEEE 802.15.6 protocol and our previous work on relay selection are presented in Sects. 3 and  4, respectively. In Sect. 5, our proposed adaptive energy-aware relay mechanism is described in detail. The simulation and the corresponding results are demonstrated in Sect. 6. Finally, We conclude the paper in Sect. 7.

2 Related Works

In Wireless Sensor Networks (WSNs) which is the ancestor communication technology of WBANs, there are already a number of routing protocols and relay selection algorithms to extend network lifetime. In [9], the authors proposed an energy-aware routing algorithm that uses minimum number of hops for transmission of data. By varying the transmission distance, the interconnections between the nodes can be changed and different network topologies can be obtained. An energy balanced robust scheme based on swarm intelligence that chooses the next node based on node’s local information was suggested in [10]. This method balances load evenly among the nodes and is able to achieve longer lifetime. Another approach proposed in [11] reduces the total consumed energy based on two optimization objectives, i.e., path selection and bit allocation. Packets with the optimum size are relayed to the fusion node from sensor nodes in the best intermediate hops. In [12], a relay selection algorithm was proposed to formulate an optimization problem to maximize user data rates and minimize the total transmission power of the network.

However, porting these solutions from WSNs to WBANs is problematic due to the different network architectures and operating conditions. In WSNs, hundreds to thousands of sensor-nodes cover large areas offering a considerable degree of redundancy and use multi-hop communications. On the contrary, WBANs cover an area limited to the human body and offer no redundancy and only involve two hops. Data must be collected reliably under unique characteristics such as frequent varying channel conditions and transmission power restriction which is not presented in WSNs. In a word, efficient relay mechanisms should be designed specifically for WBANs.

Several WBANs-dedicated relay methods were proposed attempting to prolong the network lifetime of WBANs. Authors in [13] make some modifications to IEEE 802.15.6 relay mechanism to improve the reliability and energy-efficiency of the networks, but it does not consider each node’s energy condition and regard the coordinator and sensor nodes have the same ability of processing and energy storage. An opportunistic relay mechanism is proposed in [14] aiming to improve the network lifetime of WBANs. The mechanism uses predefined relays and adaptive relays which are selected based on outage probability to avoid channel fading and transmission failures.

A mechanism was described in [15] to prolong network lifetime through formulating the network lifetime as a function of node transmission mode, cooperative node, transmission power and time slot, and maximizing the network lifetime subject to resource allocation constraints, then obtaining an optimal joint relay selection strategy. A UWB-based WBAN relay selection algorithm was proposed in [16]. The proposed algorithm utilizes an energy-efficient selection criterion to make relay selection for total power consumption minimization. In [17], the authors performed energy efficiency and reliability analysis of two-relay cooperative and two-hop UWB WBANs and compared their performance with direct link and one-relay UWB cases. The results obtained give guidelines for which relay is to be chosen, and what is the optimal number of relays for a given communication scenario.

In [18], Elias proposed an energy-aware WBAN topology model, which optimizes the number and the location of relays to be deployed by an integer linear programming model to minimize the total energy cost of the network. The authors in [19] presented a game-theoretic relay selection and power control method to investigate the problem of relay selection and power control with quality of service constraints in WBANs. The proposed method focused on energy efficiency and its performances are examined in various scenarios. However, these works only concentrate on energy-efficiency of the total energy consumption rate which may be misleading to prolong the WBANs’ lifetime due to the ignorance of node-level residual energy condition. In [20], the authors presented an MI-based incremental cooperative routing protocol for WBANs. By adopting an incremental cooperative relay-based routing scheme, the energy consumption of the implanted sensors is significantly reduced because the overall communication distance is minimized. In [21], the authors proposed a clustering-based routing protocol for WBAN that targets in achieving optimization of multiple performance metrics including network lifetime, throughput, latency, node signal power and specific absorption rate (SAR) of human body for emf radiation.

Some multi-hop transmission strategies were presented in [22,23,24,25,26] with the aim to improve the network lifetime of WBANs. However, these works are not suitable for WBANs. The reasons are threefold:

  • Multi-hop will incur additional delay to the package transmission due to the process in each relay node. More hops a package experiences, larger delay it suffers.

  • As the communication range in a WBAN is up to 3m (Typical 2m when deployed on a human body), there is no necessity to utilize multi-hop (more than two-hop) transmission in such a short distance. As we know, relaying work takes extra energy for the sensor nodes which are selected as relay nodes. Exceeding hops will cost unnecessary energy depletion.

  • Multi-hop transmission is not allowed in IEEE 802.15.6 protocol, so these proposals are not compatible with the specification.

In a word, existing research on improving the energy-efficiency of WBANs either lacks joint consideration of energy consumption and energy storage condition of sensor nodes, or introduces extra energy consumption by using more than two-hop transmission, which is incompatible with the IEEE 802.15.6 protocol.

3 Review of IEEE 802.15.6

In this section, for better understanding of this paper and giving an overall background foundation, a review of IEEE 802.15.6 MAC layer specification is made focusing on two aspects: beacon-enabled superframe structure and relay mechanism which act as key roles in WBANs communication. In this paper, for simplicity and consistency of the description, we call a sensor node relayed node if it needs a relay to transmit its data to the coordinator and a sensor node relaying node if it helps relayed node with frames transmission acting as a relay.

3.1 Superframe Structure

The beacon-enabled superframe structure is depicted in Fig. 2. The superframe starts from the beacon frame transmission slot. The coordinator establishes a common time base for a WBAN by sending beacon frame periodically. It shall also divide each superframe into applicable access phases ordering them as shown in the figure and defining their specific durations. All the information about the partition in a superframe are contained in the beacon frame which are sent out to all the nodes in the network during the beacon frame transmission slot in this superframe. In the Exclusive Access Phase (EAP), which is used only for the transmission of emergency data, Random Access Phase (RAP) and Contention Access Period (CAP), nodes use CSMA/CA or Slotted ALOHA methods. In the managed access period (MAP), the coordinator may schedule intervals employing TDMA mechainsm, or poll nodes. It should be noted that Fig. 2 only illustrates active period in a superframe and there may be an inactive period in a superframe if needed. During the inactive period, all the nodes turn into sleep mode to save energy.

Fig. 2
figure 2

Beacon-enabled superframe structure

3.2 Relay Mechanism

As mentioned in Section I, IEEE 802.15.6 supports a two-hop star topology extension, as shown in Fig. 1, in which the data frame from a relayed node can be transmitted to the coordinator through a selected relaying node. To establish the two-hop connection, two procedure (proactive/passive procedure) can be selected to implement the connection. In proactive procedure, the relayed node first overhearing frames transmitted from potential relaying nodes and select one candidate as its relay and sends out a connection request frame to the coordinator through the relaying node. The coordinator then returns a connection assignment frame to the relayed and relaying nodes. On the contrary, in passive procedure, the coordinator allocating relaying node to the relayed node in a centralized manner. Specifically, the protocol allow prearrangement of relaying node, that is, during the initialization of a WBAN, depending on the information of the sensor nodes in the network, the coordinator makes relay allocation to some sensor nodes that may need relaying node for the propose of improving reliability and network lifetime. The prearranged relay allocation will not changed unless the coordinator makes arrangement again.

4 LMRSS: Lifetime Maximization Relay Selection Scheme

Before the introduction of our proposed relay mechanism, a review of LMRSS is presented which is the relay selection method we adopt in the relay adjustment procedure of update phase in our proposed mechanism to better illustrate our proposal. See [8] for more detailed information.

LMRSS is a dedicated relay selection scheme for WBANs based on an optimization problem where not only energy consumption condition but also energy storage of each node are taken into consideration when making relay selection. In this optimization, relay selection of each sensor node in the WBAN is regarded as optimization variables and the objective of the problem is to maximize the minimum lifetime of sensor nodes in the network. Besides, the constraints in the optimization indicate that this relay selection totally complies with IEEE 802.15.6 specification.

In order to solve this NP-hard optimization, a heuristic algorithm were designed to find the solution for this problem. The rapid solution utilizes sensor nodes’ information to fulfil the iteration until the termination condition is satisfied and the relay selection of each node in the network can be obtained. The needed information of sensor nodes for the rapid solution includes energy storage condition, distance/location information and transceiver types.

The simulation results demonstrated that the rapid solution has a very low time complexity, thus, only a small amount of time, which is much smaller than the length of superframe in IEEE 802.15.6, is cost to run this rapid algorithm to get the relay selection results for the network.

In a word, LMRSS is an effective relay selection scheme in WBANs to prolong the network lifetime. However, in this paper, with the help of LMRSS, we not only concentrate on relay selection but the whole relay mechanism which contains the initialization, update timing and update method of the relay selection, termination of the mechanism, control information interaction and error recovery measures. Besides, the relay mechanism needs to be suitable in the framework of IEEE 802.15.6 specification.

5 Adaptive Energy-Aware Relay Mechanism

In this section, our motivation behind the proposed relay mechanism is firstly presented. Then, the proposed adaptive energy-aware relay mechanism will be introduced in detail. In the third part of this section, we illustrate how to make this relay mechanism compatible with IEEE 802.15.6 framework. Finally in the fourth part, illustrative examples are presented for the better description of our proposed relay mechanism.

5.1 Motivation

In the original relay mechanism in IEEE 802.15.6 protocol, relaying node can be selected by the relayed node in proactive procedure, which may bring little improvement of network lifetime or even not be able to improve the network lifetime due to the lack of global knowledge for the relayed node. Besides, in proactive procedure, a relayed node may frequent change its relaying node because of the distributed manner, which may incur massive overheads wasting a lot of energy. On the other hand in passive procedure or prearranged relay allocation which are centrally controlled by the coordinator, the protocol only describes the establishment of the connection between the relayed node and relaying node. How to make relay selection for sensor nodes to prolong the network lifetime are absent in the protocol which is an important issue in WBANs.

What’s more, assuming that a optimal relay allocation is made during the initialization, with the network keeping sensing and communicating, the initialized optimal relay allocation will not be the optimal allocation any more as a result of the changing parameters of sensor nodes such as residual energy and node location. When to make relay selection again for network topology adjustment so as to improve the lifetime performance is another important issue. Keeping these two issues in mind, in this paper, we propose an adaptive energy-aware relay mechanism which addresses the issues mentioned above and effectively improve the network lifetime of WBANs.

5.2 The Proposed Relay Mechanism

The proposed relay mechanism consists of two phases, namely initialization phase and update phase. The initialization phase is implemented during the initialization of the network. While the update phase can be invoked by enquiry method or report method to adaptively adjust the relay allocation strategy and network topology based on the varying residual energy condition of sensor nodes in the network. More specific, in enquiry method, the coordinator periodically invokes update phase to reallocate relay and reform the network topology. On the contrary, in report method, the coordinator only invoke update phase upon receiving alert message from a certain sensor node when its residual energy ratio is below a specified threshold. The detailed description of the proposed relay mechanism utilizing enquiry method for the coordinator and sensor nodes is shown in Algorithms 1 and 2, respectively, while the description for report method is presented in Algorithm 3 and Algorithm 4. It should be pointed out that actions and responses within the while loop in the algorithms are carried out at the very beginning of every superframe.

5.2.1 Initialization Phase

(Lines 8–12 in Algorithm 1, Line 1 in Algorithm 2, Line 7–11 in Algorithm 3, Line 2 in Algorithm 4) In initialization phase, the coordinator firstly obtains essential information of each sensor node in the network including battery capacity and the position of the sensor node in the form of coordinate during the node admission/connection process. Based on the information acquired from the sensor nodes, the coordinator implements relay selection algorithm to make the first relay allocation for the network. After relay selection, the coordinator broadcasts the relay allocation result and the network will operate under this newly informed topology.

5.2.2 Update Phase

(Lines 14–33 in Algorithm 1, Lines 5–16 in Algorithm 2, Line 13–26 in Algorithm 3, Lines 5–18 in Algorithm 4) After the initialization in enquiry method, the coordinator will start its counter, which is count in Algorithm 1, to execute update phase in a periodical fashion so as to proactively enquire the information it needs to fulfil the adjustment. The counter will be added 1 at the beginning of every superframe. When the counter reaches a specified value, that is \(N_{update}\) in algorithm 1 which is utilized to define the update frequency of the mechanism, the coordinator will execute update phase in this superframe. At the beginning of the update phase, the coordinator broadcasts a request message to require all the sensor nodes in the network to report their related information including residual energy and location coordinate. Sensor nodes send the report message during their transmission slots to the coordinator. After receiving the reports from each sensor node, the coordinator implements relays selection algorithm and broadcasts the newly obtained relay allocation result to update the topology of the network. The sensor nodes then transmit their data under the updated topology until the next update phase occurs. If there is one sensor node in the network runs out, that is, its residual energy is below the minimum energy threshold, the exhausted sensor node directly reports the exhaustion in its next transmission slot. In this case, the coordinator terminates the network and report this condition to the management entity for further processing.

When it comes to report method, each sensor node in the network has the responsibility to monitor its residual energy ratio in the battery. When its residual energy ratio is below a certain threshold \(\alpha\) or the minimum energy threshold \(\beta\), it will send an alert message to the coordinator on its own initiative and then, the coordinator will start update phase upon this alert message. The following procedure is as the same as enquiry method. However, different from enquiry method, each sensor node in report method needs to regard residual energy at present as the new battery capacity at the end of update phase. The residual energy ratio is defined in Eq. (1)

$$\begin{aligned} residual\_energy\_ratio = \frac{residual\_energy}{battery\_capacity} \end{aligned}$$
(1)

In addition to the description of the algorithms, minimum energy threshold \(\beta\) is set to reserve the minimum energy for a sensor node to guarantee the transmission of its report message that alerts its exhaustion to the coordinator.

figure d
figure e
figure f
figure g

5.3 Compatibility with the Framework of IEEE 802.15.6

In this part, a discussion on compatibility with the framework of IEEE 802.15.6 for the proposed relay mechanism is presented.

5.3.1 Collection of the Information

In the initialization phase, the coordinator needs to collect the information on the position and battery capacity of each node This process can be done by node admission/connection during which each node send its information in the Connection Request frame or I-Ack frame. On the other hand during update phase, the coordinator utilize beacon frame to broadcast its request message while sensor nodes send their residual energy and location information through piggy-back fashion in data frame during their allocated transmission slots.

5.3.2 Alert Information Delivery

To fulfil the function of our proposed relay mechanism under report method, residual energy alert from sensor nodes must be delivered to the coordinator. The alert delivery can be realized by defining a one bit alert flag field in data frame. When alert flag is checked to be 1 in one data frame, the coordinator will start update phase in the next superframe. The general format of MAC frame in IEEE 802.15.6 is shown in Fig. 3, in which we can see that there is reserved bits in frame control field for extension which can be used for our proposed mechanism.

Fig. 3
figure 3

The general MAC frame format in IEEE 802.15.6

5.3.3 Broadcast of Relay Allocation Result

After the relay selection, the relay allocation result can be broadcasted through beacon frame.

Besides, as discussed in [8], LMRSS has very low time complexity. Hence, the relay allocation result can be obtained during update phase very quickly which is extremely short compared to the superframe duration, which means the proposed mechanism can quickly fulfil its function when an alert is received. For example, as shown in Fig. 4, If one sensor node sends alert in Nth superframe, the coordinator will collect residual energy information in (N+1)th superframe and be able to obtain the relay allocation result in the same superframe. The relay allocation result will be broadcasted in (N+2)th superframe and sensor nodes will use the new topology to communicate from this superframe. The whole phase only takes one superframe duration when working in the framework of IEEE 802.15.6.

5.3.4 Measures for Information Exchange Errors

Wireless channel in WBANs varies frequently leading to fast changing and unpredictable channel conditions. As a result, information utilized in our mechanism may suffer from delivery failures. In order to guarantee the regular procedure of our mechanism, we also consider some measures to deal with the information exchange errors in the framework of IEEE 802.15.6. According to the superframe structure depicted in Fig. 2, there is a B2 frame transmission slot which is occupied by the coordinator to broadcast B2 frame to the sensor nodes in the network. Following the B2 frame transmission slot, an optional CAP period can be set based on the parameters conveyed in the B2 frame.

To cope with delivery failure of report message, we add an receive flag map field in the payload of B2 frame to indicate the reception conditions of report message for sensor nodes in the network. The size of the field is 64bits as the maximum sensor nodes in a WBAN regulated in the specification is 64. Each bit in this field indicates the reception condition of the corresponding sensor node. For example, the 16th bit in receive flag map field setting to 1 indicates that the corresponding sensor node whose node ID is 16 have successfully transmitted its report message to the coordinator. Otherwise, the value of this bit is set to 0 if the report message fails to be correctly received by the coordinator.

B2 frame will not be broadcasted if all the report messages are received successfully. However, once there are errors happening during the report message transmission, the coordinator will broadcast B2 frame in the dedicated slot setting the values in receive flag map according to the receipt conditions of the corresponding sensor nodes. Also, the coordinator will set the following CAP period available to let sensor nodes which failed to report their information before to retransmit the report message to the coordinator by CSMA/CA or slotted ALHOA. The length of this CAP period is specified in this B2 frame by the coordinator depending on the total number of the retransmitting sensor nodes. The detailed algorithm to decide the length of CAP period will be investigated in the future.

Fig. 4
figure 4

Correct invoking procedure of update phase utilizing enquiry method

Fig. 5
figure 5

Correct invoking procedure of update phase utilizing report method

5.4 Illustration Examples

In this part, we give some graphic examples under the framework of IEEE 802.15.6 to better illustrate our proposed relay mechanism.

Figures 4 and 5 show the correct invoking procedures of update phase utilizing enquiry method and report method respectively. The corresponding operation time points of the proposed mechanism and transmission slots of the related frames which containing useful information for the mechanism can also be found in the figures.

Figure 6 presents the procedure to deal with the transmission errors happened during the report message delivery. It can be seen from the figure that sensor node 3 and sensor node 7 suffer from failure when transmitting their data frame to the coordinator which contain their report information needed in update phase. When the coordinator acquires all the report transmission condition at the end of the MAP period and find that there are transmission failures, it generates B2 frame where the corresponding bits are set to 0 (3rd bit and 7th bit in this figure) in receive flag map field to indicate related sensor nodes to get ready to retransmit their report in the following CAP period and broadcast this frame in B2 frame transmission slot as the figure shows.

In addition, it may happen that some sensor nodes fail to receive beacon frame which contains information request during the update phase. In this case, the measure presented here is also available. Because sensor nodes which fail to receive beacon frame due to the transmission error will not send their report information to the coordinator. The coordinator could still use B2 frame to inform these sensor nodes to retransmit their report information during the CAP period as the same as Fig. 6 presented.

Fig. 6
figure 6

Example illustration of measure for report transmission failure

6 Performance Evaluation

In this section, the performance of our proposed relay mechanism will be evaluated through simulations and the results from the simulations will be analyzed. We firstly present the system model used in the simulation. Then, key parameters which can severely affect the performance are discussed. Finally, the network lifetime performance of our proposed mechanism is evaluated via the comparison with other relay mechanisms related to WBANs. At the end of this section, simulations where a sensor node have the ability to move are conducted to evaluate the performance of our mechanism in the body-moving scenarios.

6.1 System Model

6.1.1 Network Topology

In the simulation, we put 16 sensor nodes into a wireless body area network deployed on a human body. Considering that sensor node executing a certain sensing task may not be always deployed at the same position but in a designated area, in order to show generality of sensor node deployment, we classify the human body into six parts in the simulations as shown in Fig. 7, which contains head part, main body part, left/right arm part and left/rigth leg part. The range values of each part are measured from a male human body whose height is 175cm. In the simulations, we deploy 6 sensor nodes in main body part and 2 sensor nodes for every other parts. Sensor nodes are randomly deployed in the parts where they belong. Considering the possible implanted sensors or sensor nodes deployed in the backside of human body, we set the ratio of implanted/back side sensors to the total sensor nodes in the network to 25%. The coordinator is placed at the front side of abdomen as it is the center of the human body and the location is stable on human body. The node distribution is decided based on the functionality each part contains. The detailed information for node distribution and body parts are listed in Table 1.

Fig. 7
figure 7

Sensor nodes placement in the simulation

Table 1 Sensor nodes distribution

Only uplink transmission from sensor nodes to the coordinator is considered in the simulation as the major application for WBANs is to collect sensing data from human body or arounding environment for further processing. Superframe consists of active part and inactive part. Active part contain one managed access period (MAP) for the simplicity of the simulation. In every superframe, each sensor node has one transmission slot which is able to transmit one periodical data frame. If a sensor nodes has relayed nodes, the coordinator will allocate additional transmission slots for it. The number of additional transmission slots is equal to the relayed nodes it has. The length of superframes in the simulation is fixed. When all the sensor nodes has been allocated their transmission slots, the remaining duration will be inactive part. We assume that each sensor node transmits one periodical data frame to the coordinator and there are always frames waiting to be transmitted in each sensor node’s buffer. Synchronization mechanism is also assumed in the simulation to support TDMA-based MAP phase in active part.

6.1.2 Energy Consumption Model

We have chosen the energy consumption model in [27, 28] which is widely used in many WBANs related works. As we are only interested in the energy consumption of the communication, which is much larger than the energy used for sensing [29], we ignore the latter in this paper. And as described in previous subsection, a TDMA mechanism is implemented, so it is considered that there is no energy waste on idle listening, overhearing, collision, etc. Assuming that an ideal power control is realized in the network, the model takes \(d^n\) as energy loss due to channel transmission with the distance d between sender and receiver. The energy cost during transmitting and receiving are described in Eqs. (2) and (3) as follows:

$$\begin{aligned} E_{tx}(k,d,n)= & {} E_{TXelec} \cdot k + E_{amp} \cdot k \cdot d^{n} \end{aligned}$$
(2)
$$\begin{aligned} E_{rx}(k)= & {} E_{RXelec} \cdot k \end{aligned}$$
(3)

In these formulas, \(E_{tx}\) represents the transmission energy, \(E_{rx}\) the receiver energy, \(E_{TXelec}\) and \(E_{RXelec}\) the energy the radio dissipates to run the circuitry for the transmitter and receiver respectively, and \(E_{amp}\) the energy for the transmit amplifier. The specific values of these parameters are hardware dependent. k represents the number of bits sent in one packet. In addition, n is set to be 3.38 when the channel between transmitter and receiver is LOS(line-of-sight). Otherwise, it is set to be 5.59 if channel is NLOS(none-line-of-sight). The values of n is adopted from the measurement campaign in [30] and widely used in the WBAN-related literatures [16, 27, 28, 31, 32]. In this paper, we select the values in the Nordic nRF2401 low power single chip transceiver as the energy consumption parameters in Eqs. (2) and (3) which is frequently used in sensor networks and is suitable for WBAN.

The battery capacity is variable in the simulation since sensor nodes in the network may be different in node size and thus their battery capacities differs. As a result, based on the variation of battery capacity and Central Limit Theorem, we adopt normal distribution to represent the energy storage condition of each sensor node. Meanwhile, we select an appropriate upper bound and lower bound for the energy storage values to avoid extreme large or small random values in normal distribution, which is impossible to appear in reality. In summary, the battery capacity of the ith sensor node in the simulation follows truncated normal distribution which is represented as the following:

$$\begin{aligned} E_{i} \sim N(\mu ,\sigma ^2), \mu -\varDelta \le E_{i} \le \mu +\varDelta \end{aligned}$$
(4)

where \(\mu\) and \(\varDelta\) are standard value for the residual energy and maximum energy deviation from standard value in each node, respectively. While \(\sigma ^2\) stands for the energy difference degree among sensor nodes. Larger value of \(\sigma ^2\) reflects more residual inequality in the network. The system parameters used in the simulation are summarized in Table 2.

Table 2 System parameters

6.2 Result Analysis

We have conducted simulations based on C++ platform where our proposed relay mechanism is implemented in the system as described above. The simulation runs for 1000 times and the averaged results are taken. In the simulations, the proposed relay mechanism is compared with the relay mechanisms proposed in [12, 15] as well as no relay-aided mechanism where each sensor node transmits its sensing data directly to the coordinator as a benchmark in the comparison. The comparison is conducted in terms of network lifetime and residual energy of each sensor node when the simulation stops. The fact should be emphasized that each sensor node in WBANs is irreplaceable due to its unique function so that the exhaustion of one sensor node may lead to network failure. Hence, the lifetime in the simulation is specified as the time duration between the initialization of a WBAN to the point when the first sensor node in the network exhausts(we assume that coordinator has sufficient energy compared to sensor nodes).

Before the comparison with other mechanisms, we firstly investigate the influence of \(N_{update}\) and \(\alpha\) on the performance of our relay mechanism since the variation of these two parameter can bring significant impact. It is a necessity that the optimal value should be found to achieve the best performance of our relay mechanism in the comparisons.

As described in Sect. 5, the update phase of the proposed relay mechanism can effectively adjust the relay allocation and network topology according to the residual energy condition of the sensor nodes. Frequent implementation of update phase will make the relay allocation always suitable for the residual energy change of the network. However, the update phase incurs energy depletion when sensor nodes transmit its information to the coordinator during their allocated transmission slots, which means frequently updating the relay allocation will make sensor nodes consume more energy on information exchange with the coordinator. Inferred from the Algorithm 1-4, smaller value of \(N_{update}\) and larger value of \(\alpha\) bring more frequent update phases. As a consequence, there is an optimal value for \(N_{update}\) and \(\alpha\) to achieve the best performance of the proposed mechanism in terms of network lifetime.

Using the system model presented above, we first conduct simulations to investigate the impact of values of \(N_{update}\) and \(\alpha\) on the network lifetime performance under our proposed mechanism. \(\sigma\) is set to 1. Figures 8 and 9 illustrate the simulation results on network lifetime performance under different values of \(N_{update}\) and \(\alpha\) when our proposed mechanism adopts enquiry update invoking method and report update invoking method, respectively. Different curves in each figure represent different network performance under different length of report information data. For instance, 25% in the figure means that the length of report information data is 25% length of data frame which is actually \(1200\times 0.25=300\,\text {bits}\) in the simulations.

It can be seen from Fig. 8 that the optimal value of \(N_{update}\) varies depending on the battery capacity. Specifically, in Fig. 8a, the optimal value for \(N_{update}\) is \(2^7=128\), while the average battery capacity is 0.12J. In Fig. 8b, the optimal value for \(N_{update}\) is \(2^{11}=2048\), while battery capacity is 1.2J. In the same way, the values in Fig. 8c, d are (\(2^{13}=8192\),6J) and (\(2^{15}=32768\),12J). Inspired from these pairs of numbers, we can conclude that the optimal value of \(N_{update}\) is not the same under different battery capacity conditions and the exact relationship between the optimal value and the battery capacity is difficult to obtain due to the dynamic nature of the problem. In order to choose a practical value of \(N_{update}\), two factors need to be considered. The first is its optimality with regard to network lifetime. The second is the adaptability of the update phase to node movement, which is discussed later. It can be seen from Fig. 8 that when \(N_{update}\) is between \(2^4\) and \(2^6\), the network lifetime performance is very close to the optimal value with the maximum gap less than 6.7%. Besides, with a typical superframe length of 300ms, when \(N_{update}\) is between \(2^4\) and \(2^6\), the update phase will be invoked every 4.8–\(19.2\hbox {s}\) which is a suitable time interval to keep track of human body movement. Therefore, \(N_{update}\) can be set to a value in the range \(2^4\)\(2^6\) when enquiry invoking method is used in our relay mechanism.

Fig. 8
figure 8

Impact of \(N_{update}\) on network lifetime performance. a \(\mu =0.12J, \varDelta =0.06J\); b \(\mu =1.2J, \varDelta =0.6J\); c \(\mu =6J, \varDelta =3J\); d \(\mu =12J, \varDelta =6J\)

Figure 9 shows the impact of \(\alpha\) on network lifetime when our proposed mechanism adopts report invoking method. It can be seen from the figures that different from \(N_{update}\) in enquiry method, the optimal value of \(\alpha\) is not influenced by the battery capacity conditions. In detail, the optimal values for \(\alpha\) in all four figures are illustrated as 0.5 regardless of their different battery capacity conditions in the network. It can be concluded from this observation that it is the best choice for the sensor nodes to send alert message to the coordinator when they find the residual energy in battery is less than half.

From Figs. 8 and 9, we can see that the best performances of network lifetime by using enquiry method and report method is almost the same. Also, the optimal value of \(\alpha\) in report method is easily known for us without prior knowledge of battery capacity of sensor nodes. It should also noticed that the influence of different report information length on network lifetime can be neglect at the optimal point in each figure. Hence, in the following illustration, we will not make comparisons between different report information length.

Fig. 9
figure 9

Impact of \(\alpha\) on network lifetime performance. a \(\mu =0.12J, \varDelta =0.06J\); b \(\mu =1.2J, \varDelta =0.6J\); c \(\mu =6J, \varDelta =3J\); d \(\mu =12J, \varDelta =6J\)

Next, we compare the performance of our mechanism with benchmark, LMRSS [8] and relay mechanisms in [12] and [15]. More specific, LMRSS is in fact the relay mechanism only consists of the initialization phase of our proposed mechanism without update phase. Relay mechanism in [12] is a popular relay selection mechanism in WSNs aiming to minimize the total energy consumption while the mechanism proposed in [15] is dedicated for WBANs which formulates an optimization problem to minimize the maximum energy consumption rate among sensor nodes. In the following comparisons, we regard these two relay selection mechanism as sum-rate mechanism [12] and maxi-rate mechanism [15], respectively.

Figure 10 demonstrates the network lifetime performance comparison obtained from the simulations. We adopt report invoking method in our proposed mechanism in the comparison with the value of \(\alpha =0.5\). In these simulations, \(\mu\) is set to 12J and \(\varDelta\) is set to 6J. It can be seen from the figure that the proposed mechanism outperforms the other mechanisms and the advantages over the other mechanisms are more significant with the increasing value of \(\sigma\). In more detail, network lifetime under our mechanism has 22% more lifetime than benchmark and sum-rate mechanism, 9% more than LMRSS and maxi-rate mechanism when sensor nodes in the network has the same energy storage (\(\sigma ^2=0\)). When \(\sigma ^2=1\), the advantage gap between our proposed mechanism and benchmark as well as sum-rate mechanism increased to 32%, 13% for maxi-rate mechanism and 11% for LMRSS. The reason is twofold: (1) The proposed mechanism can adjust the relay allocation rapidly through update phase when the residual energy condition changes during the normal network operation while others only make relay allocation once at the initialization of the network. (2) Relay selection algorithm LMRSS adopted in proposed mechanism considers both energy consumption rate and residual energy of each node while sum-rate mechanism and maxi-rate mechanism only concentrate on energy consumption.

Fig. 10
figure 10

Network lifetime performance comparison

Figure 11 illustrates the condition of residual energy in the network when the first sensor node in the network runs out of energy. To illustrate this figure, we set \(\mu =12\) and \(\sigma ^2=1\). It can be seen from the figure that the average residual energy of the proposed mechanism is the least when compared with others and also the most balanced. As shown in the figure, the averaged residual energy among sensor nodes under the proposed mechanism is 51% lower than benchmark and sum-rate mechanism, 44% lower than maxi-rate mechanism and 24% lower than LMRSS. These values indicate that our proposed relay mechanism can make more fully use of energy in each sensor node. It can also been observed in this figure that our proposal has the smallest gap between the maximum residual energy and the minimum one when the network stop working, which means more balanced energy utilization on sensor nodes in the network. The reason for these advantages is that the proposed mechanism considers each sensor’s residual energy when making relay allocation and the update phase can effectively adjust the allocation according to the variation of the network residual energy. In other words, the proposed mechanism let energy-sufficient sensor nodes burden more transmission tasks to conserve the ones that lacks energy, which in turn prolong the overall network lifetime.

Fig. 11
figure 11

Residual energy condition comparison

For better exhibiting the advantage of our mechanism and the understanding of the reasons, we conduct simulations where we adjust the total number of nodes in the network and keep other simulation parameters the same with the simulations in Fig. 11. The number of sensor nodes in each body part follows the same ratio as shown in Table 1.

Figure 12 shows network lifetime performance of different relay mechanisms under different number of sensor nodes in the network. It can be observed from the figure that with the increasing number of nodes, that is the density of the network, our mechanism has more significant advantage in terms of network lifetime. In detail, our proposed mechanism has 32% more lifetime than benchmark and sum-rate mechanism when the number of nodes is set to 16. While the advantage jumps to 108% when the number of nodes increases to 64. The reason is that with more sensor nodes deployed in the network, each remote sensor node has more choices to select a relay for transmission. As a result, it facilitates our mechanism to make full use of all possible relay selections to prolong the network lifetime during the update phase.

Fig. 12
figure 12

Performance comparison under different number of sensor nodes

Figure 13 also confirms the reason mentioned above where the residual energy conditions in the network utilizing our proposed relay mechanism are presented when the first sensor node runs out of energy. It can be seen in the figure that with the increasing deployment density, the residual energy left in the network adopting the proposed mechanism decreases obviously, which means that our mechanism can utilize the energy in each sensor node more effectively. It can be found that when the number of nodes is set to 64, even the maximum residual energy in the network is less than the average residual energy in the network where the total number of nodes is 16. In this way, sensor nodes which lacks of energy can be efficiently conserved and more residual energy is able to be used through adjusting the network topology and relay allocation to prolong the network lifetime to the greatest extent as shown in the Figs. 12 and 13.

Fig. 13
figure 13

residual energy conditions of our proposed relay mechanism under different number of sensor nodes

In order to show that our proposed relay mechanism can support sensor node moving scenarios, a simple on-body deployment scenario is designed where one sensor node has the ability to move because of the body part it attaches. The scenario is shown in Fig. 14 where the coordinator is still deployed at the front side of abdomen while one sensor node is put on one side of hand. Another sensor node is deployed in the main body part acting as the candidate relay for sensor node on the hand. The sensor node on the hand can move with the hand according to a certain route which is also shown in the figure with the two ends marked. In order to shown generality of the moving condition, we set this sensor node to change its position with possibility of 50% every four superframes. Each moving distance is as long as 20% length of the route. The moving direction is also randomly selected with the possibility of 50% to move towards and 50% to move backwards on the route. In this scenario, the moving sensor node changes its location at the beginning of the superframe and keeps still during this superframe. The detailed location information has been drawn in the figure. In addition, we assume that the moving sensor node can obtain its movement and location information by some movement recognition methods which is out of the scope of this paper.

Fig. 14
figure 14

A simple on-body moving sensor scenario model

Aiming to keep track of sensor node movement in our proposed relay mechanism, enquiry method works effectively for this scenario as it invokes update phase in a periodical manner. As discussed before, we set \(N_{update}=2^4=16\) as the value is reasonable in a real application scenario. For instance, when the length of a superframe is 300 ms (typical value for WBANs), the update phase will be invoked every 4.8 s which is a suitable time interval to keep track of human body movement.

Table 3 shows the relative performance comparison in this sensor node moving scenario between our proposed relay mechanism, LMRSS and benchmark. The battery capacity of moving sensor node is set to 0.01J and the other sensor node in main body part is assumed to have sufficient energy in order to better emphasize the effect of sensor node moving and the performance of our proposed mechanism in this scenario. It can be seen from the table that the proposed mechanism has the longest network lifetime as it can update the relay selection and network topology according to the movement condition of sensor nodes in the network. The relay node usage ratio which reflects the ratio between two hop transmission through the sensor node in the main body and the total transmission also proves that our proposed relay mechanism has the ability to make relay selection according to the sensor node movement condition. In more detail, when the moving sensor node is close to the position of (85, 40), our mechanism will allocate relay node for it since the distance from moving sensor node to relay is less than the distance to the coordinator. On the contrary, when the moving node is close to (10, 30), it will be set to utilize direct transmission because the coordinator is nearer than the relay node in this condition.

For a better presentation, we take first 100 superframes in one simulation as a sampling to show the variation and the relationship between the transmission strategy of moving sensor node and the distance away from the coordinator as shown in Fig. 15. In the figure, 1 on transmission index axis represents the two-hop transmission strategy via relay node, while 0 is for one-hop direct transmission. It can be indicated from the figure that our proposed mechanism can make a coarse catch-up with the moving sensing node. It should also be seen that in the figure some points mismatch between the distance and transmission strategy. The reason is that relay selection update phase is invoked in every 16 superframes so that it can not be updated precisely with the movement of sensor node.

It should be explained here that the simple moving scenario designed here is to help us testify that our proposed relay mechanism can support sensor node moving application scenarios. The simulation results also prove that the mechanism is able to effectively prolong the network lifetime in such scenarios. However, the real application scenarios are complex in terms of movement pattern, movement frequency and the number of moving sensor nodes. On the other hand, parameter \(N_{update}\) plays an important role in these moving scenarios. We will further investigate more complex application scenarios and adjustment of \(N_{update}\) based on our proposed relay mechanism in the future.

To conclude this section, our proposed relay mechanism can effectively improve the network lifetime of WBANs when compared with benchmark by 32% and also outperforms two existing relay mechanisms (i.e., sum-rate mechanism and maxi-rate mechanism) by at least 9% and 22%, respectively. The advantage of lifetime improvement becomes larger when the energy difference degree is higher because our proposed mechanism is aware of energy storage level in each node and can update the relay allocation and network topology according to the variation in the network. At the end of this section, we design a simple sensor node moving application scenario to illustrate that our proposed mechanism has the ability to support mobility of sensor nodes in the network. The simulation results demonstrate that compared with benchmark and LMRSS, our mechanism has the longest network lifetime in moving scenarios.

Fig. 15
figure 15

The relationship between distance and transmission strategy

Table 3 Performance comparison in sensor node moving scenario

7 Conclusion

In this paper, an adaptive energy-aware relay mechanism is proposed for WBANs under the IEEE 802.15.6 framework. Based on our previous work on relay selection scheme, an update phase is designed to adjust the relay allocation according to the residual energy distribution in the network for fully utilizing the energy in each sensor. Simulation results show that the network adopting our proposed relay mechanism has better network lifetime performance compared with existing relay mechanisms and the one-hop transmission mechanism under various scenarios. Furthermore, our proposed mechanism can support mobility of sensor nodes in the network.

In the future, we will focus on the performance evaluation of our proposed relay mechanism in more complex and comprehensive sensor node moving scenarios where related parameters will be deeply investigated and discussed. In addition, algorithms to decide CAP period length which were mentioned in Sect. 5.3.4 will also be studied.