1 Introduction

Due to the increasing pressure from high health-care costs and the aging population, it becomes important and necessary to provide efficient and effective health-care services for the old as well as the patients. To achieve this, the emerging medical cyber-physical systems (MCPS) have aroused significant concern from the both industry and academia. MCPS is an integration of sensing, computation, communications and medical processes, which can provide reliable and real-time services [17, 31]. They monitor various vital life signs (e.g., blood pressure, electrocardiogram (ECG), electroencephalogram (EEG), temperature, etc.) for patients or elderly people in a real-time manner, and provide diagnostic evaluation of the collected signals in a timely manner. Meanwhile, they also have the capability of delivering useful clues to doctors, thus enabling the remote control of patients’ health conditions.

The proliferation of microprocessors, sensor technology and wireless network technology, has fostered rapid growth MCPS recently. However, significant efforts are still needed to satisfy the strict requirements of MCPS, such as high-confidence, reliability, and real-time. In order to guarantee the validity of the data, MCPS imposed strict and critical requirements with respect to reliability and timeliness. This is because many vital data related to human life safety is time-critical and delay-sensitive in MCPS. Therefore, it is necessary to ensure reliable and real-time data transmissions in MCPS. IEEE 802.15.4 is considered to be an excellent candidate owing to its low-power and low-cost communications. But it cannot provide the guarantee of reliability and timeliness [32, 33]. Although the IEEE 802.15.4 protocol has an optional CFP (Contention Free Period) which can provides Guaranteed Time Slots (GTS) for emergency data transmissions, the number of available GTS is limited such that it is insufficient to achieve high performance. As mentioned above, the IEEE 802.15.4 protocol cannot be applied to MCPS directly. To address these challenges, we modify the original IEEE 802.15.4 protocol for MCPS.

In this paper, we propose a new protocol, called Ada-MAC, which is built on top of IEEE 802.15.4 standard to achieve real-time transmission, reliability, collision avoidance and adaptivity. The proposed protocol consists of a series of efficient mechanisms such as the time-triggered mechanism, the priority queue mechanism, and the adaptive mini-slot allocation strategy. In this way, the proposed protocol can not only enable dynamic GTS allocation but also provide differentiated services for different nodes according to their data types. Hence, reliable and real-time transmissions are guaranteed for high-priority data, while the lower-priority data can be transmitted during other time slots that are not initially assigned. We simulate the proposed protocol based on the OMNET++ simulation platform. To examine the performance of the proposed protocol, two different access modes of IEEE 802.15.4 MAC (slotted CSMA/CA and CFP mode) will be considered. Simulation results will be presented and analyzed.

The rest of the paper is structured as follows. Section 2 highlights the related work. Then Sect. 3 gives a brief introduction of IEEE 802.15.4 protocol and the time-triggered protocol (TTP). Section 4 presents a detailed description of the Ada-MAC protocol. Sections 5 and 6 report the simulation setting and simulation results, respectively. Finally, Sect. 7 concludes the paper.

2 Related work

A large number of research efforts have been made on data communications in fields closely related to MCPS, such as home care, wireless health monitoring, body sensor networks, assisted living, and tele-medicine[1, 15]. For instance, Ali et al. [1] proposed an urgency-based MAC protocol to provide service differentiation for patient and elderly health monitoring. The protocol is based on cutting-off the number of packet retransmissions for sensor nodes of non-urgent data to increase the access probability of sensor nodes with urgent health information. In [21], the authors proposed a congestion control and service prioritization protocol for real time monitoring of patients’ vital signs using wireless biomedical sensor networks. It can distinguish physiological signals and assign them different priorities, which results in better quality of service in important data transmissions. Seo et al. [28] introduced a novel dynamic slot allocation scheme based on IEEE 802.15.4 for wireless body area networks (WBAN), which could dynamically allocate CFP slots in demand-driver manner. The scheme provides the flexibility while reducing bandwidth waste. In addition, the authors exploited the opportunity period in inactive period for flexible ranges of the latency. Yan and Liu [36] presented a context-aware MAC protocol which can switch between normal state and emergency state. As a result, data rate and duty cycle of sensor nodes are dynamically changed to meet the requirement of latency and traffic loads in a context-aware way. In [10], the authors proposed a traffic-adaptive MAC protocol for WBAN. The protocol is supported by a traffic-base wake up mechanism and awake up Radio mechanism that are used to accommodate various kinds of data in a reliable manner. Paso et al. [26] introduced a novel dynamic slot allocation scheme based on IEEE 802.15.4 MAC for hospital environment which enables effective utilization of the GTS slots introduced in the IEEE 802.15.4 MAC protocol. The PAN (personal area network) coordinator allocates the GTS slots based on the GTS buffer lengths of the end devices to guarantee immediate channel access to high priority traffic.

Meanwhile, the new generation of medical health-care solutions (i.e. MCPS) has drawn lots of attention [17, 29]. In the future, the MCPS will evolve into ubiquitous supervisory-control, patient-centric systems performing autonomous, cooperative and coordinated actions [18]. Most current medical care systems operating in store-and-forward mode have no-real-time diagnostic capabilities. In contrast, the MCPS allow diagnostic evaluation of vital signs in real-time and makes continuous care possible, as shown in Fig. 1 [8]. To achieve these functions, a highly confidential communication protocol is crucially important, for high QoS, adaptation, real-time and reliable transmissions of life-critical data. In this paper, we propose a new MAC protocol based on IEEE 802.15.4 standard for MCPS.

Fig. 1
figure 1

An example of medical cyber-physical systems

Since the release of IEEE 802.15.4 in 2003 and the emergence of the first product on the market, IEEE 802.15.4 soon becomes a popular short-distance communication protocol and has been applied to a wide range of fields for its advantages in terms of interoperability, low power and cost efficiency.

In recent years, lots of researchers have been devoted to investigating the performance of IEEE 802.15.4 protocol in different conditions, for example,[4, 5, 7, 19, 20, 22, 23], and our previous work [33]. With the deepening of this research, more and more research studies reveal that the IEEE 802.15.4 protocol has the problem of unreliability and high latency. Giuseppe et al. [2] gave a comprehensive analysis of IEEE 802.15.4 protocol targeting at the unreliability problem including packet dropout, latency, etc. Meanwhile, to overcome these problems, many ideas have been proposed[16, 30].

Park et al. [27] presented a novel adaptive MAC algorithm and the stations can adjust the MAC parameter adaptively using the proposed algorithm to guarantee the reliability and delay constrains of the IEEE 802.15.4 protocol, according to current transmission condition. In [11], Anis et al. added the priority queue to the IEEE 802.15.4 protocol. In each node, the packets with different priorities have different values of the CSMA/CA parameters. In [12], a new priority-based algorithm for the IEEE 802.15.4 beacon-enable network was proposed in order to alleviate the end-to-end delay.

But all these improvements are considered in the slotted CSMA/CA mechanism. Besides improving in CSMA/CA mechanism, many researchers start to pay attention to the GTS allocation mechanism in the CFP.

In [9, 24, 25], the authors proposed a priority-based service-differentiation scheme which means that each node within a network is divided into multiple different priority classes by differentiating the contention window size and the backoff exponent. The data with higher priority has the higher reliability and lower latency. In [13], the authors presented a new approach to allocate GTS in the IEEE 802.15.4 protocol which is called i-GAME that allows sharing the same GTS among multiple flows based on their traffic specifications and delay requirements to guarantee the reliable and timely transmission. An adaptive and real-time GTS allocation mechanism called ART-GAS has been given in [34] which has two stages: operating a service-differentiation mechanism that dynamically assigns data-base priorities and rate-based priorities to all nodes in the first stage, and allocating GTS resources to node according to their priorities assigned in the second stage.

In [6], the authors used the time-triggered communications over the IEEE 802.15.4 protocol and gave a preliminary solution for the transmission of real-time time-triggered traffic. In [3], Afonso et al. modified the IEEE 802.15.4 protocol and presented a new MAC protocol supporting for real-time and loss intolerant traffic through the contention-free operation, the retransmission scheme flexibility and the high throughput efficiency.

It has been recognized that CSMA/CA mechanism cannot provide the timely and reliable transmission and utilizing GTS slots in the CFP period enables effective data transmissions for time-critical data. But we also realize some weaknesses of original GTS allocation procedure. Firstly, if the slave nodes which own GTS have no data to send, the resources will be wasted. Secondly, the maximum number of GTSs is limited to 7 in one superframe. When the offered load exceeds the capacity of the GTS allocation, some slave node will be starving and cannot obtain GTS. This may lead to some serious unacceptable results that vital data from one node would be lost since all GTS are allocated to some others. Thirdly, the GTS allocation strategy is not priority-based and all data are equally treated. Some high priority data cannot obtain enough GTS compared to lower priority data. Here we revised the original protocol to solve the above mentioned problems.

In this paper, we expand the state-of-the-art research on the IEEE 802.15.4 protocol and propose the Ada-MAC protocol based on our previous work [35]. The main contributions of the paper are: (1) We implant the priority queue and the time-triggered mechanism into the IEEE 802.15.4 protocol; (2) The proposed protocol can support adaptive GTS allocation that improves the utilization ratio of GTS and reduces the waste of time slots; (3) We simulate the proposed protocol using the OMNeT++ simulator and provide a careful performance evaluation; (4) A performance comparison of the proposed protocol and the IEEE 802.15.4 MAC is given.

3 IEEE 802.15.4 and time-triggered protocol

3.1 The IEEE 802.15.4 protocol

IEEE 802.15.4 is a standard designed for low-rate PANs. It covers the PHY layer and the MAC layer of a low-rate wireless network.

The PHY layer is defined for the operation in three different unlicensed ISM frequency bands (i.e. the 2.4 GHz band, the 915 MHz band and the 868 MHz band) which includes 27 communication channels.

The MAC layer offers two different modes: beacon-enable mode and non beacon-enable mode. In beacon-enable mode, the coordinator sends beacon frames periodically. The beacon interval defines the time between two consecutive beacon frames. it contains an active period and optionally, an inactive period. The active period is also called superframe, which is divided into 16 time slots equally. The superframe contains a beacon frame, a contention access period (CAP) and a CFP. During the CAP, a CSMA/CA mechanism is used for data transmission. The CFP is optional and contains up to 7 GTSs in each superframe. Guaranteed Time Slot is reserved for the specified nodes to transmit time-critical packets.

3.2 Time-triggered protocol

The TTP is intended for the use in distributed real-time applications which require a high dependability [14]. The data communication in TTP is organized in TDMA rounds, each round is a TDMA frame and is divided into slots. Each node in the network has one slot to send its data packet. In TTP, a particular node, the master node offers a clock synchronization that establishes the global time base without relying on a central time server. The master generates a periodic message called trigger message and broadcast it to synchronize all the other nodes in the network. The transmission of a trigger message represents the start of one TDMA frame. The message also contains the schedule of the TDMA frame which is controlled by the master node. So each node could know the time when the TDMA frames start and the position of its slot within the frame in order to know exactly when to begin its packet. The TTP has the biggest advantage in avoiding collisions. In addition, the protocol could guarantee the data transmission with predictable low latency and provide service with minimal overhead.

4 The Ada-MAC protocol

The Ada-MAC protocol is a hybrid MAC protocol, which combines schedule-based on TTP and the contention-based CSMA/CA mechanism. It enables real-time transmissions and provides collision avoidance by using the GTS policy, and also can adjust the CFP durations adaptively. Meanwhile, the proposed protocol can allocate appropriate numbers of time slots for the particular node that has burst or important data to transmit based on the time-triggered mechanism, while other nodes will transmit their data in the left slots using CSMA/CA mechanism.

4.1 Superframe structure

The Ada-MAC protocol is designed based on the beacon-enabled IEEE 802.15.4 MAC in a star topology network. The superframe structure of the protocol is shown in Fig. 2. The superframe is divided into a fixed number of mini-slot (current implementation is 64, we can adjust it according to the demand) and each mini-slot is long enough to transmit one data packet. During the transmission process, the coordinator broadcasts the beacon frame periodically, which determines the new superframe structure. Such information may includes the position of the mini-slot pre-allocated to each node that has important data, the duration of CFP, begin time of CAP, beacon interval, etc. A beacon frame means the start of a certain superframe. When a node receives a beacon frame, it should synchronize the coordinator first, which is a key step in the time-triggered mechanism.

Fig. 2
figure 2

Structure of superframe

The superframe can be subdivided into the following three periods: (1) CFP; (2) CAP; (3) The inactive period. Unlike a beacon-enabled IEEE 802.15.4 superframe structure where the CAP duration is followed by CFP duration, we swap the position of CAP and CFP in the superframe. In Ada-MAC, the CFP is followed by CAP in order to enable the data in CFP be transmitted earlier than those in the CAP.

The CFP contains a number of GTS allocated by the PAN coordinator to the specific nodes for sending real-time data. Each GTS may contain one or more mini-slots and only belongs to one node. The CFP uses the time-triggered mechanism and each node can be triggered at the start of its own GTS and transmits burst and periodic data according to the GTS information announced previously in the beacon frame of the current superframe. When its own GTS expire, the node would turn off the transceiver and switch to sleep mode. The GTS assignment for a node is valid only in the current superframe. Consequently it can optimize the passive GTS deallocation scheme. The transmissions during the CFP can provide reliability and real-time guarantees for the time-critical data. In addition, we remove the seven GTSs per superframe restriction in Ada-MAC protocol. The maximum duration of CFP can be dynamically extended, even to the length of the whole active period.

The CAP is placed after the CFP. During the CAP, each node can transmit normal data using the slotted CSMA/CA mechanism. In addition, if the nodes have burst data to transmit in this period, they can compete with normal data during CAP to guarantee reasonably bounded delay. Compared with sending normal data, the node send burst data with different value of CSMA/CA parameters, including Content Window Length (CW), Number of Backoff (NB), Backoff Exponent (BE) and MaxFrameRetries. By using this priority backoff method, the burst data are more likely to access the channel and avoid conflict with normal data. Furthermore, in order to guarantee the reliability, the coordinator shall send acknowledgement (ACK) to the source node when receiving the burst data.

4.2 Priority queue mechanism

The proposed Ada-MAC protocol defines three data types: burst data, periodic data and normal data. The burst data is defined as emergency data which is unpredictable and need to be transmitted immediately. The periodic data are generated periodically and are equally importance. Moreover, the burst data and periodic data require real-time and reliable transmissions while the normal data do not need specific requirements, as shown in Table 1. Here, we refer to the real-time as timely treatment of data before a particular deadline and not low-delay communication. The priority queue mechanism can allocates different types of data to separate queues and the packets within each queue are maintained in Earliest Deadline First (EDF) order. The Priority Queue mechanism can reduce the queuing delays of the high priority data.

Table 1 Priority of data

In this protocol, we set the number of queues to three, as shown in Fig. 3. When the data frames arrive, the queue system at first classifies the frames based on the frame type identified by the upper layer and stores them into corresponding queues. The packets in low-priority queue can only be transmitted in the CAP using the CSMA/CA mechanism. During the CFP, when the burst data and periodic data are all waiting for transmission, the MAC layer will choose the burst data to be transmitted first. Here we assume that Queue 3 contains burst data, Queue 2 contains periodic data and Queue 1 contains normal data.

Fig. 3
figure 3

Priority queue

4.3 Adaptive mini-slot allocation

As described in the previous section, we divide the whole superframe duration into 64 mini-slots and remove the seven GTSs per superframe restriction in Ada-MAC protocol. In this way, more nodes can obtain the GTS to transmit their real-time data frames in a reliable and timely manner.

In order to reduce the number of wasted time slots and achieve dynamic distribution of resources, the nodes will send GTS requests to the PAN coordinator at the end of each superframe. Before sending the request, the node will check the number of the burst data and periodic data waiting for transmission in the priority queues respectively and also the total average remaining permissible delay (RPD) of them. At last, it records the information in the GTS allocation request if it has. After the coordinator receives the GTS requests, it schedules the structure of the CFP by using the Mini-slot Allocation Strategy. Before presenting the Mini-slot allocation strategy, we introduce some important notations and formulas.

Definition 1

The permissible delay for a packet is defined as the time interval (ms) between the packet generation time and its deadline.

Definition 2

The remaining permissible delay for a packet is defined as the remaining time (ms) before it reaches its deadline.

The following notation refers to the time variable of the packet in the queue. Terms containing subscripts Q and i correspond to the ith packet in queue Q, \(1\le Q\le 3\).

\(D_{({actual},i)}^{Q}\) :

denotes the actual delay of packet.

\(D_{({permissibe},i)}^{Q}\) :

denotes the permissible delay of packet

\(T_{({deadline},i)}^{Q}\) :

denotes the deadline of packet.

\(D_{({RP},i)}^{Q}\) :

denotes the remaining permissible delay of packet.

\(T_{{cur}}\) :

denotes current time.

\(T_{({arrive},i)}^{Q}\) :

denotes the time that the packet arrive at the destination.

\(T_{({gen},i)}^{Q}\) :

denotes the generation time of packet.

\(AD_{({RP})}^{Q}\) :

denotes the total average remaining permissible delay of data in queue Q.

As we defined, each packet has a permissible delay when it generated in the application layer. The permissible delay of a packet can be expressed as follows:

$$\begin{aligned} D_{({permissible},i)}^{Q}=T_{({deadline},i)}^{Q}-T_{({gen},i)}^{Q} \end{aligned}$$
(1)

We can compute the remaining permissible delay of packet \(D_{({RP},i)}\) at any time before its deadline. It can be expressed as the following equation:

$$\begin{aligned} \begin{aligned} D_{({RP},i)}^{Q}&=D_{({permissibe},i)}^{Q}-(T_{{cur}}-T_{({gen},i)}^{Q})\\&=T_{({deadline},i)}^{Q}-T_{{cur}} \end{aligned} \end{aligned}$$
(2)

Equation (3) is used for calculating average remaining delay of data in queue Q. \(AD_{{({RP})}}^{Q}\) reflects an average level of nodes’ remaining permissible delay in queue Q. Here \(N^{Q}\) means the total number of time-critical data in queue Q. \(AD_{({RP})}^{Q}\) is an important parameter for calculating the \(K^{Q}\) in (4).

$$\begin{aligned} \frac{\sum \nolimits _{i = 1}^{N^{Q}}{D_{({RP},i)}^{Q}}}{N^{Q}} \end{aligned}$$
(3)

In order to get a fair distribution strategy, the coordinator allocates the mini-slots to the nodes according to the value of \(K^{Q}\). The value of \(K^{Q}\) is dynamically adjusted and depends on the number of packets (\(N^{Q}\)) and the average remaining permissible delay of packets in queue Q.

$$\begin{aligned} K^{Q}= \frac{{N^{Q}}}{AD_{({RP})}^{Q}} \end{aligned}$$
(4)
figure f

The actual delay of packet can be calculated using (1). If the actual delay is smaller than the permissible delay, the packet is validated. Otherwise, the packet is overdue. Even if the packet arrived at the destination, it still will be dropped. It is an essential parameter for computing On-time delivery ratio.

$$\begin{aligned} D_{({actual},i)}^{Q}=T_{({arrive},i)}^{Q}-T_{({gen},i)}^{Q} \end{aligned}$$
(5)

Here we describe the Mini-slots Allocation strategy. The detailed information has been given by Algorithm 1. In Algorithm 1, GR stands for the GTSs Request sent by the nodes. It contains four parameters: length, MacAddress, \(N_{b}\), \(N_{p}\), \(RPD_{b}\) and \(RPD_{p}\). length signifies the number of mini-slot requested. MacAddress signifies the mac address of the request node. \(N_{b}\) denotes the number of burst data that the node needs to transmit; \(N_{p}\) denotes the number of periodic data that node needs to transmit. \(RPD_{b}\) and \(RPD_{p}\) indicates the average remaining permissible delay of burst data and periodic data respectively. Similarly, GL stands for the GTS List scheduled by the PAN coordinator. It contains three parameters: startslot, length and MacAddress. startslot means the starting mini-slots of GTS allocated by the PAN coordinator for the nodes sending requests. A value of 0 means no GTS is allocated to the node. length shows the number of mini-slots for the GTS.

On receipt of the GTS request, the coordinator calculated \(K^{Q}\), based on the information contained in the request frame: the amount of the real-time data, priority of the data, and the average remaining permissible delay, as expressed in (4). Hence, \(K^{Q}\) is regarded as an important threshold value in the whole GTS allocation process, considering all above mentioned aspects. In our proposed algorithm, burst data always rank before periodic data to obtain GTS allocations, and for each of them, data with the same priority and a larger \(K^{Q}\) will be privileged. At last, the schedule information of the CFP is conveyed in the beacon frame by the field “GTS Allocation List”, as shown in Fig. 4.

Fig. 4
figure 4

Structure of GTS allocation list in beacon frame

5 Simulation settings

In order to evaluate the performance of the Ada-MAC protocol, we adopt the medical health-care scenario which consists of a base control node (the PAN coordinator) and several wireless monitoring nodes, as depicted in Fig. 5. The PAN coordinator collects the data from the sensor nodes deployed in different parts of the body. These sensor nodes can sense physiological signals such as ECG, EEG, blood pressure and temperature for the heath care service. They send data to the PAN coordinator periodically. Some of them need to be delivered correctly within a predefined deadline. Burst data is totally unpredictable. It is generated randomly and needs to be transmitted in time. The permissible delay of each data type we assumed is presented in Table 2. Moreover, we assume that there are two types of nodes except the coordinator in simulation. One is RT node which can generate all three types of data we mentioned above. The other one is normal node which can only generate the burst data and normal data. The same types of data generated by different kinds of nodes have the same priority. Besides, without loss of generality, several assumptions are made to reduce the complexity of the simulation model and they are described as follows:

Fig. 5
figure 5

Simulation scenario

  • No hidden nodes in the simulation.

  • The coordinator only receives the GTS requests and not transmits.

  • Only the transmit GTSs for the uplink traffic are considered.

We simulated the Ada-MAC protocol using the OMNET++ simulator. In the simulation, a star topology with a single PAN coordinator and 16 nodes deployed in the area of 300 cm *300 cm is considered. The nodes are uniformly distributed around a 150 centimeters radius circle while the PAN coordinator is placed at the center of the circle. Every transmission is a single-hop. All the nodes are set to be in each other’s radio range and each node can learn the other nodes easily. The payload size of packet is fixed as 60 bytes. The sensor nodes transmit data on a 2.4 GHz RF band for 2,000 s of simulation. The detailed simulation settings are shown in Table 3.

Table 2 Allowable delay of data
Table 3 Simulation parameters

As we mentioned above, in order to guarantee the burst data priority access the channel during the CAP, we use the priority backoff methods during the channel contention. In CSMA/CA algorithm, there are three factors: NB, CW and BE. Besides, MaxFrameRetries is also an important parameter. Thus, we set the different CSMA/CA parameters for burst data and normal data, as shown in Table 4. These value can also be dynamically adjusted according to actual situations.

Table 4 CSMA/CA parameters in simulations

By changing the packet generation rate of different types of data, we intend to investigate the performance of the Ada-MAC protocol including the timeliness, reliability, and resource efficiency. In order to meet these requirements, we select mean (max) end-to-end delay, packet loss rate, on-time delivery ratio, packet drop ratio (by queue) and effective utilization rate of CFP as performance metrics.

  • Mean (max) end-to-end delay: It refers to the average (max) time duration from the time that a packet is generated in the monitoring node to the time the packet is successfully received by the coordinator (receiver) in the application layer. They are the crucial metric to evaluate the real-time performance of networks.

  • On-time delivery ratio: This metric reflects the dependability and latency performance of networks. It is computed as the ratio of the number of packets delivered to the MAC layer of destination node correctly before the deadline to the total number of each type of packets generated by all source nodes. \(D_{({permissible},i)}\) is an important threshold value. Here we define that only if \(D_{({permissible},i)}\ge D_{({actual},i)}\), the packet is considered as validate and the transmission is an on-time delivery.

  • Packet drop ratio (by queue): This metric expresses the ratio of the total number of packets are dropped by the queue at the source nodes to the total number of each type of packets generated by all source nodes. This metric can also reflect the reliability of the network.

  • Packet loss rate: This metric expresses the ratio of the number of packets are lost during the transmission to the total number of each type of packets generated by all source nodes.

  • Effective utilization rate of CFP: This metric can measure the effective utilization rate of CFP bandwidth. It indicates the GTS resource efficiency. It is the ratio of the time used for transmitting time-critical packets to the total time duration of CFP.

6 Results and analysis

In the previous section, we described the common settings for the simulation. This section will present the performance of the Ada-MAC protocol and compare it with the IEEE 802.15.4 MAC protocol in two different access modes. In this way, we can analyze the advantages and disadvantages of the proposed protocol easily.

Assume that all of data are generated from an exponential distribution and the burst data is generated randomly. We range the generation probability of the burst data (\(P_{{burst}}\)) from 2‰ to 100‰. The generation interval of the periodic data (\(PGI_{periodic}\)) ranges from 0.1 to 0.7 s while the generation interval of the normal data is fixed to 0.06 s. In this way, we can evaluate the performance of our proposed protocol.

6.1 Mean(Max) end-to-end delay

In this section, we evaluate the real-time performance in different access modes (Ada-MAC, Slotted CSMA/CA mode, CFP mode). Figures 6 and 7 clearly show the mean end-to-end delay and max end-to-end delay of time-critical data (periodic data and burst data) with different number of RT nodes. We set the total end device to 20 and the number of RT nodes among them is varied. Form the results, we can find that in the original 802.15.4 MAC with slotted CSMA/CA mechanism, the delay of the time-critical data rise significantly with the increasing number of RT nodes, attributable to the high contention caused by the CSMA/CA mechanism. As the number of RT nodes becomes larger, the delay of most time-critical data are very high. After using the CFP mode, most of the real-time data get a smaller delay but still cannot meet the real-time requirement. On the contrary, in the Ada-MAC protocol, the periodic data can always keep an acceptable latency with the increasing number of RT nodes. This is because in the original IEEE 802.15.4, the buffered packet brings about the severe contentions and causes a pretty long delay of real-time data. However, the priority queue adopted in the Ada-MAC protocol can ensure that the high priority data are privileged to be delivered to their destination. In addition, the Ada-MAC allocates GTS for the burst data and the periodic data dynamically depending on their remaining permissible delay. This method can schedule the transmission order of the time-critical data more reasonably compared with CSMA/CA mechanism and CFP mode. Furthermore, the burst can also be transmitted in the CAP, which will also decrease the delay significantly.

Fig. 6
figure 6

Impact of number of RT nodes on mean end-to-end delay

Fig. 7
figure 7

Impact of number of RT nodes on max end-to-end delay

Next we examine the mean end-to-end delay of the burst data and periodic data in Ada-MAC with different value of \(P_{burst}\) and \(PGI_{periodic}\) (Figs. 8, 9). We can observe that under the same \(PGI_{periodic}\), the larger \(P_{burst}\) leads to the longer average delay. As \(PGI_{periodic}\) decreases, the average delay grows gradually. It can be easily explained that the larger \(P_{burst}\) or smaller \(PGI_{periodic}\) means a higher traffic load which leads to worse competition environment and the data will suffer a longer waiting time. Nevertheless, most of the delay of time-critical data maintains within their permissible delay. This is precisely because the Ada-MAC provides a priority queue and an adaptive mini-slot allocation strategy and tries to ensure the critical-data can be delivered to the destination in a bounded time interval.

Fig. 8
figure 8

Mean end-to-end delay of periodic data in Ada-MAC

Fig. 9
figure 9

Mean end-to-end delay of burst data in Ada-MAC

6.2 On-time delivery ratio

Next we evaluate on-time delivery ratio (ODR) to analyze the reliable performance of Ada-MAC. Figure 10 compares the on-time delivery ratio of time-critical data with various numbers of RT nodes. In original IEEE 802.15.4 MAC with slotted CSMA/CA mechanism, we notice that with the ascending number of RT nodes, the ODR of critical data descends form the top (nearly 100 %) to very a small value. Perhaps the primary factor is that the more RT nodes cause a more intense channel competition and the more packets will be dropped for the delay beyond their permissible delay. In case of the CFP mode, the ODR of critical-time data is low and declines slowly with the increasing number of RT nodes. The reason can be explained as follows: the capacity of GTS is limited and the data may suffer a long waiting time resulting from the rough GTS allocation strategy before obtaining the GTS. Thus, the fewer data can reach the destination within the permissible delay. We can see that Ada-MAC has an outstanding performance in terms of on-time delivery ratio and can provide highly reliable transmissions for time-critical data.

Fig. 10
figure 10

Impact of number of RT nodes on on-time delivery ratio

Figures 11 and 12 further show the on-time delivery ratio of periodic data and burst data respectively in Ada-MAC with different value of \(P_{burst}\) and \(PGI_{periodic}\). It is clear that the smaller \(PGI_{periodic}\) leads to the lower ODR. For the same \(PGI_{periodic}\), the ODR rises slightly with the increasing \(P_{burst}\). Overall, the ODR of time-critical data always stays at a high level in the all scenarios. The reason is that the priority queue, priority backoff mechanism and the GTS can ensure the time-critical data priority access the channel and avoid collisions with others. Furthermore the adaptive GTS allocation strategy tries the best to guarantee the time-critical data arriving at the destination in a timely manner to keep the validity.

Fig. 11
figure 11

On-time delivery ratio of periodic data in Ada-MAC

Fig. 12
figure 12

On-time delivery ratio of burst data in Ada-MAC

6.3 Packet drop rate (by queue)

As shown in Fig. 13, packet drop rates (by queue) of time-critical data are presented under different number of RT nodes. We can see that under the slotted CSMA/CA mechanism, the packet drop rate grows significantly when more than 8 RT nodes try to access the channel. Because the intense contention leads to longer waiting time for data in queue, more data will be dropped for the queue’s limited capacity. The worst case is CFP mode and the packet drop rate is very high due to the poor GTS allocation algorithm. The packet drop rate of time-critical data in the Ada-MAC is superior to all the other schemes, owing to the priority queue and service differentiation.

Fig. 13
figure 13

Impact of number of RT nodes on packet drop rate (by queue)

6.4 Packet loss rate

Figure 14 depicts the packet loss rates with different number of RT nodes. From the figure, we can see that when the density of RT nodes is low, all the three schemes maintain a good performance. As the RT nodes become dense (more than 8), the packet loss rate under slotted CSMA/CA mechanism begins to incline gradually while the others (the Ada-MAC and CFP mode) hardly change. Hence, it can be concluded that the CFP mode is more reliable than the CSMA/CA mechanism. On the other hand, similar to the CFP mode, the Ada-MAC has a very good performance.

Fig. 14
figure 14

Impact of number of RT nodes on packet loss rate

6.5 Effective utilization rate of CFP

At last, we measure the effective utilization rate of CFP in Ada-MAC and IEEE 802.15.4 MAC with CFP mode respectively. As can be seen in Fig. 15, the effective utilization of CFP in the Ada-MAC is close to 95 % while it is only about 30 % in the CFP mode. There is a striking contrast between them. A number of factors might contribute to this phenomenon. Firstly, the priority queuing distinguishes the time-critical data so that the GTS can serve for them more efficiently. Secondly, the adaptive mini-slot allocation strategy can optimize the GTS assignment by dynamically adjusting the CFP and reducing the waste of GTS. So the Ada-MAC can provide a high utilization rate of CFP.

Fig. 15
figure 15

Effective utilization rate of CFP

According to the simulation results and our analysis, we can know that the Ada-MAC is more outstanding than the other two schemes in providing real-time and reliable communication service.

7 Conclusion

This paper has presented an adaptive MAC protocol, called Ada-MAC, which can guarantee real-time and reliable communications for medical cyber-physical systems over wireless body sensor networks. The proposed protocol can provide different transmission modes for different types of data. In the Ada-MAC protocol, GTS are allocated in a dynamic and adaptive manner to needy devices with important data to transmit, which is known from the priority queue. A mini-slot allocation policy is further used to improve its adaptability. We compare via extensive simulations the performance of the proposed Ada-MAC protocol and the original IEEE 802.15.4 MAC protocol in two different modes. The results have demonstrated that the proposed protocol significantly outperforms the traditional one, in terms of reliability and real-time guarantees for time-critical data transmissions. Our future work in this line is to implement the proposed protocol and test it in a real system.