Probabilistic Model Checking: One Step Forward in Wireless Sensor Networks Simulation

A novel collision resolution algorithm for wireless sensor networks is formally analysed via probabilistic model checking. The algorithm called 2CS-WSN is specifically designed to be used during the contention phase of IEEE 802.15.4. Discrete time Markov chains (DTMCs) have been proposed as modelling formalism and the well-known probabilistic symbolic model checker PRISM is used to check some correctness properties and different operating modes and, furthermore, to collect some performance measures. Thus, all the benefits of formal verification and simulation are gathered. These correctness properties as well as practical and relevant scenarios for the real world have agreed with the algorithm designers.


Introduction
The joint efforts of the Zigbee Alliance and the IEEE 802. 15.4 Task Group have produced a set of protocols that ensure the functionality of wireless personal area networks (WPANs). IEEE 802.15.4 standard [1] defines the specification of the physical and media access control (MAC) layers for lowrate wireless personal area networks (LR-WPANs). These networks are convenient in scenarios where the availability of resources is limited. IEEE 802.15.4 supports star and peerto-peer network topologies and uses carrier sense multiple access with collision avoidance (CSMA/CA) as medium access mechanism. Moreover, it provides two operating modes that may be selected by a central node: nonbeaconenabled and beacon-enabled. They are used in nonslotted CSMA/CA and slotted CSMA/CA, respectively. When a device wishes to transfer data to a coordinator in a beaconenabled network, it first listens for the network beacon. When the beacon is found, the device synchronises to the superframe structure. At the appropriate point, the device transmits its data frame, using slotted CSMA-CA, to the coordinator. The coordinator acknowledges the successful reception of the data by transmitting an optional acknowledgement frame. When a device wishes to transfer data in a nonbeaconenabled network, it simply transmits its data frame, using unslotted CSMA-CA, to the coordinator. The coordinator acknowledges the successful reception of the data by transmitting an optional acknowledgement frame. The performance of slotted CSMA/CA algorithm has been analysed previously (e.g., [2,3]) concluding that the binary exponential backoff algorithm is not flexible enough to be used in largescale sensor networks.
We focus here on 2CS-WSN (two cells sorted wireless sensor network) algorithm [4], a simple, fast, and effective collision resolution method specifically designed to be used during the contention phase of IEEE 802. 15.4. It is intended to be used as alternative to CSMA/CA. As 2CS-WSN uses probabilities and sorted transmissions for quick collision resolution, there is a clear need to inspect how those parameters can be tuned so as to achieve performance improvements as well as to detect possible inconsistencies or issues (e.g., deadlocks).
From our experience, we advocate for the use of simulation and formal verification techniques to analyse protocols or algorithms since there is an eternal debate about the appropriateness of using simulation or formal verification in not only this area. On the one hand, simulation-based approaches study in a nonexhaustive way the behaviour of the system. On the other hand, formal verification is based on a systematic and exhaustive analysis of all the possible paths in the system, trying to find possible inconsistencies and/or errors not 2 International Journal of Distributed Sensor Networks evaluated in the simulation. Obviously, each of them has its advantages and disadvantages and it is out of the scope of this paper to summarise them, but, from our experience, it is better to use formal verification up until the problem of "state explosion" arises and, then, use simulation to obtain results in bigger scenarios.
Here, we use probabilistic model checking (a formal method for the verification of probabilistic systems) since the use of probabilities can influence the behaviour of 2CS-WSN. In particular, we describe 2CS-WSN algorithm in terms of discrete time Markov chains (DTMCs) and, using the wellknown probabilistic symbolic model checker PRISM [5], we verify some correctness properties, compare different operating modes of the algorithm, and analyse the performance and accuracy of different model abstractions. It is clear that the resolution of a collision in minimum time is a primary requirement in these kinds of algorithms and therefore our performance analysis is mainly focused on temporal aspects. By adding the incurred time costs during the execution of the system, we can evaluate the expected time to resolve the collision in different scenarios. In addition to this, we are able to study properties of great interest to designers such as "the probability that a certain number of nodes have successfully managed to transmit within a certain time" or "the probability that all nodes have transmitted before a certain time. " Analysing such properties for a range of parameter values (e.g., retransmission probability) is often key to identify interesting or anomalous behaviour, and, probably the most important issue the designer can determine if the algorithm fulfils the timing requirements.
The rest of the paper is organised as follows. As usual, we first introduce some related works and compare it with our work. We continue by presenting some background required for a better understanding of this work. Thus, we describe the algorithm under study in Section 3, and some formal background in Section 4. After that, we show the PRISM model for 2CS-WSN in Section 5, and we study it in Section 6. Finally, we summarise some conclusions and discuss possible future work.

Related Works
Recently, the analysis of WSNs has attracted a lot of attention and, therefore, there are many ways to present these works. We divide such works in two main categories (simulationbased and formal verification-based) since both techniques are used here.
To begin with, we present those works that are based on simulation. It is worthwhile to mention here that some of them use simulation to demonstrate the correctness of their analytical approach; that is, an analytical model of the protocol/algorithm is introduced and, then, some experiments are conducted in a well-known (or ad hoc) simulator to validate the correctness of the analytical model. For instance, Bianchi defines in [6] an analytical evaluation of the saturation throughput of the 802.11 distributed coordination function. As in our work, the author uses a Markov chain to model the behaviour of a single node and assumes an ideal channel. In [7], Ye et al. introduce S-MAC, a medium access control protocol designed for wireless sensor networks, and validate it in a real testbed. Faridi et al. [8] characterise the key metrics in a beacon-enabled IEEE 802.15.4 system with retransmissions, and, in [9], Lee et al. propose an additional carrier sensing algorithm based on the IEEE 802.15.4 acknowledgement mode to detect the channel condition. Then, a Markov chain model is depicted, analysing the throughput of the algorithm by means of an ad hoc experimentation. Finally, Hoesel and Havinga [10] develop a novel lightweight medium access protocol (LMAC) for wireless sensor networks. In addition, they validate the algorithm in the simulation package OMNet++ enriched with a framework for WSNs.
On the other hand, one can use formal verification to verify the correctness of a system. A well-known problem when using formal verification is that it becomes intractable when the possible paths in the model are infinite. For example, in [11], it is modelled and analysed LMAC [10] by using timed automata and the popular model checker UPPAAL [12]. In [10], they are able to analyse networks with up to 5 nodes, whereas we are able to analyse bigger networks (up to 40 nodes). In [13], LMAC is studied as a case study to present a new version of UPPAAL, SMC-UPPAAL. The novelty here is that they apply statistical model checking to LMAC. Roughly speaking, the substantial difference between simulation and statistical model checking is that the latter one obtains the probability that the system behaves in such a manner. Again, small networks (up to 10 nodes) are studied. Next, we cite two works fairly related to the present one. On the one hand, Duflot et al. [14] evaluate CSMA/CD by using probabilistic timed automata and two well-known tools, PRISM and APMC [15]. With PRISM, they study the system using probabilistic model checking, whereas with APMC they approximate other properties. On the other hand, Kwiatkowska et al. [16] pose the automatic verification of a medium access control protocol of the IEEE 802.11 WLAN standard using probabilistic model checking. They use probabilistic timed automata as modelling formalism and PRISM as model checker. Finally, let us note that we have previous experience analysing wireless algorithms. For instance, we studied a recent role-based routing algorithm (NORA) for WSNs in [17], and its fuzzy-logic based version in [18]. Moreover, we would like to note that our paper is, to the best of our knowledge, the first work that achieves applying probabilistic model checking to networks up to 40 nodes in conflict since the related works presented in this section only success to model networks with at most 10 nodes.

2CS-WSN: Random Access with Stack Protocols
Before we begin, let us remark that 2CS-WSN algorithm is partially derived from the definition of the stack algorithm described in [19]. In the following, we will refer to it as 2C algorithm. It is a fair, efficient, and simple algorithm to resolve the possible collision when sharing the same transmission channel and it is called a stack protocol because its time evolution can be easily visualised as a group of stations moving up and down in a two-cell stack; that is, stations may be either transmitting or waiting, and these two states can be represented using only two cells in a stack. The transmission cell (TC) represents the group of transmitting stations and the waiting cell (WC) the group of stations that have deferred transmission. Although 2C algorithm has many desirable features it may incur in significant access delays when a large number of stations contend for the channel since, with only two cells, it takes a long time to randomly distribute the stations. Thus, 2C algorithm was improved in [4], leading to the definition of 2CS-WSN algorithm, where wireless communication and several cells are considered. Moreover, there are two main features that share in common 2C and 2CS-WSN. First, collision resolution is performed by using probabilities and, second, time is slotted, allowing stations to transmit only at the beginning of a time slot. A time slot is normally considered as the time a station needs to transmit a packet and receive a feedback message from a central station. The feedback message is binary; that is, it is a C (collision) message when a collision was detected and a NC (no collision) message otherwise. If only one station transmitted, the corresponding packet will be successfully transmitted. On the other hand, if there were several transmission attempts in the same slot, there will be a collision and its resolution shall begin in the following slot. The collision resolution ends when all colliding stations can successfully transmit. This time interval is known as a collision resolution interval (CRI). A station that generates a new transmission request, when a CRI is in progress, has to wait until the current CRI ends before attempting to access the channel. Thus, 2C (and 2CS-WSN) are able to provide some fairness in the access to the channel since all the participants will eventually transmit. As commented previously, 2CS-WSN is designed to be used with wireless communications although the original description of 2C algorithm is not tied to any specific transmission medium. Therefore, it has to be adapted to the particularities of the wireless medium. For instance, in 2C, it is assumed that there is a central station that is continuously monitoring the channel and providing feedback messages. However, in self-configuring wireless ad hoc networks, this assumption is unrealistic. In this case, the participants have to assume this role by monitoring the transmission medium and reacting accordingly. This leads to a second issue: how to detect a collision. In wired networks it is rather easy to detect a collision, but in wireless networks this is not a trivial matter. In 2CS-WSN, instead of detecting implicitly a collision, network nodes infer that a collision has happened. A wireless node can infer that its transmission has collided if the reply to its request does not arrive. In this case, the station has to randomly choose whether to retransmit (i.e., to remain in TC) or to join the waiting group (WC). We model this fact by using probabilities. Let us denote by TC the probability of remaining in TC and by WC the probability of moving to the first waiting group (with the obvious condition that WC = 1 − TC ). We suppose here that all nodes are provided with an unbiased coin to make the decision; that is, they stay in TC with probability 0.5 or they move to WC with the same probability. Figure 1 shows the flow chart of the 2CS-WSN algorithm.
For instance, we show in Figure 2 how 2CS-WSN behaves in a five-node network, where all nodes want to transmit in the same slot and a collision occurs. To solve this collision, each node uses its unbiased coin to decide its following step. For instance, nodes 1 and 5 decide to enter the waiting group WC 1 whereas nodes 2, 3, and 4 decide to remain in the transmission group TC. Therefore, in the next slot, nodes 2, 3, and 4 attempt to transmit and collide again. Then, let us suppose that nodes 3 and 4 decide to enter the waiting group WC 1 .  Figure 2: Collision resolution example using 2CS-WSN algorithm with a five-node network.
Nodes 1 and 5 move from WC 1 to WC 2 . At this time only node 2 is in TC thus achieving a successful transmission. This successful transmission causes nodes in WC 1 (i.e., nodes 3 and 4) to move to TC and nodes in WC 2 (i.e., nodes 5 and 1) to move to WC 1 . This process is repeated until all nodes that participated in the initial collision can successfully transmit.

Formal Background
Now, we introduce briefly some formal background. We start by defining discrete time Markov chains (DTMCs) as it has been used as modelling formalism. Next, we briefly introduce probabilistic model checking and PRISM.

Discrete Time Markov Chain.
Basically, a Markov process is a special class of stochastic process that satisfies the Markov property (or memoryless), that is, given the state of the process at time , the future behaviour after is independent of the behaviour before . When it is considered discrete state (sample) space, they are called Markov chains and if one considers only discrete time steps, they are called discrete time Markov chains (DTMC). Moreover, if the conditional probability is invariant with respect to the time origin, then the DTMC is said to be time-homogeneous. We only consider time-homogeneous DTMC in this paper. For more details see [20].
(ii) A DTMC is said to be time-homogeneous if, for all = 0, 1, . . . and for all , in , (2) In this way, represents the probability that the process will, when in state , next make a transition into state ; that is, is the probability to move from the state to the state in one step.
(iii) The matrix of transitions probabilities (stochastic matrix) of a time-homogeneous DTMC is defined as where each is the probability of moving from state to state . Since the probabilities are positive numbers and due to the fact that the process must take a transition into some state, we have that Moreover, according to Chapman-Kolmogorov equations, the probability to reach the state from the state in steps, denoted by ( ) , is the element ( , ) of the matrix .
The behaviour of a DTMC is fully probabilistic; thus we can define a probability space over infinite paths through the model and it is possible to compute the probability of a particular event.
A DTMC can be also defined as a triple ( , 0 , ), where is the set of states, 0 is the initial state, and is the stochastic matrix. And a DTMC can be also represented by a state transition diagram, which is a directed graph where each node is a state (number of nodes = number of states if is finite), and there is an arc from to if and only if > 0. In this way, a state is accessible from 0 if there is a walk in the graph from 0 to , that is, an ordered string of nodes, ( 0 , 1 , . . . , , ), ≥ 0, in which there is a directed arc from to +1 and from to .

Probabilistic Model Checking. Probabilistic model check-
ing is a formal verification technique for the automatic analysis of systems that exhibit stochastic behaviour. It provides the likelihood of the occurrence of certain events. In conventional model checkers, it is used as input of the model of the system, represented in some formalism, and its specification, usually a formula in some temporal logic. After International Journal of Distributed Sensor Networks 5 computing the formula in the model, one gets as output "yes" or "no, " indicating whether or not the model satisfies it. Probabilistic model checking involves also reachability analysis in the state space, and the calculation of probabilities through appropriate numerical or analytical methods. The algorithms for probabilistic model checking are usually derived from conventional model checking, numerical linear algebra, and standard techniques for Markov chains. In this way, probabilistic model checking can be used to ascertain not only correctness, but also quantitative measures such as performance and reliability.
Probabilistic model checking can be applied to a range of probabilistic models, typically variants of Markov chains. The specification language is a probabilistic temporal logic, capable of expressing temporal relationships between events and likelihood of events. Probabilistic temporal logics are usually obtained from standard temporal logics by replacing the standard path quantifiers with a probabilistic quantifier. In this paper we use probabilistic computation tree logic (PCTL) [21] as probabilistic temporal logic, which is based on the well-known branching-time computation tree logic (CTL) [22]. It allows us to verify properties such as if the model "finishes or not properly" (all nodes have successfully transmitted) and/or to reason about quantitative measures such as "what is the probability that a certain number of nodes have successfully managed to transmit within a certain time" or "what is the probability that all nodes have transmitted before a certain bound" or "the expected time that all nodes have transmitted" and so on. [5] is an open source probabilistic model checker developed initially at the University of Birmingham and currently maintained and extended at the University of Oxford. PRISM supports several types of probabilistic models such as discrete time Markov chains (DTMCs), continuous time Markov chains (CTMCs), Markov decision processes (MDPs), probabilistic automata (PAs), and probabilistic timed automata (PTAs), considering also extensions of these models with costs and rewards.

PRISM. PRISM
Models are described using the PRISM modelling language, a state-based language based on reactive modules. The fundamental components of the PRISM language are modules and variables. A model is a set of modules which can interact with each other. Typically, a probabilistic model is constructed in PRISM as the parallel composition of a set of modules. In every state of the model, there is a set of commands (belonging to any of the modules) which are enabled, that is, whose guards are satisfied in that state. The choice between which command is performed (i.e., the scheduling) depends on the model type. PRISM includes also support for the specification and analysis of properties based on rewards (and costs). Thus, it is possible to assign different rewards to different states or transitions, depending on the values of model variables in each one.
PRISM provides also support for the automatic analysis of a wide range of quantitative properties. The property specification languages provided by PRISM are PCTL, CSL, LTL, and PCTL * , as well as extensions for quantitative specifications and costs/rewards. One of the key features of PRISM is its symbolic implementation technique. It uses data structures based on binary decision diagrams (BDDs), which allow compact representation and efficient manipulation of extremely large probabilistic models by exploiting structure and regularity derived from their high level description. As a proof of maturity, PRISM has been used to analyse systems from many different application domains, including communication and multimedia protocols (see the PRISM website [23] for multiple examples).

Modelling 2CS-WSN in PRISM
A model of 2CS-WSN in terms of DTMCs has been developed using PRISM language. In Section 3, we showed how 2CS-WSN behaves in a network with five colliding nodes and we will leverage this example to show how the algorithm has been modelled in PRISM. We recall that this does not mean that the network has only 5 nodes, but, among the nodes in the network, there are 5 trying to transmit at the same slot.
Box 1 shows the PRISM model for this scenario. A state consists of a triple (TC, WC 1 , WC 2 ) where TC is the number of nodes in collision and WC 1 , WC 2 are the number of nodes waiting to retransmit in each waiting cell. This initial state of the model is represented by the triple (5, 0, 0), meaning that there are five nodes in TC and zero nodes in each one of the waiting cells. On the other hand, Figure 3 shows the state transition diagram associated to the DTMC described in Box 1. It consists of 42 states. Each state is represented as a rectangle with an identifier and a triple (TC, WC 1 , WC 2 ). Each directed arc from the state to the state is labelled with the probability , which indicates the probability of moving from the state to the state according to the 2CS-WSN algorithm.
The initial state is set to the node number 41 labelled with the tuple (5, 0, 0). The node number 0 is the final state and it is labelled with (0, 0, 0), that is, no nodes either in TC or in WC , meaning that the five nodes have been able to transmit successfully and the initial collision has been resolved.
Carefully analysing the state transition diagram, it can be appreciated that the DTMC generates all possible alternatives to solve this collision. In particular, in Figure 3, the trace followed in Example 2 has been pointed out with dashed lines.
Hence, for instance, the probability to move in one step from the initial node (5, 0, 0) (node number 41 in Figure 3) to the node (3, 2, 0) (node number 37 in Figure 3) is obtained by considering that 3 of the 5 nodes in the transmission cell remain in it and the other 2 move to the first waiting cell. Let the probability to retransmit of each node be 0.5 (i.e., to remain in TC); then the probability to move is computed as ( 5 2 ) ⋅ 0.5 5 = 0.3125. Notice that the model takes into account any 2 nodes taken from TC, and not only nodes 1 and 5 which were chosen in the example of Figure 2.
Once the model has been explained with a specific example, this model can be generalised as follows.
Let be the number of nodes in collision and the number of waiting cells. A state is defined as a tuple possibilities for the number of nodes that remain in TC, then the behaviour of variable TC follows a binomial distribution = ( ; ), where = TC . Whenever ≥ 2, nodes in WC move to WC +1 with ∈ [2, . . . , − 1] in the next step. Nodes in the last waiting cell make no movement. Nodes in TC choose to retransmit with probability TC or to move to WC 1 with probability 1 − TC . Let be the number of nodes that remain in TC and the number of nodes that move to WC 1 , where + = . The probability that nodes remain in TC is defined as ( )⋅( TC ) (1− TC ) with ∈ [0, . . . , ] and = − . If TC = 0.5, the probability is ( )⋅(0.5) . Whenever ≤ 1 nodes in WC move to WC −1 with ∈ [2, . . . , ] and the last waiting cell must be empty. Therefore, next state is defined as follows: where is the number of nodes in TC and = + .

Verification and Performance Evaluation
To evaluate the DTMC model in PRISM, the following parameters have been considered. As commented previously, we have used PCTL logic for expressing significant properties. First of all, we want to check if the model eventually finishes. To this end, we need to know how many nodes have successfully transmitted (finish). This is computed by using the following formula, where is the number of the waiting cells: formula finish = nodes − (TC + WC 1 + ⋅ ⋅ ⋅ + WC ) .

(6)
This formula computes the number of finished nodes. Thus, nodes is the number of nodes initially in collision (we consider 40 in this scenario), and TC, WC 1 , . . . , WC −1 , or WC represent the number of nodes in such a cell.
By using this formula, we can evaluate the following property 1 : If this property holds, we can ensure that the algorithm eventually terminates successfully. The result of the evaluation was true and, therefore, we can conclude that the model eventually finishes. This property turns out to be of great interest for some scenarios (emergencies, control sensors, etc.) as it ensures that all the nodes can eventually transmit in contrast to CSMA-based protocols where a backoff period is used for channel contention and some threshold will decide if transmission is rejected. These protocols cannot guarantee channel access for all nodes [24].  Once we know that the algorithm eventually finishes, we turn our attention to collect performance results about collision resolution time. To this end, we extend first our model with rewards so that a real value (reward) is associated with certain transitions of the model. In this case, and to be in accordance with [4], we defined a time slot of 1.6 ms; that is, each transition in our model has a reward associated of 1.6. In PRISM, we can analyse properties about the expected values of these rewards. This is achieved using the operator. In particular, we use "cumulative reward" property that also associates a reward with each path of a model (not only to states/transitions). In this case, we evaluate the expected conflict resolution time using 2 . We ran then PRISM experiments on 2 , with verification (we compute the whole state space), varying the probability of transmission ( TC ) and/or the number of waiting cells according to Table 1. The field Step value represents how much we vary the parameter in each experiment. The goal of this experiment is to demonstrate what is the best configuration for the algorithm since, unfortunately, the designers of 2CS-WSN (and 2C) have never studied how these parameters could affect its performance. Figure 4(b) (or Table 2) shows that the best choice in order to    (Figure 4(b)). minimise the collision resolution time is considering TC = 0.5 as the parameter of probability of retransmission and 5 as the number of waiting cells. Surprisingly, the designers of 2C and 2CS-WSN chose the best option without studying the possible configurations. In contrast, in 2CS-WSN, they assumed that the number of waiting cells is unlimited (this assumption is not realistic in the real world since the resources are limited). Moreover, the results obtained in [19] for 2C algorithm can be improved considering 4 waiting cells instead of 2 (see Table 2).
To validate the conformity of our proposed probabilistic model with the model proposed in [4], we compare the results obtained here with PRISM and the results obtained in Table 3: Differences PRISM versus CASTALIA results (ms) (Figure 4(a)). the simulator CASTALIA. In Figure 4(a) (or Table 3) we can observe that the differences between the collision resolution time obtained taking 1000 simulations in CASTALIA and the expected time obtained by using PRISM is, in the worst case, about 5 ms, and normally less than 2 ms. Therefore, we can conclude undoubtedly that our model fits adequately. Furthermore, we can also use time-bounded probabilistic reachability properties. The main difference with other kind of properties is that one can associate a strict time deadline to relevant events. As it can be observed in Figure 4(b), the four best probabilities of retransmission are TC = 0.3, 0.4, 0.5, 0.6. Therefore, we ran PRISM experiments on 3 (using verification), varying the retransmission probability parameter from 0.3 to 0.6 and the deadline time ( ) from 0 to 400 (ms). Figure 5 (or    the probability that all nodes have successfully within the deadline . Observe that we have chosen 400 ms since after this time all the nodes have successfully transmitted. For example, the probability to solve all the collisions in less than 128 ms is nearly 0 and practically 1 considering 320 ms or more. Besides, if we fix = 240 ms, we achieve to solve the collision with at least a probability of 0.98 ( TC = 0.4 or TC = 0.5) and with at least a probability of 0.9 ( TC = 0.3). Observe also that this probability is almost 0.94 considering TC = 0.6. Finally, note that this study was not conducted in [4,19].
Finally, considering the best option ( TC = 0.5 and the number of waiting cells as 5), we can ask about the probability that nodes have transmitted within ms. To answer this question we ran again PRISM experiments, using verification, on 4 , where we change the number of nodes ( ) from 5 to 40 and the deadline ( ) from 0 to 300 ms. Figure 6 (or Table 5)  shows the results. For instance, considering 160 ms, the probability that at least 20 nodes had transmitted within 160 ms is more than 0.99, the probability that 25 nodes had transmitted within 160 ms is less than 0.9, and the probability that 35 nodes had transmitted within these 160 ms is less than 0.1. This kind of questions could help in critical situations, where a fixed number of nodes must transmit to inform, for instance, about an emergency.

Conclusions
This paper presents the formal modelling and initial validation of a novel collision resolution algorithm for wireless sensor networks. 2CS-WSN is specifically designed to be used during the contention phase of IEEE 802.15.4. In our study, we try to find any error/inconsistency presented in the specification of the algorithm, and we have evaluated some properties for nontrivial, practical, and relevant scenarios.
In detail, we present the specification of the 2CS-WSN algorithm in terms of DTMCs and perform probabilistic model checking by using the well-known tool PRISM.We have used PCTL to formulate relevant properties. Forinstance, we have checked the absence of deadlock and theconformity with the former implementation in CASTALIA. We have focused here on temporal parameters since they are of great interest for the algorithm designers. In particular, we have studied the expected collision resolution time and properties that cannot be evaluated with general simulators such as "the probability that a certain number of nodes have successfully transmitted within a certain time" or "the probability that all nodes have transmitted before a certain time. " Furthermore, we have found the best configuration ( TC = 0.5 and = 5) for the algorithm. Now, our next step is aimed at finding possible improvements to the algorithm and, thus, we are collaborating with the designers in future versions of 2CS-WSN. For instance, we want to evaluate the effect of using adaptive probabilities (each node can use its own transmission probabilities regarding some parameter we are studying or we can use probabilities to move up in the stack instead of using only when