Parameter analysis and optimization of polling-based medium access control protocol for multi-sensor communication

In this article, a comprehensive parameter analysis for the polling-based medium access control protocol is executed. The theoretical expressions of the relationship between network parameters and performance including delay and energy consumption are given for the first time. The specific conclusions in this article are as follows: (1) awake duration is the parameter that has the greatest impact on delay and energy consumption. Increasing the duty cycle (awake duration) will effectively reduce the delay, but will also increase the energy consumption within a certain range; (2) increasing polling duration can reduce the delay, but it will also increase the energy consumption; and (3) more forwarding nodes cause a smaller delay, and it can save the energy with modest increase of delay by reducing the polling duration. An adaptive parameter optimization polling-based medium access control protocol is proposed to optimize network performance. In this protocol, the residual energy gets fully used to increase awake duration and polling duration, which makes the delay smaller, and the network maintains a long lifetime meanwhile. Based on the results of the analysis, the adaptive parameter optimization polling-based medium access control protocol proposed in this article reduces the delay by 22.40% and increases the energy efficiency by 23.25%.


Introduction
A report from Cisco shows that the number of devices connected to the Internet of things (IoT) is unprecedentedly large. [1][2][3] The number of devices connected to the network is expected to reach 24 billion by 2020. 1,3,4 One of the huge driving forces behind the development of IoT is the expansion of various sensor devices. [5][6][7] With the development of microprocessor technology, the size of current sensor devices is getting smaller, 8,9 and its functions are becoming much more powerful. Sensor devices can be deployed in various applications, [9][10][11] such as monitoring scenarios including 1 School of Computer Science and Engineering, Central South University, Changsha, China 2 industrial monitoring, [12][13][14] traffic information collection and temporary testing, 15,16 and monitoring of wild animals and plants. 17,18 Generally, these sensor nodes are huge in number and self-organized into a network, [19][20][21] forming a multi-sensor system. Some are embedded in mobile phones, mobile vehicles, and other carriers. 15,22,23 In addition to completing the sensing tasks, such sensing devices can also communicate with neighboring sensing devices to form a multi-sensor system in a collaborative way. The current application of the multi-sensor system has gradually expanded from initial military investigation to many civilian areas, including environmental detection, traffic monitoring, and emergency rescue. 24,25 The multi-sensor system collaborates to accomplish diverse tasks, the prerequisite of which is the effective communication between sensors. The medium access control (MAC) protocol is the basis of the communication protocol, 4,7,14,26 which dominates important performances in the network, including energy consumption, data transmission delay, throughput rate, and so on. 4,7 These performances have an important impact on the multi-sensor base system. Since sensor nodes are mostly powered by batteries, the energy consumption directly determines their lifetime. 11,13,19,27 According to the research, the energy consumed by sensor nodes for communication accounts for 70% of the total energy. Therefore, an efficient communication protocol plays a key role for multi-sensor-based systems. And it is the most critical issue for the multisensor system that how to design an effective communication protocol to save energy. 4,7,14,26 The energy consumption of sensor nodes in awake state is more than 1000 times that in sleep state. 4,7 In most applications, the frequency of sensing data is relatively slow, often in seconds, minutes, or even hours. However, the duty cycle of sensor nodes is much less than 1 s. Therefore, it does not affect the application and can save a lot of energy using the duty cycle as working mode. 7,28 In such a working mode, nodes are periodically in the awake/sleep rotation. Obviously, shorter awake duration causes more energy saved. But this may increase the transmission delay and reduce the network throughput rate.
Some MAC protocols using duty cycle working mode have been proposed. 7,28 There is one called polling-based MAC protocol used widely. 29,30 The main principle of this protocol is that sensor nodes use duty cycle working mode. 29,30 When the sender has data to send, it will change to awake state and transmit preamble signal. The transmitting time is called polling duration. If there is a node in the awake state, it responds to the sender with an early ACK as the receiver after reaching the preamble signal. Then, the sender and receiver can build a connection for data transmission. If there is no receiver waking up when the sender sends the preamble signal, the receiver will not receive the ACK message. The sender will pause for a short period called polling pause and then sends the preamble signal again. The process above continues until the data are successfully sent or overtime. Then, the sender transfers to the normal awake/sleep rotation cycle. 29,30 From the above analysis, there are many parameters that affect the performance of polling-based MAC protocol, mainly including awake duration, polling duration, and polling pause. The qualitative impact of these parameters on communication performance is analyzed as follows: the larger awake duration, which means that the sensor nodes are in the awake state longer. Therefore, when the sender has data to send, the probability its receiver awake is higher. It is helpful to reduce the delay. 29,30 However, the nodes are in awake state for a long time, so their energy consumption is large, which lead to a short lifetime. The polling duration indicates the duration of the preamble signal sent by the sender when looking for the receiver. Obviously, the receiver can receive the preamble signal once it wakes up if the polling duration lasts for a long time, which helps to establish a communication connection in time and reduce the delay. The same as awake duration, however, the long polling duration makes the energy consumption larger. In addition, the receiver needs to return the ACK after the polling duration time. An excessive polling duration will make the receiver waiting too long, which will increase the delay. Polling pause represents the interval between two preamble signals. 29,30 Obviously, there is a positive correlation between polling pause and delay. The receiver that wakes up during the polling pause cannot establish a communication connection because the sender is in a silent state, which makes delay increasing. However, a large polling pause will reduce the energy consumption of nodes. Not only is the performance of the pollingbased MAC protocol related to its own parameter values, but also the number of neighbor nodes in the network. In the network, sensor nodes usually send data to the sink by multi-hop routing. Then, the nodes within the transmitting radius and closer to the sink are the forwarding nodes of the sender, the set of which is called forwarding nodes set (FNS). 7 In this way, the sender only needs to select one awake node from its FNS to send the data. Obviously, if there are more elements in the FNS, it is easier to find the node in the awake state to communicate, so the transmission delay is smaller. 7 However, excessive forwarding nodes result in more serious communication interference. When multiple nodes have data to send, due to the communication interference, the delay of the nodes that do not pre-empt the channel will increase. 7 From the above analysis, there are many parameters affecting the performance of polling-based MAC protocol which interact with each other, so the multiple parameters' comprehensive optimization is very challenging. These major challenge issues are as follows: 1. Although we have analyzed the impact of these parameters on the MAC protocol above, it is only a qualitative analysis giving the trend of performance, which cannot optimize the MAC protocol accurately. Due to the various parameters of the MAC protocol and the interaction between them, the optimization work is very difficult. To the best of our knowledge, no research has been able to reveal the relationship between parameters and the network performance such as delay and energy consumption theoretically. Therefore, it is very challenging to analyze the theoretical relationship between these parameters and performance. 2. There are some studies on the communication between a pair of nodes, but lacking in theoretical analysis of the communication between multi-sensors. Since multiple sensors interfere with each other in the communication and various parameters affect each other. As a result, the optimization of multi-sensors communication faces a larger challenge.
To conquer these challenge issues, we first theoretically analyze the relationship between MAC protocol parameters and the performance. Then, we propose a better protocol called adaptive parameter optimization polling-based medium access control (APOPM) protocol. The main contributions of this article are as follows: 1. In this article, a comprehensive parameter analysis for polling-based MAC protocol is executed. The relationship expressions between network parameters and the performance are given theoretically for the first time. The theoretical analysis of this article helps guide the setting of parameters to optimize the network performance, such as reducing the energy consumption, reducing the delay, and increasing the network lifetime. 2. Based on the comprehensive parameters analysis for polling-based MAC protocol, an APOPM protocol is proposed to optimize network performance. APOPM protocol first uses the theoretical analysis results in this article to select the parameters to optimize the network lifetime for the near sink area. Then, the APOPM protocol makes full use of the residual energy of the outer nodes to increase its awake duration and polling duration to reduce the delay. Overall, the APOPM protocol reduces the delay while maintaining long lifetime. Based on the analysis results, the APOPM protocol proposed in this article reduces the delay by 22.40% and increases energy efficiency by 23.25%.
The rest of this article is organized as follows. Section ''Related work'' reviews related works. System models and problem statement are illustrated in section ''System model and problem statements.'' Section ''The parameter analysis of polling-based MAC protocol'' theoretically gives the results of the parameter analysis of polling-based MAC protocol. In section ''APOPM protocol,'' the APOPM protocol is proposed. The conclusion of this article is given in section ''Conclusion.''

Related work
With the development of microprocessor technology, the volume of sensor devices has become smaller while their functions are more powerful. 31,32 The computing ability of current mobile phones has surpassed that of personal computers 10 years ago. Massive devices connected to the IoT have caused huge changes in the current network architecture. 1 Due to abundant devices connected to the edge network, the total amount of computing and storage is very huge, which makes the focus of the network shift from the cloud to the edge of the network, forming the edge network and edge computing model gradually. [33][34][35] With the development of artificial intelligence, it is possible to dig up rich knowledge from the big data perceived by the collaborative work of sensor devices, thereby bringing human life great changes. 36 However, the basis of collaborative work of multisensor systems is the effective communication mechanism between the nodes. Through the communication between multiple nodes the data can be transmitted successfully, which is the most important task for multisensor systems. Therefore, designing an effective communication mechanism is one of the significant contents of sensor-based systems.
There has been some research on the design of communication mechanism or the improvement on the basic MAC protocol for different application scenarios. For instance, Zhang et al. 37 proposed a Q-learningbased MAC switching scheme for the fly ad hoc networks (FANETs). Applying this scheme, each node in the type of network can switch the MAC protocol between carrier-sense multiple access with collision avoidance (CSMA/CA) and time-division multiple access (TDMA) according to the current condition of network to improve the communication performance. 37 Moreover, for the vehicular ad hoc networks (VANETs), Kumar and Kim 38 proposed a new MAC protocol (bitmap-based hybrid medium access control (BH-MAC)) based on TDMA. BH-MAC uses bitmaps with small size to represent the slot status, and the CSMA mechanism for the slot reservations is applied. 38 Therefore, the data amount in the transmission can be reduced, and the transmission delay and energy consumption are both lower compared to the existing MAC protocol. In addition, also for the VANETs, a traffic-aware time-division multiple access-based medium access control (TA-MAC) protocol is proposed by Deng et al. 39 They considered the varying data traffic due to the high mobility of vehicles, and the basic slot allocation approach of TDMA cannot fully use the channel resource, and even leads to high data collision probability. 39 Therefore, Deng et al. 39 established a traffic-aware mechanism for the real-time data traffic acquisition, and the TA-MAC dynamically changes the slot assignment based on the varying data traffic. The channel efficiency and low transmission delay are both guaranteed.
The protocols introduced above are mostly designed for the characteristic of different scenarios, and the theoretical analysis and universal optimization considering the essential features of MAC protocol is lacking. Currently, the most working mode of MAC protocol in wireless sensor network (WSN) is the periodic awake/ sleep rotation duty cycle, because the energy of sensor nodes is generally limited by batteries and they need to save by periodic sleeping. 7,14 And there is much research on the duty cycle working mode, 36 which mainly studies the impact of proportion of awake duration in one cycle on the network performance. Generally, if the awake time of the node is longer, the energy consumption is larger, so the lifetime is shorter. However, if the sender has data to send, its FNS can easily get the receiver in the awake state, which leads to a small delay. 7 Otherwise, the energy consumption is low and the lifetime is long, while its delay is large. As can be seen from the above, the awake time affects the life and delay of nodes. Therefore, some studies try to optimize these two performances. Byun et al. 40 proposed a strategy of duty cycle adjustment based on feedback control, the basic idea of which is to reduce the awake time of nodes as much as possible to extend their lifetime under the premise that the data transmission delay meets the application requirements. The thought of this strategy is: if the time of the data flow reaching the sink is larger than the demand of the application, which means the awake time adopted by the current nodes is too small, so the sink node sends control information along the data propagation path. The nodes receive the information and increase their awake time to reduce the delay. If the delay is too small, the same method is used to notify the data source nodes to reduce the awake time to prolong the lifetime. Even in the case of the same duty cycle, the performances differ when the sender chooses distinct forwarding nodes. Liu et al. 7 found that the first forwarding node waking up is not necessarily superior if the sender has data to send, for the sender has multiple forwarding nodes whose distances from the sink are different. The forwarding node that first wakes up may be far from the sink. If the sender chooses it as the relay node, more hops are required to reach the sink. Each hop will introduce a delay, so the more hops the greater the total delay. If the sender waits for the node closest to the sink waking up and selects it as the relay node, the data can forward a long distance in one hop. In this way, although the delay at this hop is large, it can reduce the number of hops to the sink, which perhaps causes a smaller overall delay. Accordingly, Liu et al. 7 proposed an optimized forwarding node selection strategy.
In the specific organization of MAC time slots, the classic protocols are as follows. Figure 1 shows the principle of the Berkeley medium access control (B-MAC) protocol, which is one of the classic MAC protocols. In B-MAC protocol, the nodes periodically enter the awake and sleeping state. When the node has data to send, it will wake up and issue a long preamble, waiting until a receiver wakes up. The receiver in B-MAC protocol only listens to the channel awake. If the long preamble from the sender is received by the receiver, the connection between them is established, and then the data can be transmitted.
The disadvantage of B-MAC protocol is that the sender must deliver the long preamble constantly until the receiver wakes up, causing much more energy consumption. Aiming at this shortcoming, another protocol named the X-MAC protocol is proposed. 30 In the X-MAC protocol, the sender issues multiple short preambles instead of one long preamble when has data to send. After sending each short preamble, the sender pauses for a period and then sends the next one. In this way, the sender can reduce the time of sending preambles, which saves the energy. However, the delay will increase compared to the B-MAC protocol, because in one case when the sender sends a short preamble but the receiver is in the sleeping state, it cannot receive the short preamble. The sender needs to send more preambles until the receiver wakes up and obtains one of the preambles, and then the connection can be established. The polling-based MAC in this article is the X-MAC protocol. The polling duration is equivalent to the short preamble in X-MAC protocol, and the polling pause corresponds to the listening time of the sender is shown in Figure 2. The X-MAC protocol is widely used in sensor systems. 30 Therefore, analyzing and optimizing parameters on the theoretical level make great sense in the performance improvement of network.
The protocols discussed above have one thing in common that the sender is initiative to establish a data connection. This type of protocol is called senderinitiated (SI) duty-cycled MAC protocol. 7,26,30 In fact, there is another type called receiver initialization (RI) MAC protocol. 28 In the RI protocol, the node with data does not send a data transmission request. The sender enters listening state instead. Once the sender obtains a beacon sent from the receiver, which is equivalent to the preamble in the SI protocol, the data transmission connection will be established.
In addition to the significant impact of the awake duration, the polling duration and the polling pause in the polling-based MAC protocol also affect the network performance. 29 Besides the internal parameters, there are other factors impacting on the performance of network, the most important of which is the delay caused by communication conflicts and interference. Since the nodes in wireless networks share the channel, only one node can be allowed to send the data at the same time. Conflicts will occur if multiple senders initiate data transmission simultaneously, and only one sender will get the channel and successfully send it. Obviously, in a network with a high density of nodes, excessive awake time will increase the probability of collision between the nodes. Communication collision makes all the energy and time consumed in building connections wasted, which leads to a low system revenue. Therefore, simply increasing the awake time of nodes will not reduce the delay effectively in the network with abundant nodes. Another factor affecting the network performance is the load of nodes. Apparently, the node with heavy load will be allocated more awake time, which also probably causes communication collision. From above, the factors that affect network communication performance are diverse and complex, so the relative research is very challenging.
There are also some studies to dynamically adjust the parameters of polling-based MAC protocol to optimize network performance based on the load of nodes. For instance, the variable traffic-adaptive duty cycled sensor medium access control (VTA-SMAC) proposed by Masood Ur et al. 41 effectively improves the network performance by adapting duty cycle based on the varying data traffic or node load. Al-Janabi and Al-Raweshidy 42 proposed a hybrid MAC protocol incorporating TDMA and CSMA/CA, which can adapt the sleep/wake-up period according to the variance of network load. Moreover, Siddiqui et al. 29 proposed the adaptive and dynamic polling-medium access control (ADP-MAC) protocol. The thought of ADP-MAC protocol is to dynamically adjust the polling distributions and polling intervals in the MAC protocol according to the data volume of nodes. When the load is light, the polling interval is increased to save energy. Otherwise, reduce the polling interval to increase the processing power of nodes. The polling distributions are also adjusted according to the arrival distribution of the data, which makes the two parameters adapted to improve network performance, although it is difficult in practice.

Network model
We consider a sensor network with several nodes, the radius of which is R and the node density is r. These nodes no longer change their positions after being deployed. 7 Each node sends the data packets received from the outer nodes together with self-generated data packets to the next layer until they reach the sink nodes. The probability of data generating is a, and the radius of data transmission range is r.

Energy consumption model
The energy of nodes in the network is consumed in receiving packets from outer nodes, sending data to the next layer and sleeping, 7,9,11 which respectively expressed as E r , E s , and E sleep . Nodes at the fringe of network only send self-generated data packets while sink nodes receive and process data in the whole network. Thus, the energy consumption is as follows

Problem statement
In multi-sensor systems, sensors cooperate to complete complex calculating tasks, which depend on the communication between the nodes. According to related research, 7 the energy consumed in communication accounts for more than 70% of its total energy consumption for sensor nodes, and the MAC protocol is a key affecting the performance of nodes. The pollingbased MAC protocol is one of them widely used and researched. In polling-based MAC protocol, there are many parameters such as awake duration, polling duration, and polling pause duration, impacting on the performance of network including the delay, energy consumption, throughput rate, channel conflict, and so on. In addition, the network environment, for instance, the number of nodes in the communication range called forwarding nodes will also affect the network performance. There are some relative studies; however, due to the interaction between parameters, the research is very complicated, which leads to the previous research mainly on the analysis of communication between two single nodes. There is no research on MAC parameter optimization of multi-sensor system, also the lack of optimized polling-based MAC protocol. The research objectives of this article are mainly as follows: (1) theoretically analyze the impact of different MAC parameters such as awake duration, polling duration, and polling pause on the performance of communication protocols consisting of energy consumption and delay in multi-sensor systems, providing the guidance for MAC protocol parameter optimization and (2) propose an optimized polling-based MAC protocol, which can effectively use the energy and significantly improve the performance of the entire network. The performance indexes to be optimized are as follows.
Reduce the transmission delay. Transmission delay refers to the time it takes for the outer nodes to propagate data packets to the inner ones until the sink nodes successfully receive the data, which is expressed as D. The smaller the transmission delay, the better the timeliness of the network. Considering that there are altogether k hops from the edge of network to sink nodes, the time it takes for the data packet to transmit at the ith hop is D i . The minimum transmission delay can be expressed as Extend the lifetime of network. Network lifetime refers to the duration from it starting to work to the first node dead, expressed as L. Since the sink nodes exhaust energy first, maximizing the lifetime of the network is equivalent to maximizing that of the sink nodes.
Assuming the initial energy of the sink nodes E init and the average power at work P sink , the maximum network lifetime can be expressed as Increase the energy efficiency. There is residual energy in the outer nodes when the network dies. In the local optimization work, we adjust the parameters of the outer nodes to use the remaining energy better and maximize the energy efficiency of the network. Assume that there are n nodes in the network and the initial energy of each node is E init . When the network dies, the energy consumed of the ith node is E i . The maximum energy efficiency q can be expressed as The parameter analysis of polling-based MAC protocol The polling-based MAC protocol Polling-based MAC protocol is a common communication protocol used for nodes to transmit data in WSN, which is shown in Figure 3.
As is shown in Figure 3, in this protocol, sender and receiver both have two states awake and sleeping. In addition, there are two states of polling and polling-off appearing alternately in the awake duration of receiver. Receiver can only receive packets in polling state. Before the formal transmission, the sender sends preamble packets constantly to ensure that the receiver is ready to receive the data packets. Receiver will successfully receive the preamble and respond an early acknowledge when polling, indicating that it is ready to receive data. And then, the data transmission starts. However, if the receiver is in polling-off state, the preamble cannot be received. Therefore, the sender can only continue to transmit them during its awake duration until receives the early acknowledge from the other side, or enter the next sleeping period. The symbols and their meanings used in the following network analysis are listed in Table 1.

Transmission delay analysis
This section discusses how MAC parameters including awake duration and polling duration affect the transmission delay in networks. We will start with the single-to-single model, where there is only one sender and one receiver in the network, and then we promote to discuss the other three models.
Single-to-single model. In this section, a single-to-single model for calculating delay is established.
Theorem 1. The transmission delay of single-to-single model D sts is calculated as equation (5), the parameters in which are listed in Table 1 D where There is only one sender and one receiver communicating in the single-to-single model. When the sender has data packets to send, it constantly propagates preambles to the receiver until the receiver receives one and returns the early acknowledge. The receiver can only attain the preamble during polling. However, the sender probably starts sending preambles at the time receiver polling-off or sleeping, which causes extra transmission delay. Two situations of transmitting preambles are discussed: (1) sender starts sending preambles during the awake period of the receiver and (2) sender starts sending preambles when the receiver is in sleep. The probabilities of these two situations are T a =T a + T o and T o =T a + T o , and the transmission delay of two situations is d a and d o , respectively. For the first situation, it can be divided into the following two cases. First, when the receiver is in the polling state, the preamble sent by the sender can be received immediately, probability of which is T po =T po + T pp . Considering the transmitting success rate m, the transmission delay in this case is d po . When the first preamble is successfully transmitted, there is no extra delay and only the transmitting time of the preamble and the returning time of early acknowledge. s p + s e =g, where s p is the data size of preamble, s e is the data size of early acknowledge, and g is the transmitting rate in this channel, which is related to the bandwidth W and the signal-to-noise ratio (SRN) P s =N . However, if the first preamble fails, the sender will continue sending  The duration when the sender/receiver is awake T o The duration when the sender/receiver is off T cycle The duration of each cycle (the sum of T a and T o ) T po The duration of one polling T pp The duration of the pause between two polling T ea The duration of sending/receiving the early acknowledgment T ack The duration of sending/receiving the acknowledgment T ad The additional time of the awake duration T cs The duration of carrier sense T bo The duration of back off T pr The duration of one preamble T pa The duration of the pause between two preambles T d The duration of sending/receiving data preambles after the duration t p , and the probability of this situation is 1 À m. The expected transmitting times of preambles are 1=m, but the sender may re-transmit preambles in the polling pause of receiver. In this case, the receiver never receives the preambles, and the probability is T pp =T pp + T po . Therefore, considering the case that the sender sends the preambles at polling pause, the total transmitting times are 1=m Á (1 + T pp =T pp + T po ). Therefore, the extra delay is 1=m where t p is the interval between two preambles. Second, the other case is that the sender starts to establish communication when the receiver is in the polling pause, the probability of which is T pp =T po + T pp . In this case, preambles cannot immediately be received, so the sender needs to wait till the receiver go into the next polling period, and the expected value of waiting time is T pp =2. Therefore, compared to the situation that the sender starts sending preambles when the receiver is polling, the extra delay of this situation is T pp =2. Above all, when the sender sends preambles in the awake duration of the receiver, the expected delay is The second situation is that the sender establishes communication when the receiver is sleeping, which also includes two cases. Assuming that the sleeping duration is always larger than the awake duration, we cut the sleeping duration into T o À T a and T a . When the sender begins transmission in the later section T a , it can wait until the receiver enters polling state in this cycle. The calculating method of the expected transmission delay is similar to d pp . In this case, the delay can be expressed as d ol = d po + (T a =2).
However, the sender never waits for the receiver to wake up in this cycle when sending preambles in the former segment T o À T a , and it needs to enter sleeping until the next cycle to continue to send packets, which causes a cycle of delay T o + T a . When the next awake period arrives, the reception of the preamble is transformed into the first situation, which calculation method is the same as above. To simplify the problem, we default that the tolerance of communication establishing is two cycles. The delay in the second cycle plus the duration of the first cycle is the total one in this case The probabilities of the two cases above are T a =T o and T o À T a =T o , respectively. Therefore, the transmission delay in the second situation is expressed as In summary, the expected transmission delay in the single-to-single model is Figure 4 illustrates that the transmission delay changes with awake duration and polling duration. First, it can be seen that the delay reduces slightly with the increase in polling duration when other parameters are fixed. Second, the awake duration of nodes has great impact on the transmission delay that larger T a brings smaller delay, shown as the black, red, and blue lines in Figure 4. Third, from the black line and green line, the delay increases with the decrease in transmitting success rate m, which is consistent with the theoretical analysis above. Moreover, the transmitting rate g has similar impact. When the bandwidth or the SRN is unsatisfactory, the transmitting rate is smaller, and the delay of transmitting preambles and data packets is larger. In summary, to reduce transmission delay, the awake duration and polling duration of nodes should be increased. Figure 5 illustrates the impact of sleep duration and polling pause duration on the delay. As the sleep duration increases, the probability of sender sending the preambles when the receiver is awake is lower, so the transmission delay increases. Similarly, the increase of polling pause duration has the same effect on the transmission delay.
Single-to-m model. In this section, the single-to-m model is established based on Theorem 1 and the relationship between the transmission delay and the number of receivers is analyzed. where Proof. In the single-to-m model, the transmission delay is defined as the duration from the sender starting sending preambles to any receiver obtaining the preamble and responding the early acknowledge to the sender. The calculation of delay in this model is similar as the single-to-single model, but the probability is different. First, the worst situation is that all receivers are sleeping when the sender begins transmission, where the sender needs to wait till one receiver enters the polling state. In single-to-m model, the probability of m receivers all sleeping is P o = (T o =T a + T o ) m . Thus, the delay in this situation can be expressed as where the probabilities in d ofm should be changed.
The other situation is that as long as there is one receiver awake when the sender sends the preamble, the data transmission can start immediately, whose probability is P a = 1 À (T o =T a + T o ) m . In summary, the delay in the single-to-m model is D stm = P a Á d am + P o Á d om .
Figures 6 and 7 reveal the impact of MAC parameters and channel parameters on transmission delay in the single-to-m model, respectively. From Figure 6, first, we can see the transmission delay decreases with the number of receivers. This is because that if there are more receivers in the network, the probability that all of them sleep simultaneously is lower. Therefore, the probability of sender waiting becomes lower, which means the delay is smaller. In addition, larger polling duration or larger awake duration is beneficial to the reduction of delay, which is consistent with Figure 4. Moreover, from Figure 7, it can be seen that good channel environment, including larger bandwidth and SRN, makes the transmission delay lower.
N-to-single model. In this section, the n-to-single model is established based on Theorem 1. where Proof. Similar to the single-to-single model, we can also divide the transmission into four cases. The expected delay of these four cases is d pon , d ppn , d ofn , and d oln , respectively. In addition, the data collision should be considered in the n-to-single model because several senders may send preambles at the same time slot. When the preambles from different senders collide, the receiver obtains neither of them and all the senders should wait for a random interval and re-transmit preambles. Therefore, data collision will cause larger delay. In the single-to-single model, we have calculated the delay d po .
Due to the channel noise, the expected transmitting times are 1=m Á (1 + T pp =T pp + T po ). However, in the nto-single model, although the preamble is sent successfully at the probability of m, there may be other data collides with it. Therefore, the transmitting times should be modified to when there are n senders. In this formula is the probability of no collision, where a is the probability of data generation. From the probability, there will be no collision if the other a Á n À 1 senders with data do not enter the polling state and send preambles at this time slot. u is the rate of the average back-off time t bo due to the collision and the interval of preambles t p , that is, u Á t p = t bo . The calculation of expected delay in the other three cases is similar with the singleto-single model, so there is no further elaboration. Figure 8 shows the transmission delay changes with MAC parameters in the n-to-single model. It can be seen that when the awake duration and polling duration increase, the delay can be reduced. However, with the increase in the number of senders, the performance of delay reduction is worse, and even the delay increases compared to that when the value of parameters is not increased. This is because longer polling duration of senders leads to larger probability of data collision. Therefore, in this delay model, the impact of MAC parameters becomes complex when considering the data collision. Figure 9 illustrates the transmission delay changes with other parameters in equation (7). First, larger transmitting success rate m brings smaller delay, corresponding to Figure 7. Second, when the data generating probability is larger, more senders join in the communication establishment with the receiver. Therefore, the collision probability is larger and the transmission delay increases.
N-to-m model. In this section, the n-to-m model for transmission delay is established based on the models above.  where Proof. In the n-to-m model, there are n senders and m receivers. The senders with data need to communicate with any receiver and transmit data packets to it. D ntm is the average expected delay. In the calculation of D ntm , we consider the characteristic of single-to-m model and n-tosingle model simultaneously: (1) multiple receivers increase the probability of preamble received and (2) the preambles from multiple senders may collide. The calculation method of components in equation (8) has been illustrated in the models above, so there is no further elaboration. Figure 10 illustrates the transmission delay changes with the number of senders and receivers. When the number of senders n increases or the number of receivers decreases, the delay is higher. This is because the increase of senders leads to a higher collision rate, while the increase of receivers causes a higher probability of preambles received. Moreover, Figure 11 shows the impact of MAC parameters on the delay in the n-to-m model, which is consistent with Figure 9. When the awake duration and polling duration are excessively large, the collision rate is higher and the transmission delay will increase.

Energy consumption analysis
This section mainly discusses the impact of MAC parameters on the energy consumption in the network. The model of network energy consumption is established on the basis of the delay calculated in section ''Transmission delay analysis.'' Similar to the delay model, we first start with single-to-single model, and then promote it to discuss the single-to-m model, n-tosingle model, and n-to-m model.
Proof. In the single-to-single model, the energy consumption of communication establishment consists of two parts: the energy consumed by the sender and the receiver, expressed as E s sts and E r sts , respectively. In addition, s d =r(P s + P r ) is the energy consumption for transmitting data.
Similar to the delay calculation, we also divide the communication establishment into four cases. The first case is the sender starting sending preambles when the receiver is polling. The energy consumption of this case for the sender and receiver is e s po and e r po , respectively. e s po consists of the energy for sending preambles 1=m Á (1 + T pp =T pp + T po ) Á t p Á P pr and receiving early acknowledge s e =r Á P r , where P pr is the average power of sending preambles with a certain interval. Similarly, e r po consists of the energy for polling before receiving the preamble 1=m Á (1 + T pp =T pp + T po ) Á t p Á P po and the energy for sending back early acknowledge s e =r Á P s , where P po is defined as the average power of polling state and polling pause state. The second case is that the sender starts sending the preamble when the receiver is in polling pause. According to the delay calculation, we know that the extra expected delay is T pp =2. In this duration, the sender keeps sending preambles, so its power is P pr , while the power of receiver is P pp . The two cases above constitute the situation of the sender sending preambles in the awake duration of receiver; the energy consumption for both is e s a and e r a , respectively. Moreover, for the situation of the sender sending preambles when the receiver is sleeping, the sleeping state of receiver is also divided into two sections T o À T a and T a . When the sender starts sending preambles in the latter section, the sender can wait for the receiver waking up in the current cycle. From section ''Transmission delay analysis,'' the extra delay of this case is T a =2. In the extra delay, the sender continues sending preambles, while the receiver is sleeping. The energy is calculated as e s ol and e r ol . On the contrary, when the sender starts sending preambles in the former section, the sender cannot wait for the receiver waking up in the current cycle. The extra delay of this situation is T cycle , and in the next cycle, the sender still sends the preambles like the three cases above, so the energy consumption is e s of = T a Á T po T po + T pp Á P pr + T pp T po + T pp Á P pp In this formula T a Á T po T po + T pp Á P pr + T pp T po + T pp Á P pp is the energy consumption in the first cycle, and T a =(T o + T a ) Á e s a + T o =(T o + T a ) Á e s ol is the energy consumption of the next cycle. Similarly, the energy consumption of the receiver is as e r of . In summary, the energy consumption of four cases is illustrated above. Combined with the corresponding probability, the total energy consumption can be obtained as equation (9). Figure 12 shows that under different polling duration, the energy consumption of nodes increases monotonically with the awake duration. Moreover, the transmission success rate m and the data rate g also impact the energy consumption that larger m or g brings smaller energy consumption.
Single-to-m model. In this section, we extend from the single-to-single model to discuss condition where there is one sender and several receivers. International Journal of Distributed Sensor Networks Theorem 6. Based on Theorem 2, the energy consumption of single sender to m receivers E stm is calculated as Proof. In the single-to-m model, it is allowed that the sender only send data to any receiver successfully. Similar to the calculation of delay, the probability of cases in the single-to-single model should be modified to P a and P o , which represent the probability of any receiver awake and that of no receiver awake, respectively. In addition, when the sender successfully sends the preamble to one receiver, the preamble may be also obtained by other receivers in awake duration, and the expected number of receivers is (T po =(T pp + T po )Á T a =(T a + T o )) Á m. Therefore, the energy for receiving data packets should be modified as (T po =(T pp + T po ) Á T a =(T a + T o )) Á m Á P r Á s d =r. The rest of the calculation method is the same as the single-tosingle model, which is not elaborated in detail. Figures 13 and 14 illustrate the change of energy consumption with MAC parameters and channel parameters. First, from Figure 13, we see that the total energy consumption increases with the number of receivers, because more receivers may be awake and receive the data packets simultaneously. In addition, the increase of awake duration and polling duration brings more energy consumption in the single-to-m model. Second, from Figure 14, the reduction of channel parameters such m and g also increases the energy consumption.   N-to-single model. In this section, we continue promoting to discuss the n-to-single model. There are several senders and one receiver in the network. The formula of energy consumption and its proof are as follows.
Theorem 7. Based on Theorem 3, the energy consumption of n sender to single receiver E nts is calculated as Proof. The calculation of energy consumption in the nto-single model is similar to the single-to-single model. However, the difference is that we should consider the data collision when there are multiple senders.
According to the modification of section ''N-to-single model'' in section ''Transmission delay analysis,'' we should change the expected transmitting times in e s pon and e r pon from 1=m Á (1 + T pp =T pp + T po ) to when considering the data collision. The other parts of the calculation are demonstrated in detail in section ''N-to-single model'' in section ''Transmission delay analysis,'' and the basic thought is that the duration of the different states is multiplied by the corresponding power. Figures 15 and 16 illustrate the change of energy consumption with MAC parameters and channel parameters. First, the total energy consumption increases with the number of senders, and larger awake duration or polling duration leads to more energy consumption in the n-to-single model. Moreover, from Figure 16, the reduction of channel parameters such m and g also increases the energy consumption, which is consistent with Figure 14.
Data amount analysis. Before the analysis of n-to-m model, we first focus on the calculation of node number and data amount. In the network, the data amount undertaken by nodes changes with the distance of the node from the sink area. In this section, we expand the scenario to the whole network, and establish a model for calculating the data amount. According to Huang et al., 12 assume that the radius of network is R, the node density is r, and the probability of each node generating a packet is a. The network area is divided into L layers, so the width of each layer is R=L. The sink nodes are deployed in the first layer, also the center of network. Nodes in two adjacent layers can transmit data packets, so the data amount in the lth layer will be added into the (l + 1)th layer. Based on the assumption above, the data amount of the lth layer can be calculated as equation (12). In this formula is the area of the circle with the distance from the lth layer to the edge of the network as the width, which represents the data from the outer layers converge to the inner layers. According to equation (12), we draw the graph of the variation of the data amount with the number of layers, as shown in Figure 17. It can be seen that the number of nodes in outer layers is larger, so there are more data generated. In addition, the data amount decreases with the distance of nodes from the sink N-to-m model for energy consumption. In this section, we will analyze the n-to-m model for energy consumption based on the network scenario in section ''Data amount analysis.'' Theorem 8. The total energy consumption of nodes at the lth layer is E l Proof. According to section ''Data amount analysis,'' we know that the nodes at the lth layer should receive the data packets from the (l + 1)th layer and forward the data to the next layer. In addition, the data generated by the nodes at the lth layer also should be sent to the next layer. Therefore, the energy consumption consists two parts E s l and E r l . In the calculation of E r is the energy consumption in the stage of communication establishment, where is the node number in the lth layer. The calculation of E r ntm is similar to E r nts in the n-to-single model, but the probabilities T a =T o + T a and T o =T o + T a should be modified to P a and P o according to the single-to-m model. And A l + 1 Á s d =g Á P r is the energy for receiving the data packets from the (l + 1)th layer, where A l + 1 is the packet number in the (l + 1)th layer. Moreover, the energy consumption of sending data packets to the next layer E s l is also calculated as the way above. Figure 16. The change of energy consumption with the channel parameters in the n-to-single model. Figure 17. The data amount of each layer. Figure 18 shows that the energy consumption of the nodes in different layers. As the distance from sink increases, the data amount undertaken by nodes is smaller and the energy consumption reduces. And the increase of MAC parameters brings more consumed energy. Moreover, from Figure 19, we see there is more residual energy in nodes of outer layer when the initial energy of nodes is fixed. And the data generation rate has great impact on the residual energy. Therefore, the residual energy of outer nodes can be used to reduce more delay.

APOPM protocol
The proposal of the APOPM protocol According to the calculation models of delay and energy consumption established in section ''The parameter analysis of polling-based MAC protocol,'' the adjustment of various network parameters, such as awake duration and polling duration, will impact on the performance of network. Therefore, a new APOPM MAC protocol is proposed to find suitable network parameters to ensure that the energy efficiency of network while the delay reduces. The APOPM MAC protocol uses an adaptive MAC parameter strategy that different network parameters are applied to different network areas to maintain the high performance. Specifically, the lifetime of nodes near the sink area determines that of the entire network. Therefore, the APOPM MAC protocol is used in the area close to sink to low the energy consumption of nodes and maintain the network lifetime. Otherwise, the nodes far from sink area have energy surplus, so the MAC parameters will be adjusted to use the residual energy to continue reducing the delay.
Therefore, the optimization of the APOPM protocol mainly consists of two organic components. The first is to find the optimal MAC parameters for sink nodes, which improve the performance on energy consumption, transmission delay, and data transmission success rate in a tradeoff way. Then, the lifetime of sink nodes can be prolonged and the delay is controlled to be not excessively large. The second step is to optimize the performance of the outer nodes. N-to-m model for energy consumption reveals that the outer nodes still have residual energy when the network dies, which causes energy waste. And we find the farther the node is away from the sink, the more energy is left. Therefore, the MAC parameters are dynamically optimized according to the different physical positions of the nodes, which appropriately use the residual energy and optimize other performance such as transmission delay and transmission success rate.

The performance optimization for sink nodes
According to the characteristic that sink nodes only receive data from outer nodes and do not send packets, we choose the n-to-m model to calculate the transmission delay and energy consumption. Therefore, the objective function O(T a , T po ) is shown in equation (14), where l D and l E are the weights of two performance indicators, respectively. Our goal is to find the optimal parameters T Ã a and T Ã po which make the value of objective function reaching minimum Aiming at the above optimization problem, the common method is to obtain the partial derivative of the objective function for several parameters, and apply the gradient descent method to get the optimal solution.  However, the gradient descent method only directly applies if the objective function is continuous and convex in the definition domain. If the objective function is not strictly convex, there may be multiple local minima. Gradient descent may fall into a local minimum and fail to reach the global optimum. Therefore, we first judge that the objective function is not convex. Then, according to the characteristic of the problem, an alternate optimization method for multiple MAC parameters is proposed. 43 Theorem 9. The MAC parameter optimization for sink nodes is not a convex problem.
Proof. The objective function of MAC parameter optimization problem for the sink nodes is a multivariate function. The principle of determining whether a function with several variables is convex is that the Hessian matrix of the function is semi-positive definite. Since the theoretical calculation of D sink and E sink is excessively complicated, the scientific computing modules SymPy in Python is applied to solve the second-order partial derivatives of the objective function separately, and the Hessian matrix H is obtained, as shown in equation (15)  According to the calculation result of SymPy, ∂ 2 O=∂T a ∂T po = ∂ 2 O=∂T po ∂T a , which shows that H is a symmetric matrix and also proves that the objective function is continuously derivative of the second order in the definition domain, which meets the first condition of using gradient descent method. Since the second-order derivative expression in H is complicated and it is hard to find the eigenvalues of H, we transform the problem to determine whether the principal minors of H are all greater than 0. The first-order principal minor of H is ∂ 2 O=∂ 2 T po , which is constantly greater than or equal to 0 in the definition domain, and its trend is shown in Figure 20. The second-order principal minor is (∂ 2 O=∂ 2 T po ) Á (∂ 2 O=∂ 2 T a )À (∂ 2 O=∂T po ∂T a ) Á (∂ 2 O=∂T a ∂T po ), whose function image is shown in Figure 21, does not satisfy the condition that the second-order principal minor is constantly greater than or equal to 0. Therefore, H is not a semi-positive definite matrix, and the objective function is not a convex function.
Theorem 9 proves that the objective function O(T a , T po ) is not convex, so there is no guarantee that the final result of applying gradient descent optimization directly is globally optimal. However, although our optimization problem is not convex for multiple MAC parameters, it is convex for the unitary functions O(T po ) and O(T a ), that is, fixing T a and T po as constant value, respectively. Therefore, an alternate optimization method for multiple MAC parameters is proposed. 43 The following is the first step to prove that O(T po ) and O(T a ) are the convex functions. Proof. Fixing T a to T a0 , the objective function becomes a function with only one variable. The trend of its second-  order derivative ∂ 2 O=∂ 2 T po in the definition domain is already shown in Figure 20. ∂ 2 O=∂ 2 T po is constantly greater than 0 in the definition domain, indicating that the univariate function O(T po ) is a convex function. Similarly, Figure 22 shows the trend of the second-order derivative ∂ 2 O=∂ 2 T a after fixing T po , which is also constant greater than 0 in the definition domain, and O(T a ) is also a convex function. Therefore, an alternate optimization method for multiple MAC parameters is proposed to find the optimal value of T a and T po .
Algorithm 1 shows the process of the alternate optimization method, where R is the number of iterations, and s a and s po are the learning rates for updating T r a and T r po , respectively. The algorithm first fixes T po as T r po and updates the value of T a using the gradient descent method. The termination condition of the iterative search for the lowest point of O(T a , T r po ) is jT r + 1 a À T r a j ł D, where D is a preset small threshold. After determining T r + 1 a , T a is fixed and T r + 1 po is updated in the same way for the purpose of alternate optimization parameters.

The performance optimization of outer nodes
In section ''The performance optimization for sink nodes,''Algorithm 1 is applied to find the optimal parameter value for sink nodes and balance the delay and energy consumption. However, based on the previous analysis, sink nodes will first run out of energy, while the outer nodes have residual energy. Therefore, we next propose the APOPM algorithm to optimize the parameter value adaptively according to the physical location of nodes. Then, the simulations also illustrate the performance of optimizing method. Algorithm 2 shows the process of APOPM algorithm, where Nodes is the node list in the network. L is the total number of layers in the network, and sink nodes are located at the first layer. e a and e po are the update strength of T a and T po , respectively. In the algorithm, the residual energy of nodes in each layer of the network is calculated. And the nodes still have residual energy when sink nodes die, which means that their MAC parameter value can continue to increase to reduce the data transmission delay. After the layer-bylayer optimization of Algorithm 2, the nodes in the network find suitable parameter value: the outer nodes make full use of the remaining energy to reduce the delay, and the inner nodes try to save energy and extend the lifetime within the tolerance range of delay.  T l a T l a + e a , T l po T l po + e po 10: Calculate E l according to equation (13) 11: E res E init À E l 12: End While 13: End For 14: Return T 1 a . . . T L a , T 1 po . . . T L po Next, we analyze the cost of APOPM algorithm. The iteration number for parameter alternate optimization in Algorithm 1 is R, and v parameters (two in this research, T a and T po ) need to be optimized in each iteration. For each parameter, it is necessary to find the minimum value using gradient descent. Assume that the average number of computing gradient is t, so the time complexity of Algorithm 1 is O(R Á v Á t). In addition, there is the optimization for outer nodes at (L À 1) layers. However, since the algorithm is sequential optimization, the parameters are always incremental. Therefore, the maximum iteration number is only related to the nodes at the Lth layer. Suppose the final parameter value of nodes at the Lth layer is T L a and T L po , then (T L a À T 1 a )=e a or (T L po À T 1 po )=e po is the total number of iterations, so the updating number is (T L a À T 1 a )=e a Á v. In summary, the algorithm complexity of APOPM is

Analysis of the simulation experiment
In this section, the simulation experiment is designed to prove the performance of the algorithms proposed above. We apply Python to implement the APOPM and simulate the communication establishment and data transmission between nodes. Table 2 lists the initial value of the parameters when using the APOPM protocol to optimize the network. Figure 23 presents the change of transmission delay of nodes at different layers after optimization using Algorithm 1 and APOPM. First, comparing the black curve and red curve, we see that better MAC parameters are obtained by Algorithm 1, and the transmission delay of nodes is reduced. In addition, due to more data undertaken by the sink nodes, the delay is larger compared to the outer nodes. Second, when the APOPM is applied, the performance of outer nodes on delay is better, shown as the blue curve in Figure 23. It is proved that the residual energy of outer nodes can be used to further reduce the transmission delay. The other three curves illustrate the situation when the data generation probability is larger, so the transmission delay is larger. Based on the theoretical analysis, the change of MAC parameters also impacts on the energy consumption of nodes. Figure 24 illustrates the change of energy efficiency of nodes at different layers after applying Algorithm 1 and APOPM. The energy efficiency is the rate of energy used and the initial energy. From the black curve, we see that the energy efficiency of outer nodes is lower because the data amount at outer layers is smaller. Although the energy efficiency raises generally after applying Algorithm 1, the condition of energy consumption of outer nodes is still unsatisfactory.   However, after using APOPM, the MAC parameters of outer nodes are modified adaptively, so the large residual energy in the outer nodes can be further used, and the energy efficiency is higher. In summary, the simulation experiment further proves the feasibility of the APOPM proposed. After using APOPM protocol, the average transmission delay of the network is reduced by 22.40%, and the average energy efficiency of the nodes increases by 23.25%.

Conclusion
In multi-sensor systems, the communication between multiple sensors affects and interferes with each other, so it is a challenge issue to analyze the MAC communication protocol between multiple sensors. In this article, we establish the data transmission model of multiple nodes, and theoretically analyze the effect of network parameters such as awake duration and polling duration on the transmission delay and energy consumption of nodes. Based on this, we propose a new protocol called the APOPM protocol to optimize the existing network MAC protocol. Some performance of the network, including transmission delay, network lifetime, and energy efficiency all get improved. According to the relationship between parameters and performance, we propose the optimization algorithm to modify the parameters of the sink nodes and improve the node performance in a compromise strategy. The algorithm can adjust the weights of the two aspects of performance according to the timeliness and energy-saving requirements of the actual network application, and use the parameter alternate optimization method to find the best parameter values according to the characteristics of the objective function that it is continuously derivable and has a minimum value in the range of parameters. Second, we dynamically adjust the parameters of the outer nodes according to their positions, using the residual energy in the network to further reduce the delay. In the experiments, we calculate the theoretical results through the model in section ''The parameter analysis of polling-based MAC protocol.'' The changes of delay and energy efficiency before and after optimization are given in the form of graphs. Then, we use Python to simulate the data transmitting in the network and present the comparison of performance between the APOPM protocol and the previous protocols, which further proves the effectiveness of the APOPM protocol that achieves the optimization goal of improving network performance.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.