Contention-based node selection with applications to relay communications and load balancing

This article proposes and analyzes a distributed probabilistic selection protocol in which several nodes perform a random access competition on a shared slotted channel. Nodes that are better suited according to some metric are preferred in the random access and are thus selected with high likelihood. Analytical performance studies are made in terms of reliability, message complexity, and delay. The protocol is applied in two case studies: relay communications and load balancing in wireless networks. In relay communications, a node is selected based on its channel state to serve as relay. In load balancing, a node is selected based on its battery charge state to perform a task. Results indicate that selecting nodes based on the observed metric contributes to better performance and longer network lifetime.


Introduction
Many network protocols require a distributed solution for selecting a node from a candidate set to perform a certain task. Examples of such scenarios from the area of mobile computing include the selection of a cluster head in multihop networks [1], a relay node in cooperative wireless communications [2], and a gathering node for data processing in sensor networks [3].
This article proposes such a distributed mechanism. The basic concepts are as follows: First, the selection is performed in a contention-based manner with the goal to obtain low signaling overhead. Two random access methods are proposed as alternatives. The first one maximizes the probability of successful selection; the second one reduces the signaling overhead in terms of reply messages sent by candidate nodes. Second, the selection takes into account the specific capability of each node to perform a given task. This capability is quantified in terms of a metric maintained by each node. Nodes with a high metric are well-suited to become selected and are thus preferred in the random access process.
The node selection is evaluated in two case studies. The first case study refers to the selection of a relay node *Correspondence: guenther.brandner@uni-klu.ac.at 1 Mobile Systems Group, Institute of Networked and Embedded Systems, University of Klagenfurt, Klagenfurt 9020, Austria Full list of author information is available at the end of the article in a multipath fading environment [2]. Each node maintains a metric describing its current channel quality. The selection process prefers nodes with good channels to be selected as relay. The second case study refers to the selection of nodes performing energy-consuming tasks, and the goal is to balance the load in the network. Using the battery charge state of each node as a selection metric, the proposed selection mechanism contributes toward a longer network lifetime, i.e., it increases the time span until one of the nodes fails due to an empty battery.
Many algorithms for node selection in distributed systems have been proposed in literature. Most of these algorithms employ explicit message exchange between the nodes for selection (see, e.g., [4][5][6][7][8][9]). Unlike these, the approach presented here is of probabilistic nature using a random access competition between the nodes. The intention is to reduce the overhead in terms of signaling and delay at the cost of a nondeterministic success of selection. The message complexity of many selection algorithms significantly depends on the number of nodes n. For example, the algorithm in [8] exhibits a message complexity of order n log(n), and that of [9], of order n. The message complexity of the selection protocols presented in this article, however, is in principle independent of n and thus suited for dense networks. http://jwcn.eurasipjournals.com/content/2013/1/211 The remainder of this article is structured as follows: Section 2 presents the selection protocol and mathematically analyzes its reliability, message complexity, and delay. Section 3 first demonstrates the protocol for relay selection in wireless systems and then also for load balancing. Related work addressing selection algorithms, and relay selection and load balancing is discussed in Sections 2 and 3 individually.
Parts of this article, including some equations and results, were previously published in [10] and [11]. Those papers presented some first ideas and results of Section 2. The article at hand gives a more comprehensive analysis and presents two case studies illustrating the use and performance of the proposed approaches.

Contention-based node selection
In this chapter we first present the contention-based selection approach in Section 2.1 and performance metrics like reliability, message complexity, and delay in Section 2.2. In Section 2.3 we derive two access strategies applicable for the presented contention-based selection, where the first one (uniform access) maximizes reliability, while the second one (slow-start access) maximizes the probability that only one reply is sent during the selection. In Section 2.4 we analyze the proposed selection schemes theoretically, while in Section 2.5 we introduce the metric-based selection which prefers better-suited nodes to be selected. Finally, in Sections 2.6 and 2.7, we briefly recap the selection procedure and address related work, respectively.

Basic approach
A query node transmits a request message to all its neighboring nodes indicating its need to find a node to perform a certain task. The protocol continues with a contentionbased random access scheme using slotted ALOHA during s time slots. These slots are called contention slots in the following. All n nodes receiving the request compete within the contention slots in a way that each node i sends a reply in slot j with probability p ij , where i ∈ {1, . . . , n} and j ∈ {1, . . . , s}.
The sending probabilities can be written in a matrix If we assume these probabilities to be nodeindependent, they can be written as a vector p := (p 1 , . . . , p s ), where p j := p ij ∀i, j is the probability that a node sends in contention slot j. Note that a node may send more than one reply during the selection. The reply contains a node identifier and, optionally, a metric indicating the node's suitability for selection.
If no node transmits a reply in a given slot, the slot is called empty slot. If more than one node transmit in this slot, the messages will collide in this slot; such slots are called collision slots. Only if exactly one node transmits in a given slot the reply will be properly received by the query node. Such slots are called singleton slots; such messages are called non-colliding messages. The node sending the first non-colliding message is the winner and serves as selected node. To avoid misinterpretations, a message is called first non-colliding message if it is a non-colliding message and all previous slots were either empty or collision slots. The winner is informed by the query node in a dedicated control slot.
A main challenge in the protocol design is to use a suitable P that enables reliable and fast selection with few messages. In the following, we analyze different approaches for choosing P and compare their performance with respect to (a) reliability, the probability that the selection is successful; (b) message complexity, the number of replies sent from candidate nodes; and (c) delay, the number of contention slots used for one selection attempt.
A node selection is successful once the first noncolliding message is received. Depending on the application, the selection process can be either stopped upon such a message or it can be continued until all s slots are finished. In the following we evaluate the selection algorithms for both cases. We denote the case where the selection is stopped after the first non-colliding message as early stop, while we denote the case where the selection is not stopped as standard protocol.
In some applications the number of candidate nodes must be known or estimated to apply contention-based node selection. The number of neighboring nodes is often known in certain technologies through the exchange of beacon signals. If not, simple and fast approaches to estimate the number of nodes can be found in [12,13].

Performance metrics
We evaluate the proposed selection algorithms based on three metrics which are reliability, message complexity, and delay, respectively.

Message complexity
The number of reply messages required for a selection attempt is called message complexity M. For the standard protocol (i.e., no early stop), the probability mass function (pmf ) is where 0 ≤ r ≤ ns (see Appendix B.1 in Additional file 1). The expected number of messages is E(M) = s j=1 n p j , and its variance is Var(M) = s j=1 np j (1−p j ). If each node has the same sending probability in each contention slot, p := p j ∀j, the pmf simplifies to a binomial distribution When applying early stop, the pmf of message complexity is given by replacing the upper limit s in (4) with The expected message complexity with early stop can be expressed as We refer to Appendix B.2 in Additional file 1 for derivations of these expressions.

Delay
For the standard protocol, the delay D equals the number of slots s. When applying early stop, D equals the slot number where the first non-colliding message occurs. Then, the pmf of D is (see Appendix B.2 in Additional file 1) The expected delay E(D) and its variance Var(D) can be calculated from (7).

Cumulative message complexity and delay
Note that so far E(M) and E(D) express message complexity and delay, respectively, for a single selection independent of whether or not the selection was successful. A simple strategy to handle unsuccessful selections is to repeat the selection until it is successful. Values for the expected cumulative message complexity and delay are given by c E(M) and c E(D) with a proportionality constant c. As shown in Appendix B.3 in Additional file 1, this constant is c = 1/R(n, s, p). For example, five nodes with ten contention slots yield c = 1.067 for slow-start and c = 1.005 for uniform access.

Access strategies
We propose two access strategies, where the first one (uniform access) maximizes reliability while the second one (slow-start access) maximizes the probability that only one reply is sent under early stop, i.e., the message complexity of the selection is reduced.

Uniform access
We assume node-independent access probabilities p := (p 1 , . . . , p s ) and maximize these with respect to (3) for given n and s. The probabilities maximizing (3) are given as This property is proven in Appendix A.1 in Additional file 1. The approach using (8) as sending probabilities in the random access period of the selection protocol is called uniform access.

Slow-start access
The objective of uniform access is to maximize the reliability R. When evaluating its message complexity using equation (6), we see that, e.g., for n = 5 nodes and s = 10 slots, the expected number of replies is 2.43. This high message complexity demands for a different, non-uniform slot access policy to reduce this complexity. Therefore, we maximize the probability that only one reply is sent when applying early stop, i.e., The expression for P(M = 1) is where 0
The node-independent access probabilities p = (p 1 , p 2 , . . . , p s ) that maximize (9) are Appendix A.2 in Additional file 1 gives derivations of these expressions. The resulting algorithm is called slowstart access.

Performance evaluation
We evaluate the performance of both access strategies in terms of reliability, message complexity, and delay. Figure 1 plots the reliability R over s for n nodes applying uniform access (upper curves). Clearly, the more contention slots and the fewer nodes there are, the more likely the selection process will succeed. It is important to note that the number of nodes has in fact only minor influence on the success probability for reasonable values of n. The reliability is always better than 80% if more than four contention slots are used. Successful selection is achieved with high probability using ten contention slots or more. The reliability of node selection using slow-start access is slightly lower than that of uniform access ( Figure 1, lower curves). Nevertheless, selection success is achieved almost always and independently of n if at least s= 40 contention slots are used. Figure 2a shows the pmfs of message complexity for the standard protocol for n = 5 and s = 10. The pmf of uniform access shows that it is very likely to receive many replies. For slow-start access, however, the pmf is much more pronounced at lower numbers of replies. Table 1 lists

E(M)
and Var(M) for some typical values of n and s. As can be seen, the expected message complexities using uniform access do not scale nicely with the number of slots, while for slow-start access, the expected message complexity is reduced significantly. Nevertheless, it increases for increasing s, although not as severely as with uniform access. When applying early stop, the pmfs are shown in Figure 2b (n = 5, s = 10). In both cases the message complexities are reduced tremendously; however, for slow-start access the probability of having only one reply is even higher than for uniform access. Furthermore, also the probabilities of having three, four, or five replies are significantly lower for slow-start access than for uniform access. Table 1   and 1.04 for slow-start access. Node selection with slowstart access yields better performance than uniform access independently of the parameters. For example, with five nodes and ten contention slots, the expected number of replies is about 2.4 for uniform access and 1.2 for slowstart access. Furthermore, the expected number of replies approaches one for increasing s using slow-start access, while it approaches values between 2.4 and e using uniform access, depending on n. As shown in Appendix B.2 in Additional file 1, lim n,s→∞ E(M) = e for uniform access. Figure 3 shows the expected message complexities for fixed reliability R ≈ 0.9 and early stop. For each n ∈ {2, . . . , 100}, the number of slots s is determined such that |R(n, s, p) − 0.9| → min and the corresponding message complexities are shown.
The figure illustrates that, for comparable reliabilities, slow-start access exhibits a message complexity that is approximately halved compared to uniform access. For R = 0.98 (not shown), the message complexity of slowstart remains at about one-half compared to uniform access. Note that for access probabilities p j ≤ 1 n , the message complexities are almost independent of n and always -for both standard protocol and early stop -bounded by the number of slots s.
As can be seen from Table 1, the expected message complexities are much lower for early stop than for the standard protocol.

Delay
For the standard protocol the delay of one selection is always equal to the number of slots s, independent of the access strategy. Therefore, in the following we only consider the delay when applying early stop. Figure 4 shows the pmfs of delay for uniform access and slow-start access for increasing s. The pmfs show that for uniform access the probabilities of short delays are much higher than for slow-start access. Table 2 shows that for uniform access, the delay increases initially but then converges to a value between about 2.4 and 2.8 depending on n. For slow-start access, the delay is mainly depending on the number of slots s, i.e., E(D) ≈ 0.4 s. Thus, there is a trade-off between low message complexity (slow-start access) and short delay (uniform access). Figure 5 shows the expected delay for fixed reliability R ≈ 0.9 and early stop. Uniform access exhibits a shorter   delay than slow-start access. For the chosen reliability, the delay of uniform access is about half of that of slow-start access. For R = 0.98 (not shown), the delay of uniform access is about one-fourth of the delay of slow-start access.

Metric-based selection
So far, all nodes have been treated as equally suited to be selected. In many scenarios, however, it is beneficial to select a node that is better suited than others with respect to a certain metric (see, e.g., [1]). More suitable nodes should be preferred in the random access competition, i.e., such nodes should have a higher chance of sending a first non-colliding message. A similar concept is also applied, for example, in the context of qualityof-service support in wireless local area networks [14].
To obtain node-dependent slot access probabilities, we take the node-independent access probabilities and modify them by a metric that quantifies a node's capabilities. The metric is defined for each node i at time instant t as a real-valued number m i (t) ∈[ 0, 1].
To be more specific, the approach is to apply for each node i a modification function f (m i (t)) on the nodeindependent access probabilities p j such that We impose the following requirements on the modification function: 1. The resulting access probabilities p ij (t) must be properly bounded, i.e., p ij (t) ∈[ 0, 1].
2. The function should allow for an adjustment of the modification intensity that is imposed on the probabilities p j .
3. For each time instant t, the sum of node-dependent access probabilities p ij (t) in a given contention slot shall be approximately equal to the sum of node-independent sending probabilities, i.e., n i=1 p ij (t) ≈ np j . This property ensures that performance measures such as reliability, message complexity, and delay, as shown in Section 2.4, are not significantly altered when applying metric-based selection.
A modification function that fulfills all requirements is given by where δ is a parameter for adjusting the intensity of the modification, m i (t) ∈[ 0, 1] is the threshold value of node i at time instant t that determines whether its current metric m i (t) is 'good' or 'bad' , and m ik (t) is node i's estimate of node k's metric. Furthermore, we define where h(m, m, δ) Appendix C in Additional file 1 proves that the nodedependent access probabilities are properly bounded, when applying f (·) on the node-independent probabilities for uniform access (8) and slow-start access (10). It also proves the third property, i.e., n i=1 p ij (t) ≈ n p j . Figure 6 plots g(m, m, δ) over m for different δ-values (n = 5, m = 0.5). The figure visualizes that with increasing δ the modification performed on the probabilities intensifies and that for nodes with 'average' metric values, i.e., m ≈ m, g(m, m, δ) ≈ 1.
If a node cannot estimate the metrics of the other nodes, the denominator of (12) is set to where

Summary of the selection protocol
In summary, the selection protocol works as follows: • The query node sets the system parameters: number of candidate nodes n and contention slots s. • The query node broadcasts a request to all n candidate nodes. This message includes the values of n and s. • Candidate nodes send a reply in each contention slot based on their metric (if we apply metric-based selection) and one of the access strategies. Slow-start access is applied if low message complexity is desired. Uniform access is applied if low delay is desired. • If the selection is successful, the winner is informed by the query node in a control slot.

Related work
In general there are selection algorithms for slotted and non-slotted channels. In the work at hand, we focus on slotted channels since they are widely used in practical applications. Many distributed algorithms for node selection are of deterministic nature (see, e.g., [5,7,8]). The message complexity of these algorithms depends on n. The slow-start algorithms presented in this article are of probabilistic nature and exhibit a message complexity that is in principle almost independent of n (see Table 1). In the following, we thus focus on probabilistic approaches for node selection.
Tay et al. [15] investigate and optimize the probability that the first channel access does not collide. The modeling assumptions defer, however, in the following ways: Tay et al. determine the probability distribution for nodes picking a certain slot. Consequently, each node accesses exactly one slot, implying that the sum of the probabilities equals one. In the paper at hand, we determine node access probabilities for each slot. In particular this means that the sum of the probabilities is in general not equal to one and that nodes may access several slots or no slot at all. Due to the fact that we do not impose the requirement that each node must reply in exactly one slot, we achieve a higher selection reliability: When applying the probabilities of Tay et al. for, e.g., n = 16 and s = 8, we get a reliability of R = 0.89036, while for slow-start access we get R = 0.91029. For other parameters, similar results were obtained.
Tang et al. [16] propose a selection protocol where all nodes with metric values exceeding some threshold participate in the selection. These nodes access the channel with node-independent probabilities, which implies that they are regarded to be equally suited. Although we employ the same basic idea of channel access for performing node selection, we extend the work of Tang et al. [16] in the following ways: We propose, derive, and analyze two access probabilities, where the first one maximizes reliability while the second one reduces message complexity. In contrast to Tang et al., we propose a metric-based selection scheme, where nodes with better metrics are preferred, and analyze this scheme in two case studies.
Shah et al. [17] propose a selection protocol where metrics of nodes are mapped to discrete timers. The better the node's metric value, the shorter it waits until it accesses the shared medium. The assumption of this selection procedure is that metric values are samples of a continuous random distribution and, furthermore, that all metrics are statistically independent. Under these assumptions, the probability that metric values are equal is zero. In applications, however, metrics are often distributed discretely, e.g., received signal strength indicator (RSSI) in radio platforms [18]. In some applications, it might even be the aim that metrics become equal over time. We show such an application in Case study II: load balancing (Section 3.3), where the nodes' battery states become balanced over time. For such applications, the selection algorithm proposed by Shah et al. will suffer from collisions since the likelihood that the metric values of the best and secondbest node are very close to each other (or even equal) is clearly nonzero. In contrast to this, the selection algorithm proposed in the paper at hand maintains a high reliability even if metrics are equal. Basically, in the extreme case where all nodes' metric values are equal, the metric-based selection becomes metric-independent, and its reliability is given in Figure 1.
Qin et al. [19] present an opportunistic algorithm allowing a node to send in each slot only if its metric falls within a specified interval. An extension of this algorithm is given by Yim et al. [20]. Nodes send at variable transmit powers. The main difference from the article at hand is that those http://jwcn.eurasipjournals.com/content/2013/1/211 protocols start with a well-defined interval and split this interval at each stage into a lower and upper interval until the best node is selected. For the case where, e.g., the metric values of the best and the second-best node are very close to each other or even equal (e.g., if the assumption of statistical independence of the nodes' metrics does not hold), the message complexity of these algorithms will be high. We aim for low message complexity while retaining a high selection reliability even in cases where the best and second-best nodes exhibit the same metric value.

Case studies
Let us now demonstrate and analyze the metric-based selection in two case studies. The first study addresses the task of relay selection for cooperative wireless communications (Section 3.2). The second study is concerned with load balancing to increase network lifetime (Section 3.3). Before we address these case studies, however, we first consider related work on relay selection and load balancing in Section 3.1.

Relay selection
Bletsas et al. [21] describe a relay selection scheme with random access based on timers and channel estimation. Upon receiving a CTS packet, each relay candidate starts a timer. The value of these timers is based on channel measurements, and the timer of the relay with the best end-to-end channel condition will expire first.
Lo et al. [22] propose a relay selection scheme that favors nodes with better channel gains. All relay candidates compete on a slotted channel, where each one sends a reply with a defined probability in one randomly selected slot. This message contains information about the node's channel condition. The destination then chooses one of the candidates as the relay node. In our work, only nodes possessing a good value of the regarded metric reply, which in turn reduces the message complexity.
Nosratinia et al. [23] present a distributed relay selection protocol, where each node decides on its own whether or not to assist other nodes. Each node maintains a priority list used for cooperation purposes. In contrast to our proposal, the aim of this protocol is to achieve full diversity across the network.
Adam et al. [24] study relay selection with explicit consideration of the energy required to receive data. They propose a relay selection scheme that exhibits benefits with respect to energy efficiency. Nodes compete in the relay selection process by setting timers based on the channel state.
Lima et al. [25] present a contention-based relay selection mechanism. Nodes access the medium based on a common probability. Whenever a collision occurs, the relays split into subgroups. The goal is to get replies from many relay candidates such that the source can select the most appropriate one.
These papers demonstrate the importance of a selection protocol for cooperative relay communications. The paper at hand performs a much more comprehensive analysis of such a relay selection protocol than previous work in this area.

Load balancing
Several algorithms for load balancing in task assignments have been proposed for mobile and wireless networks. Examples include the following: Tonguz et al. [26] present a mathematical framework for the evaluation of dynamic load balancing strategies in cellular networks. Alanyali et al. [27] focus on dynamic resource allocation and analyze the performance of two call assignment policies, i.e., least loaded routing and least relatively loaded routing. Further load balancing strategies are proposed and evaluated, e.g., in [28] and [29]. In the case study presented in this article, each node determines its suitability to perform a certain task on its own. The design of the random access scheme keeps the overhead at a low level.

Case study I: relay selection
A current field of application for contention-based selection can be found in cooperative wireless communications. In such systems, a radio link between a source and a destination node is supported by one or more relay nodes [2]. An important task is to select an appropriate relay from the set of all possible relay candidates to forward messages to the destination [24]. We focus on on-demand relaying techniques, where relaying is only performed if requested by the destination [24]. We assume that all relay candidates receive the message from the source. Relay selection is carried out by the destination.

Relay selection algorithm
The destination acts as query node and transmits a request message with transmit power κ. Relay selection should put preference on nodes having good channel conditions to the destination node. Assuming symmetric channels, each node measures the reception power of the selection requests from the destination and averages these reception powers over time.
The signal power received by a node i from the destination at a certain time instant t is called ℘ i (t) (in dBm). The receiver sensitivity of node i -i.e., its minimum power for successful decoding -is denoted by θ i (in dBm). Upon each reception of a request, a node i computes the metric The power values ℘ i (t 1 ), ℘ i (t 2 ), . . . are stored by the node. The average received power over z selection requests is The metric threshold at time t is set to This selection process prefers nodes for which the instantaneous channel conditions are better, i.e., node i is regarded to be better than node k if Considering a channel with pathloss exponent α and multipath propagation, the received power can be modeled by [30] where the distance d i between destination and node i is normalized to meters, and the random variable H describes multipath fading. In case of Rayleigh fading, H is exponentially distributed with mean 1. Furthermore, we require H > 0. For a sufficiently large number of measurements z, the average power becomes Combining (15), (17), (19), and (20) yields for each node i at time instant t. Thus, using (14), each node can compute the denominator of (12) by Applying the resulting modification function f (m i (t), m i (t), δ) in (11), each node computes its access probabilities for this selection and replies in each slot accordingly. For large-enough channel coherence time, the selected relay will exhibit good channel conditions for relay-destination communications.

Performance study
Let us now investigate the performance of this metricbased relay selection algorithm by simulations. As a case study, we employ TelosB nodes, which are programmable wireless platforms. The nodes have a transmit power κ = 0 dBm and a receiver sensitivity θ = −94 dBm [18]. The pathloss exponent is set to α = 3. Furthermore, we assume Rayleigh fading. We randomly place n relay candidates using a uniform distribution in an area of size A =1,200 m × 1,200 m. The query node (additional node) is placed at the center of the area. Random access for relay selection is performed with s = 10 contention slots.
For each request sent by the query node, each relay candidate computes its metric and access probabilities. We perform 1,000 simulation runs, each consisting of 100 selection attempts. At the beginning of each simulation run, nodes are randomly (re-)distributed and selection thresholds are reset.
We first consider n = 5 relay candidates within the range of the query node. The reliability R of each selection is computed using (2). As the sending probabilities adjust to the current metric, R also changes over time. We visualize these changes of R for the entire simulation using boxplots. The whiskers of the boxplot visualize the 0.1 and 0.9 quantile, respectively. Note the different scalings of the y-axes to improve visibility. As shown in Figure 7, uniform access with intensity δ = 20 yields high reliability, where more than 90% of all values are larger than R = 98%. Using slow-start access, the reliabilities decrease. Nonetheless, 90% of all values are larger than R = 86%. Applying δ = 10 yields 99% and 91%, respectively. Table 3 shows cumulative message complexities for different parameters. Slow-start access is always superior to uniform access, and in both cases, early stop can reduce the complexities significantly. The cumulative delays (not shown) follow a different behavior: they are lower for uniform access than for slow-start access. With δ = 20, e.g., the average delay is 5.7 contention slots for slow-start access and 2.5 contention slots for uniform access. With δ = 10, we obtain 5.4 and 2.4, respectively.
Besides reliability, message complexity, and delay, two further performance measures are analyzed: 1. The percentage of selections γ 1 where the best node is selected. 2. The percentage of selections γ 2 where the best or second-best node is selected. Figure 8 shows γ 1 and γ 2 for different values of δ. The best node is selected in about γ 1 =35% to 40% of all cases when using δ = 20. This value decreases to about 28% when using δ = 10. The best or second-best node is selected in about γ 2 = 62% for δ = 20 or 50% for δ = 10, respectively. For uniform access, one can also apply more extreme values for δ, without decreasing the reliability too much: When applying, e.g., δ = 50, the best node is selected in γ 1 = 53% of all cases, while the best or the second-best node is selected in γ 2 = 78% of all cases. The reliability remains at high levels, i.e., the median is 99.6%; 90% of all reliabilities are larger than 96%.
Let us now increase the number of nodes from n = access and larger than 98% for uniform access. As shown in Table 4, the average cumulative message complexities increase only slightly (cf. Table 3). Also, the average delays (not shown) are only slightly increased.
Last but not the least, the best node is selected for slowstart access in about γ 1 = 26% (δ = 20) or 13% (δ = 10) of all cases. For uniform access, the performance is γ 1 = 28% and 13%, respectively. The best or second-best node is selected at a rate of γ 2 = 42% or 22% applying slowstart access; it is 45% or 23% for uniform access. Roughly speaking, metric-based selection chooses the best node about five times as often as metric-independent selection (γ 1 = 1/n = 5%) when using δ = 20.

Impact of discrete RSSI values
In practical applications, the RSSI value provided by radio platforms is discrete. For the CC1100E low-power sub-GHz RF transceiver, for example, the RSSI value can be retrieved (in dBm) with a resolution of 0.5 dB [31].
Simulations showed that the performance of the proposed selection algorithm does not degrade due to this quantization.

Case study II: load balancing
Another application of node selection is to balance the load among several devices. We use a selection where devices with high battery charge states are preferred.

Load balancing algorithm
Assume that a given node requires another node to perform a certain energy-consuming task. It sends a request to all candidate nodes. Each candidate node i derives a metric m i from its battery state b i ∈[ 0, b max ] by We assume that a reply from node j includes its value m j . Then, each node i updates its threshold m i as where m ij is the value of node j's metric received by node i from node j's last reply. Furthermore, each node calculates its sending probabilities p ij using (12) and accesses the contention slots according to these. The first few selections are made with a metricindependent selection until nodes know (most) of the other nodes' metrics. Once all candidate nodes can well estimate the values m ij , the protocol changes to metricbased selection.

Performance study
For performance analysis of contention-based load balancing, let us consider the specifications of the CC1100E low-power sub-GHz RF transceiver [31]. Each node is powered with a battery providing 3,000 mAh. For a data rate of 38.4 kbaud, the current consumption is 16.5 mA in transmission mode (at 0 dBm output power) and 17.7 mA in reception mode; it is only 700 nA in sleep mode. The time required to switch from sleep to transmit or receive mode is 240 μs at a current of 9 mA during state transitions. We use binary FSK as a modulation scheme. Each packet has a length of 88 bytes, including preamble/sync word of 4 bytes. We set the duration of each slot such that one packet can be transmitted during a single slot. All nodes listen for the preamble/sync word at the beginning of each slot. If no preamble/sync word is received, a node switches to sleep mode for the remaining slot duration and wakes up right before the next slot starts (cf. Figure 9). Based on these specifications, the energy consumption per slot when no reply is sent is 0.84 · 17.7 + 0.24 · 9 + 17.02 · 0.0007 + 0.24 · 9 ≈ 0.02 · 10 −6 As, while the energy consumption per slot when receiving is 18.34 · 17.4 ≈ 0.32 · 10 −6 As.
Thus, the energy consumption of listening (i.e., no reply is received during the slot) is about 6% of that of receiving.
In the following, we assume that the task to be fulfilled requires 3.6 mJ. A practical task with such an energy consumption would be, e.g., measuring temperature and atmospheric pressure. The barometer specified in [32] requires a current of 5 mA, while the temperature sensor specified in [33] requires 4 mA. We average over a time period of 350 ms to get accurate measurement values. Thus, the energy consumption for performing the measurement is (1.7 + 5 + 4) · 0.35 ≈ 3.6 mJ, where 1.7 mA is the current consumption of the CC1000E in idle mode.
The simulation is performed in the following way: Each node is assigned an initial battery state of charge. The query node sends a request to all candidate nodes containing the task to perform. The candidate nodes access the channel using uniform access or slow-start access, respectively. The node that sends the first non-colliding message will have to perform the task. If the selection is unsuccessful, it will be repeated until it is successful. Since nodes are not aware of other nodes' battery states in the beginning, we perform the first n selections always with the metricindependent strategy and then switch to the metric-based selection. As reference, we also evaluate the performance of metric-independent selection, i.e., the entire simulation is performed applying the metric-independent strategy. If not mentioned otherwise, node selection is performed over s = 10 contention slots. We compute the total energy needed for successful and unsuccessful selections and execution of the tasks. We also sum up the number of replies and delays of selections. The simulation runs until there is only one charged node left.
There are five candidate nodes with initial battery states (b 1 , . . . , b 5 ) = (3,000, 2,700, 2,400, 2,150, and 1,520 mAh). The reliability R of each selection is evaluated using (2). As the sending probabilities adjust to the current metric, R also changes over time. Figure 10 shows boxplots of the reliabilities R based on a complete simulation for different vales of δ. The whiskers of the boxplot represent the 0.1 and 0.9 quantile, respectively. Note the different scalings of the y-axes to improve visibility. Uniform access yields a very high reliability with a median value of 99.5% almost independent of δ. The reliability of slow-start access is worse, yielding a median of 93.8% and higher variance. A larger δ leads, in general, to a higher variance of the reliability as can be seen in Figure 10, but the influence of the metric on R is rather limited. In particular, we observe that the impact is smaller than in Case study I, which is due to the fact that each candidate node is informed about the other nodes' metrics during the selections, such that each node can adapt its sending strategy (more) appropriately.
Let us now study the network lifetime [34], defined as the time period from the beginning of the simulation until the point in time when the first node fails due to an empty battery. Figure 11 shows the battery levels of all nodes over time, comparing metric-independent and metric-based selection and comparing different strategies. The key observation is that metric-based selection extends the network lifetime for both access schemes by balancing the load between the nodes. For example, using slow-start access with early stop (Figure 11a), the first node runs out of battery after approximately five million tasks using metric-independent selection. Applying metric-based selection, however, the network lifetime increases to almost 8 million tasks for δ = 20 or 7.3 million tasks for δ = 10 (not shown). In general, node selection with uniform access slightly reduces the network lifetime, independent of whether or not metrics are employed for selection (cf. Figure 11a,b). This behavior is due to the fact that the energy consumption of listening is low compared to that of receiving. Applying node selection without early stop (Figure 11c,d), significantly reduces the network lifetime. This is because nodes have to listen for (and potentially receive) messages during all s = 10 contention slots.
There is again a trade-off between message complexity and delay. As shown in Table 5, slow-start access has almost half the message complexity of uniform access. For example, if δ = 20, an average of about 1.3 replies is received for slow-start access compared to about 2.4 for uniform access. Uniform access, in turn, has about half the delay of slow-start access (no table).
The ratio between the energy consumption of listening and receiving determines as to whether or not slow-start http://jwcn.eurasipjournals.com/content/2013/1/211   access exhibits benefits in terms of energy consumption.
To analyze this further, we derive the expected energy consumption per node as the sum of the weighted probabilities that either a node is sending, listening, or receiving:  where e S = 16.5 mA and e R = 17.7 mA. Figure 12 shows the values of τ * for different n and s. The value depends strongly on s and depends somewhat on n. For s = 10 and n ≥ 5, τ must be smaller than about 0.15 to yield a benefit of slow-start access in terms of energy efficiency. For the same s and n = 100 nodes, this value is about 0.18. Let us perform the same analysis using n = 20 nodes with initial battery states shown in Table 6. The obtained reliabilities of metric-based selection are very similar to those with low node density. For example, more than 90% of all values are larger than 93% for slow-start access and 99% for uniform access (δ = 20). Table 7 shows the message complexities. Both message complexity and delay increase only very slightly compared to low node density. Results on the network lifetime can be summarized as follows: Slow-start access with early stop enables about 9 million tasks for metric-independent selection and about 12.7 million tasks for metric-based selection with δ = 20. Uniform access with early stop reduces the lifetime to 7.3 million and 9.7 million tasks, respectively.

Conclusions
This article presented and analyzed a general method for distributed node selection using a random access competition on a shared slotted channel. Two access strategies were proposed: uniform access maximizes reliability; slow-start access reduces message complexity. Making slot access probabilities dependent on a node metric, both schemes can be applied for node selection. We analyzed the selection protocol theoretically in terms of reliability, message overhead, and delay. Furthermore, we tested the protocol in two case studies, namely relay selection and load balancing. For the application of relay selection, we applied the channel state as the metric and showed that the metricbased strategy selects one of the better relays with high likelihood compared to metric-independent selection. For the application of load balancing we applied the battery state of a node as the metric. Nodes are selected to perform a certain task. To balance the battery consumption of the nodes, we put preference on nodes that have higher battery states. The metric-based selection increases the network lifetime considerably compared to metric-independent selection.

Additional file
Additional file 1: Appendix. Document contains proofs and derivations.

Competing interests
The authors declare that they have no competing interests. 1 Mobile Systems Group, Institute of Networked and Embedded Systems, University of Klagenfurt, Klagenfurt 9020, Austria. 2 Lakeside Labs GmbH, Klagenfurt 9020, Austria.