Self-Stabilizing TDMA Algorithms for Dynamic Wireless Ad-hoc Networks

In dynamic wireless ad-hoc networks (DynWANs), autonomous computing devices set up a network for the communication needs of the moment. These networks require the implementation of a medium access control (MAC) layer. We consider MAC protocols for DynWANs that need to be autonomous and robust as well as have high bandwidth utilization, high predictability degree of bandwidth allocation, and low communication delay in the presence of frequent topological changes to the communication network. Recent studies have shown that existing implementations cannot guarantee the necessary satisfaction of these timing requirements. We propose a self-stabilizing MAC algorithm for DynWANs that guarantees a short convergence period, and by that, it can facilitate the satisfaction of severe timing requirements, such as the above. Besides the contribution in the algorithmic front of research, we expect that our proposal can enable quicker adoption by practitioners and faster deployment of DynWANs that are subject changes in the network topology.


Introduction
Dynamic wireless ad hoc networks (DynWANs) are autonomous and self-organizing systems where computing devices require networking applications when a fixed network infrastructure is not available or not preferred to be used. In these cases, computing devices may set up a short-lived network for the communication needs of the moment, also known as an ad hoc network. Ad hoc networks are based on wireless communications that require implementation of a medium access control (MAC) layer. We consider MAC protocols for DynWANs that need to be autonomous and robust and have high bandwidth utilization, a high predictability degree of bandwidth allocation, and low communication delay [1] in the presence of frequent changes to the communication network topology. Existing implementations cannot guarantee the necessary satisfaction of timing requirements [2,3]. This work proposes an algorithmic design for self-stabilizing MAC protocols that guarantees a short convergence period and, by that, can facilitate the satisfaction of severe timing requirements. The proposed algorithm possesses a greater degree of predictability, while maintaining low communication delays and high throughput.
The dynamic and difficult-to-predict nature of wireless ad hoc networks give rise to many fault tolerance issues that requires efficient solutions. DynWANs, for example, are subject to transient faults due to hardware/software temporal malfunctions or short-lived violations of the assumed settings for modeling the location of the mobile nodes. Fault tolerant systems that are self-stabilizing [4] can recover after the occurrence of transient faults, which can cause an arbitrary corruption of the system state (so long as the program's code is still intact), or the model of dynamic networks in which communication links and nodes may fail and recover during normal operation [5]. The proof of self-stabilization requires convergence from an arbitrary starting system state. Moreover, once the system has converged and followed its specifications, it is required to do so forever. The selfstabilization design criteria liberate the application designer from dealing with low-level complications, such as bandwidth allocation in the presence of topology changes, and provide an important level of abstraction. Consequently, the 2 International Journal of Distributed Sensor Networks application design can easily focus on its task and knowledgedriven aspects.
The IEEE 802.11 standard is widely used in wireless communications. Nonetheless, the research field of MAC protocols is very active and requires further investigation. In fact, the IEEE 802.11 amendment, IEEE 802.11p, for wireless access in vehicular environments (WAVE), has just being published. It was shown that the standard's existing implementations cannot guarantee channel access before a finite deadline [2,3]. Therefore, applications with severe timing requirements cannot predictably meet their deadlines, for example, safety-critical applications for vehicular systems.
ALOHAnet and its synchronized version slotted ALOHA [6] are pioneering wireless systems that employ a strategy of "random access. " Time division multiple access (TDMA) [7] is another early approach, where nodes transmit one after the other, each using its own timeslot, say, according to a defined schedule. Radio transmission analysis in ad hoc networks [8] and relocation analysis of mobile nodes [9] show that there are scenarios in which MAC algorithms that employ a scheduled access strategy have lower throughput than algorithms that follow the random access strategy. However, the scheduled approach offers greater predictability of bandwidth allocation and communication delay, which can facilitate fairness [10] and energy conservation [11].
Our design choices have basic radio technology in mind, whilst aiming at satisfying applications that have severe timing requirements. We consider TDMA frames with fixed number of fixed-length timeslots. The design choice of TDMA frames with fixed-length radio time fits well applications that have severe delay requirements. By avoiding the division of fixed-length frames into timeslots of nonequal length, as in [10,12], we take into consideration the specifications of basic radio technology.
In the context of the previous design choices, there are two well-known approaches for dealing with contention (timeslot exhaustion): (1) employing policies for administering message priority (for meeting timing requirements while maintaining high bandwidth utilization, such as [13]) or (2) adjusting the nodes' individual transmission signal strength or carrier sense threshold [14]. The former approach is widely accepted and adopted by the IEEE 802.11p standard, whereas the latter has only been evaluated via computer simulations. The proposed algorithm facilitates the implementation of both of the previous approaches. We consider implementation details of the standard approach in Section 7.
For the sake of presentation simplicity, we start by considering a single priority MAC protocol and base the timeslot allocation on vertex coloring, before considering multipriority implementation in Section 7. The proposed algorithm allocates timeslots to a number of nearby transmitters, that is, a number that is bounded by the TDMA frame size, whereas nonallocated transmitters receive busy channel indications. The analysis considers saturated situations in which the node degree in the message collision graph is smaller than the TDMA frame size. As explained previously, this analysis assumption does not restrict the number of concurrent transmitters when implementing the proposed MAC algorithm.

Related Work.
We are not the first to propose a MAC algorithm for DynWANs that follows the TDMA's scheduled approach. STDMA [15] and Viqar and Welch [16] consider global navigation satellite system -based scheduling (GNSS) [17] according to the nodes' geographical position and their trajectories. Autonomous systems cannot depend on GNSS services, because they are not always available, or preferred not to be used, due to their cost. Arbitrarily long failure of signal loss can occur in underground parking lots and road tunnels. We propose a self-stabilizing TDMA algorithm that does not require GNSS accessibility or knowledge about the node trajectories. Rather, it considers an underlying selfstabilizing local pulse synchronization, such as [18,19], which can be used for TDMA alignment; details appear in [18].
When using collision detection at the receiving side [14,15,[20][21][22], it is up to the receiving side to notify the sender about collisions via another round of collision-prone transmissions, say, by using frame information (FI) payload fields that include entries, where is the TDMA frame size. Thus far, the study of FI-based protocols has considered stochastic resolution of message collision via computer network simulation [15,20,[22][23][24][25]. Simulations are also used for evaluating the heuristics of MS-ALOHA [14] for dealing with contention (timeslot exhaustion) by adjusting the nodes' individual transmission signal strength and/or carrier sense threshold. We do not consider lengthy frame information (FI) fields, which significantly increase the control information overhead, and yet we provide provable guarantee regarding the convergence time. Further analysis validation of the proposed algorithm via simulations and testbed implementation can be found in Section 8, and respectively, in [18].
The proposed algorithm does not consider collision detection mechanisms that are based on signal processing or hardware support, as in [26]. Rather, it employs a variation of a well-known strategy for eventually avoiding concurrent transmissions among neighbors. This strategy allows the sending side to eventually observe the existence of interfering transmissions. Before sending, the sender waits for a random duration while performing a clear channel assessment using basic radio technology (details appear in Section 3).
There are several MAC algorithms that are based on clear channel assessment. A recent example, [12], focuses on fair bandwidth allocation for single-hop-distance broadcasting while basing the interference model on discrete graphs. The authors do not consider self-stabilization. This work also considers clear channel assessment. However, we employ a strategy of random transmission delay in a way that allows the recipients to notice, in a probabilistic manner, prospective transmissions. We show that after a small number of rounds, the system is able to use the previous strategy for allocating the network bandwidth for single-hop-distance broadcasting when basing the interference model on discrete graphs. Further mitigation efforts of transmission pathologies, such as hidden terminal phenomena when unicast are considered, can be taken, for example, self-stabilizing two-hop-distance vertex coloring [27], equalizing transmission power, and coding-based methods [28], to name a few.
An abstract MAC layer was specified for DynWANs in [29]. The authors mention algorithms that can satisfy their specifications. However, they do not consider predictability.
Local algorithms [30,31] consider both theoretical and practical aspects of MAC algorithms ( [32] and references therein) and the related problem of clock synchronization; see [33] and references therein. For example, the first partlyasynchronous self-organizing local algorithm for vertex coloring in wireless ad hoc networks is presented in [34]. However, this line currently does not consider dynamic networks and predictable bandwidth allocation.
Two examples of self-stabilizing TDMA algorithms are presented in [10,35]. The algorithms are based on vertexcoloring and the authors consider (nondynamic) ad hoc networks. Recomputation and floating output techniques ( [4], Section 2.8) are used for converting deterministic local algorithms to self-stabilization in [36]. The authors focus on problems that are related to MAC algorithms. However, deterministic MAC algorithms are known to be inefficient in their bandwidth allocation when the topology of the communication network can change frequently [9]. There are several other proposals related to self-stabilizing MAC algorithms for sensor networks, for example, [37][38][39][40]; however, none of them consider dynamic networks, and their frame control information is quite extensive.
The MAC algorithms in [9,18,41,42] have no proof that they are self-stabilizing. The authors of [9] present a MAC algorithm that uses convergence from a random starting state (inspired by self-stabilization). In [18,41,42], the authors use computer network simulators for evaluating self-⋆ MAC algorithms.

Our Contribution.
This work proposes a self-stabilizing MAC algorithm that demonstrates rapid convergence without the extensive use of frame control information. Our analysis shows that the algorithm facilitates the satisfaction of severe timing requirements for DynWANs.
We start by considering transient faults and topological changes to the communication network, that is, demonstrating self-stabilization in Theorem 2. We then turn to focus on bounding the algorithm's convergence time after an arbitrary and unbounded finite sequence of transient faults and changes to the network topology. Theorem 3 shows that the expected local convergence time is brief and bounds it in (7). Theorem 7 formulates the expected global convergence time in (21). Moreover, for a given probability, the global convergence time is calculated in (22).
For discussion (Section 8), we point out the algorithm's ability to facilitate the satisfaction of severe timing requirements for DynWANs. Moreover, the analysis conclusions explain that when allowing merely a small fraction of the bandwidth to be spent on frame control information and when considering any given probability to converge within a bounded time, the proposed algorithm demonstrates a low dependency degree on the number of nodes in the network (as depicted by Figures 2 and 3).
We note that some of the proof details appear in the Appendix for the sake of presentation simplicity.

Preliminaries
The system consists of a set, , of anonymous communicating entities, which we call nodes. Denote every node ∈ with a unique index, .

Synchronization.
Each node has fine-grained, real-time clock hardware. We assume that the MAC protocol is invoked periodically by synchronous (common) pulse that aligns the starting time of the TDMA frame. This can be based, for example, on TDMA alignment algorithms [18], GPS [44], or a distributed pulse synchronization algorithm [19]. The term (broadcasting) timeslot refers to the period between two consecutive common pulses, and +1 , such that +1 = ( mod ) + 1, where is a predefined constant named the frame size. Throughout the paper, we assume that ≥ 2. In our pseudocode, we use the event timeslot( ) that is triggered by the common pulse. We assume that the timeslots are aligned as well.

Communications and Interferences.
At any instance of time, the ability of any pair of nodes to communicate is defined by the set, ⊆ , of (direct) neighbors that node ∈ can communicate with directly. Wireless transmissions are subject to interferences (collisions). We consider the potential of the nodes to interfere with each other's communications. The interference model in this paper is based on discrete graphs.
The set N ⊇ is the set of nodes that may interfere with 's communications when any nonempty subset of them, ⊆ N : ̸ = 0, transmits concurrently with . We call N the (extended) neighborhood of node ∈ , and = |N | is named the (extended) degree of node . We assume that at any time, for any pair of nodes, , ∈ ; it holds that ∈ N implies that ∈ N . Given a particular instance of time, we define the (interference) graph as := ( , ), where := ∪ ∈ {( , ) : ∈ N } represents the interference relationships among nodes.

Communication Schemes.
We consider (basic technology of) radio units that raise the event carrier sense() when they detect that the received energy levels have reached a threshold in which the radio unit is expected to succeed in carrier locking; see [45]. Timeslots allow the transmission of DATA packets using the primitives of transmit() and receive() after fetching (MAC fetch()) a new packet from the upper layer, and respectively, before delivering (MAC deliver()) the packet to the upper layer. A beacon is a short packet that includes no data load, rather the timing of the event carrier sense() is the delivered information [12]. We assume that every node ∈ that invokes the operation transmit() causes the event carrier sense() to be raised by its neighbors, ∈ N , within the exposure time, . Before the transmission of the DATA packet in timeslot , our communication scheme . Each timeslot has a constant number, = 4, of listening/signaling periods in which beacons can be transmitted. The duration of each listening/signaling period is (signal exposure time); the period during which a beacon that is sent by node ∈ is transmitted and raises the ca received by all neighbors ∈ N . Namely, the period between 's transmission and 's rise of the carrier sense() event. Contour charts [50] present two parameter functions, for example, the convergence time function, ( , ) presented in (22). Contour lines in Figure 3 connect values of ( , ) that are the same (see the text tags along the line). When nodes attempt to access the medium, the convergence time, S (cf. the contour lines), is stable in the presence of a growing number, , of listening/signaling periods.
uses beacons for signaling the node's intention to transmit a DATA packet within ; see Figure 1.

System Settings.
We consider the interleaving model [4]. Every node, ∈ , executes a program that is a sequence of atomic steps. The state of a node consists of the value of all the variables of the node (including messages in transit for ). Variables are associated with individual node states by using the subscript notation, that is, V is the value of variable V in 's state. The term configuration is used for a tuple of the form ( , { } =1 ), where is the (interference) graph, and { } =1 are the nodes' states (including the set of all incoming communications). An execution (run) := ( (0), (1), . . .) is an unbounded sequence of system configurations ( ), such that each configuration ( + 1) (except the initial configuration (0)) is obtained from the preceding configuration ( ) by the execution of steps, { ( )} ∈ , taken by all nodes.
Let (task) be a specification (predicate) set and a set of all executions that satisfy task . Let us consider TDMAbased MAC protocols for which the task TDMA requires that every node has its own broadcasting timeslot that is unique within its neighborhood. We note that TDMA 's requirements are obviously satisfiable when the ratio between the extended degree and the frame size is less than one; that is, there is no timeslot exhaustion when for all ∈ : 1 ⪇ / . Therefore, the studied task also deals with timeslot exhaustion by delivering busy channel indications, ⊥, to the nodes for which there were no timeslot left. We define TDMA to be the set of legal executions, , for which for all ∈ : ((( ∈ [0, − 1]) ∧ ( ∈ N )) ⇒ ̸ = ) ∨ ( = ⊥ ⇒ for all ∈ [0, − 1] ∃ ∈ N : = ) holds in all of 's configurations.
We say that configuration safe is safe if there is an execution ∈ , such that safe is 's starting configuration. Let be an execution and ∈ its arbitrary starting configuration. We say that converges with respect to if within a bounded number of steps from , the system reaches a safe configuration safe . The closure property requires that ∈ , for any execution, , that starts form safe . An algorithm is said to be self-stabilizing if it satisfies both the convergence and the closure properties.
We describe execution as an unbounded number of concatenated finite sequences of configurations. The finite sequence, ( ) = ( 0 ( ), . . . −1 ( )), > 0, is a broadcasting round if (1) configuration 0 ( ) has a clock value, , of 0 and immediately follows a configuration in which the clock value is −1, and (2) configuration −1 ( ) has a clock value of −1 and immediately precedes a configuration in which the clock value is 0.

Algorithm Description
The proposed MAC algorithm periodically performs clear channel assessments. It uses these assessments when informing each node about the nearby unused timeslots. The nodes use this information for selecting their broadcasting timeslots, assessing the success of their broadcasts and reselecting timeslots when needed.
The MAC algorithm in Algorithm 1 satisfies the TDMA task. During the convergence period, several nodes can be assigned to the same timeslot. Namely, we may have ∈ : The algorithm solves such timeslot allocation conflicts by letting the nodes and go through a (listening/signaling) competition before transmitting in its broadcasting timeslot. The competition rules require each node to choose one out of listening/signaling periods for its broadcasting timeslot; see Figure 1. This implies that among all the nodes that attempt to broadcast in the same timeslot, the ones that select the earliest listening/signaling period win this broadcasting timeslot and access the communication media. Before the winners access their timeslots, they signal to their neighbors that they won via beacon transmission. The signal is sent during their choice of listening/signaling periods; see Figure 1. When a node receives a beacon, it does not transmit during that timeslot, because it lost this (listening/signaling) competition. Instead, it randomly selects another broadcasting timeslot and competes for it on the next broadcasting round.
In detail, the MAC algorithm in Algorithm 1 is invoked at the start of every timeslot, . When is the first timeslot, the algorithm tries to allocate the broadcasting timeslot, , to (line 11) by randomly selecting a timeslot for which there is no indication to be used by its neighbors. Later, when the timeslot becomes 's broadcasting timeslot, , the node attempts to broadcast (by calling the function send() in line 13). We note that the start of timeslot also requires the marking of as an unused timeslot and the removal of stale information (line 12). This indication is changed when the carrier sense( ) event is raised (line 27) due to a neighbor transmission; namely, when the detected energy levels reach  a threshold in which the radio unit is expected to succeed in carrier locking; see [45]. When a node attempts to broadcast, it uses the (listening/signaling) competition mechanism for deciding when to signal to its neighbors that it is about to transmit a DATA packet. The competition has rounds, and it stops as soon as the node transmits a beacon or a neighbor succeeds in signaling earlier (lines 18 to 23). We note that this signaling is handled by the carrier sense( ) event (line 27). Moreover, beacons are not required to carry payloads or any other information that is normally stored in packet headers. They are rather used to invoke the carrier sense event in N .
The carrier sense in timeslot indicates to each node that it needs to defer from transmission during (line 25). In particular, it should stop using timeslot for broadcasting, stop competing, and mark as a used timeslot. Lastly, arriving DATA packets are delivered to the upper layer (line 15).

Correctness Proof: Outline and Notation
The proof starts by considering networks that do not change their topology and for which the ratio between the extended node degree and the frame size is less than one, that is, for all ∈ : 1 ⪇ / . (We deal with cases in which for all ∈ : 1 ⪇ / does not hold in Section 8). For these settings, we show that the MAC algorithm in Algorithm 1 is self-stabilizing with respect to task TDMA (Appendices A to B), before considering the convergence time within a single neighborhood (Section 5) and the entire neighborhood (Section 6). These convergence estimations facilitate the exploration of important properties, such as predictability, and dealing with changes in the network topology of DynWANs (Section 8).

Proof
Outline. The exposition of the proof outline refers to Definition 1, which delineates the different states at which a node can be in relation to its neighbors. Definition 1 groups these states into three categories of relative states: (1) Ready to be allocated, when the node state depicts correctly its neighbor states, (2) Obtaining a timeslot, when the node is competing for one, but there is no agreement with its neighbor states, and (3) Allocated to a timeslot, when the node is the only one to be allocated to a particular timeslot in its neighborhood. The correctness proof shows that the MAC algorithm in Algorithm 1 implements TDMA in a selfstabilizing manner by showing that eventually all nodes are allocated with timeslots; that is, all nodes are in the relative state Allocated; see Definition 1.
Let be an execution of the MAC algorithm in Algorithm 1 and ( ) the th complete broadcasting round of , where > 0 is an integer. We simplify the presentation by using uppercase notation for the configurations, name ( ), where ∈ [0, − 1] is a timeslot. This notation includes the of the first event to be triggered immediately after configuration , that is, International Journal of Distributed Sensor Networks Definition 1. We say that node ∈ is Ready (to be allocated) to a timeslot in configuration timeslot 0 ( ), if properties (1), (2), and (3) hold for node , but Property (4) does not. We say that is Obtaining timeslot in configuration timeslot 0 ( ), if properties (1) to (4) hold for node , but Property (5) does not. We say that node ∈ is in Allocated state, with respect to timeslot in configuration timeslot 0 ( ), if properties (1) to (5) hold for node as follows: Property (1) implies that node finishes any broadcast attempts within a timeslot. Properties (2) to (3) consider the case in which 's internal state represents correctly the timeslot allocation in its neighborhood. In particular, property (2) means that processor views timeslot as an unused one if, and only if, it is indeed unused. Property (3) implies that when node is not using any timeslot, there is an unused timeslot at its disposal. Property (4) says that node is using timeslot . Property (5) refers to situations in which 's neighbors are not using 's timeslot during the next broadcasting round.
Starting from an arbitrary configuration, we show that node becomes Ready within two broadcasting rounds (or one complete broadcasting round); see Appendix A. Then, we consider the probability, ( ), that a node enters the relative state Allocated from either Ready or Obtaining; see (6) (and Appendices B and D). Namely, (6) considers the probability that node is the only one to use its broadcasting timeslot in its neighborhood, where = 1/ = 1/ is 's probability to select the th listening/signaling period for transmitting its beacon. Consider Theorem 2 demonstrates self-stabilization.
Theorem 2 (self-stabilization, the proof appears in Appendix C). The MAC algorithm in Algorithm 1 is selfstabilizing with respect to the task TDMA .
Bounding the convergence time. We bound the time it takes the MAC algorithm in Algorithm 1 to converge by considering the relative states, Ready, Obtaining, and Allocated and describe a state machine of a Markovian process. This process is used for bounding the convergence time of a single node (Section 5) and the entire network (Section 6).
In detail, given node ∈ , its neighborhood N , we define a random environment of a Markov chain; see Box 1.
By looking at this random environment, we can focus our analysis on 's relative states while avoiding probability dependencies and considering average probabilities [46]. Suppose that 's environment, , is known. Theorem 3 estimates two bounds on the expectation of probability | , which is literally the probability , given that the environment is .
In order to do that, we consider a set, R, of executions of the MAC algorithm, such that each execution ∈ R starts in a configuration, ∈ , in which (I) for any node ∈ , properties (1), (2), and (3) hold, and (II) node is in the relative state Ready, which implies that (III) eventually, node arrives to the relative state Allocated.
With this convention, we can add a probability 1 to transit from the relative state Allocated to Ready; see the dashed line in the state machine diagram of Box 1. This allows us to estimate the expected time to reach the final relative state Allocated from relative state Ready by the expectation of the first hitting time of the irreducible Markov chain [43].
When computing the expected time for node to reach state Allocated within its neighborhood, we see that it is sufficient to consider the lower bound of the probability ( ) to obtain an upper bound on the expected time to convergence; see Section 5. Moreover, when considering the network convergence time, that is, the expected convergence time of all nodes in the network, we see that the most dominant parameter is the mean neighborhood size. We do that by applying the arithmetic mean versus geometric mean (AM-GM) inequality and bounding the expected network convergence time; see Section 6.

Notation.
Throughout the paper, we denote the states of the Markov chain by { } ≥0 , + = min{ > 0 such that = } and (⋅) is the expectation, given that we start in relative state , ( + ) = ( + | 0 = ). In this paper, the states 1, 2, and 3 of the Markovian process correspond, respectively, to states Ready, Obtaining and Allocated and the time = 0, 1, . . . corresponds to configuration timeslot 0 ( + ) ∈ ( + ), where ( ) is the first complete broadcasting round in that starts in a configuration, timeslot 0 ( ), in which all nodes are in the relative state Ready. For example, 3 ( + 3 ) is the expected time to reach the Allocated state.
Let ∈ be a node for which ̸ = ⊥ ∧ ∃ ∈ N : = in configuration timeslot 0 ( ). We define ( ) = { ∈ N : = } to be the set of 's (broadcasting timeslot) matching neighbors, which includes all of 's neighbors that, during broadcasting round ( ), are attempting to broadcast in 's timeslot. In our proofs, we use as the number of listening/signaling periods, .

Convergence within a Neighborhood
Theorem 3 bounds the expected time, S , for a node to reach the relative state Allocated, and follows from Proposition 5 and (12). Note that S ≤ 4 when the number of listening/signaling periods is ≥ 2 and considering saturated situations in which the extended node degree < is smaller than the TDMA frame size. Namely, the proposed algorithm convergence with a neighborhood is brief.
Theorem 3 (local convergence). The expected time, S , for node ∈ to reach the relative state Allocated satisfies (7), where is the number of listening/signaling periods, is the TDMA frame size, and is 's extended degree. Consider We look into the transition probability among relative states by depicting the diagram of Box 1 as a homogeneous Markov chain. We estimate the diagram transition probabilities in a way that maximizes the expected time for reaching the diagram's final state, Allocated. It is known that the first hitting time is given by is the invariant probability vector [43]. Let S be the expected time it takes node that starts at the relative state Ready to reach Allocated. It is clear that S = + 3 − 1, because + 3 − 1 is the return time of the relative state Allocated. In our case, the transition matrix is given by the following: The invariant probability vector satisfying = is given by = (ℎ + , , ℎ + + ) ℎ + + + ℎ + + .
The estimation of the maximal expected time necessary to assign the node to a timeslot requires us to compute bounds on the probabilities , ℎ , and that maximize as follows The expected time for to reach the relative state Allocated is bounded in International Journal of Distributed Sensor Networks 9 Equation (7) has a compact and meaningful bound for (11). We achieve that by studying the impact of the parameters and on the MAC algorithm in Algorithm 1. Lemma 4 and (11) imply S ≤ ℎ + + ℎ + + = 1 .
Lemma 4. Suppose that ≥ 2 is the number of listening/signaling periods; see line 2 of the code in Algorithm 1. Then ≥ .
Proof. Let us consider node ∈ that is in relative state Ready. Given that has V neighbors that compete for the same timeslot, the probability that gets allocated, | V , is given by (13).
Consider next that is in relative state Obtaining, and thus, we know that transmitted during the preceding broadcasting round and transited from relative state Ready to Obtaining. Moreover, is using the same timeslot for the current broadcasting round. The only neighbors of that are using the same timeslot are the neighbors that are also in relative state Obtaining and have chosen the same listening/signaling period as during the preceding broadcasting round. Let us denote by ℓ , the number of such neighbors. Given ℓ the probability | ℓ that is allocated to the timeslot is given by We have that ℓ is stochastically dominated by V [47], that is, (ℓ ) ≤ (V ). Indeed, V is a random variable that counts the number of neighbors that choose the same timeslot as , while ℓ counts the number of neighbors that choose the same timeslot and listening/signaling period as . For ≥ 2, ℓ 's expected value is smaller than V 's expected value. To conclude, we remark that expressions (13) and (14) are the same decreasing function, → ∑ −1

Proposition 5. Let
= 1/ . Equation (16) bounds from below the probability ; see Appendix D. Consider The first bound, 1/ ≤ (2 /( − 1)) / ( (7)), has a simple intuitive interpretation. Let us consider first that two nodes compete for a same timeslot. The two nodes choose independently any of the listening/signaling periods and there are 2 different possible outcomes. Among these outcomes correspond to the situation where the two nodes choose the same listening/signaling period and there is no winner. We then have 2 − = ( − 1) outcomes that lead to a winner. There is then a probability of ( − 1)/ 2 = ( − 1)/ that one of the nodes wins the (listening/signaling) competition. Since the game is symmetric, the probability that wins is ( − 1)/(2 ). The fact that we have timeslots divides the number of competing nodes, , and implies that there are / competing nodes for the same timeslot. If we interpret the game as a collection of / independent games, where for each game wins with probability ( − 1)/(2 ), thus, the probability that wins is (( − 1)/2 ) / . The inverse of this expression gives the average time for the event to occur and is the bound by (7).

Network Convergence
We estimate the expected time for the entire network to reach a safe configuration in which all nodes are allocated with timeslots. The estimation is based on the number of nodes that are the earliest to signal in their broadcasting timeslot. These nodes are winners of the (listening/signaling) competition and are allocated to their chosen timeslots. However, counting only these nodes leads to underestimating the number of allocated nodes, which then results in an overestimation of the convergence time. Indeed, node ∈ might have a neighbor ∈ N that selects the earliest listening/signaling period in N , but does not transmit because one of its neighbors, ∈ N \ N , had transmitted in an earlier listening/signaling period. Our bound considers only while both and transmit, became is inhibited by 's beacon.
Lemma 6 shows that the assumption that the nodes are allocated independently of each other is suitable for bounding the network convergence time, S. Theorem 7 uses Lemma 6 for bounding the network convergence time, S.
In Section 5, we prove a bound on the expected time, S , for a single node to be allocated to a timeslot. We observe that the bound depends uniquely on the number of listening/signaling periods, , as well as the ratio between the extended degree and the frame size, / . In order to obtain a bound valid for all nodes, we bound this ratio with / where is as defined in Lemma 6. We note that the time needed for the allocation of timeslots to all the nodes depends on , the total number of nodes.
In detail, the convergence time estimation considers the (fixed and independent) bound, , for the probability that a node reaches the relative state Allocated within a broadcasting round. Then, the convergence time, , is a random variable with geometric probability, that is, ( = ) = (1 − ) −1 . Let us denotes 1 , . . . , the time it takes for the nodes The convergence time, S, for all the nodes is given with max({ 1 , . . . , }), which depends on . (17), where = 2 / , is the number of timeslots, the number of edges in the interference graph, , and = | | the number of nodes that attempt to access the communication media. Consider

Lemma 6. The expected number of nodes, ( ), that win the (listening/signaling) competition after one broadcasting round satisfies
Proof. The nodes that are allocated to a timeslot can previously be on relative state Ready or Obtaining. The probability of a transition from relative state Obtaining to Allocated is , and a transition from relative state Ready to Allocated is . As proved in Lemma 4, we always have ≥ . To bound the number of nodes that get allocated during a broadcasting round, we use the lower bound on the probability that a node gets allocated to a timeslot. Moreover, in the computations, we use the AM-GM bound [48], which says that if ∑ = 1 then ∏ ≤ ∑ and denote by the number of neighbors of node . As proved in Proposition D.1, since there are timeslots the number of neighbors of that choose the same timeslot as and compete for it is bounded by / . This lemma is proved by (18), where the last line of the expression holds because ∑ = 2 .
One has We note that we use the AM-GM bound to reach the 4th row of (18).
By arguments similar to the ones used in the proof of Proposition 5, we deduce that if nodes compete, the expected number ( ) of nodes that get allocated to a timeslot is lower bounded as follows: Theorem 7 bounds the system convergence time. We numerically validate Theorem 7; see Figure 2. Moreover, our experiments showed that the average convergence time of the network is below the upper bound of (21).

Theorem 7 (global convergence). The expected number of retransmissions is smaller than
Hence, one has that the expected number of broadcasting rounds, S, that guarantee that all nodes reach the relative state Allocated satisfies Moreover, given that there are nodes in the network and ∈ (0, 1), the network convergence time is bounded by (22) with probability 1 − . Consider This means that with probability , all nodes are allocated with timeslots in maximum broadcasting rounds; see Figure 3.
While the processors get allocated to a timeslot, the parameters and change because some timeslots are no longer available ( decreases, some nodes are allocated, decreases). Actually the ratio becomes (max{ }−ℎ )/( − ), where ℎ ≥ because if a timeslot is allocated or sensed used by processor , then , the number of available timeslots decreases by 1 and , the number of competing nodes, must decrease at least by one since there must be at least one processor that uses the busy timeslot (there may be multiple that are in state Obtaining). Under these circumstances, we always have max{ }/ ≥ (max{ } − ℎ )/( − ). Thus, we can obtain a lower bound for the expected time to reach the relative state Allocated by assuming that all nodes are allocated independently with probability = (( − 1)/2 ) max{ }/ . We simplify the following arguments by using this definition of .
To bound the number of broadcasting rounds, we consider the following game. The bank pays 1 unit to the nodes that get in state Allocated (get allocated to a timeslot) and receives /(1 − ) units per nodes that fail to get in state Allocated. The game is fair because in each round the expected gain is 1× − /(1− )×(1− ) = 0. If we denote by the number of processors that get in state Allocated during the th broadcasting round and by the number of processors that fail, we have that the gain is given by (23), where denotes the total number of rounds.
One has The expected gain is 0 because the game is fair ( (gain) = 0) and ∑ =1 = because eventually all the nodes get in state Allocated and the bank pays 1 unit for each such processors. If we compute the expectation on both sides of (23), we then obtain We observe that (∑ =1 ) is the expected total number of retransmissions and (∑ =1 )/ is the average expected number of retransmissions whose value is (1− )/ . Replacing with its expression, we obtain that the average number of retransmission is bounded by (2 /( − 1)) max{ }/ − 1, and, this leads to the bound (21).
To prove the second assertion, let 1 , . . . , be the convergence time of nodes 1, . . . , , respectively. The random variables, , are bound by random variables with geometric random distribution with expectation of (2 /( − 1)) / , with = max{ : ∈ }. We require that max = max{ 1 , . . . , } in order to ensure that all nodes are allocated with timeslots. The fact that the random variables, , are independent and identically distributed, implies (25), where is a random geometrical random variable, that is, Pr Which max ≤ satisfies (26) with probability ?

Implementation
Existing MAC protocols offer mechanisms for dealing with contention (timeslot exhaustion) via policies for administering message priority, such as [13]. In particular, the IEEE 802.11p standard considers four priorities and techniques for facilitating their policy implementation. We explain similar techniques that can facilitate the needed mechanisms.

Prioritized Listening/Signaling Periods.
We partition the sequence of listening periods, [0, ) is used only for the th priority. For example, suppose that there are six listening/signaling periods and that nodes with the highest priority may use the first three listening/signaling periods, [0, 2], and nodes with the lowest priority may use the last three, [3,5]. In the case of two neighbors with different listening period parameters, say, [0, 2] and [3,5], that attempt to acquire the same broadcasting timeslot, the highest priority node always attempts to broadcast before the lowest priority one.

TDMA-Based
Backoff. Let us consider two backoff parameters, CW start and CW end , that refer to the maximal and minimal values of the contention window. Before selecting an unused timeslot, the procedure counts a random number of unused ones. Algorithm 2 presents an implementation of the select unused() function that facilitates backoff strategies as an alternative to the implementation presented in line 29 of Algorithm 1.
The statically allocated variable records the number of backoff steps that node takes until it reaches the zero value. Whenever the function select unused() is invoked with = 0, node assigns to a random integer from [CW start , CW end ] (cf. line 7). Whenever the value of is not greater than the number of unused timeslots, the returned timeslot is selected uniformly at random (cf. lines 8 to 9). Otherwise, a ⊥-value is returned after deducting the number of unused timeslots during the previous broadcasting round (cf. lines 6 and 10).

Discussion
Thus far, both schedule-based and nonschedule-based MAC algorithms could not consider timing requirements within a provably short recovery period that follows (arbitrary)

International Journal of Distributed Sensor Networks
Additional constants and variables (2) and : backoff parameters count : statically allocated variable that counts the backoff steps (4) Function select unused(set) (6) let transient faults and network topology changes. This work proposes the first self-stabilizing TDMA algorithm for Dyn-WANs that has a provably short convergence period. Thus, the proposed algorithm possesses a greater predictability degree, whilst maintaining low communication delays and high throughput.
In this discussion, we would like to point out the algorithm's ability to facilitate the satisfaction of severe timing requirements for DynWANs by numerically validating Theorem 7. As a case study, we show that, for the considered settings of Figure 2, the global convergence time is brief and definitive. Figure 3 shows that when allowing merely a small fraction of the bandwidth to be spent on frame control information, say, three listening/signaling periods, and when considering 99% probability to convergence within a couple of dozen TDMA frames, the proposed algorithm demonstrates a low dependency degree on the number of nodes in the network even when considering 10, 000 nodes.
We have implemented the proposed algorithm, extensively validated our analysis via computer simulation, and tested it on a platform with more than two dozen nodes [18]. These results indeed validate that the proposed algorithm can indeed facilitate the implementation of MAC protocols that guarantee satisfying these severe timing requirements.
The costs associated with predictable communications, say, using cellular base stations, motivate the adoption of new networking technologies, such as MANETs and VANETs. In the context of these technologies, we expect that the proposed algorithm will contribute to the development of MAC protocols with a higher predictability degree.

Appendices
The proof of Theorem 2 uses the propositions in Appendices A and B. Proof. The value of signal is updated in line 18 (assigned to true) and in lines 12, 20, and 27 (assigned to false). Let us look into these assignments.

A. Properties
In every timeslot, the value false is assigned to signal (cf. line 12). Suppose that the function send() is called, and thus, true is assigned to signal (line 18). We propose that before returning from the function send() and after true is assigned to signal (line 18 ( + 1), or (2) There exists a configuration ∈ ( ), such that ̸ = ⊥ in and = ⊥ in timeslot 0 ( + 1) (because by unused set's definition, ⊥ is never in unused set ).
We note that in every broadcasting round, node ∈ at most once (1) Allocates the broadcasting timeslot (when = 0; see line 11), (2) transmits a packet (when = ; see line 13), and (3) deallocates the broadcasting timeslot (by assigning ⊥ to when = and the carrier sense( ) event is raised; see line 26). Moreover, node updates unused [ ] only in lines 12 (true) and 27 (false), when removes stale information just before timeslot , and respectively, when the event carrier sense( ) is raised.
Line 12 is executed at the start of every timeslot, whereas line 27 is executed after and only when the event Defining optimal transmission probabilities for any choices of , , and is not possible. We choose to consider and look for optimal choices when ≃ (the "hard" case) and make a case for a uniform probability = 1/ : ∈ [1, ]. Let us consider node ∈ that competes, together with − 1 other neighbors, for the same unique timeslot. The probability that node wins the (listening/ signaling) competition is 1 (1 − 1 ) −1 , where 1 is the probability of choosing the first listening/signaling period. The value 1 = 1/ maximizes this probability. In the more general case where there is more than one timeslot, we consider a strategy that aims at guessing the number, , of competing neighbors, which the optimal probability of transmission depends on. During the first listening/signaling period, the strategy considers the case in which there are = signaling nodes, and thus, the transmission probability is 1/ , where ≃ . During the second listening/signaling period, the strategy considers the case in which there are − 1 neighbors, and thus, the transmission probability is 1/( − 1), and so on. This sequential selection of the listening/signaling period leads to a uniform choice of a listening/signaling neighbor. The above strategy is driven by a heuristic in which nodes signal with probability that is optimal for the case of ≃ , and thus, it depends on the number of competing neighbors.
carrier sense( ) is raised. The event carrier sense( ) is raised after and only when the node ∈ N transmits in timeslot . In other words, none of 's neighbors, ∈ N , that transmits in timeslot = , can avoid causing the event carrier sense( ) to be raised, and timeslot to be included in unused set \ { }. Proof. If ̸ = ⊥ in timeslot 0 ( + 1), we are done. Let us suppose that =⊥ in timeslot 0 ( + 1) and show that unused set \{ } ̸ = 0 in timeslot 0 ( + 1). Let us assume, in the way of proof by contradiction, that, unused set \ { } = 0 and show that / > 1, that is, a contradiction with the assumption that for all ∈ : / ⪇ 1.
Recall that unused set ∈ N }| ≤ , which implies ≤ : a contradiction with the assumption that / ⪇ 1. (4) to (5) Appendix A shows that, starting from an arbitrary configuration, node ∈ enters the relative state Ready within two broadcasting rounds. This section considers the probability for to enter the relative states Obtaining and Allocated.

B. Properties
Let > 0 and be an execution of the MAC algorithm in Algorithm 1. Suppose that timeslot 0 ( ) is the first configuration in a complete broadcasting round ( ) for which properties (1) to (3) hold in configuration timeslot 0 ( ) with respect to node ∈ ; that is, is in relative state Ready, Obtaining or = } and the number = | ( + 1)| of 's neighbors that attempt to broadcast during 's timeslot, , of broadcasting round ( ).
Let be the probability for to transmit in the th listening/signaling period of timeslot (cf. line 19). This paper considers the concrete transmission probability = 1/ . We motivate our implementation choice of the transmission probability, , in Box 2. Note that the sequential selection of the broadcasting rounds with probability 1/( − + 1) leads to the uniform selection = 1/ .  . (B.1)), that only node transmits in its broadcasting timeslot, , of broadcasting round ( ).
One has Proof. We show that there is a nonzero probability that only node transmits in its broadcasting timeslot, , of broadcasting round ( ). Let us look at and the nodes in ( ) while they attempt to broadcast in the steps timeslot, ( ) and timeslot, ( ) | ∈ ( ) . All of these steps include the execution of line 19; namely, each node chooses to transmit in listening/signaling period ℓ ∈ [0, ] with probability ℓ = 1/( − ℓ). Therefore, for any > 0, there is a nonzero probability, ( ), that, during timeslot , node transmits in the listening/signaling period ∈ and no node in ( ) transmits in round (or in an earlier one).
We note that the fact that transmits first during timeslot implies that it is the only one to transmit during . This is because once transmits a beacon in step timeslot, ( ) (which includes the execution of line 21), node ∈ N ⊇ ( ) raises the event carrier sense( ) immediately after timeslot, ( ). Thus, for all ∈ ( ) we have that immediately after step timeslot, ( ), node takes step carrier sense, ( ), which includes the execution of lines 26 and 27 that assign ⊥ to and false to signal . Thus, leaves the (listening/signaling) competition for timeslot (see line 18) and does not transmit its DATA packet (see line 23).
We now turn to calculate ( ). Let the variable = | ( )| denote the number of nodes that select the same timeslot as in configuration timeslot: s ̸ = ⊥ 0 . The value of ( ) depends on the value of , and we denote this dependence with the notation ( )| (conditional probability). It means the value of ( ) depends on the value of . The value of ( ) for = 0 is ( )| =0 = 1. For the case of > 0, ( )'s value is given by (B.1) (that appears again next), where is the probability for transmitting in the th listening/signaling period. Consider We note that the th term in (B.1) is the probability that node selects the th listening/signaling period and all its neighbors select a later listening/signaling period. Proposition B.3 shows that once a node is the only one in its neighborhood to transmit during its broadcasting timeslot, it enters the relative state Allocated.

Proposition B.3.
( ) = 0 (or having none of the nodes in ( ) transmitting during timeslot ) implies that node is in the relative state Allocated in timeslot 0 ( + 1).
Node raises the event carrier sense only during timeslots in which 's neighbor, , transmits. By the proposition assumptions that, during timeslot of broadcasting round ( ), none of 's neighbors transmits, we have carrier sense, ( ) ∉ ( ). Moreover, timeslot, ( + 1) does not include an execution of line 11 that changes the value of , because = ̸ = ⊥ in timeslot 0 ( + 1).

Showing That
∈ N : ̸ = in timeslot 0 ( + 1). The proposition assumes that for all ∈ N : ̸ = in timeslot 0 ( ). We wish to show that the same holds in timeslot 0 ( + 1). Since the variable is assigned to a non-⊥ value only in line 11 when = 0, it is sufficient to show that when line 11 is executed in step timeslot,0 ( + 1) the function select unused() considers a set that does not include 's timeslot, . This is implied by the facts that for all ∈ N : unused [ ] = false (Claim 10.1) and = (first item of (II) of this proof) in timeslot 0 ( + 1).

C. Theorem 2
Theorem 2 shows that all nodes are allocated eventually with timeslots (convergence) and once all nodes are allocated, they stay this way (closure).
Theorem 2 (self-stabilization). The MAC algorithm in Algorithm 1 is a self-stabilizing algorithm with respect to the task .
Proof. After the previous proof of propositions, we can demonstrate this theorem.
(i) Convergence. We need to show that properties (1) to (5) eventually hold in configuration timeslot 0 ( + ) for a finite value of > 0. Propositions A.1, A.2 and A.3 imply that properties (1), (2), and, respectively, (3) within two broadcasting round. Propositions B.1, B.2 and B.3 show that there is a nonzero probability that node enters the rela-tive state Allocated from either Ready or Obtaining within one broadcasting round. Thus, by analyzing the expected time of the scheduler-luck games [4,51], we have that has a finite value. Further analysis of appears in Theorems 3 and 7.
(ii) Closure. Suppose that timeslot 0 ( ) ∈ is a safe configuration and let ∈ be any node. By the assumption that timeslot 0 ( ), we have that is in the relative state Allocated; that is, properties (1) to (5) hold for any node . We need to show that properties (1) to (5) hold in configuration timeslot 0 ( + 1).
Properties (4) to (5)  ( ) and = | ( )|. The reason is that is a random variable, that is, = ( ( )| ), where the expectation is computed with respect to the random variable .
We note that all the terms in (B.1) are convex functions of . This means that by Jensen's inequality, we obtain a lower bound of in (D.1) by evaluating the expression | at 's expectation, ( ) [52].
One has = ( | ) ≥ | ( ) (D.1) The expression on the right side of the inequality can be again lower bounded if we estimate an upper bound for ( ). We proceed to the computations in the proof of Proposition D.2 after demonstrating Proposition D.1 which shows that ( ) is bounded by the ratio / , which is rather intuitive but needs to be proved.  Our assumption that ≤ − 1 implies that > 0. Using that = ∑ ∈N (1 { ̸ = ⊥} +1 { =⊥} ) and, ≥ −∑ ∈N 1 { ̸ = ⊥} , we obtain the following: Proof. In this proof, we use the letter instead of for reason of space. We replace with 1/ in (6) to obtain (D.5). Consider