# Beacon Success Rate versus Gateway Density in Sub-GHz Sensor Networks
## 4 The Relationship between the Beacon Collision Probability and Beacon Error Rate  
The loss of a beacon causes an increased latency to resynchronize and might result in the falling out of the network; hence, beacon collision probability is investigated in detail in this section. Each beacon must be transmitted periodically; hence, GWs do not employ the LBT mechanism, which does not help in collision avoidance. Assuming a binomial distribution for the devices that can collide with each other at a given instant in time, we can write the collision probability as follows. Let \(N\) represent the number of devices that can collide with each other. It can, for example, represent the number of ENs in the neighbor WAN performing UL. Or, \(N\) represents the number of GWs in the area that are beaconing and can potentially collide with another beacon from another GW. Such beacon-to-beacon collision is referred to as DL collision as well, since beacons are broadcast in the DL direction. Let \(p_{c}\) represent the collision probability between individual links. The probability of \(x\) devices colliding out of \(N\) devices can be calculated as follows, where \(x\leq N,x\in\{1,2,\ldots,N\}\):  
\[f(x\mid N,p_{c})=\binom{N}{x}p_{c}^{x}(1-p_{c})^{N-x} \tag{6}\]  
Here, \(x\) represents the number of collisions in \(N\) trials of a Bernoulli process with an individual probability of collision given by \(p_{c}\). The term \(\mathrm{f}\big{(}x\mid\mathrm{N},p_{c}\big{)}\) represents the Probability Mass Function (PMF) of the number of collisions, \(x\). Then, the total probability of collision summed across all possible values of \(x\leq N\) can be calculated as:  
\[F(x\mid N,p_{c})=\sum_{\alpha=0}^{N}\binom{N}{x}p_{c}^{x}(1-p_{c})^{N-x} \tag{7}\]  
The term \(F(x\mid N,p_{c})\) represents the Cumulative Distribution Function (CDF) of the number of collisions. Here, it is assumed that any transmission on a given channel is independent of the other transmissions. The mean number of collisions can be calculated as:  
\[\mu=N\times p_{c}. \tag{8}\]  
A collision is assumed to occur if any packet collides for a duration greater than zero. With this assumption, the individual collision probability per link, denoted by \(p_{c}\), can be calculated as follows [32]:  
\[p_{c,DL}=\frac{(T_{beacon}+T_{beacon})}{T_{beacon\ interval}\times N_{ch}}. \tag{9}\]  
The terms \(p_{c,UL}\) and \(p_{c,DL}\) represent the individual collision probabilities on a beacon from the UL links and the DL links, respectively. The term \(p_{c,UL}\) represents the probability of collision between a beacon and an UL packet, while \(p_{c,DL}\) represents the collision probability between two individual beacons from two different GWs. The primary GW's beacon is assumed to occupy \(T_{beacon}\) seconds, sent once every \(T_{beacon\ interval}\) across \(N_{ch}\geq 1\) channels. The term \(N_{pht}\) represents the number of UL packets within each beacon interval, and \(T_{pht}\) represents the duration of each UL packet from each neighbor EN. The number of channels where frequency hopping is exercised is represented by the term \(N_{ch}\). A large number of channels or a longer beacon interval decreases the likelihood of collisions. Similarly, a larger number of packets per beacon interval increases the likelihood of collisions in the UL. For instance, the PMF with \(N\) = 5000 GWs, denoted as \(f(x\mid N=5000,\ p_{c})\), is illustrated versus \(x\) in Figure 15 for the DL. This plot depicts the distribution of beacon collision probability. The parameters considered for this result are \(T_{beacon}\) = 152 ms, \(N_{ch}=69\), and \(T_{beacon\ interval}=10.08\) s. With these assumptions, the mean number of collisions is \(\mu=N\times p_{c,DL}=1.9\). The PMF plot in Figure 15 above serves as an illustrative example, revealing that, with \(N=5000\) GWs, the likelihood of \(x=1\) and \(x=2\) devices colliding is around 0.25 and 0.27, respectively.