Effects of mobility on latency in a WSN that accommodates mobile nodes

Several applications have been proposed for mobile wireless sensor networks. Some of these applications require the transfer of a large amount of data in a short period of time. This is challenging, since mobility can lead to a deterioration in the quality of an established link. Frequent link disconnection may in turn require a mobile node to repeatedly establish new links with the surrounding relay nodes to proceed with the data transfer. The new link establishment may cause extra data communication latency and make most of the applications delay sensitive. To evaluate the effect of mobility on latency, this paper first sets up a mathematical model based on a hybrid medium access control (MAC) protocol in mobile scenarios. It then uses NS2 simulation to further analyze the latency associated with mobility. Both results show that the latency increases with an increment in the network density and the duty cycle.


I. INTRODUCTION
Wireless sensor networks that accommodate mobile nodes have several applications [12] [16] [14] [13] [8] [5].These applications consist of nodes attached to mobile persons, animals, or objects as well as static nodes assisting the mobile nodes to deliver the sensed data to the base station over a multi-hop path.These types of networks have been proposed for supervising post-surgery rehabilitation (recovery from a hip or knee replacement) [3]; for diagnosing dyskinesia symptoms of patients in Parkinson Disease (PD) [2]; for monitoring and controlling the behavior of animals (such as grazing pattern and aggressive temperament) [1], and for detecting oil spills and avoiding toxic gases in refineries [11].
While the advantage of node mobility is obvious, it also brings with it some formidable challenges [6].For instance, mobility can lead to a deterioration in the quality of a communication link and thus, makes the data transmission prone to failure.This increases the packet retransmission cost and route change frequency.Frequent disruption of a link during data communication will force the mobile node to repeatedly establish new links with its neighbor nodes.The new link establishment will consume extra time, since the mobile node may not be able to set up a new link immediately after the original link breaks, especially when the asynchronous duty cycles are applied by nodes [9].This introduces a large packet delivery latency and requires additional packet management overhead at the destination.This paper quantitatively investigates the latency of a single-hop packet transmission in a wireless sensor network that accommodates mobile nodes.The investigation is based on a mathematical model in which a low-power MAC protocol uses beacons to enable receivers to initiate a communication whenever they are ready to receive data from the mobile transmitters.The mathematical model is complemented with the simulation evaluation implemented in the N S2 simulation environment.Both the analytical and the simulation results indicate that the packet delivery latency increases with an increment in the network density as well as in the duty cycle.
The remaining part of this paper is organized as follows: in Section II, a brief introduction to RI-MAC and its optimization is described.In Section III, the effect of mobility on latency is evaluated based on the optimized RI-MAC.In Section IV, the latency caused in case of mobility is evaluated.In Section V, both the analytical and simulation results are visualized and the observations are discussed.Finally, in Section VI, concluding remarks are given.

A. RI-MAC
The Receiver-Initiated MAC protocol (RI-MAC [15]) is chosen for analyzing the effect of mobility on latency.RI-MAC is selected because it applies beacons to find a rendezvous time for exchanging data.The lack of control packets and preambles enable RI-MAC to achieve the minimal data transmission delay compared with other types of MAC protocols.Since RI-MAC provides a lower bound value on the packet delivery latency, it can be used as a benchmark for the study of other types of MAC protocols.
In RI-MAC, once a receiver completes a sleep phase and detects a free channel, it will broadcast a beacon containing only the source address information (SRC).All the neighbors of the receiver with pending data will start transmission upon receiving it.If two or more packets are transmitted simultaneously, collision will occur [10] [4].This leads to another beacon transmission from the receiver, in which a back-off window field (BW) is additionally included to reduce future collisions.If a data packet wins the channel, the receiver will reply with an ACK beacon (DST) serving as the acknowledgement.However, if no packet is received during a dwell time after a beacon is transmitted, the receiver will go to sleep.In RI-MAC, the dwell time is proportional to the BW value in beacons.Since the BW value is automatically adjusted according to the collision frequency, so is the dwell time.

B. Demerit of RI-MAC
Even though RI-MAC achieves efficient channel utilization and high packet delivery ratio, it has some demerits.Firstly, in a round of transmission, the BW size in beacons never decreases.Instead, it either remains unchanged or keeps increasing whenever collision is detected.The increase can be very fast in case of small transmission intervals.This will lead to a large back-off window as time goes by.Therefore, a sender has to remain idle for a long period of time before it can transmit data packets.The fact that the waiting time does not adapt to the traffic load introduces RI-MAC extra latency.Secondly, the phenomenon that a receiver does not receive any data packet during a dwell time can be also caused by an unsuccessfully transmitted beacon instead of an idle channel.Consequently, it may happen that a receiver has to go to sleep although there are transmitters wishing to communicate with it.

C. Optimization of RI-MAC
To slow down the monotonous increment of BW size and to reduce the probability of the dwell time, we propose to use a burst transmission pattern of data packets.Thus, instead of competing for the medium to send just a single packet, a node transmits a pre-defined number of packets in burst.The beacon between two data packets is only set as acknowledgement, as shown in Figure 1.By intercepting the ACK beacons, competing neighbors will realize that the medium is currently occupied and will refrain from attempting to seize the channel.The burst transmission may be unfair, but it is efficient in terms of latency.Suppose n data packets are transmitted in burst.As soon as the first data packet is transmitted, a link between the transmitter and the receiver is successfully established.Then (n − 1) data packets are left to be sent.The time required to transmit these packets is given by: Here, the parameters N data , N b , R t and T SIF S denote, in respective order, the data packet size, the ACK beacon size, the transmission rate, and the time to switch the radio from transmitting to receiving mode or the other way around.The distance a node travels during T n−1 data can be variable depending on different moving styles.However, most of the mobility models which generalize the movement characteristic from real applications verify that a node usually changes its direction and speed once the time expires or the maximum permitted distance is reached [7].Therefore, by assuming a node moves at a uniform speed v along the radius of the radio transmission range, R, of its partner, the largest distance between two nodes that ensures an uninterrupted data communication can be defined as: This means, if a transmitter, whose distance with respect to the receiver exceeds d at the very start, wins the channel, its data transmission will be definitely interrupted, since the link will break in the middle of communication.Therefore, the effect of mobility on latency can only be evaluated under the assumption that the transmitter is located at any place between d and R within the radio transmission range of the receiver.The link disconnection caused by node mobility is illustrated in Figure 2. Suppose one of the contending transmitters, S1, is the mobile node.Once it seizes the medium, it will transmit data packets with its intended receiver, R1, in a burst pattern.The communication continues until it finally moves out of the radio transmission range of R1.As soon as the link breaks, S1 will attempt to set up a new link with one of its surrounding receivers.The link set-up time can be very different depending on when the transmitter is able to win the channel.If at least one extra receiver of the transmitter is awake before or at the moment of the link termination, a base beacon will be broadcasted at T 3.This enables the transmitter to establish a new link with a minimum delay.However, the time required for setting up a new link can also be quite long, since the transmitter may not immediately receive a beacon from one of its neighbors due to the asynchronous duty cycles that nodes apply in RI-MAC.
Apart from this, extra latency can be introduced after the original transmitter, S1, successfully receives a beacon from a new receiver, R2, after the link breaks.This is because multiple neighbors of R2 are medium competitors and S1 is only one of them.The new link establishment is described in Figure 3. Since at least two nodes are assumed to be actively present around a particular node, a collision on the data packets must occur in the first medium competition.This makes a BW field to be additionally included in the next beacon.As a result, in the following competitions, it may happen that (a) the original

IV. LATENCY EVALUATION IN THE CASE OF MOBILITY
A. Time Consumed Before The Link Breaks Once a receiver wakes up and detects the free medium using the CCA (Clear Channel Assessment) check, it will broadcast a base beacon.If k out of N neighbors of the receiver except the original transmitter are in an active state (N ≥ 2, k ≥ 1), at least two senders will receive this beacon at the same time.Since no BW field is embedded in the base beacon, collision must occur.This forces the receiver to broadcast another beacon after a random back-off delay.As only one data packet is transmitted before the establishment of the link (n 1 = 1), t 1 (as shown in Figure 2) can be expressed as: The terms T r and T CCA represent the random back-off duration (T r = BW m=1 (mσ) BW , BW is the back-off window size, σ is a slot time), and the time used for making the CCA check.The parameter T bwm denotes the back-off interval determined by k nodes out of which one wins the channel in the (m+1) th competition.m can be one or more depending on the collision frequency.T bwm can be specifically expressed as: As the transmitter is located at any place between d and R within the radio transmission range of the receiver, the distance it travels between T 1 and T 3 (as shown in Figure 2) on average can be evaluated as R−d 2 .This makes the time spent on such traveling, t 2 , to be: At the moment of the link break, either the transmitter fails in receiving the ACK beacon, or the receiver fails in receiving the data packet.But the packet has to be retransmitted in any case.Therefore, the number of data packets that are left for transmitting after the link breaks, n 3 , can be quantified as:

B. Time Needed For Setting Up A New Link
As illustrated in Figure 3, there are three possible transmission patterns after the link breaks.For case (a), the transmitter can directly resume its remaining data transmission.For case (b), the transmitter cannot start sending until the node which wins the channel completes its data transmission.And for case (c), the transmitter will contend for the medium after the collision.In order to simplify the evaluation, we assume that the original transmitter can seize the medium at latest at the third attempt.This indicates that the time evaluated for setting up a new link here is much less under the average.
As different numbers of active nodes introduce different back-off durations, which will further influence the setting up time of a new link, t 3 should be expressed as: Here, D denotes the duty cycle, that is the probability of a node for being in the active state.According to the three possible transmission patterns from the perspective of the original transmitter, t k 3 can be quantified as: The three coefficients that determine the values of t a , t b and t c denote, in respective order, the probability that S1 wins and fails in the medium, and the probability that collision occurs in the second transmission attempt.As depicted in Figure 3, t a , t b and t c can be expressed as: The terms T u and T col bw1 represent the time unit used for transmitting a data packet (T u = N data Rt + N b Rt + 2T SIF S ) and the back-off interval determined by a collision in the second competition.By substituting A for ( bw1 can be expressed as: By combing equations ( 7)-( 12), the time needed for setting up a new link can be obtained.Then by combing equations (3), ( 5) and ( 7), the time required for transmitting all the n data packets during which the link breaks can be evaluated.We employed Matlab (version 7.0.1) to visualize the latency that is quantified in the mathematical model.We defined the number of data packets transmitted in burst to be 140 and the average moving speed of human beings to be 1.5m/s .Consequently, if a node wins the medium after it moves out of 24.5m of the radio transmission range of its receiver, the communication link between the two nodes will break during their data transmission.

V. RESULT AND DISCUSSION
In our simulation, we used N S2 network simulator (version 2.29) that applied the commonly used standard combined free space and two-ray ground reflection radio propagation model.Each sensor node is simulated with a single omnidirectional antenna.To simplify the evaluation, we do not include the routing traffic and assume a routing protocol providing the shortest path between any two nodes.
Table I presents the key parameters for simulating the radio of sensor nodes.Most of these parameters are taken from the data sheet of CC2420 radio.The transmission range and carrier sensing range depend on many factors such as transmission power, antenna and environment.In N S2, these two parameters are modeled after the 914MHz Lucent WaveLAN radio and are respectively set as 250m and 550m, which however is not typical for a sensor node.To mostly approach the reality, we used 25m and 55m instead, since they are the values tested during the real experiment.The frame length was set as 5s and the initial wake-up time of each node was randomized to avoid synchronized beacon transmissions from neighboring nodes.The time consumed before link termination is caused by the initial medium contention and the following communication of several data packets between a pair of nodes.As shown in Figure 4, with the increment of both the duty cycle and the network density, the latency decreases.This decrease is attributed to the backoff interval a node has to wait before data communication.For a fixed network density larger than two, the number of neighbors of a particular node that are awake at the same time increases when the duty cycle grows.This enables more neighbors of the receiver to contend for the channel, since each medium competitor is required to choose a random value between 0 and BW once receiving a beacon.The more the nodes participate in the contention, the smaller the average backoff interval will be.

A. Analytical Result
When the network density is two, the latency remains unchanged regardless of the duty cycle.This is because the optimized protocol formulates the rule that when a beacon without a BW field is broadcasted, collision will definitely occur if more than one transmitter with pending data are awake.To embody the feature of base beacon, we assume that at least two nodes take part in the channel contention, even though both of them have a low duty cycle.No matter which one finally wins the medium, the backoff interval remains the same, leading to a constant latency of 0.1806s.This is also the reason why the time cost before link deterioration is equal for all the network densities once the duty cycle approaches zero.
For a fixed duty cycle, the increment of the network density results in a large quantity of nodes in channel occupation and a small backoff value.This shortens the time that the winner transmitter idle-listens before it starts with its own data transmission.Especially, when the duty cycle reaches one, all the neighbors of the receiver are active and will participate in the medium contention, resulting in the shortest communication latency.Fig. 5: Latency for setting up a new link Figure 5 displays the time required for the remaining data transmission after the link breaks.Once the original link disrupts, the transmitter will wait for the appearance of a new receiver to try to establish a new link.With the decrease of the duty cycle and the network density, the number of nodes that are awake at the same time minimizes.As all the active neighbors of the new receiver are allowed to participate in the channel contention, the probability that the original transmitter again wins the medium after the link termination becomes higher, leading to a shorter time for setting up a new link.
Once the duty cycle approaches 0, the latency has a limited value and remains the same for all the network densities.This happens because as soon as the original transmitter seizes the medium, it will not go to sleep until it completes sending the remaining data packets, even though its listen period has expired.Not alike, the active time of other nodes that newly wake up and do not occupy the medium will turn off the radio as soon as the sleep periods arrive.Therefore, when the duty cycle is extremely small, only the original transmitter is active and is able to participate in the data communication.This makes the time consumed for setting up a new link minimum regardless of the network density.However, when the duty cycle increases to one, all the neighbors of the new receiver will take part in the channel competition.Since a collision may occur and one of the other transmitters may occupy the medium for several rounds before the original transmitter finally wins, the latency required for the new link establishment can become very long.However, to facilitate the mathematical evaluation, we assume that the original transmitter wins the medium at latest at the third competition during the new link establishment.And even if it fails in the second competition, one of the other nodes that successfully wins the medium can stay for at most one transmission round (that is to transmit only 140 data packets).Under these simplifications, the latency consumed for setting up a new link is bounded between 0.347s and 0.43s.
Figure 6 provides an overview of the time required for transmitting a burst of data packets.The total latency is evaluated by combining the time intervals consumed prior to Fig. 6: Latency for sending a burst of data packets the link termination and for the following new link establishment.Obviously, the latency introduced before and after the disruption of the link has different variation tendency under the same duty cycle and network density.It increases in the former case, but decreases in the latter case with the increment in both parameters.Since the transmitter may not immediately discover a new receiver or win the medium after it discoveries, it needs more time to proceed with its remaining data transmission after the link breaks compared with the time needed before the link breaks.The curve presenting the total latency for the communication of n data packets has a similar exhibition with the latency for the establishment of a new link ( as shown in Figure 5).The latency changes from 0.528s to 0.609s when the duty cycle and the network density increase.To focus on our study goal, only the simulations in which the mobile node seizes the medium are regarded valid.However, as the network density increases, the probability that the mobile transmitter wins the channel becomes small.For the sake of evaluating the communication latency based on the same number of the valid samples, the running times of the simulation should be different under different network densities.To this end, we divided the duty cycle into 100 partitions and run the simulation (100 × M ) times for the network density equal to M , among which approximately 100 simulation results are useful.The latency for each duty cycle is obtained by averaging the values perceived from all these valid simulation samples.

B. Simulation Result and Comparison
The simulation figure of the latency for communication of a burst of data packets presents similar latency trend but with more fluctuations compared with the figure given by Matlab.Different from the mathematical model, the simulation allows the original transmitter to win the medium at any competition round after the link breaks.In other words, the limitations that the original transmitter seizes the channel at latest in the third contention and the number of data packets transmitted is at most 140 before it wins are relaxed.This makes both the latency for setting up a new link and for the total data transmission much larger.An extreme case may occur even with a minor probability.It may happen that the original transmitter never wins the medium after the link disrupts.Instead, either a collision occurs or one of the other transmitters seizes the channel at each contention.
The curve fluctuation is a result of the finite simulation runs and the multiple communication patterns that a node may apply after the link breaks.The channel competition in which the original transmitter wins and the number of collisions and contention failures occurred before it wins are randomly chosen by the simulations.Due to the complete randomness, the latency required for setting up a new link under a small duty cycle can be even greater than that under a big duty cycle.Similar phenomenon can appear in terms of the network density.Nevertheless, on the whole, the total latency for transmission of a burst of data packets is directly proportional to the duty cycle and the network density.
As depicted in Figure 7, there is a short straight line appearing at the bottom left corner, showing that the latency stays small and remains the same for all the network densities.This tells that when the duty cycle is less than 5%, all the transmitters expect the original one have already entered into the sleep mode before they can receive a beacon, even though they may have just woken up and obtained a data packet from the upper layer.In the simulation, it is pretty difficult to align the start time of the active period of a node with the time at which the communication begins when the duty cycle is extremely small.As a result, the latency 0.35s is consumed when only the mobile transmitter is active and participates in the data communication.

VI. CONCLUSION
In this paper, we proposed a burst transmission pattern to optimize RI-MAC.Based on it, we evaluated the effect of mobility on latency.The evaluation was implemented both theoretically by setting up a mathematical model and practically by running N S2 simulation.We asserted that the total latency varied from 0.537s to 0.61s and from 0.63s to 1.6s in the analytical and simulation results, respectively.In the future, we plan to design a seamless handover mechanism that enables a mobile node to transfer the communication to a better link before the quality of the current one deteriorates.After comparing with the time introduced by the handover mechanism, we can find out the latency trade-offs.

Fig. 2 :
Fig. 2: Link disconnection in the optimized RI-MAC Fig. 3: The establishment of a new link

Fig. 7 :
Fig. 7: Latency for sending a burst of data packets

TABLE I :
Parameter List