# Neighbor Discovery for IPv6 over BLE Mesh Networks
## 4 Performance Analysis  
In this section, we analyze the performance of neighbor discovery for 6 LoBLEmesh, including the probability of successful discovery in a whole 6 LoBLEmesh domain, the discovery average latency for one advertiser, and the average energy consumption for an advertiser during the discovery process. The terms used in the analysis are given in Table 3.  
First, we investigated the probability of successful discovery for all the nodes in the 6 LoBLE domain. Based on the 6 LoBLEmesh ND, the collision between nodes will lead the fail of the neighbor discovery process. There are two collision situations during discovery, the ADV_EXT_IND packet collision and the AUX_ADV_IND collision. Let \(P_{coll\_ADV}\) denote the probability of collision between two ADV_EXT_IND packets. We express this probability as  
\[P_{coll\_ADV}=\frac{2\tau}{T_{ADV}} \tag{1}\]  
Considering the characters of the mesh network, one relay node may try to establish a connection with more than one node. Therefore, we have the probability of the ADV_EXT_IND packet being received successfully expressed as \(P_{succ\_ADV}=(1-P_{coll\_ADV})^{N_{con}-1}\). Here, \(N_{con}\) denotes the average number of connections with one delay node, and \(N_{con}=\frac{N-N_{r}}{N_{r}}\). Then, we have  
\[ \begin{split} P_{succ\_ADV}&=(1-P_{coll\_ADV})^{ \frac{N-N_{r}}{N_{r}}-1}\\ &=(\frac{T_{ADV}-2\tau}{T_{ADV}})^{\frac{N-2N_{r}}{N_{r}}}\end{split}  \tag{2}\]  
Based on BLE 5.0, the AUX_ADV_IND packet could be transmitted on one of the secondary channels(CH0-CH36). Then, we have the probability of collision between two AUX_ADV_IND packets  
\[P_{coll\_AUX}=\frac{2\tau_{AUX}}{37*T_{ADV}} \tag{3}\] \begin{table}
\begin{tabular}{c c} \hline \hline
**Terms** & **Denotion** \\ \hline \(T_{ADV}\) & AdvInterval \\ \(\tau\) & Advertising period per channel \\ \(\beta\) & Waiting time for the response on each channel \\ \(\omega_{SW}\) & ScanWindow \\ \(T_{SIN}\) & ScanInterval \\ \(N\) & Number of the nodes in a domain \\ \(N_{r}\) & Number of relay nodes in a domain \\ \(\tau_{AUX}\) & Transmission time for the AUX_ADV_IND packet \\ \(P_{coll\_ADV}\) & Probability of the ADV_EXT_IND packet collision \\ \(P_{succ\_ADV}\) & Probability of the ADV_EXT_IND packet being received successfully \\ \(P_{coll\_AUX}\) & Probability of the AUX_ADV_IND packet collision \\ \(P_{succ\_AUX}\) & Probability of the AUX_ADV_IND packet being received successfully \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The terms utilized in the analysis. Similarly, the probability that the relay node can receive the AUX_ADV_IND packet successfully \(P_{succ\_AUX}\) can be derived as  
\[ \begin{split} P_{succ\_AUX}=(1-P_{coll\_AUX})^{\frac{N-N_{r}}{N_{ r}}-1}\\ =(\frac{37*T_{ADV}-2\tau_{AUX}}{37*T_{ADV}})^{\frac{N-2N_{r}}{N_{ r}}}\end{split}  \tag{4}\]  
The probability that all the nodes in the domain are discovered at least by one relay node can be expressed as  
\[ \begin{split} P_{succ\_N}=(P_{succ\_AUX}*P_{succ\_AUX})^{N-N_{ r}}\\ =(\frac{(37*T_{ADV}-2\tau_{AUX})(T_{ADV}-2\tau)}{37*T_{ADV}^{2}}) ^{\frac{(N-2N_{r})(N-N_{r})}{N_{r}}}\end{split}  \tag{5}\]  
In [15], we proposed a performance analysis model for BLE neighbor discovery based on the Chinese Remainder Theory (CRT). For asynchronous neighbor discovery protocols, CRT guarantees the successful discovery between nodes in every \(n_{i}n_{j}\) period under the condition that \(n_{i}\) and \(n_{j}\) are coprime. Here, \(n_{i}\) and \(n_{j}\) denote the duty cycle of each node. The advertiser starts its advertising at \(t_{0}\), and the scanner starts its scanning at \(t_{1}\). Using the latency analysis method in [15], we have the CRT solution on each primary channel  
\[ \begin{split} x_{on}^{37}&=\Gamma(t_{0},t_{1},\frac {T_{ADV}}{\tau},\frac{3T_{SIN}}{\omega_{SW}})\\ x_{on}^{38}&=\Gamma(t_{0}+\tau+\beta,t_{1}+T_{SIN}, \frac{T_{ADV}}{\tau},\frac{3T_{SIN}}{\omega_{SW}})\\ x_{on}^{39}&=\Gamma(t_{0}+2(\tau+\beta),t_{1}+2T_{ SIN},\frac{T_{ADV}}{\tau},\frac{3T_{SIN}}{\omega_{SW}})\end{split}