An Adaptive Back-Off Mechanism for Wireless Sensor Networks

: Wireless sensor networks (WSNs) have been extensively applied in many domains such as smart homes and Internet of Things (IoT). As part of WSNs’ communication protocols, back-off mechanisms play an essential role in the deployment of wireless channels for network nodes and have been at the core of ensuring effective communication. The performance of many back-off algorithms is excellent in light or middle load networks. However, it degrades dramatically in heavy load networks. In this paper, we propose an adaptive contention window medium access control (MAC) protocol to improve the throughput performance under heavy load. By using the number of historical collisions as the parameter in the back-off mechanism to reﬂect the channel status, the size of the contention window is adjusted automatically, and the throughput of network is then improved. Simulation results show that our optimized MAC protocol has higher throughput and energy efﬁciency.


Introduction
Wireless sensor networks (WSNs) are widely applied in many domains ranging from military applications to civilian applications and gradually play more important roles in disaster relief, urgent search, health care, environmental monitoring, and so on.Generally, WSNs consist of large numbers of low-cost, densely deployed sensor nodes that organize themselves into a multi-hop wireless network.In WSNs, data collection and transmission can be automatically carried out so as to gain effective environmental information.Meanwhile, WSNs also face many challenges such as insufficient coverage, scalability, a lack of robustness, congestion, and mobility support [1].Furthermore, as sensor nodes are often deployed in hostile or inaccessible environments, battery charging and replacement are inconvenient and even impractical.As a result, WSNs are always faced with a seriously limited lifetime.
Medium access control (MAC) protocols have the function of deploying wireless channel resources efficiently for network nodes in WSNs in order to improve channel utilization and avoid data collision.There are different categories of MAC protocols, such as schedule-based, contention-based, hybrid, cross-layer, and real-time.Meanwhile, different MAC protocols are designed for different types of applications [2].Contention-based MAC protocols adopt specific back-off mechanisms to adjust the size of the contention window of each node before transmitting a message.The node with a smaller contention window size has a higher priority to access the wireless channel.Due to the back-off mechanism, the node preemptively occupying the channel sends data, when other nodes wait for another contention period until the channel is idle again.Thus, data collision is avoided to some extent.
Future Internet 2017, 9, 19; doi:10.3390/fi9020019www.mdpi.com/journal/futureinternet It is worth noting that the wireless network performance, i.e., throughput, delay, and energy efficiency, among other parameters, may vary with different back-off mechanisms.In general, the major cause of energy waste in conventional MAC protocols is idle listening, which is a requisite period of some MAC protocols such as IEEE802.11 or code division multiple access (CDMA) protocol.During this period, the nodes have to keep listening to the channel for the potential message directed to them.Relevant studies have shown that the energy consumed in idle listening is comparable to that consumed in receiving or transmitting [3].As mentioned above, the WSNs are faced with a serious energy limitation, and these MAC protocols with long idle listening are not suitable for WSNs because of the high-energy consumption in idle listening.As a result, specially designed MAC protocols for WSNs are needed.Sensor-MAC (S-MAC) [4], which is initiated based upon the 802.11protocol, is a typical kind of contention-based MAC protocol designed for WSNs.In March 2010, the newest version of S-MAC was proposed.In order to reduce energy consumption, S-MAC protocol adopts a periodic listening/sleep working mechanism.This working mode has a low duty cycle.Sensor nodes periodically alternate between listening and sleep states.When listening, nodes are able to transmit or receive data; when sleeping, nodes turn off their radio to save energy.The core of the S-MAC protocol is to shorten the idle listening time and further reduce power consumption by controlling non-working nodes to go into a sleep state [5].T-MAC [6] was proposed to improve the poor performance of S-MAC when traffic load is variable.In T-MAC, the idle listen period ends when no activation event has occurred in the channel for a fixed time threshold.Nodes will keep on updating their timeout values whenever an activation event occurs.When no events occur in a timeout period, the nodes will go to sleep.To eliminate energy waste caused by a continuous renewal of node timeout values in T-MAC, the concept of advertising for data contention is introduced in advertisement-based MAC (ADV-MAC) [7], advertisement-based time-division multiple access (ATMA) [8], and adaptive MAC (AdAMAC) [9].Several protocols have also been proposed to minimize packet latency, such as demand wakeup MAC (DW-MAC) [10] and multi-divided deliver MAC (MDD-MAC) [11].DW-MAC introduces a low overhead scheduling algorithm that allows nodes to wake up on demand during the sleep period.MDD-MAC proposes a rotation method between sending and receiving data during the active period.The reinforcement learning mechanism [12] is introduced to MAC protocols in WSNs to avoid idle listening and overhearing.
Compressed handshake MAC (CH-MAC) [13] is presented to reduce unnecessary and redundant handshake frame so as to reduce the end-to-end delay and energy consumption.CH-MAC is a synchronized duty cycle MAC protocol.Similar to S-MAC, each cycle in CH-MAC is divided into the active period and the sleep period.The active period also consists of two periods: data and avoid.In the data period, a node with pending data contends for a wireless channel using a four-way handshake as in S-MAC.However, the RTS and CTS are replaced by a T frame.Data communication is initiated by an intended receiver node.Receiver will send a T frame with an upcoming request if the medium is idle.Upon receiving the T frame, the sender node will then reply with a data frame, which will be acknowledged by a receiver's ACK.Once the sender node receives the ACK, it will go to sleep.By reducing the handshake time, CH-MAC can shorten the time during which a pair of nodes occupy the medium and can improve the end-to-end delay.Besides, CH-MAC can also decrease the transmission energy consumption by cutting down the RTS packet transmission.Furthermore, CH-MAC sets up an initiative sleeping mechanism.In the avoid period, after finishing the data transmission, a node goes to sleep immediately and wakes up when the next hop neighbor finishes its data transmission.This method will slightly reduce energy consumption and solve the hidden terminal problem.
As mentioned above, many S-MAC-based protocols are proposed to further improve the performance in WSNs.It is important to find an appropriate target to make an improvement.It is worth noting that the back-off mechanism of S-MAC is quite simple.The size of the contention window in S-MAC is fixed, and all nodes share the same contention window sizes whether they have successfully obtained the channel or not.When the WSN is under light load, the mechanism is fairly efficient because, under this circumstance, the probability of data collision is quite small, and a fixed-size but narrow contention window can decrease the transmission delay.Thus, a short delay and a relatively high throughput are acquired.However, when the network load is heavy, the common fixed-size contention window makes nodes and their neighbors in the network more likely to send data at the same time.Under this circumstance, the fixed-size contention window becomes the bottleneck leading to a serious collision and aggravating the efficiency of wireless channel access.To cope with this performance deterioration, the back-off mechanism of S-MAC should be emphatically improved in order to guarantee the network performance under heavy load.In this paper, we propose a well-designed MAC protocol adopting an adaptive contention window which has higher adaptability in a heavy-load network.Based on the contention condition, conflict probability is significantly controlled by altering the back-off window size.Ultimately, higher throughput and energy efficiency are obtained.
The remaining portions of this paper are organized as follows.In Section 2, we present a literature review of the related work.In Section 3, our proposed MAC protocol is shown in detail.In Section 4, the simulation results based on network simulator version 2 (NS-2) are given out.Finally, we conclude with a summary and some directions for future work.

Review of Related Work
Since our proposed MAC protocol is on the basis of S-MAC protocol, in this section, we firstly introduce some critical technologies of this protocol.Some modified back-off mechanisms are then provided in order to gain an overall understanding of this research progress.

Periodic Listen and Sleep
The S-MAC protocol's operation cycle includes a listen period and a sleep period.The periodic listen and sleep mechanism is shown in Figure 1.During sleep period, nodes may turn off their transceivers for some time in order to reduce power consumption.During the listen period, each node wakes up from a sleep state and listens to check if any other node has data delivered to it.It is worth noting that, before each node starts periodic listening and sleep, it needs to choose or generate a schedule that determines the time to sleep and exchanges it with its neighbors by sending a synchronization (SYNC) packet.Each node maintains a schedule table that stores the schedules of all its known neighbors [14].Finally, nodes adopting the same schedule achieve synchronization and form a virtual cluster in which nodes can communicate directly.
size but narrow contention window can decrease the transmission delay.Thus, a short delay and a relatively high throughput are acquired.However, when the network load is heavy, the common fixed-size contention window makes nodes and their neighbors in the network more likely to send data at the same time.Under this circumstance, the fixed-size contention window becomes the bottleneck leading to a serious collision and aggravating the efficiency of wireless channel access.To cope with this performance deterioration, the back-off mechanism of S-MAC should be emphatically improved in order to guarantee the network performance under heavy load.In this paper, we propose a well-designed MAC protocol adopting an adaptive contention window which has higher adaptability in a heavy-load network.Based on the contention condition, conflict probability is significantly controlled by altering the back-off window size.Ultimately, higher throughput and energy efficiency are obtained.
The remaining portions of this paper are organized as follows.In Section 2, we present a literature review of the related work.In Section 3, our proposed MAC protocol is shown in detail.In Section 4, the simulation results based on network simulator version 2 (NS-2) are given out.Finally, we conclude with a summary and some directions for future work.

Review of Related Work
Since our proposed MAC protocol is on the basis of S-MAC protocol, in this section, we firstly introduce some critical technologies of this protocol.Some modified back-off mechanisms are then provided in order to gain an overall understanding of this research progress.

Periodic Listen and Sleep
The S-MAC protocol′s operation cycle includes a listen period and a sleep period.The periodic listen and sleep mechanism is shown in Figure 1.During sleep period, nodes may turn off their transceivers for some time in order to reduce power consumption.During the listen period, each node wakes up from a sleep state and listens to check if any other node has data delivered to it.It is worth noting that, before each node starts periodic listening and sleep, it needs to choose or generate a schedule that determines the time to sleep and exchanges it with its neighbors by sending a synchronization (SYNC) packet.Each node maintains a schedule table that stores the schedules of all its known neighbors [14].Finally, nodes adopting the same schedule achieve synchronization and form a virtual cluster in which nodes can communicate directly.

Collision and Overhearing Avoidance
It is of great importance for contention-based protocols to guarantee an effective collision and overhearing avoidance mechanism.S-MAC employs both physical and virtual carrier sense [15].Physical carrier sensing is performed by listening to the channel for possible transmissions, while virtual carrier sensing is realized by the node′s recording of the value of a sender′s remaining transmission time, which is contained in a variable called the network allocation vector (NAV).The transmission between transmitter and receiver is controlled by a fourfold handshake mechanism.The transmitter firstly sends a request-to-send (RTS) packet to its receiver.After successfully receiving

Collision and Overhearing Avoidance
It is of great importance for contention-based protocols to guarantee an effective collision and overhearing avoidance mechanism.S-MAC employs both physical and virtual carrier sense [15].Physical carrier sensing is performed by listening to the channel for possible transmissions, while virtual carrier sensing is realized by the node's recording of the value of a sender's remaining transmission time, which is contained in a variable called the network allocation vector (NAV).
The transmission between transmitter and receiver is controlled by a fourfold handshake mechanism.The transmitter firstly sends a request-to-send (RTS) packet to its receiver.After successfully receiving this packet, the receiver sends a clear-to-send (CTS) packet as a reply.After receiving the CTS packet, the transmitter begins to send the data packet, and the receiver replies with an acknowledgement (ACK) packet as the sign of a successful transmission.The value of NAV is loaded and updated in all these four types of packets.When neighbor nodes overhear these packets and obtain the NAV value, they will immediately turn to sleep state until the transmission is complete.In this way, the hidden terminal problem and data collision is avoided to some extent.

Message Passing
Related research has revealed that a bigger packet size brings with a smaller transmission success rate.For this reason, S-MAC fragments big packets into small fragments and transmits them in a burst.Every time a receiver receives a data fragment, it should send an ACK to the transmitter.If the transmitter fails to receive the ACK, it will extend the reserved transmission time to re-transmit the corresponding fragment immediately.

Modified Back-Off Mechanisms
Back-off mechanisms are at the core of carrier sense procedure.In the S-MAC protocol, after detecting the medium free for a distributed inter-frame spacing (DIFS) period, the node should then calculate a random back-off time for another deferral time and start a timer that gradually declines.If the medium is still free when the timer declines to 0, the node starts transmitting.Contrarily, if the node detects that the medium is becoming busy before the time is up, it cancels the timer and goes to sleep and then starts another carrier sense after waking up.The back-off time of S-MAC can be generated as shown in Equation ( 1): where Random(0, CW) is a function that draws a pseudorandom integer from a uniform distribution over the interval [0, CW].CW is the contention window size, which is a constant in S-MAC.SlotTime is the basic delay unit set by the system.As mentioned above, the back-off mechanism of S-MAC adopts a fixed contention window size to calculate the back-off time in order to avoid the data collision.However, in real wireless sensor networks, traffic status is usually constantly changing.When the traffic load is light, a relatively big contention window may cause a large delay.On the other hand, when the traffic is heavy, a smaller one may lead to a serious data collision and a low delivery rate.In addition, when the medium is observed busy, after each back-off process, the same contention window size is adopted and the back-off time will be recalculated again.To sum up, S-MAC's back-off mechanism is insensitive to the traffic load's variation and relatively inefficient because of the repetitive calculation of back-off time, which adopts a fixed-size contention window.For the reasons given above, S-MAC cannot adapt to dynamic network traffic, especially a heavy one, and may lead to an insufferably low throughput and energy efficiency.
Binary exponential back-off (BEB) mechanism is a classical contention window adjustment algorithm.The back-off timer is calculated using Equation (1).However, what is distinct from S-MAC is that the contention window (CW) size is unfixed and the window size can varywith whether the transmission is successful or not.Specifically, the initial CW is set to be a minimum value, which is denoted as CW min , and it is doubled for the next transmission attempt every time the packet is involved in a collision until it reaches the max contention window size CW max .Moreover, CW is reset to the initial value after every successful transmission.The BEB algorithm is given in Figure 2. Compared with S-MAC, though the BEB mechanism takes transmission status into consideration and adjusts the contention window size, it still cannot efficiently adapt to the variation of the traffic load.Especially in the heavy load network, the contention window′s sudden decrease causes a capture effect that permits a node to seize the channel for a long time, which reduces the medium access′ fairness and the overall network throughput [16].
In order to improve the fairness in the network, some adaptive back-off mechanisms based on BEB have been proposed [17][18][19][20][21].In these papers, the contention window sizes of different nodes are balanced to prevent certain nodes from occupying wireless channel for too long on condition of an efficient medium access.In [17] and [18], collision probability was chosen as a parameter to adjust the contention window size.The node with a higher collision probability was allocated with a larger window.In [19] and [20], distributed and shadow-price-theory-based proportional fairness back-off schemes were designed to overcome the funneling effect in multi-hop WSN.The node with more data to be sent had a higher transmission priority.In [21], after a successful transmission, the backoff value was set between current CW and the minimum value, which was different from the BEB mechanism and improved fairness.However, in this research, algorithmic performance is not specially optimized and assessed in heavy-load wireless networks, and the methods of obtaining a channel′s competition intensity is relatively complex, which are not quite suitable for source-limited nodes in WSNs.

Proposed Back-Off Scheme
In order to improve the delivery performance under heavy load in WSNs, we propose a new back-off scheme to decrease the probability of data collision.In our designed protocol, the number of historical collisions is chosen as the parameter to reflect the channel status and nodes′ usage of the wireless channel.This parameter is easy to acquire and can reduce the complexity of the algorithm when compared with research mentioned above.A larger collision number reflects a higher competitive level in the wireless channel, and a larger contention window is needed under this condition to prolong the access time in order to relieve the competition.In BEB, its contention window adjustment mechanism is too rough that it only depends on the data transmission status to double or halve the contention window size.On the one hand, when data collision occurs, the contention window is doubled in BEB.However, this exponential increase is too rapid when traffic load is not heavy, which leads to unnecessary delay.It is better to retard this increase process under this circumstance.If traffic load is heavy, this exponential increase in BEB can effectively avoid data collision.On the other hand, when data transmission is successful, the contention window is halved directly in BEB.It is better to refer to the last transmission, which can partially reflect channel status.Based on these core ideas, the detailed back-off algorithm is described in Figure 3. Compared with S-MAC, though the BEB mechanism takes transmission status into consideration and adjusts the contention window size, it still cannot efficiently adapt to the variation of the traffic load.Especially in the heavy load network, the contention window's sudden decrease causes a capture effect that permits a node to seize the channel for a long time, which reduces the medium access' fairness and the overall network throughput [16].
In order to improve the fairness in the network, some adaptive back-off mechanisms based on BEB have been proposed [17][18][19][20][21].In these papers, the contention window sizes of different nodes are balanced to prevent certain nodes from occupying wireless channel for too long on condition of an efficient medium access.In [17,18], collision probability was chosen as a parameter to adjust the contention window size.The node with a higher collision probability was allocated with a larger window.In [19,20], distributed and shadow-price-theory-based proportional fairness back-off schemes were designed to overcome the funneling effect in multi-hop WSN.The node with more data to be sent had a higher transmission priority.In [21], after a successful transmission, the back-off value was set between current CW and the minimum value, which was different from the BEB mechanism and improved fairness.However, in this research, algorithmic performance is not specially optimized and assessed in heavy-load wireless networks, and the methods of obtaining a channel's competition intensity is relatively complex, which are not quite suitable for source-limited nodes in WSNs.

Proposed Back-Off Scheme
In order to improve the delivery performance under heavy load in WSNs, we propose a new back-off scheme to decrease the probability of data collision.In our designed protocol, the number of historical collisions is chosen as the parameter to reflect the channel status and nodes' usage of the wireless channel.This parameter is easy to acquire and can reduce the complexity of the algorithm when compared with research mentioned above.A larger collision number reflects a higher competitive level in the wireless channel, and a larger contention window is needed under this condition to prolong the access time in order to relieve the competition.In BEB, its contention window adjustment mechanism is too rough that it only depends on the data transmission status to double or halve the contention window size.On the one hand, when data collision occurs, the contention window is doubled in BEB.However, this exponential increase is too rapid when traffic load is not heavy, which leads to unnecessary delay.It is better to retard this increase process under this circumstance.If traffic load is heavy, this exponential increase in BEB can effectively avoid data collision.On the other hand, when data transmission is successful, the contention window is halved directly in BEB.It is better to refer to the last transmission, which can partially reflect channel status.Based on these core ideas, the detailed back-off algorithm is described in Figure 3.In the algorithm mentioned above, [] represents a function of getting an integral value ([x] denotes the largest integer that is no more than a positive real number x).From the beginning, the contention window is set to min CW as a default.Once data collision occurs during transmission, the contention window will be adjusted.In detail, if the collision number (denoted as ) is less than the first threshold (denoted as 1 TH ), the contention window size will be calculated by Equation ( 2): where is a variable ranging from 0 to 1 i − .Obviously, after the multiplication, a larger collision number brings with a larger contention window size.It is worth noting that 1 TH is a relatively smaller constant.By adopting this formula, the window size will increase smoothly as the collision number increases.When the collision number surpasses the first threshold and is less than the second threshold (denoted as 2 TH ), which represents a more serious competition, this formula will be abandoned and the current contention window size will be doubled in order to obtain a fast adjustment.Especially, if the transmission is still failed even when collision number has reached 2 TH , the contention window will be set to min CW directly.There are two main reasons for setting the contention window to min CW .The first reason is that, if a node′s contention window is persistently large, it has to wait for a long time to transmit its packets.As a result, its data buffer is likely to be full.Under this circumstance, the node has to drop its upcoming packets, which is adverse for network throughput.The second reason is that this operation can balance the contention window size between different nodes, which can improve the fairness between different nodes as well as the average transmission delay.In the BEB mechanism, after a successful data delivery, the contention window size will be reset to min CW regardless of the channel status.In our mechanism, the window size, after a successful transmission, will be halved if the node′s last transmission is successful or will remain if its last transmission fails, considering that a sharp decrease in the contention window size will lead to a higher collision probability under a heavy network load.

Simulation and Analysis
In this section, we compare the performance of our proposed MAC protocol, which adopts this new back-off mechanism, against that of S-MAC, BEB, and CH-MAC.We chose three metrics In the algorithm mentioned above, [] represents a function of getting an integral value ([x] denotes the largest integer that is no more than a positive real number x).From the beginning, the contention window is set to CW min as a default.Once data collision occurs during transmission, the contention window will be adjusted.In detail, if the collision number (denoted as i) is less than the first threshold (denoted as TH 1 ), the contention window size will be calculated by Equation ( 2): where n is a variable ranging from 0 to i − 1. Obviously, after the multiplication, a larger collision number brings with a larger contention window size.It is worth noting that TH 1 is a relatively smaller constant.By adopting this formula, the window size will increase smoothly as the collision number increases.When the collision number surpasses the first threshold and is less than the second threshold (denoted as TH 2 ), which represents a more serious competition, this formula will be abandoned and the current contention window size will be doubled in order to obtain a fast adjustment.Especially, if the transmission is still failed even when collision number has reached TH 2 , the contention window will be set to CW min directly.There are two main reasons for setting the contention window to CW min .The first reason is that, if a node's contention window is persistently large, it has to wait for a long time to transmit its packets.As a result, its data buffer is likely to be full.Under this circumstance, the node has to drop its upcoming packets, which is adverse for network throughput.The second reason is that this operation can balance the contention window size between different nodes, which can improve the fairness between different nodes as well as the average transmission delay.In the BEB mechanism, after a successful data delivery, the contention window size will be reset to CW min regardless of the channel status.In our mechanism, the window size, after a successful transmission, will be halved if the node's last transmission is successful or will remain if its last transmission fails, considering that a sharp decrease in the contention window size will lead to a higher collision probability under a heavy network load.

Simulation and Analysis
In this section, we compare the performance of our proposed MAC protocol, which adopts this new back-off mechanism, against that of S-MAC, BEB, and CH-MAC.We chose three metrics including the network throughput, energy efficiency and end-to-end delay to assess the algorithmic performance.Simulations were realized on NS-2 (ns2-2.35).

Network Topology
Since the network topology mainly consists of mesh, and the linear topology of real WSNs, we adopted these two different topologies to evaluate our proposed back-off mechanism.Mesh topology as shown in Figure 4a, this contains nine nodes.One sender is Node 5 whose destination is Node 6, and the other one is Node 7 whose destination is Node 8.In Figure 4b, the linear topology consists of five nodes, and the sender and receiver are Node 0 and Node 4, respectively.The distance between adjacent nodes for both topologies is 200 m.
including the network throughput, energy efficiency and end-to-end delay to assess the algorithmic performance.Simulations were realized on NS-2 (ns2-2.35).

Network Topology
Since the network topology mainly consists of mesh, and the linear topology of real WSNs, we adopted these two different topologies to evaluate our proposed back-off mechanism.Mesh topology as shown in Figure 4a, this contains nine nodes.One sender is Node 5 whose destination is Node 6, and the other one is Node 7 whose destination is Node 8.In Figure 4b, the linear topology consists of five nodes, and the sender and receiver are Node 0 and Node 4, respectively.The distance between adjacent nodes for both topologies is 200 m.

Parameter Setting
Our general experimental parameters and corresponding values are as follows in Table 1.We selected the constant bit rate (CBR) flow to generate data packets from each sender at 50 s after the simulation runs 1 TH and 2 TH are adjustable parameters; after several tests, we set them to 5 and 9 to obtain a relatively better performance.The initial energy of each node is 1000 J, and the energy consumption in different states was also provided in order to measure energy efficiency in subsequent tests.

Experimental Results and Analysis
In the network adopting a mesh topology, the throughput, energy efficiency, and end-to-end delay comparison are presented in Figure 5, Figure 6, and Figure 7, respectively.By introducing an adaptive contention window mechanism, we can see that our proposed back-off mechanism has a better performance than S-MAC and BEB in all aspects.The throughput performance of proposed MAC is also better than that of CH-MAC.Since the nodes adopting our proposed MAC can update their contention window according to the traffic load in real time, there are fewer collisions than that in S-MAC, BEB, and CH-MAC.As a result, a higher throughput is acquired, especially when the traffic load is heavy, which is illustrated in Figure 5.We can see that, when the packet interval is less than 3 s, the throughput of our presented MAC protocol compared with S-MAC, BEB, and CH-MAC

Parameter Setting
Our general experimental parameters and corresponding values are as follows in Table 1.We selected the constant bit rate (CBR) flow to generate data packets from each sender at 50 s after the simulation runs TH 1 and TH 2 are adjustable parameters; after several tests, we set them to 5 and 9 to obtain a relatively better performance.The initial energy of each node is 1000 J, and the energy consumption in different states was also provided in order to measure energy efficiency in subsequent tests.

Experimental Results and Analysis
In the network adopting a mesh topology, the throughput, energy efficiency, and end-to-end delay comparison are presented in Figures 5-7, respectively.By introducing an adaptive contention window mechanism, we can see that our proposed back-off mechanism has a better performance than S-MAC and BEB in all aspects.The throughput performance of proposed MAC is also better than that of CH-MAC.Since the nodes adopting our proposed MAC can update their contention window according to the traffic load in real time, there are fewer collisions than that in S-MAC, BEB, and CH-MAC.As a result, a higher throughput is acquired, especially when the traffic load is heavy, which is illustrated in Figure 5.We can see that, when the packet interval is less than 3 s, the throughput of our presented MAC protocol compared with S-MAC, BEB, and CH-MAC increases by 165%, 65%, and 15% on average, respectively.In order to assess the energy efficiency of the proposed protocol, we collected the information of overall energy consumption in the simulation and calculated the energy consumed per packet.Obviously, the lower this value is, the better the performance of the network is.Energy efficiency is shown in Figure 6, in which we can see lower energy consumption of the proposed mechanism when compared with S-MAC and BEB.From the statistical result, the energy consumed per packet adopting the proposed protocol decreases by 65% and 40% compared with S-MAC and BEB mechanisms.Owing to the redundant handshake frame and an initiative sleeping mechanism, CH-MAC performs well in the aspect of energy efficiency, which is comparative with our proposed MAC.The end-to-end delay comparison is illustrated in Figure 7.The proposed MAC outperforms S-MAC and BEB mechanism because of its proper size of contention window.When traffic load is heavy, S-MAC and BEB are vulnerable to data collision, leading to a large transmission delay; nodes adopting our proposed MAC tend to have a large contention window size, which will increase delay to some extent.Considering the simplified handshake procedure in CH-MAC, the delay of CH-MAC is slightly superior to the proposed MAC.increases by 165%, 65%, and 15% on average, respectively.In order to assess the energy efficiency of the proposed protocol, we collected the information of overall energy consumption in the simulation and calculated the energy consumed per packet.Obviously, lower this value is, the better the performance of the network is.Energy efficiency is shown in Figure 6, in which we can see lower energy consumption of the proposed mechanism when compared with S-MAC and BEB.From the statistical result, the energy consumed per packet adopting the proposed protocol decreases by 65% and 40% compared with S-MAC and BEB mechanisms.Owing to the redundant handshake frame and an initiative sleeping mechanism, CH-MAC performs well in the aspect of energy efficiency, which is comparative with our proposed MAC.The end-to-end delay comparison is illustrated in Figure 7.The proposed MAC outperforms S-MAC and BEB mechanism because of its proper size of contention window.When traffic load is heavy, S-MAC and BEB are vulnerable to data collision, leading to a large transmission delay; nodes adopting our proposed MAC tend to have a large contention window size, which will increase delay to some extent.Considering the simplified handshake procedure in CH-MAC, the delay of CH-MAC is slightly superior to the proposed MAC.increases by 165%, 65%, and 15% on average, respectively.In order to assess the energy efficiency of the proposed protocol, we collected the information of overall energy consumption in the simulation and calculated the energy consumed per packet.Obviously, the lower this value is, the better the performance of the network is.Energy efficiency is shown in Figure 6, in which we can see lower energy consumption of the proposed mechanism when compared with S-MAC and BEB.From the statistical result, the energy consumed per packet adopting the proposed protocol decreases by 65% and 40% compared with S-MAC and BEB mechanisms.Owing to the redundant handshake frame and an initiative sleeping mechanism, CH-MAC performs well in the aspect of energy efficiency, which is comparative with our proposed MAC.The end-to-end delay comparison is illustrated in Figure 7.The proposed MAC outperforms S-MAC and BEB mechanism because of its proper size of contention window.When traffic load is heavy, S-MAC and BEB are vulnerable to data collision, leading to a large transmission delay; nodes adopting our proposed MAC tend to have a large contention window size, which will increase delay to some extent.Considering the simplified handshake procedure in CH-MAC, the delay of CH-MAC is slightly superior to the proposed MAC.In the network adopting a linear topology, the performance comparisons are provided in Figure 8, Figure 9, and Figure 10.Since there is only one sender node in the linear topology, the traffic load is relatively lighter than that in the mesh topology when the CBR intervals are the same.As is shown in Figure 8, Figure 9, and Figure 10, the main performance improvements are focused on the CBR intervals, which are less than 1.5 s.As is shown in Figure 8, the throughput of the proposed protocol outperforms S-MAC, BEB, and CH-MAC by 35%, 27%, and 8% on average.In Figure 9, the energy consumed per packet adopting proposed protocol decreases by 30% and 20% comparing with S-MAC and BEB mechanisms.The energy efficiency of the proposed MAC and CH-MAC is comparative, which is similar to the performance in mesh topology.In Figure 10, our proposed MAC protocol outperforms the other three protocols in terms of end-to-end delay.The main reason is that the traffic load is not too heavy in this linear topology, on average, the contention window of nodes adopting proposed MAC protocol is not as large as it was in the mesh topology.As a result, the delay performance of the proposed MAC is superior to the other three protocols.When the CBR interval is larger than 1.5 s, the traffic load is light, almost all packets will be received successfully by the receiver node.Under this circumstance, these four protocols have almost the same throughput, energy efficiency, and end-to-end delay.In the network adopting a linear topology, the performance comparisons are provided in Figures 8-10.Since there is only one sender node in the linear topology, the traffic load is relatively lighter than that in the mesh topology when the CBR intervals are the same.As is shown in Figures 8-10, the main performance improvements are focused on the CBR intervals, which are less than 1.5 s.As is shown in Figure 8, the throughput of the proposed protocol outperforms S-MAC, BEB, and CH-MAC by 35%, 27%, and 8% on average.In Figure 9, the energy consumed per packet adopting proposed protocol decreases by 30% and 20% comparing with S-MAC and BEB mechanisms.The energy efficiency of the proposed MAC and CH-MAC is comparative, which is similar to the performance in mesh topology.In Figure 10, our proposed MAC protocol outperforms the other three protocols in terms of end-to-end delay.The main reason is that the traffic load is not too heavy in this linear topology, on average, the contention window of nodes adopting proposed MAC protocol is not as large as it was in the mesh topology.As a result, the delay performance of the proposed MAC is superior to the other three protocols.When the CBR interval is larger than 1.5 s, the traffic load is light, almost all packets will be received successfully by the receiver node.Under this circumstance, these four protocols have almost the same throughput, energy efficiency, and end-to-end delay.In the network adopting a linear topology, the performance comparisons are provided in Figure 8, Figure 9, and Figure 10.Since there is only one sender node in the linear topology, the traffic load is relatively lighter than that in the mesh topology when the CBR intervals are the same.As is shown in Figure 8, Figure 9, and Figure 10, the main performance improvements are focused on the CBR intervals, which are less than 1.5 s.As is shown in Figure 8, the throughput of the proposed protocol outperforms S-MAC, BEB, and CH-MAC by 35%, 27%, and 8% on average.In Figure 9, the energy consumed per packet adopting proposed protocol decreases by 30% and 20% comparing with S-MAC and BEB mechanisms.The energy efficiency of the proposed MAC and CH-MAC is comparative, which is similar to the performance in mesh topology.In Figure 10, our proposed MAC protocol outperforms the other three protocols in terms of end-to-end delay.The main reason is that the traffic load is not too heavy in this linear topology, on average, the contention window of nodes adopting proposed MAC protocol is not as large as it was in the mesh topology.As a result, the delay performance of the proposed MAC is superior to the other three protocols.When the CBR interval is larger than 1.5 s, the traffic load is light, almost all packets will be received successfully by the receiver node.Under this circumstance, these four protocols have almost the same throughput, energy efficiency, and end-to-end delay.To sum up, we can see that the proposed MAC protocol adopting adaptive contention window mechanism has a better performance with respect to throughput and energy efficiency, especially in the heavy load network.By automatically adjusting the contention window size according to the channel competition fierce degree, data collision can be effectively avoided and higher throughput and energy efficiency are obtained.

Summaries and Future Work
In this paper, we put forward a new back-off mechanism based on the S-MAC protocol.By selecting the number of historical collisions as the parameter to acquire channel status, nodes in WSNs can adaptively adjust their contention window size to avoid data collision.Meanwhile, for those nodes whose retransmission time beyond a threshold, a relatively smaller window size is distributed to them, which improves the fairness in the transmission procedure.The simulation results demonstrate the efficiency of the proposed mechanism and a throughput and energy efficiency are obtained when comparing with S-MAC, CH-MAC, and BEB algorithms.Moreover, our future work will concentrate on large-scale network scenarios and further improve algorithmic performance.To sum up, we can see that the proposed MAC protocol adopting adaptive contention window mechanism has a better performance with respect to throughput and energy efficiency, especially in the heavy load network.By automatically adjusting the contention window size according to the channel competition fierce degree, data collision can be effectively avoided and higher throughput and energy efficiency are obtained.

Summaries and Future Work
In this paper, we put forward a new back-off mechanism based on the S-MAC protocol.By selecting the number of historical collisions as the parameter to acquire channel status, nodes in WSNs can adaptively adjust their contention window size to avoid data collision.Meanwhile, for those nodes whose retransmission time beyond a threshold, a relatively smaller window size is distributed to them, which improves the fairness in the transmission procedure.The simulation results demonstrate the efficiency of the proposed mechanism and a higher throughput and energy efficiency are obtained when comparing with S-MAC, CH-MAC, and BEB algorithms.Moreover, our future work will concentrate on large-scale network scenarios and further improve algorithmic performance.To sum up, we can see that the proposed MAC protocol adopting adaptive contention window mechanism has a better performance with respect to throughput and energy efficiency, especially in the heavy load network.By automatically adjusting the contention window size according to the channel competition fierce degree, data collision can be effectively avoided and higher throughput and energy efficiency are obtained.

Summaries and Future Work
In this paper, we put forward a new back-off mechanism based on the S-MAC protocol.By selecting the number of historical collisions as the parameter to acquire channel status, nodes in WSNs can adaptively adjust their contention window size to avoid data collision.Meanwhile, for those nodes whose retransmission time beyond a threshold, a relatively smaller window size is distributed to them, which improves the fairness in the transmission procedure.The simulation results demonstrate the efficiency of the proposed mechanism and a higher throughput and energy efficiency are obtained when comparing with S-MAC, CH-MAC, and BEB algorithms.Moreover, our future work will concentrate on large-scale network scenarios and further improve algorithmic performance.

Figure 6 .
Figure 6.Energy comparison in mesh topology.

Figure 6 .
Figure 6.Energy comparison in mesh topology.Figure 6.Energy comparison in mesh topology.

Figure 6 .
Figure 6.Energy comparison in mesh topology.Figure 6.Energy comparison in mesh topology.

Figure 7 .
Figure 7. End-to-end delay comparison in mesh topology.

Figure 7 .
Figure 7. End-to-end delay comparison in mesh topology.

Figure 7 .
Figure 7. End-to-end delay comparison in mesh topology.

Figure 8 .
Figure 8. Throughput comparison in linear topology.Figure 8. Throughput comparison in linear topology.

Figure 8 .
Figure 8. Throughput comparison in linear topology.Figure 8. Throughput comparison in linear topology.

Figure 9 .
Figure 9. Energy comparison in linear topology.

Figure 10 .
Figure 10.End-to-end delay comparison in linear topology.

Figure 9 .
Figure 9. Energy comparison in linear topology.

Figure 9 .
Figure 9. Energy comparison in linear topology.

Figure 10 .
Figure 10.End-to-end delay comparison in linear topology.

Figure 10 .
Figure 10.End-to-end delay comparison in linear topology.

Table 1 .
Simulation parameters and corresponding values.CW: contention window; CBR: constant bit rate; AODV: ad hoc on-demand distance vector.

Table 1 .
Simulation parameters and corresponding values.CW: contention window; CBR: constant bit rate; AODV: ad hoc on-demand distance vector.