Reliable and Energy Efficient MAC Mechanism for Patient Monitoring in Hospitals

In medical body area network (MBAN) sensors are attached to a patient’s body for continuous and real-time monitoring of biomedical vital signs. Sensors send patient’s data to hospital base station so that doctors/caregivers can access it and be timely informed if patient’s condition goes critical. These tiny sensors have low data rates, small transmission ranges, limited battery power and processing capabilities. Ensuring reliability in MBAN is important due to the critical nature of patient’s data because any wrong/missing/delayed data can create a situation in which doctors may take wrong decisions about patient’s health which can have fatal results. Data transmission reliability in MBAN can be ensured by retransmissions, acknowledgments or guaranteed time slot mechanism but it causes more power consumption. We propose an efficient MAC mechanism to achieve both reliability and energy efficiency at an acceptable tradeoff level. The proposed MAC mechanism not only overcomes the limitations of ZigBee MAC mechanism such as inefficient CSMA/CA and underutilization of guaranteed time slots, but also adapts for different traffic types such as emergency and normal traffic. Our results show that application level throughput and packet delivery ratio increase and packet loss decreases. We also optimize energy utilization by tuning macMaxCSMABackoffs and macMinBE parameters of ZigBee MAC mechanism. Keywords—Medical Body Area Network; MAC Protocols; ZigBee MAC Mechanism; Guaranteed Time Slot Allocation Scheme


I. INTRODUCTION
Wireless sensor network is composed of tiny sensors for the purpose of sensing or monitoring different environmental or physiological parameters and conditions [1].Wireless sensor network(WSN) attained a world wide attention and is one of most promising research areas because of its diverse applications and a number of advantages over conventional networks such as ease of deployment, low cost, scalability, flexibility, reliability, etc. Application areas of WSN are military, security, agriculture [2], industrial, medical [3], [4], [5], [6], [7], environmental monitoring and home and office automation etc [8].Some other examples of WSN applications are real time monitoring of wheel condition of train [9], exploration of underwater environment [10], monitoring of concentration of volatile organic compound at risky sites [11] and fire monitoring [12] etc. Medical body area network(MBAN) is a subclass of wireless sensor network in which both internal and external sensors [13] can be attached to a person's body for the purpose of continuous and real-time monitoring of biomedical vital signs in order to provide timely healthcare facilities [14].Applications of body area network other than healthcare include entertainment, Lifestyle and Sports, Military etc [15].Network environment of body area network is different from wireless sensor network [16], [17].There are some minor differences among body area network and other applications of wireless sensor network, such as topology is known in a body area network, communication is hybrid, replacement of batteries is possible but difficult, and information is both identity centric and data centric etc.
Sensor devices are low cost, low powered, small sized, have small memory and are less in processing and computing power, and can be classified into sink and source nodes.Source nodes monitor the surroundings and sink node collects data from these source nodes in the network and sends it to the base station.Some important characteristics of a good wireless sensor network include scalability, responsiveness, reliability, energy efficiency and mobility.
In a medical body area network, medical sensors attached to a patient's body to monitor the patient's vital signs and forward data to sink node for further processing and taking actions.Sink node sends this information to the base station from where doctors or caregivers can access patient's information in order to take necessary actions.There are a number benefits of medical body area network such as continuous and real time patient monitoring, early detection of patient's critical health conditions, timely treatment, and solving the issues of medical staff shortage, etc. Medical body area network also enables doctors to give timely treatment if any patient has critical condition.Medical body area network can be used in remote patient monitoring applications such as at homes or old people houses [18] and it can be used within hospitals [19] for continuous monitoring of critical patients in ICUs or sitting in waiting rooms of hospitals.Another application of the medical body area network is to monitor the victims during the time of disasters by attaching medical sensors to their body.This application is very useful because during the time of disasters, there are high numbers of victims and it is not possible to look after all patients at the same time.All these applications of the medical body area network have two major benefits.First benefit is continuous monitoring of critical patients.This is not possible if nurses attend to patients because every hospital have limited nursing staff and each nurse has to attend multiple patients periodically.Second major benefits of the medical body area network is that we can attend to a large number of patients at a time by attaching medical sensors to their bodies to monitor and analyze their vital signs.Medical body area network has gained much attention in research because of its important and beneficial applications for mankind.A huge research has been done in the field of body area network, including applications, architectural design and challenges of the medical body area network.Research on architectural design of the medical body area network is important because it has always a significant impact on network performance.
Although medical body area network is a very beneficial application of wireless sensor network, but there is still a space for improvement in this field because improving reliability and energy efficiency is really a big challenge [20].Research is going on in the field of medical body area network for efficient routing, reliable communication and energy efficiency, etc. Reliability is important because any corrupt data or late delivery of data can cause critical results for the patient's health.We need energy efficiency because sensor nodes have limited battery power and it is very difficult to replace the batteries.In this paper, we focus on improving reliability and energy efficiency in medical body area network and propose an enhancement in ZigBee MAC mechanism to achieve these performance outcomes.
Rest of the paper is organized as follows: Section II gives an overview of ZigBee MAC mechanism.Section III discusses the related work such as existing solutions to achieve reliability and energy efficiency in medical body area network.In section IV we present our proposed solution and implementation details.After that we discuss results and future discussion in section V. Finally, we conclude the paper in section VI.

II. OVERVIEW OF ZIGBEE MAC MECHANISM
IEEE 802.15.4[21] is standard for personal area network for short range communications with low data rates i.e. 250 kbps.It defines the lower layers of protocol suite such as physical layer and MAC layer.However ZigBee is IEEE 802.15.4 based standard and it defines the upper layer of protocol suite.It is used in different applications of wireless sensor network and medical body area network such as home automation, agriculture, military, and healthcare, etc. Wireless sensor nodes with limited capabilities need a lightweight protocol for wireless communication in order to minimize power consumption, but not on the cost of network performance such as reliability, minimal delay, shortest latency etc.These are most important requirements of medical body area network because of critical nature of patient's data.In this section we discuss about the functionality of the ZigBee MAC mechanism.
ZigBee MAC supports two types of devices in network i.e. full-function devices (FFD) and reduced-function devices (RFD).Personal area network (PAN) coordinator, which acts as an in-charge of the whole network is a full-function device and it is capable of performing high duty jobs in network such as data collection and processing, storage of information, network management etc.Intermediate router in wireless sensor network is also a full-function device.Source nodes with limited functionality in the network are reduced-function devices which sense and collect data from the network and forward it to PAN coordinator.ZigBee MAC can support star and peer to peer topologies in order to connect these devices with each other in the network.In star topology, source nodes are connected to PAN coordinator and cannot directly communicate with each other.PAN coordinator manages the network and collects data from the sensor nodes.In peer to peer topology, nodes can directly communicate with each other.These nodes are capable of transmitting their own data and can cooperatively pass on the data of neighboring nodes to the sink node.ZigBee MAC provides two types of services, e.g.data service and management service.Data service includes transmission and reception of data at the MAC layer and the management service includes the management of PAN and coordination among the nodes.
Beacon enabled and non-beacon enabled are two network operating modes supported by ZigBee MAC in order to enable two way data communication in the network.Beacon enabled mode is best suited for battery powered PAN coordinator and end devices because of duty cycling.PAN coordinator periodically wakes up and sends beacon packets to end devices in the network.Similarly, end devices periodically wake up to check for incoming beacon packets from PAN coordinator.In non-beacon enabled modes, some devices remain active all the time such as PAN coordinator and router while other end devices such as source nodes remain in the sleep state.Active devices in non-beacon enabled mode have high power consumption, so they need a continuous power supply.Both beacon and non-beacon enabled operating modes of ZigBee can manage different traffic types such as periodic data, burst data, etc.In beacon enabled network, slotted CSMA/CA scheme and an optional guaranteed time slot (GTS) allocation scheme are used for channel access and unslotted CSMA/CA channel access scheme is used in non-beacon enabled network.For the body area network applications we focus on beacon enabled network because this mode is considered to ensure reliability in the network.The Superframe structure of ZigBee MAC is shown in Fig. 1 in which beacon interval is divided into superframe duration and an inactive period.In an inactive period all nodes go into a partially sleep mode to save battery power.Superframe duration is further divided into sixteen equal sized time slots.In the first slot of every superframe, PAN coordinator node broadcast a beacon packet to advertise the network information among the nodes connected to it.All those nodes who are willing to communicate in the network, capture network information from beacon packets and synchronize themselves with the network.Next fifteen time slots are divided into contention access period and an optional contention free period.Alternate terms for the contention access period and contention free period are GTS-off mode and the GTS-on mode respectively.GTS stands for guaranteed time slots.We use these alternate terms instead of conventional names such CAP and CFP in the rest of our paper.We discuss about these GTS-off and GTS-on modes in the following subsections.

A. GTS-off Mode
Default working mode of ZigBee is GTS-off in which CSMA/CA mechanism is used for the purpose of contention avoidance in the network.In this mode every source node maintains three variables which are backoff exponent (BE), number of backoffs (NB) and contention window (CW) for each transmission attempt in the network.BE refers to a number of backoff periods a node should wait before trying to access channel.Backoff period is a basic time unit equal to 80 bits(0.32ms).NB refers to the number of backoffs required by the CSMA/CA algorithm while trying to attempt current transmission.If NB is exceeded by maximum number of backoffs, then the algorithm reports failure and device terminates its current channel access attempt.CW is length of backoff period, which need to be clear before any transmission attempt.The default value of BE is in the range from 3 to 5 i.e. macMinBE and macMaxBE refer to minimum and maximum values of BE in Zigbee MAC.The default value of NB is 4 and of contention window is 2. Each node which has data to send, competes for free channel access and if it gets free channel then it transmits its data.If the channel is busy then node backoff its transmissions for random period of time and try to access channel after that time.In CSMA/CA, after each successful clear channel assessment (CCA), value of CW decrement (CW = CW -1) until its value reaches 0. If CW = 0, the node transmits its packet, otherwise the algorithm performs another CCA.After finding the channel busy each time the state of NB and BE is updated by increment in the values of NB, BE and CW such as NB is incremented as NB = NB + 1 until the NB < macMaxCSMABackoffs, and increment in the BE is as BE = min (BE+1, macMaxBE) and the size of CW resets to 2.
CSMA/CA is a good mechanism to avoid collisions in the network, but it is not as much efficient as needed for medical body area network because the operating state of the network is always changing and network traffic especially emergency traffic is totally random and unpredictable.This type of traffic not only needs a collision avoidance mechanism but also needs a mechanism which should be able to cope with such conditions when there is a high packet drop rate due to collision in the network in order to ensure reliability at an acceptable level.That is why there is a need of a flexible CSMA/CA mechanism which adapts itself according to network conditions.

B. GTS-on Mode
Along with collision avoidance mechanism, ZigBee MAC provides the facility of reliable data transfer by offering a GTS allocation mechanism in which nodes can send GTS requests in current superframe for advance reservation of a time slot in the next superframe.The GTS allocation mechanism is used for two way communication between PAN coordinator and source node in the network.PAN coordinator can only allocate GTS to nodes on first come first serve basis.GTS always appear at the end of superframe structure, i.e. contention free period.PAN coordinator allocates GTS to the source nodes on the basis of GTS requests from particular node and available capacity in superframe.Available capacity for GTS allocation in superframe can be determined by minimum contention access period length, which is equal to 440 symbols when use GTS allocation mechanism in ZigBee MAC.A single GTS can span more than one slot in superframe and it allows a node to transmit in network within that portion of the superframe while other nodes defer their transmission in that portion and remain in sleep mode which helps to reduce energy consumption and avoid collision in the network.The drawback of the GTS allocation scheme is that it is not a flexible scheme.It follows the first come, first serve mechanism which causes some nodes to fail to get the GTS because those nodes who send GTS request earlier get the slot and avail all available slots in superframe structure.Similarly, if a selfish node joins the network who always gets a guaranteed time slot while other nodes having critical data to send fail to reserve a slot in next superframe.In both cases, nodes shall not be able to transmit their data which results in packet loss due to buffer overflow.Another inflexibility of the GTS allocation scheme is that each node can send a request for the fixed number of slots irrespective of its bandwidth requirements.If a node has a small amount of data to send but according to standard it has to reserve a fixed number of slots which are larger than its requirement causes bandwidth under-utilization.
In the next section we present literature review for reliability and energy efficiency in medical body area network and background study of ZigBee MAC for ensuring these requirements of medical body area network.

III. RELATED WORK AND BACKGROUND
Fatima et al. [22] presented a survey on network architecture and research challenges in medical body area network and discussed research challenges of the medical body area network such as reliability and energy efficiency.Marwa et al. [23] presented a survey on technologies to cope with reliability and fault tolerance issues in body area network.Manish et al. [17] presented a survey on different mac protocols for body area network.Yu-Kai et al. [24] proposed an adaptive GTS allocation scheme to achieve low latency and fairness in body area network.In the proposed scheme, nodes reserve guaranteed time slots in advance either they have data to send or not and priority of each node is set on basis of time slot usage by that node.Liang et al. [25] proposed a GTS allocation scheme in which more than one device can share a single time slot in order to solve the problem of bandwidth underutilization.Yong et al. [26] proposed a GTS allocation scheme in which they increase the number of slots by decreasing the size of time slots in a contention free period according to super-frame order values.Bharat et al. [27] proposed an algorithm for optimization of the GTS allocation scheme in which nodes send a GTS request only if the number of packets cross the buffer threshold to improve reliability and bandwidth utilization.Hyung et al. [28] proposed an utilization aware GTS allocation scheme in which coordinator node maintains state of nodes on the basis of their network joining time, allocated GTS and utilization and desire for GTS allocation to improve the bandwidth utilization and reduce the latency in the network.Shrestha et al. [29] presented a Markov model hybrid communication in the network in which, if a node gets a guaranteed time slot then it will defer its transmission in CAP and only send in the CFP otherwise the node will transmit its data in the CAP.De-Thu et al. [30] proposed an enhancement in Zigbee by enabling an adaptive duty cycling to reduce energy consumption in body area network.Sherstha et al. [31] enhanced their work presented in [29] for wireless propagation and also evaluated the performance of proposed mechanism using a wheel chair body area network scenario.Nam-Tuan et al. [32] proposed an unbalance GTS allocation scheme to allocate GTS to nodes with different slot durations in wireless personal area network in order to solve bandwidth underutilization problem.Ho et al. [33] proposed a multi-factor dynamic GTS allocation scheme which considers the size of data, delay and GTS utilization to allocate GTS to nodes to improve the performance of network by reducing delay and increasing throughput in the network.Zhisheng et al. [34] proposed a QoS driven scheduling approach which uses Markov model to adjust the transmission order of nodes by using a threshold based scheme and addresses the packet delivery probability and energy efficiency.Mohammad et al. [35] proposed a GTS allocation scheme for emergency traffic using parameters such as traffic type and data rates in which traffic with the highest data rate will have higher priority.Haoran et al. [36] proposed a superframe based GTS allocation scheme in which priority of each node to be allocated a maximum number of slots is defined on the basis of sample rate, buffer size and slot utilization to improve energy efficiency in medical body area network.Jin et al. [37] proposed an adaptive slot allocation scheme in which contention access period is divided in to three phases and restricts the nodes to send their data on the basis of data type.Kong et al. [38] proposed a slot allocation scheme which uses two heuristic algorithms which are sampling rate oriented algorithm and successive approximation algorithm to determine the amount of data in buffer and to set priority of each node on the basis of sample rate.This scheme also takes a benefit from fixed topology of a wireless body area network.Tuomas et al. [39] proposed a dynamic GTS allocation scheme to solve the problem of unfairness in the GTS allocation scheme by including the number of packets and priority of each single packet in the GTS request packet.Pradnya et al. [40] proposed a modification in super-frame structure of IEEE 802.15.4 in which a fixed contention access period is used for the activities such as GTS management, network management etc to address the issues of scalability and interference etc. Maman et al. [41] proposed a wake up radio mechanism which considers two types of traffic in network, i.e. normal traffic and emergency traffic and uses a separate channel to send wakeup radio in order to ensure energy efficiency in body area network.Mario et al. [42] proposed an adaptive access parameter tuning of ZigBee MAC such as macMinBE and macMaxCSMABackoffs to achieve a desirable level of reliability and energy efficiency in body area network.Simone et al. [43] presented a comparison of proposed mechanisms of parameter setting in the ZigBee MAC to improve reliability and energy efficiency in body area network.They compared the proposed approaches such as measurement based adaptation proposed by Mario et al. [44], model based adaptation proposed by Mario et al. [42] and offline computation proposed by Pangun et al. [45] and concluded that flexible and adaptive tuning of parameters is better because network operating conditions tend to change from time to time.Shuanglong et al. [46] proposed an adaptive tuning algorithm in which they jointly tune the number of retransmissions which is a MAC parameter and sampling rate which is a parameter of control system for the purpose of finding a parameter set to attain the energy efficiency and a stable control system in the network.
ZigBee MAC is suitable for other applications of wireless sensor network, but it is not best suited for medical body area network requirements.Because in medical body area network, network conditions and traffic pattern are variable and random.There is also a very high demand of reliability, energy efficiency and minimum delay for communication in medical body area network.That is why there is a need of a flexible and adaptive MAC layer mechanism to improve performance of the medical body area network.In the next section we discuss about our proposed MAC scheme to overcome the limitations of ZigBee MAC and to improve reliability and energy efficiency in medical body area network.

IV. PROPOSED SOLUTION
We propose a reliable and energy efficient MAC mechanism which can adapt two different operational modes alternatively i.e.GTS-off and GTS-on.The proposed MAC mechanism adapts different traffic pattern in a network such as normal traffic and emergency traffic, and switches its modes according to it.In the proposed mechanism nodes transmit normal traffic in GTS-off mode and in order to ensure reliability, nodes use guaranteed time slot scheme to transmit emergency data in the network.PAN coordinator allocates guaranteed time slots to nodes on their GTS request basis.Nodes send request for GTS according to the amount of data present in their buffer.We propose some flexibility in the GTS allocation scheme of ZigBee MAC to make it suitable for patient monitoring in medical body area network.We also propose tuning of some CSMA/CA parameters to improve the shortcomings of ZigBee MAC and to ensure reliability and energy efficiency in medical body area network during the GTS-off mode.In the methodology section we discuss the proposed MAC mechanism in detail.

A. Methodology
We subdivide the details of proposed MAC mechanism into three parts i.e.GTS-off mode, GTS-on mode and adaptive MAC and discuss each of them in separate sections.In GTSoff mode subsection, we discuss the proposed mechanism of parameter tuning of CSMA/CA mechanism.In GTS-on mode subsection, we talk about the proposed flexible GTS allocation scheme and in adaptive MAC subsection, we discuss that how the proposed adaptive MAC mechanism takes decisions and switches its modes on traffic type basis.

1) GTS-off mode:
In the GTS-off mode of ZigBee MAC all nodes in the network who have data to send, compete for free channel access which causes collision and packet transmission failure in network.According to ZigBee standard, in CSMA/CA mechanism a small range of BE i.e. from 3 to 5 is used to avoid packet collisions among the nodes, but due to such a small range of BE parameter packet collisions are high because of early recovery of nodes from backoff state and become part of network again.On the other hand, if we increase the range of BE it helps to reduce packet collision rate, but it also introduces the delay in the network because in this case most of nodes remain in an inactive state and do not take part in communication for most of the time.Similarly, small value of macMinBE decreases the overall delay in the network, but on the cost of reducing network throughput because of the high collision rate and high energy consumption.The reason is that due to the small value of macMinBE nodes come into active state within a short time which again causes contention among the nodes.We simulate the network to show effect of changing of these parameters.Fig. 2, Fig. 3 and Fig. 4 show the effect of these different values of macMinBE on packet delivery ratio, goodput (Kbits/Sec) and energy consumption in term of number of packet retransmissions.Fig. 5 shows the effect of changing values of minMinBE on MAC packet breakdown.
If we keep the value of macMinBE constant and change the value of macMaxBE, increasing value of macMaxBE increases the packet delivery ratio and goodput (Kbits/Sec) but on the cost of increasing energy consumption as shown in Fig. 6, Fig. 7, Fig. 8 and Fig. 9.These figures show the effect of different values of macMaxBE on packet delivery ratio, goodput (Kbits/Sec) and energy consumption and MAC packet breakdown.
Transmission failure due to collisions increases the number of retransmissions, which leads to high energy consumption in the network.Another problem with ZigBee MAC is that smaller value of macMaxCSMABackoffs makes a node to   In order to solve these problems we propose a mechanism for flexible tuning of CSMA/CA parameters i.e. macMinBE and macMaxCSMABackoffs to avoid unnecessary retrans-  missions and to improve reliability and energy efficiency in the network at acceptable level.In the proposed mechanism these parameters adapts best value set according to different network conditions such as contention among the nodes and packet collisions in the network etc to improve the network performance.In the proposed solution we also change some default values of some MAC parameters as shown in Table I.
In the proposed mechanism we reduce the value of mac-MaxFrameRetries because there is no need to retransmit a packet again and again when packet loss is due to contention in the network.There is also a need to avoid the circumstances causing energy wastage such as retransmissions, but it is also important to take some necessary actions to reduce collisions in the network.We propose tuning of two ZigBee MAC parameters macMinBE and macMaxCSMABackoffs to improve performance of ZigBee MAC in terms of reliability and energy efficiency by reducing the transmission failure rate and retransmissions.a) Flexible macMaxCSMABackoffs: We define a new range of macMaxCSMABackoffs and its tuning in which value of macMaxCSMABackoffs increases or decreases according to clear channel assessment result.If there is no contention or small contention in the network and nodes are not competing for channel access then there is no need to set a larger value of CSMABackoffs.That is why, we propose that when CSMA/CA is successful and node successfully transmits it packets for consecutive 3 times then macMaxCSMABackoffs decrements as follows:-If ((macMaxCSMABackoffs > defaultmacMaxCS-MABackoffs) && (macMaxCSMABackoffs ≤ 7)) { macMaxCSMABackoffs-; } When there is a channel access failure in the network it means that there is high contention among the nodes in the network.When a large number of nodes have data to send and they try to access the channel at the same time they encounter channel access failure.In this case they have to terminate the algorithm after a few attempts because of smaller value of macMaxCSMABackoffs.Terminating an algorithm and start it from first step introduces some delay in the network.In order to solve this issue we propose an increment in value of macMaxCSMABackoffs after three consecutive CSMA/CA failures.A mechanism to increase the value of macMaxCS-MABackoffs after three consecutive CSMA/CA failures is as given below:-If ((macMaxCSMABackoffs ≥ defaultmacMaxCS-MABackoffs) && (macMaxCSMABackoffs < 7)) { macMaxCSMABackoffs++; } b) Flexible macMinBE: We define a new range of macBE from 2 to 7. We also propose flexible tuning of macMinBE according to network conditions such as packet collision rate and acknowledgment loss.When a large number of nodes try to transmit their data at the same time, then there is a possibility of packet collision in the network.In order to avoid collisions using CSMA/CA mechanism, we propose an increment in value of manMinBE after three consecutive collisions in network.By this way, in case of high collision in the network, we put some nodes to be in backoff state in order to reduce the contention in the network.Proposed mechanism for the increment in value of manMinBE is as follows:if ((macMinBE ≥ defaultmacMinBE) && (macMinBE < macMaxBE )) { macMinBE++ ;} When there are small number of collisions due to less contention in the network, then there is no need for a node to be in a backoff state for a longer time.It only introduces unnecessary delay in the network.To resolve this issue we propose a decrement in value of macMinBE.A mechanism to decrement in value of macMinBE is given below:if ((macMinBE > defaultmacMinBE) && (macMinBE ≤ macMaxBE )) { macMinBE-;} 2) GTS-on Mode: In order to solve the problem of bandwidth underutilization in the Zigbee MAC as shown in Fig. 14, Fig. 15, Fig. 16 and Fig. 17, we revise the mechanism of sending GTS request of node to PAN coordinator.We propose a mechanism in which, if a node has emergency data to send, first of all it will try to access channel using CSMA/CA.If the channel is free, the node will immediately send its emergency data otherwise it will store the data into an emergency buffer and send a request to reserve a guaranteed time slot.We also propose that instead of sending a request for a fixed number of slots, each node check total number of packets in its buffer and send a GTS request according to buffer size.Proposed mechanism for sending GTS request is given below.3) Adaptive MAC: Traffic in medical body area network is hybrid and it depends on the patient's health conditions.If the values of the patient's vital signs do not exceed a certain threshold, we consider it as normal traffic.Emergency traffic will be transmitted if condition of the patient goes critical and values of patient's vital signs exceed certain threshold level.In order to discriminate the normal and emergency traffic, we set threshold values for different vital signs of patient.For example normal body temperature is 36 to 37 degrees Celsius.We set thresholds for a human body temperature i.e. minimum threshold, if body temperature is less than 36 degrees Celsius and maximum threshold, if temperature of human body is equal to or more than 40 degrees Celsius.These two thresholds indicate the life threatening medical emergency and requires immediate medical treatment.If any of vital sign exceeds its threshold limit, data will be sent as an emergency traffic.
Emergency traffic needs high reliability as compared to normal traffic because of the critical condition of patients.We propose a mechanism which enables the algorithm to adapt its modes i.e.GTS-off and GTS-on according to traffic type.Proposed mechanism for adapting modes of MAC is given below.
if sensor value ≥ maxThreshold || sensor value ≤ minThreshold // emergency traffic then packet will send in GTS-on mode (CFP) else packet will send in GTS-off mode (CAP)

B. Implementation
We represent the medical body area network for patient monitoring in Fig. 18.Details of network implementation are given in Table .II.The proposed mechanism is implemented in an Omnet++ based Castalia Simulator.We set the field size to 10 meters and select star topology because it is best suited for short range communications in medical body area network.We take simulations for different network scenarios by changing the number of source nodes or by changing packet rates.There is no need of routing protocol because of predefined routing path in star topology.

V. RESULTS AND DISCUSSIONS
We select four performance metrics to compare the performance of the proposed mechanism with the ZigBee MAC which are packet delivery ratio, goodput(bits/Second), MAC packet break down and energy efficiency.Packet delivery ratio represents the ratio of the number of packets successfully received at destination divided by total number of packets sent at the application layer.Unit for goodput is bits per second and it is an application layer throughput which represents the actual data communicated from source to destination per unit time.The MAC packet breakdown has four sub performance metrics, i.e. transmission failure due to buffer overflow, transmission failure due to acknowledgment loss, transmission failure due to busy channel and the rate of successful packet transmission at MAC layer.We calculate energy efficiency in term of retransmissions overhead, e.g.smaller the number of retransmissions and duplicate packets, smaller the energy consumption of network.
We compare simulation results of both MACs against six different scenarios based on different packet rates and number of nodes.In scenario 1 packet rate of all nodes is same but the number of nodes are different.In scenario 2, packet rate is different such as 1 packet/Sec 2 packets/second, 3 packets/second, 5 packets/second and 10 packets/second but number of nodes remains constant.In this scenario, there are 10 source nodes and one PAN coordinator in the network.In scenario 3 20% nodes in the network have a packet rate of 1 packet/second and 80% nodes have 5 packets/second packet rate.In scenario 4 packet rate of 20% nodes in the network have 5 packets/second and 80% nodes have 1 packet/second.In scenario 5 50% nodes in the network have a packet rate of 1 packet/second and 50% nodes have 5 packets/second.In the last scenario, each node in a network has a different packet rate between the range of 1 packet/second to 8 packets/second.

A. Simulation Results
We subdivide this section into packet delivery ratio, goodput(Bits/Second), MAC packet break down and energy efficiency.
1) Packet Delivery Ratio: Fig. 19 and Fig. 20 show the simulation results of proposed MAC mechanism and ZigBee MAC of scenario 1 and 2 respectively.Simulation results for scenarios 3, 4, 5 and 6 are shown in Fig. 21.From the simulation results we can see that all modes of proposed MAC mechanism perform better than ZigBee MAC when we increase the number of nodes in the network or increase the packet rates.Proposed MAC performs better in case of setting different packet rates for each node as shown in Fig. 21.
2) Goodput(Kbits/Sec): Fig. 22 and Fig. 23 represent the goodput of both MACs for scenario 1, 2 and Fig. 24 shows the results of scenario 3, 4, 5 and 6.If we compare the performance of both MACs we can see that all modes of proposed MAC mechanism have better performance as compared to ZigBee MAC.When we compare the simulation results of scenario 3, 4, 5 and 6 we can see that when 80% of nodes have high data rates, such as 10 packets/second and only 20% nodes are sending 1 packet/second the goodput of the network is high as compared to scenario in which 80% of nodes are sending 3) MAC Packet Breakdown: The MAC packet breakdown is one of most important performance metrics.Under this performance metric we have further four performance submetrics such as transmission failure due to buffer overflow, transmission failure due to acknowledgment loss, transmission failure due to busy channel and the rate of successful packet transmission at MAC layer.Basically, it shows that what actually happened to a packet at MAC layer when a node tries to send it to sink node.If the packet fails to transmit, there can be multiple possible reasons of this failure.We can also know that how many packets successfully received at the destination out of total packets sent at the MAC layer and how many packets failed to transmit and discarded at MAC layer due to contention among the nodes.Fig. 25 shows the MAC packet breakdown of scenario 1 in which we compare the performance of three modes of proposed MAC mechanism with ZigBee MAC.Fig. 26 shows the results of ZigBee MAC, GTS-off, Proposed MAC, GTS-off, Zigbee MAC, GTSon, Proposed MAC, GTS-on and Proposed Adaptive MAC from left to right.
Rate of transmission failure due to buffer overflow in GTSwww.ijacsa.thesai.org on mode is highest.The reason is that only nodes which are able to get guaranteed time slots can send their packets and other nodes have to wait.Those nodes, which are waiting for time slots and have buffer filled have to drop their packets.If we compare the performance of proposed and ZigBee MAC with GTS-on mode, proposed MAC mechanism shows better performance as compare to ZigBee MAC.
Packet failure due to buffer overflow in GTS-off modes is minimal because in these nodes, each node competes for channel access whenever it has a packet to transmit.Nodes transmit their data as soon as they get a free channel and buffer remain empty or partially filled.There is higher rate of transmission failure due to acknowledgment loss in GTSoff mode because of high traffic rate.High traffic rate causes packet collision or acknowledgment loss in the network.After transmitting a packet, a node has to wait for the acknowledgment for a specific time period.If an acknowledgment does not receive at the source node within that time, then node declares the failure of transmission.In the GTS-on mode, transmission failure due to acknowledgment loss is small because each node only transmits its data in the portion of allocated guaranteed time slots of the superframe.During that time other nodes defer their transmission and go into an inactive state.That is why chances of packet collision or acknowledgment loss are less in the network.If we compare the transmission failure due to busy channel, it is clear from the results that proposed MAC mechanism performs better in all scenarios.There is no transmission failure due to a busy channel in GTS-on mode   and Fig. 30.In Fig. 28 we show simulation results of both MAC mechanisms for scenario 1.This is an obvious fact that when there are small numbers of nodes in the network, retransmission overhead is less because of small contention in the network so that less energy consumption.But energy consumption in network increases when contention increases due to increasing number of nodes.The reason is that increasing number of nodes increases the rate of transmission failure due to collision in network.We cannot omit hundred percent transmission failure but reduction is possible.From the result shown in Fig. 28, with increasing number of node energy consumption is also increasing, but the important point is that our proposed MAC mechanism maintains an efficiency in energy consumption above the certain level as compared to ZigBee MAC mechanism.When there are large numbers of nodes and there is high collision rate in the network, our proposed mechanism maintains an acceptable balance between the energy consumption and reliability by increasing number of retransmissions to a certain level.We cannot see this type pf behaviour in results of ZigBee MAC mechanism.Fig. 29 shows simulation results of scenario 2. In this scenario, we increase the packet rate and calculate the energy efficiency of both proposed and ZigBee MAC mechanisms.This fact is understood that increasing network traffic leads to increase in packet collision and so the retransmission rate.Results show the same behavior in network that by increasing packet rate in the network, retransmission overhead is also increasing and energy efficiency is decreasing.Keeping this fact in mind when we compare the results of both proposed and ZigBee MAC mechanisms, our proposed mechanism has better energy efficiency as compared to ZigBee MAC mechanism.Similarly Fig. 29 shows low retransmission overhead of proposed MAC mechanism as compared to ZigBee MAC mechanism.We can see the same performance trend in Fig. 30 which shows the results of scenarios 3, 4, 5 and 6.In all scenarios, proposed MAC mechanism has less retransmission overhead as compared to ZigBee MAC mechanism.In other words our proposed mechanism has better performance as compare to ZigBee MAC mechanism.
Results shown in Fig. 31, Fig. 32 and Fig. 33 represent the details of packet transmission and retransmission of adaptive proposed MAC mechanism in all scenarios.These results show the total number of packets created as an application layer, total packets transmitted at the MAC layer, number of packets sent at first try and second try, total number of retransmission and comparisons of the retransmission overhead of both MACs.Fig. 31 shows the results of scenario 1, Fig. 32 shows the results of scenario 2 and Fig. 33 shows the simulation results of scenario 3, 4, 5 and 6.The proposed MAC mechanism compromise on energy efficiency in order to keep reliability at an acceptable level if there is high contention in network by increasing retransmissions.

5) Application Level Latency:
In this section we compare the application level latency in ms of proposed MAC mechanism and ZigBee MAC.In results, number of packets sent are shown at y-axis and time at x-axis.We divide the time started from 0 seconds to infinity at a-axis in equal sized time buckets of duration 20ms.Results show that how many packets experienced how much delay in the network.For example, how many packets received in first 20ms next 20ms and so on.Fig. 34 shows the latency of ZigBee MAC when there are one PAN Coordinator and 5 source nodes.Fig. 35 shows the latency of GTSon and GTSon modes of proposed MAC mechanism separately when there are one PAN Coordinator and 5 source nodes and Fig. 36 shows the latency of proposed adaptive MAC for the same number of nodes.Although proposed MAC mechanism shows a significant improvement in goodput, packet delivery ratio, packet loss   and energy efficiency as compared to ZigBee MAC but the simulation results of application level latency show that there is still need to improve the MAC in order to minimize the latency in the network.Proposed MAC contributes very less to minimize the latency in the network.There can be multiple reasons for this issue such as PAN coordinator has to do some extra processing for efficiency GTS allocation to the nodes.When proposed MAC mechanism works in full adaptive MAC, it has to adapt itself according to the traffic such as emergency and normal traffic.This can be a reason for proposed MAC mechanism to not contribute much for reducing the latency.In the next section we discuss the outcomes of our proposed Scheme and future work.

B. Discussion and Future Work
In this paper we proposed some enhancements in the ZigBee MAC to make it best suitable for medical body area networks.We compare the results of the proposed MAC mechanism with ZigBee, and show that proposed MAC mechanism performs better than ZigBee MAC in term of reliability and energy efficiency.We compare the reliability of both MACs   by comparing the results of goodput, packet delivery ratio and MAC packet breakdown.In order to compare the energy efficiency of both MACs we calculate the number of retransmissions and duplicate packets of both MACs and compare it with each other.Although proposed MAC mechanism shows better performance as compared to ZigBee MAC but there are still some issues which need to be addressed.If we see the results of the MAC packet breakdown in Fig. 31, Fig. 32 and Fig. 33 transmission failure due to acknowledgment loss is still an issue.It is necessary to resolve this issue to improve the reliability in medical body area network.It will also help to improve the energy efficiency of network by reducing the number of retransmissions.The GTS allocation scheme also needs some improvements and there is a need to put some more efforts to make more flexible.Performance of GTS allocation mechanism can be improved, but introducing some fairness policy among the nodes.We can also specify priorities of different nodes depending on the nature of vital signs data which they are monitoring.Another possible enhancement is reliabilitiy of GTS request and reply messages.Because in case of not getting the guaranteed time slot, the node has to wait until next superframe which can introduce extra delay in packet transmission and can also introduce packet drop due to buffer overflow.There is also a need to propose some mechanism to reduce the latency to improve the network performance.

VI. CONCLUSION
In this paper we discuss different applications and requirements of medical body area network.We also give an overview of ZigBee MAC and highlight its limitations for medical body area network.We propose a reliable and energy efficient MAC mechanism for medical body area network for patient's monitoring in hospitals.Our results show that proposed MAC mechanism has better performance compared to ZigBee MAC.We also highlight some limitations of ZigBee MAC which are still present in proposed MAC mechanism as future directions.

Fig. 13 .
Fig. 13.Effect of Changing Values of macMaxCSMABackoffs on MAC Packet Breakdown

Fig. 17 .
Fig. 17.Effect of Changing Values of requestGTS on MAC Packet Breakdown

Fig. 26
Fig.26shows the simulation results of scenario 2 and Fig.27shows the combined graph of results of scenario 3, 4, 5 and 6.From the results we can see that all modes of proposed MAC mechanism show better MAC packet breakdown performance for as compare to ZigBee MAC in all scenarios.

Fig. 37 ,
Fig. 37, Fig. 38 and Fig. 39 show the latency of ZigBee MAC, GTSon and GTSoff modes of proposed MAC mechanism and Proposed adaptive MAC mechanism receptively when there is one PAN coordinator and 10 source nodes in the network.Similarly Fig. 40, Fig. 41 and Fig. 42 show the latency www.ijacsa.thesai.org533 | P a g e

Fig. 34 .
Fig. 34.Application Level Latency(ms) of GTSon and GTSoff Modes ZigBee MAC When 1 PAN Coordinator and 5 Source Nodes

Fig. 35 .
Fig. 35.Application Level Latency(ms) of GTSon and GTSoff Modes of proposed MAC mechanism When 1 PAN Coordinator and 5 Source Nodse

Fig. 36 .
Fig. 36.Application Level Latency(ms) of Proposed Adaptive MAC When 1 PAN Coordinator and 5 Source Nodes

Fig. 37 .
Fig. 37. Application Level Latency(ms) of Standard ZigBee MAC When 1 PAN Coordinator and 10 Source Nodes

Fig. 38 .
Fig. 38.Application Level Latency(ms) of GTSon and GTSoff Modes of proposed MAC mechanism When 1 PAN Coordinator and 10 Source Nodes

Fig. 39 .
Fig. 39.Application Level Latency(ms) of Proposed Adaptive MAC When 1 PAN Coordinator and 10 Source Nodes

Fig. 40 .
Fig. 40.Application Level Latency(ms) of Standard ZigBee MAC When 1 PAN Coordinator and 15 Source Nodes

Fig. 41 .
Fig. 41.Application Level Latency(ms) of GTSon and GTSoff Modes of proposed MAC mechanism When 1 PAN Coordinator and 15 Source Nodes

Fig. 42 .
Fig. 42.Application Level Latency(ms) of Proposed Adaptive MAC When 1 PAN Coordinator and 30 Source Nodes

Fig. 43 .
Fig. 43.Application Level Latency(ms) of Standard ZigBee MAC When 1 PAN Coordinator and 30 Source Nodes

Fig. 44 .
Fig. 44.Application Level Latency(ms) of GTSon and GTSoff Modes of proposed MAC mechanism When 1 PAN Coordinator and 30 Source Nodes

Fig. 45 .
Fig. 45.Application Level Latency(ms) of Proposed Adaptive MAC When 1 PAN Coordinator and 15 Source Nodes

TABLE I .
VALUES OF MAC PARAMETERS