1 Introduction

A wireless body area network (WBAN) is a collection of intelligent, miniaturized, low-power, invasive/non-invasive wireless sensor nodes located on, in or around the human body. Each sensor node has the capacity to process and forward information to the core node named body area network (BAN) coordinator for diagnosis and prescription. Wireless BAN supports continuous health monitoring of patients under natural physiological states without constraining their normal activities. This makes WBAN more practical because that data obtained during a long time interval in the patient’s natural environment is more reliable for medical practitioners’ clinical diagnosis than that during short stays in the hospital [1]. Wireless body area network’s superiority makes its development fast. Moreover, the increasing growth of aging population in many countries, combined with limited financial resources of current healthcare systems and individuals’ growing demand for satisfying medical service, opens up new development space of WBANs. As drawing more and more attention all over the world, WBAN technology will change paradigm of healthcare, then, without burdensome cables healthcare service will be available casually.

Although challenges faced by WBANs are similar to those in the general wireless sensor networks (WSNs), there are intrinsic differences between the two networks [2, 3]. For instance, most protocols for WSNs only consider the energy efficiency of the networks [4, 5] with homogeneous sensors, whereas the same assumption used in WBANs is incorrect when taking account of heterogeneous medical sensors, each with different required traffic arrival rate and data transmission rate. And aiming to realize ubiquitous communications for improved user experience, other than medical applications, leisure and entertainment applications (e.g., video goggle, motion or mood capture) are also supported by WBANs [6, 7]. Further, the mobility in WSNs is considered on a scale of meters or tens of meters, however, movements of tens of centimeters can cause topological change in WBANs. Finally, the most important intrinsic difference between WBANs and WSNs is the wireless channel properties and the reason for this is that human body becomes a portion of communication in WBANs. The geometrical characteristic and movement of the human body will affect the channel pathloss and connectivity between nodes. Hence, for WBANs, due to different application purpose and requirements, some of these newly emerged challenges range from low latency and high reliability, to low emission power level for protecting human tissue. The first high priority among them is to extremely prolong the lifetime of the battery-powered network, i.e., energy efficiency, which is also the primary concern to avoid invasive operations to replace battery in the case of implantable devices.

Most existing energy-efficient medium access control (MAC) protocols for WBAN have been proposed based on time division multiple access (TDMA) mechanisms, such as [814]. There are also schemes such as very low power MAC (VLPM) [15] which apply existing wakeup radio approaches to WBAN. However, all of these work ignored the fact that different physiological parameters sampled by different sensor nodes generally have significant differences in terms of traffic arrival and data rate. If the same energy saving strategy is used to cope with all of the sensor nodes, the nodes with high energy consumption rate will exhaust their energy fast, which eventually make the entire network lifetime reduced. What’s more, the path loss around the human body is very high compared with the free space propagation [16, 17]. Especially when the communication is in non-line of sight (NLOS), e.g., in the scenario where the sender is placed on the back and the receiver on the chest, the direct communication between them will not always be possible even with increased transmission power. Therefore, in consideration of these factors, the protocol design for WBAN should not only be in accordance to the differentiation of each node’s energy consumption but also establish a reliable link among the nodes through the multi-hop connection. Consequently, in order to extend the network lifetime and improve reliability, we have to adopt different strategies according to the energy consumption of the nodes and the connectivity of the network. Spontaneously, constructing an optimal network formation in which the network topology can be adaptively adjusted on the basis of residual energy of each node individually is an option in mind.

Nonetheless, there has been very little research about the topology adjustment in a WBAN. CICADA [18] is a cross-layer protocol that sets up a spanning tree and offers low delay and high energy efficiency. But this mechanism did not consider the heterogeneous property of WBAN applications. In [19] it was required to construct a minimum spanning tree (MST) for implanted BAN according to each node’s battery status and distance. However, from the viewpoint of the coordinator the protocol demands for complex and repetitive MST-based topology construction procedures. Relaying for improving the network lifetime in a WBAN is presented in [2022]. These protocols introduced additional devices called relaying nodes which can spread out the transmission effort over the entire network. In addition, employing relay to enhance the network performance such as energy efficiency and low delay also presented in [2325]. In this paper, we consider to design an energy-efficient protocol employing relaying node which may be a node in the network or an extra device only for the relay function. The proposed energy-efficient strategy could be applied to other large scale wireless networks [26, 27].

Regarding to the WBAN research, other than the academia progress, the industry has also made effort to promote the international standards. The IEEE 802.15 working group (WG15) formally set up a Task Group 6 (TG6), which is aimed to work out an international standard for WBAN [28]. And IEEE 802.15.6 standard [29] is finally released through repeated revision at the beginning of 2012 which defines new Physical (PHY) layer and medium access control (MAC) layer specifications for WBANs. Although the new standard is specifically designed for WBAN applications, it is just released and relatively complicated. Moreover, IEEE 802.15.6 shows poor power consumption performance for Life Signs Monitoring applications. In [30], MedMAC is proposed for ultra low power WSN applications. The simulation results showed that compared with IEEE 802.15.6, MedMAC had a significant improvement in energy consumption with an energy saving of between 25.6–33.2 % for packet rates ranging from 1 to 10 pkts/s. However, IEEE 802.15.4 [31] is relatively simple and has the ability to support wide applications for WBANs. Moreover, our research is focused on the topology switching in WBANs, not the standards themselves, which is beyond the scope of standards. Therefore, in the paper we modify the superframes for network topology switching based on IEEE 802.15.4. In IEEE 802.15.4, two topologies, i.e., the star type and the peer-to-peer type are defined depending on the application requirements. But, most of the contents of the standard specify the operating procedure under one-hop star topology network, while the details about the peer-to-peer network formation are very limited.

Based on the IEEE 802.15.4 multi-hop superframe structure, this paper proposes an adaptive MAC protocol for WBANs, which is called as Network Longevity Enhancement by Energy Aware MAC Protocol (NLEEAP). The challenge of this mechanism is how to make the WBAN coordinator perform relay election operations in case that the shortage of a sensor node’s residual energy occurs. We address the issue through revising the superframe structure of IEEE 802.15.4 to perform the network topology adjustment. In short words, the contributions of the paper are presented as follows.

  • A framework supporting multi-hop communications is proposed. NLEEAP works well on different topologies (single-hop type or multi-hop type) according to the residual energy status of each sensor node. Moreover, to meet the varying network topologies, the superframe structure is adaptively adjusted. To the best of our knowledge, so far it’s the first time to switch the network topology adaptively between the one-hop type and multi-hop type, along with the superframe adjustment.

  • To support the network topology adjustment, an effective relaying node election policy is proposed. Using this method, the WBAN coordinator performs relay election operation in the whole network once a sensor node detects its energy shortage. This policy resolves the problem of how to choose a better relaying node in the network for the energy shortage node which is not previously involved.

  • To prove the efficiency of the proposal, performance metrics of network lifetime, packet delivery ratio and average packet delay are evaluated in the paper. Simulation results demonstrate that adaptive topology design strategy of NLEEAP works well compared with the IEEE 802.15.4 star-based network and the network lifetime is extended effectively.

The remainder of this paper is organized as follows. The next section briefly reviews the IEEE 802.15.4 MAC protocol. Section 3 presents the operational details of NLEEAP. Section 4 discusses the two-hop extended star network in IEEE 802.15.6, also with reasons of designing our protocol based on IEEE 802.15.4. The simulations conducted to evaluate the performance of NLEEAP are described in Sect. 5. Finally, the conclusions of the paper are drawn in Sect. 6.

2 Overview of IEEE 802.15.4 MAC

IEEE 802.15.4 standard defines the physical layer (PHY) and MAC sublayer specifications for low-rate wireless personal area network (LR-WPAN) architectures which focus on low-cost, low-speed communication between devices with limited power [31]. Depending on their functionalities, two types of devices are defined in an LR-WPAN: a full function device (FFD) and a reduced function device (RFD). An FFD can talk to any other device and operate as a PAN coordinator, an ordinary coordinator, or a device. An RFD can only communicate with its associated FFD because of its reduced functionality. Furthermore, the standard supports two network topologies, the star topology and the peer-to-peer topology, as illustrated in Fig. 1 [31]. In star networks, each end device directly communicates with a single central controller named the PAN coordinator which manages the entire PAN. In the peer-to-peer topology, a PAN coordinator is also used. However, it differs from the star topology as any FFD device can arbitrarily communicate with any other device as long as they are in range of one another. A special case of the peer-to-peer communications topology is the cluster tree. In this case, a node may only communicate to its parent and children nodes.

Fig. 1
figure 1

Star and peer-to-peer topology examples

IEEE 802.15.4 MAC has two operation modes: beacon-enabled mode and nonbeacon-enabled mode. If there are periodical beacons broadcasted by the PAN coordinator in the network, it is defined as a beacon-enabled mode; otherwise, it is defined as a beaconless mode. Since there is no superframe defined in the beaconless mode and no slot synchronization is available, IEEE 802.15.4 MAC operates in carrier sense multiple access with collision avoidance (CSMA-CA) and can not support the energy saving applications due to the fact that the network is always in active status. Thus in this paper we only study the beacon-enabled mode of IEEE 802.15.4 MAC and its revised version.

2.1 Star topology

For the purpose of synchronous communications at MAC layer, the IEEE 802.15.4 PAN can operate in the beacon-enabled mode. The superframe structure used in this case is shown in Fig. 2 [31]. Each superframe is bounded by periodically transmitted beacon frames for device synchronization and association control. The superframe consists of an active portion and an optional inactive portion. The PAN coordinator interacts with devices during the active period and enters a low-power (sleep) mode during the inactive period. The superframe structure is specified by the values of two MAC attributes: the beacon order (BO) and the superframe order (SO), both of which determine the length of the superframe, i.e., beacon interval (BI), and the length of its active portion, i.e., superframe duration (SD), respectively. The relation of BO to BI and the relation of SO to SD are illustrated in Fig. 2, where the value of aBaseSuperframeDuration is 960 symbols. Note that beacon-enabled PANs shall set BO to a value between 0 and 14 and SO to a value between 0 and the value of BO, i.e., \(0\le \hbox {SO}\le \hbox {BO}\le 14\).

Fig. 2
figure 2

An example of the superframe structure in the star topology

The active period of the superframe is divided into 16 equally spaced slots and is composed of three parts: a beacon, a contention access period (CAP), and a contention-free period (CFP). All frames, except acknowledgment (ACK) frames and data frame that quickly follows the acknowledgment of a data request command, transmitted in the CAP shall follow a successful execution of a slotted CSMA-CA mechanism to access the channel. Two types of data transactions exist in the CAP: the direct transmission for uplink data and the indirect transmission for downlink data. To support time critical data applications, the PAN coordinator may reserve one or more time slots to that application, which are called guaranteed time slots (GTSs). The GTSs form the CFP of the superframe, which always starts on a slot boundary immediately following the CAP and completes before the beginning of the inactive portion. The PAN coordinator may allocate a maximum of seven GTSs at the same time for a single superframe, and a GTS may occupy more than one superframe slot. It should be noticed that the CFP can not operate independently and is always integrated with the CAP.

2.2 Multi-hop topology

In the peer-to-peer network, multi-hop transmissions are supported. Similar to superframes used in the beacon-enabled star topology, not only the PAN coordinator but also any ordinary coordinator may periodically transmit its own beacons. A coordinator that is not the PAN coordinator shall maintain the timing of both the superframes in which its coordinator transmits a beacon (the incoming superframe) and the superframes in which it transmits its own beacon (the outgoing superframe). The relationship between incoming and outgoing superframes is illustrated in Fig. 3 [31].

Fig. 3
figure 3

An example of the superframe structure in the star topology

From a coordinator’s view, the incoming and outgoing superframe structure is actually the consecutive overlaps of its parent’s superframes and its own superframes. It is worth noting that the overlap only occurs between the active portion and the inactive portion. In other words, there are no overlaps for the active part of each superframe. More specifically, the active portion of the superframe transmitted by the PAN coordinator (referred to as PAN superframe) is only used for the information interaction between the PAN coordinator and its one-hop children, while other devices enter a sleep mode during this time interval for power saving. When the PAN coordinator enters a sleep mode during the inactive part of PAN superframe, its one-hop children FFDs (hereinafter noted as one-hop relaying nodes) will then act as the ordinary coordinators. At the proper time, the relaying nodes send their own superframes (relay superframes) to interact information with their children devices e.g., relayed nodes. The procedures will continue until nothing but a leaf node remains in each branch of the multi-hop network. Note that each relaying node must first listen for its associated coordinator’s beacon to synchronize with the network before it begins to transmit its outgoing superframes to its next-hop children devices. And the active portion of a relay superframe shall be completed by the end of the relaying node’s associated coordinator’s superframe.

As a coordinator, the relaying node simultaneously maintains the timing of both its incoming superframes and outgoing superframes, as shown in Fig. 3. The relative timing of these superframes is defined by the StartTime parameter of the MLME-START.request primitive in the specifications [31]. Moreover, the beacon order and superframe order are equal for all superframes on a PAN. All devices interact with the PAN only during the active portion of a superframe.

3 NLEEAP: Network Longevity Enhancement by Energy Aware MAC Protocol

Not relying on the one-fold network formation (i.e., either single-hop topology or multi-hop topology) that most of research efforts did, the network topology in NLEEAP is adaptively adjusted by the WBAN coordinator who is the master control node of the whole network. The focus of attention in NLEEAP is to provide a mechanism for the WBAN coordinator so that it can perform relay election operations when the shortage of the residual energy of one of the network nodes occurs. The primary object of NLEEAP is to prolong the lifetime of the energy-insufficient nodes through energy balance among nodes in the network, based on which the lifetime of the whole network is expected to be correspondingly extended.

At the beginning, we assume that all the associated sensor nodes communicate with the WBAN coordinator through IEEE 802.15.4 star-type network. The superframe structure used is similar to the example depicted in Fig. 2. Suppose all the sensor nodes in the network can work on different power levels and can accurately measure the residual battery power of themselves, and let\( P_{i}\) be the ratio of the remaining battery power to the initial battery power for node\( i\). In NLEEAP, once \(P_{i}\) drops below a predefined threshold, which is denoted by \(P_{thr}\), node \(i \)minimizes its power consumption by decreasing its transmission power. Accordingly a relaying node is desired to forward node\( i\)’s subsequent messages to the WBAN coordinator, i.e., providing relay service for node \(i\). Therefore the network topology is transformed from single-hop to multi-hop and the superframes have to be adjusted to support the subsequent data transfer transactions. In NLEEAP main operations include relay request, relay response and superframe adjustment.

3.1 Relay request

Whenever a device, such as node \(i\), detects its current \(P_{i}\) is less than \(P_{thr}\), it initiates the relay request operation to inform the WBAN coordinator of its energy shortage (ES). Node \(i\) is denoted as ES node hereinafter in the paper. At the moment if data transactions between node \(i\) and the WBAN coordinator exist, node \(i\) piggybacks the information onto the interacting frame (data frame, MAC command frame or ACK frame) through 1 reserved bit notification in the frame control field of the frame format. Otherwise, if node \(i\) has no data interaction with the WBAN coordinator, it transmits a dedicated frame, which is named energy shortage (ES) frame in this paper. The WBAN coordinator acknowledges the successful reception of the related piggybacked frame or ES frame by transmitting an ACK frame. After node \(i\) receives ACK from the WBAN coordinator, the relay request is completed and further procedures are initiated.

3.2 Relay response

When the WBAN coordinator gets ES notification from node \(i\) through 1 bit piggybacked information or ES frame, it performs the relay response operation in the next successive superframe. The object of relay response is to find proper relaying nodes for ES node which successfully sends ES information to the WBAN coordinator. To accomplish the relay response, the structure of the next superframe is modified as shown in Fig. 4. Relative to the superframe structure of IEEE 802.15.4 illustrated in Fig. 2, two new time periods are introduced in the active portion of the superframe, which are named neighbor discovery period (NDP) and relay decision period (RDP), respectively. Then, the active portion is divided into five parts: beacon, NDP, RDP, CAP and CFP. Essentially, the packet transactions in NDP and RDP are based on TDMA approach to avoid the collision to guarantee the relay success. For CAP and CFP in the modified superframe, all the network devices work as obeying the original IEEE 802.15.4 MAC, which are used for the contention-based and contention-free transmissions, respectively. Focusing on the function modification and newly added parts, the characteristics of the modified superframe are presented as below.

Fig. 4
figure 4

Superframe structure in relay response

3.2.1 Beacon

Apart from contributing to the synchronization between the WBAN coordinator and the surrounding nodes and defining the structure of the superframe, in order to choose proper relaying node for an ES node, beacon also needs to notify which ES node is in the network. To do so, we modify the frame format of beacon frame through adding relay pending address fields in its MAC payload, as demonstrated in Fig. 5. The relay pending address fields contain the list of addresses of the devices that currently already notified their ES status to the WBAN coordinator successfully. It is worth noting that the position of the address in the relay pending address fields indicates the order to broadcast a relay request (RREQ) frame in the subsequent NDP following the beacon. After receiving the beacon frame, each ES node extracts its transmission sequence in the relay pending address fields, so that it knows at which time slot it is allowed to broadcast a RREQ frame in the following NDP. For the FFD nodes with sufficient energy (hereinafter non-ES FFD node or NES FFD for short) which may be nodes originally existing in the network or additional nodes only for relay function with enough energy, they keep awake in the entire NDP to prepare to respond the RREQ frames from the ES nodes.

Fig. 5
figure 5

Beacon frame format in relay response

3.2.2 Neighbor discovery period (NDP)

In order to find all energy-sufficient neighbors of each ES node, the WBAN coordinator reserves one or more time slots that are assigned to the ES nodes according to their order in the relay pending address fields of the beacon frame. Such slots form the NDP of the revised superframe. The NDP shall start immediately following the beacon. Each ES node broadcasts its relay request frame with the minimum power level \( l_{min}\) supported by its transceiver in the corresponding time slot of the NDP, meanwhile all the NES FFDs stay awake to listen to RREQ frames till the end of the NDP. This wake-up mechanism ensures that all the potential relaying neighbors of each ES node can be notified.

3.2.3 Relay decision period (RDP)

A RDP is a period during which the WBAN coordinator collects all the energy-sufficient neighbors’ information of each ES node and selects proper relaying node for it. Any energy-sufficient FFD in the network (NES FFD) is desired to respond the RREQ in the previous NDP by transmitting a relay reply (RREP) frame to the WBAN coordinator. The MAC payload of a RREP frame contains its current power ratio denoted by \(P_{i}\) and a list of addresses of the devices that it has just heard during the NDP. For the prevention of collisions among RREP frames transmitted by different NES FFDs simultaneously, the WBAN coordinator broadcasts a notification (NTF) frame at the very beginning of a RDP. A NTF frame notifies a list of addresses of the FFDs in the network, which is the order to transmit its individual RREP frame. Each NES FFD listens for the NTF frame to obtain its transmission sequence in the network. After extracting its own transmission sequence, the FFD knows at which time slot in RDP it can transmit its RREP. After a time, its transmission sequence multiplied by macResponseWaitTime, the corresponding NES FFD transmits its RREP frame to the WBAN coordinator.

The WBAN coordinator receives all the RREP frames, extracts the individual \(P_{i}\) from them, and selects a NES FFD with the maximum value of \(P_{i}\) among all the NES neighbors available as the relaying node of the relevant ES node. After all the relay decisions are made for all the ES nodes, the WBAN coordinator broadcasts a relay decision (RDCS) frame which contains the list of addresses of the ES nodes and their corresponding relay address list in the last time slot of RDP.

After receiving the broadcasted RDCS frame, different devices in the network are initiated accordingly. On one hand, each ES node needs to check whether the ES address list of the RDCS contains its address or not. If so, the ES node now becoming the relayed node reads its relaying node’s address in the corresponding relay address list, and will only communicate with its relaying node using the current power level, i.e., \(l_{min,}\) supported by its transceiver in the following transactions. Otherwise, if its address is not included in the ES address list, the relay failure occurs under the current power level, then, the ES node increases its transmission power level to re-initiate the relay request operation. The procedures above are repeated until the relay decision is made for the ES node. Finally if under the acceptable maximum power level, there is still no suitable relaying node can be chosen, then the ES node will give up requesting relaying node and keep on operating as it in the star-type topology.

On the other hand, for a NES FFD, after the reception of the RDCS frame, it first extracts the corresponding relay address list to determine whether it is selected as a relaying node or not. If being selected, in the following processes, the NES FFD will communicate not only with the WBAN coordinator but also with the corresponding ES node. Otherwise, if not being selected, it maintains its original working mode with the WBAN coordinator. In other words, as long as the corresponding relay address list is not empty, the network topology will be changed into a multi-hop topology extension: for a NES FFD which is selected as a relaying node, it will forward data packets for the relative relayed node, while the non-selected FFDs will still only communicate with the WBAN coordinator as usual and no children nodes involved.

3.3 Superframe adjustment

After the relay response operation depicted in the previous sub-section is completed, the suitable relaying nodes have been selected for the relayed nodes by the WBAN coordinator. Then the network is ready to operate in the multi-hop topology (a cluster tree). By the moment, there are two types of coordinators in the network: one is the WBAN coordinator that acts as a gateway of WBAN with the outside network (e.g., a WPAN, a WLAN or a cellular network); the other is the ordinary coordinator which is selected as a relaying node in the RDP for an ES node.

To adapt to the topology transformation from the star-type to the multi-hop, the MAC sublayer switches its superframe structure to the corresponding multi-hop superframe, which is actually the continuous overlap of the superframes used in the original single-hop mode. Each ordinary coordinator maintains the timing of both the incoming superframe and the outgoing superframe. The superframe adjustment operation can be presented as follows. To begin with, as the primary controller, the WBAN coordinator transmits its beacon at a proper time and the WBAN superframe begins. All its single-hop children listen to the beacon transmitted by the WBAN coordinator, and then synchronize to the WBAN superframe structure. Any child node wishing to communicate with the WBAN coordinator should ensure that all its transactions are completed before the end of the active portion of the WBAN superframe, while the ES nodes which have requested relay successfully may enter a sleep mode during this time. Afterwards, when the WBAN coordinator enters a sleep mode, i.e., during the inactive portion of the WBAN superframe, each relaying node acts as the ordinary coordinator to interact with its one-hop children (the relayed nodes), using the outgoing superframes as illustrated in Fig. 3. Note that the time at which the relaying nodes begin transmitting beacons are relative to the received beacon from the WBAN coordinator with which the relaying nodes synchronized. Through choosing the appropriate value for the protocol parameters of SO and BO, it can be ensured that the active portion of each outgoing superframe will complete before the end of the WBAN superframe. Therefore, the continuous overlap between the WBAN superframe and the outgoing superframes from the relaying nodes forms the multi-hop superframe structure. And this adjusted superframe will always be used in the subsequent processes until the WBAN coordinator receives new ES request information again. In this case, the WBAN coordinator will re-adjust the superframe structure after making the relay decision for the new ES node, while other relaying nodes which still have sufficient energy maintain their outgoing superframe as before.

By the way, there will be no collision of the outgoing superframes among different relaying nodes because that the WBAN coordinator is aware of relaying nodes in the whole network and definitely tells the relaying node at which time slot it can transmit its outgoing superframe to avoid collision with others. In this way, from the WBAN coordinator’s viewpoint, a complete multi-hop superframe consists of the active portion of the WBAN superframe, the active portion of each outgoing superframe arranged one by one and the remaining inactive part of the WBAN superframe. It is worth noting that the duty cycle of the WBAN superframe should be low enough to accommodate the multiple outgoing superframes for different relaying nodes.

At last, there is another point to be paid attention to. Considering that prolonging the network lifetime is one of the most important attributes of MAC protocol design in WBANs, we mainly take into account the power saving issue in the protocol. It should be noticed that this protocol can also provide other benefits, such as network performance enhancement in case of channel quality deterioration caused by body posture. In this case, relay request operation is performed when a node finds that its current communication link is bad although its residual energy may be sufficient, and other procedures are the same as those of energy shortage situation. Obviously, under such circumstances, the protocol plays an important role in ensuring the connectivity of the network, since the link weakness may happen frequently, especially considering the mobility of the sensor nodes located on the extremities or the specific absorption rate (SAR) of the sensor nodes placed in close proximity to or inside the human body, both of which will also waste a large amount of energy. In a word, the proposed NLEEAP in this paper mainly provides an adaptive network switching framework and how to fully use it depends on the specific communication situation of WBANs.

4 Discussion

As the latest standard for WBANs, IEEE 802.15.6 has explicitly mentioned relays. The standard defines two network topologies: one-hop star BAN and two-hop extended star BAN. In a two-hop extended star network, frames which are exchanged between the hub and the relayed node through relaying node need to be encapsulated except control type frames. In IEEE 802.15.6, two methods are specified for the relayed node to choose a relaying node. The first method is that the relayed node may choose the node as its relaying node if it recently received the node’s acknowledgment frames to the hub; the second method is that the relayed node may choose the node as its relaying node if it recently received the node’s broadcasting T-poll frames. Although the standard gives ways to choose a relaying node, it doesn’t give the rule how to select a preferable relaying node when not just one node in the network can be the relaying node, which is of great significance to the network performance. Hence, we take this issue into account in our protocol and provide the procedure. Moreover, in IEEE 802.15.6 standard, the relayed node and the relaying node exchange their frames only in the scheduled allocations of managed access phase (MAP). In the contention phase of the superframe, the relayed node is not allowed to transmit its frames to the relaying node. The structure of the superframe in the two-hop extended star BAN is always the same with the one-hop star BAN, which is different from our protocol design. In addition, the IEEE 802.15.6 is a new standard and hasn’t been widely used in the industry, while the IEEE 802.15.4 is widespread use in the industry as well as in the academia. Furthermore, standards named IEEE 802.15.4j [32] and IEEE 802.15.4n [33], targeting for USA and China respectively, which are to create an amendment to the physical layer of the IEEE 802.15.4 accordingly with the modifications to the MAC in order to support the new physical layer are under establishment. In a word, because of its simplicity and ability of supporting wide application, the IEEE 802.15.4 can be a choice at present for us to design the adjustment of the network topology.

5 Performance evaluation

In order to prove the efficiency of the proposed mechanism, we have implemented IEEE 802.15.4 MAC and NLEEAP on the platform of MIRAI-SF [34], and simulated the respective performances of them in the same network scenario. All components in MIRAI-SF to carry out a simulation are provided as plug-in agents. Since the plug-in agents are easily implemented and rearranged, users can perform flexible simulations.

5.1 Simulation model

In the simulated WBAN, We consider a single BAN consists of one coordinator and several end devices as shown in Fig. 6. For IEEE 802.15.4, the network topology is always one-hop star type, while for NLEEAP the topology may be adjusted to be multi-hop when a node detects its energy shortage. In addition, considering the conventional application scenario of a WBAN such as a data collection system where all the data transmissions are initiated by the sensor nodes, the downlink traffic from the WBAN coordinator is not considered in this paper.

Fig. 6
figure 6

Network topology

The relevant network parameters used in the simulation are tabulated in Table 1. Here the MAC size of the frames used in the process of relay response, such as MACNTFFrameSize, MACRREPFrameSize, is not listed in the table below because of its variable MAC payload. Besides, some assumptions are made for the simulation as follows:

Table 1 Simulation parametres
  • Propagation delay is neglected.

  • The effect of bit errors in the channel is neglected. In other words, a packet is dropped only due to packet collision or device buffer overflow.

  • Acknowledgment frame is mandatory for a successful data transmission.

  • CBR is chose as the traffic model.

5.2 Simulation results

5.2.1 Performance of NLEEAP in relay mode

As NLEEAP has the ability of reducing energy consumption of ES nodes so as to prolong the total network lifetime by choosing relaying nodes, we first evaluate the performance of NLEEAP in relay mode in this part. We suppose the NLEEAP is working in relay state, i.e. ES nodes have been served by relaying node and network is working in multi-hop mode. We evaluate the effect of the number of relayed node on the network performance. By adjusting the number of relayed node, we observed the performance in terms of total energy consumption, average end-to-end packet delay and delivery ratio in relay state. In the simulation, there exists 8 ES nodes in the network, and half of them access the channel in CAP and others in GTS. For NLEEAP, relayed nodes were relayed through additional relaying nodes. By the way, the data rate of all nodes is 1kbps and the whole simulation lasts for 100 seconds.

Figure 7 depicts the total energy consumption as a function of the number of relayed node in the network. The total energy consumption here is defined as the sum of energy consumption of ES nodes, i.e. we do not consider the energy consumption of relaying node. This is because NLEEAP mainly focus on reducing ES nodes’ energy consumption to prolong the network lifetime, while relaying nodes are usually energy enough or can be charged easily. It can be observed from Fig. 7 that NLEEAP is effective in reducing the energy consumption of ES nodes due to the fact that relay occurs when a node detects its energy shortage. The more ES nodes that become relayed nodes, the lower energy will be consumed, i.e. the ES nodes will live longer. When the number of relayed node reaches 8, i.e. all the ES nodes were successfully relayed, the total energy consumption decreased by 40.7 % compared with IEEE 802.15.4. It is of great help for ES nodes to prolong their lifetime.

Fig. 7
figure 7

Total energy consumption versus number of relayed nodes

The performance of average end-to-end packet delay is plotted in Fig. 8. It is shown that NLEEAP will increase the average packet delay compared with IEEE 802.15.4. The reason behind of this is that NLEEAP works in two-hop mode. For a packet from relayed node to coordinator, it will be first transmitted to relaying node in the outgoing superframe, and then be forwarded to coordinator by relaying node in the incoming superframe. This will result in a longer waiting time in the buffer. The larger number of relayed nodes there exists in the network, the larger average packet delay will be. This implies that NLEEAP improves the energy efficiency at the cost of increasing average packet delay.

Fig. 8
figure 8

Average packet delay versus number of relayed nodes

Moreover, we evaluate the performance of delivery ratio and the result is shown in Fig. 9. It is observed that NLEEAP in relay state and IEEE 802.15.4 have almost the same performance on delivery ratio. This is due to the fact that relaying node forwards the data of its relayed nodes in the same access manner, i.e. if the relayed node has a GTS slot in the beginning, the relaying node will utilize it for GTS transmission. In other words, the way of data transmission does not changed. Therefore, NLEEAP will have little effect on delivery ratio performance.

Fig. 9
figure 9

Packet delivery ratio versus number of relayed nodes

5.2.2 Performance in human body scenario

In addition to the above simulation results, we have conducted another simulation based on human body environment. In this part, we consider heterogeneous medical application, including EEG, heart rate, ECG, body temperature, pulse oximeter and respiratory rate; the detailed value is shown in Fig. 10. In the simulation, there exist 6 medical sensors distributed in body according its function. All the sensors access the channel in CAP period, and initial energy were set to be 1J. Performance metrics evaluated in this part include network lifetime, average packet delay and delivery ratio. We considered NLEEAP with additional relay and without additional relay respectively. NLEEAP with additional relay means that the protocol introduces extra node only for relay function. While NLEEAP without additional relay means that the relaying node is chosen from nodes originally existing in the network.

Fig. 10
figure 10

Network topology on human body

Figure 11 depicts the relationship between energy threshold and network lifetime. The network lifetime here is defined as the time duration from the simulation beginning to the moment when the first sensor node runs out of its energy. It can be seen that the network lifetime of NLEEAP is higher than IEEE 802.15.4 obviously no matter whether additional relay exists or not. For the scenario without additional relay, the network lifetime increases with energy threshold and then decreases later; the peak performance is achieved when the energy threshold equals to 0.6 with 32.7 % of performance gain in network lifetime. This is because ES nodes will start to request relay too late if the energy threshold is set too low, i.e. the relay resource is not sufficiently used. On the other hand, if the energy threshold is set too high, ES nodes will start to request relay too early, which has definitely benefit from the view point of ES nodes, however, from the view point of energy sufficient node, a higher energy threshold means a trend of earlier termination of relay service, i.e. a short relay service for the relayed node. Therefore the peak performance will be achieved at a proper energy threshold. For the scenario with additional relay, the network lifetime increases with energy threshold and does not decrease. The performance gain achieves 66.9 % when the energy threshold equals to 0.9. This is because additional relay is energy sufficient and the relay service will not be terminated due to energy shortage. In this case, the higher the energy threshold is set to be, the longer the relay service will be, i.e. a better performance gain.

Fig. 11
figure 11

Network lifetime versus energy threshold

Result shows that by deploying additional relay at a proper position, NLEEAP can work very well in improving the network lifetime. Even in the scenario without additional relay, i.e. relaying nodes are chosen within network nodes, the network lifetime is also improved greatly. Although the energy consumption of relaying nodes will increase, the total network performance becomes better. Especially in WBAN, the importance of energy of different sensors is different, for example, energy of sensors implanted into body is more valuable than the energy of sensors wore at the surface of a body. Therefore the manner of sensors outside the body whose energy is sufficient or battery charging is convenient to provide relay service for implanted sensors is acceptable and can be a very useful way to save power.

Fig. 12
figure 12

Average packet delay versus energy threshold

As illustrated in Fig. 11, the network lifetime of NLEEAP without additional relay can be extended by 32.7 % over IEEE 802.15.4 at most when the energy threshold equals to 0.6. We concede that this value may be not the optimal energy threshold. However, designing a dedicate algorithm for optimizing this value is out of the scope of this paper and will be a potential topic in our future work.

Moreover, the average packet delay and delivery ratio as a function of energy threshold were plotted in Figs. 12 and 13 respectively. It can be observed from Fig. 12 that the relationship between average packet delay and energy threshold has the same trend with Fig. 11, i.e. energy threshold has same influence on network lifetime and average packet delay. For the scenario without additional relay, the average packet delay increases with energy threshold and decreases later, and the peak value is achieved at the same energy threshold 0.6. For the scenario with additional relay, the average packet delay increases with energy threshold linearly. This is because the energy threshold is a key factor which influences the duration of relay service. However the relay service will increase the average packet delay as demonstrated in the first part, it means that the longer the relay service will be, the larger the average packet delay will be. This is the reason why average packet delay and network lifetime have the same trend versus energy threshold. It can be concluded that NLEEAP has the ability to improve the network lifetime at the cost of increasing average packet delay and the increment of network lifetime is approximately proportional to the increment of average packet delay.

As is depicted in Fig. 13, energy threshold has almost no influence on delivery ratio. The reason behind this is that energy threshold can only influence the start time and the duration of relay service, while there is little change in delivery ratio during relay service as demonstrated in first part, so no matter when to start a relay process, the delivery ratio keeps stable.

Fig. 13
figure 13

Packet delivery ratio versus energy threshold

6 Conclusions

An adaptive network switching scheme for WBANs was proposed in the paper, which is called as NLEEAP. Unlike the existing energy-efficient MAC protocols for WBANs, NLEEAP does not adopt the one-fold network formation (single-hop type or multi-hop type). Instead, the network topology is adaptively controlled depending on the energy consumption of each sensor node. To satisfy the varying network formation requirement, the superframe structure is correspondingly switched from the single-hop-based superframe to the incoming and outgoing superframe supporting the multi-hop network. We compared the performance of NLEEAP with that of IEEE 802.15.4 MAC from the perspective of network lifetime, packet delivery ratio and average packet delay. Simulation results show that by adopting the energy-adaptive selection of the relaying nodes, the network lifetime in NLEEAP is effectively improved. At most the network lifetime of NLEEAP without additional relay can be extended by 32.7 % over IEEE 802.15.4. While in the scenario of introducing additional relay, the network lifetime of NLEEAP can be extended by 66.9 % over IEEE 802.15.4 at most.

Our work represents a first step in designing an energy efficient protocol with relaying nodes employed in which the topology can be dynamically controlled. Further work will include optimizing the protocol parametres, such as \(P_{thr}\), along with research into the best trade-off strategies for reducing the average packet delay and extending the network lifetime simultaneously. Furthermore, in order to increase the efficiency of NLEEAP, we will keep on improving NLEEAP in the light of specific duty cycle conditions of the devices, i.e., we will consider using flexible duty cycling techniques for NLEEAP so that devices can go into sleep mode as long as they have no data to send and receive. Moreover, because that the specialized standard for WBAN—IEEE 802.15.6 has been recently released, we will also focus our next work on adjusting the network topology adaptively based on IEEE 802.15.6 which is our top concern in the future.