<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JCC</journal-id><journal-title-group><journal-title>Journal of Computer and Communications</journal-title></journal-title-group><issn pub-type="epub">2327-5219</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jcc.2020.812020</article-id><article-id pub-id-type="publisher-id">JCC-106311</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  Accurate Analysis on Bluetooth Low Energy Neighbor Discovery
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Ting-Chao</surname><given-names>Hou</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Kuo-Chang</surname><given-names>Huang</given-names></name><xref ref-type="aff" rid="aff2"><sup>2</sup></xref></contrib></contrib-group><aff id="aff2"><addr-line>Department of Computer Science and Information Engineering, National Chung Cheng University, Taiwan</addr-line></aff><aff id="aff1"><addr-line>Department of Communications Engineering, National Chung Cheng University, Taiwan</addr-line></aff><pub-date pub-type="epub"><day>30</day><month>11</month><year>2020</year></pub-date><volume>08</volume><issue>12</issue><fpage>231</fpage><lpage>250</lpage><history><date date-type="received"><day>24,</day>	<month>November</month>	<year>2020</year></date><date date-type="rev-recd"><day>28,</day>	<month>December</month>	<year>2020</year>	</date><date date-type="accepted"><day>31,</day>	<month>December</month>	<year>2020</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  The basic concept of Bluetooth Low Energy (BLE) is short packet transmission and transient connection. It can quickly establish a connection, send data, and quickly disconnect, so that neighbor discovery is frequent and becomes an important issue. In the neighbor discovery which includes advertising and scanning, the BLE specification defines several important parameters. The parameters on the advertiser side include advertising interval, advertising duration, etc. On the scanner side, there are scan interval, scan window, etc. How to configure these parameters for quick neighbor discovery has been troublesome for BLE implementers. Prior analyses on BLE discovery process also showed some disagreements or made some incorrect assumptions. In this paper, we use rigorous probability-theory based derivations to obtain different kinds of successful discovery probabilities. We clarify disagreements in prior works and also provide insights on how to configure parameters for maximizing discovery probability. In particular, we prove that the discovery probabilities on each of the three channels are correlated. We also find that, when the advertising duration is set close to some multiples of the scan interval, an ill-fated synchronization problem will occur. To have a high discovery probability, both scan window and scan interval should be set at a large value, though it might not be good for energy saving.
 
</p></abstract><kwd-group><kwd>Bluetooth Low Energy</kwd><kwd> Advertising Interval</kwd><kwd> Advertising Duration</kwd><kwd> Advertising Event</kwd><kwd> Scan Interval</kwd><kwd> Scan Window</kwd><kwd> Neighbor Discovery</kwd><kwd> Ill-Fated Synchronization</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>It has been nearly 30 years since the Bluetooth short range wireless communication technology was proposed in the early 1990s. Over the years, Bluetooth technology has progressed from solving the cabling issue between the host computer and its peripheral devices to being widely used in various communication applications for personal hand-held devices. Because Bluetooth has been used mostly in battery-powered devices, the Bluetooth SIG (Special Interest Group) issued the Bluetooth 4.0 specification in 2010 for low power operation of Bluetooth [<xref ref-type="bibr" rid="scirp.106311-ref1">1</xref>]. It has been generally referred to as BLE (Bluetooth Low Energy).</p><p>Many BLE applications are run between battery-powered portable devices. Before any kind of connections can be set up, a pair of BLE devices need to go through the neighbor discover process to know the existence of each other. BLE specifications allocate three (37, 38, 39) out of the 40 total channels for discovery. One device does the advertising on the three channels alternately and the other device does the scanning also on the three channels alternately. Since the two devices are not synchronous, they need to be in the matching roles (one advertising and the other scanning) and at the right time and the right place (on the same channel) for the discovery to be successful. If one round of advertising does not result in successful discovery, a random delay is introduced before the next round so that a different advertising/scanning matching is tried. This is different from the infrastructure-mode WiFi (Wireless Fidelity), where an always-on access point (AP) exists and serves as a reference point for other WiFi stations to scan and connect to. Several advertising/scanning parameters (e.g., advertising interval, advertising duration, scan interval, scan window) are involved in the BLE discovery process. BLE specifications do not mandate each parameter’s value but rather provide a range of possible values for each parameter so that different applications can choose their appropriate ones. However, this also causes headaches for BLE implementers as the dimension of parameter values is too large to handle. Many rely on trial and error. It is desirable to have some parameter-setting guidance so that an efficient BLE neighbor discovery process can be realized and the power consumption is minimized.</p><p>There have been quite a few studies on analyzing the performance of the BLE discovery process. The performance metrics include successful discovery probability, discovery latency, and power consumption. In [<xref ref-type="bibr" rid="scirp.106311-ref2">2</xref>] [<xref ref-type="bibr" rid="scirp.106311-ref3">3</xref>], a 1:1 (one advertiser and one scanner) scenario is considered. The discovery latency is analyzed but its accuracy deteriorates when the advertising interval is larger than the scan window in the discontinuous scanning scenario. In [<xref ref-type="bibr" rid="scirp.106311-ref4">4</xref>], the n:1 (n advertisers and one scanner) scenario is considered. The authors use the classical Aloha model to derive the discovery latency. An enhanced mechanism is also proposed enabling BLE scanner to learn the network condition and adjust parameters accordingly. However, the analysis is still limited to the continuous scanning scenario. In [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.106311-ref6">6</xref>], more general m:n scenarios are considered. The successful discovery probabilities on each of the three channels are first derived and then the discovery latency is calculated. The derived successful discovery probabilities on each of the three channels are different. The authors also assume that successful discovery on the three channels within an advertising event are independent probability events. These are somewhat against the intuition. In [<xref ref-type="bibr" rid="scirp.106311-ref7">7</xref>], a wait-slot scheme is proposed for the neighbor discovery process in the n:1 scenario so that the collisions of response packets can be reduced. In the analysis, the probabilities of successful advertising on each of the three channels are shown to be identical. In [<xref ref-type="bibr" rid="scirp.106311-ref8">8</xref>], the authors propose a method to determine an optimal value for the BLE advertising interval to minimize the time in which all surrounding BLE advertisers are discovered by a scanner. The analysis is limited to the continuous scanning scenario. In [<xref ref-type="bibr" rid="scirp.106311-ref9">9</xref>], an energy model of BLE is presented. It accounts for all BLE parameters and all operating modes. To be able to calculate the energy consumption in the discovery process, the discovery latency needs to be calculated first, which an algorithm based on Gaussian approximation for sum of random delays in the advertising events is used. The latency result is compared to that in [<xref ref-type="bibr" rid="scirp.106311-ref3">3</xref>] and significant discrepancy is obvious. Sudden latency jumps at some parameter settings are observed but no satisfactory explanations are given. In [<xref ref-type="bibr" rid="scirp.106311-ref10">10</xref>], different device discovery schemes in BLE networks are surveyed with their advantages and limitations discussed.</p><p>From the above literature survey, we identified several issues worthy of more careful investigation. First, there is disagreement on the successful discovery probabilities on individual channels within an advertising event (to be more thoroughly explained in the next section). Second, individual channel discoveries are assumed to occur independently. Third, there are some abrupt changes in discovery probability and discovery latency at certain parameter settings, which none of prior works can explain. There is still not much insight shed on proper setting of discovery parameters. In this paper, we address all the above and claim the following contributions:</p><p>1) We give a rigorous proof that the successful discovery probabilities on three individual channels within an advertising event are the same.</p><p>2) We show that successful discovery on an individual channel is dependent on the discovery result on the prior channel within the same advertising event.</p><p>3) We find the successful discovery probability for an advertising event (which includes discoveries on three individual channels) and show what discovery related parameter settings are to avoid. The rest of this paper is organized as follows: In Section 2, we give a short introduction on the BLE discovery operation. Section 3 first reviews certain prior analyses to get a feel about how they might go wrong, and then we use rigorous probability-theory based derivations to obtain different kinds of successful discovery probabilities. Section 4 shows verification of the analysis by simulations. Section 5 is the conclusion.</p></sec><sec id="s2"><title>2. BLE Discovery</title><p>BLE minimizes the device power consumption by allowing devices to go into the sleep state. When devices attempt to communicate with each other, they wake up to discover each other. Three channels (channels 37, 38, and 39) are allocated for the discovery purpose. Consider the scenario of two BLE devices. One device enters the advertising state and periodically sends advertising PDUs (protocol data units; or simply called packets) on the three advertising channels. The other device enters the scanning state or the initiating state. It also takes turn scanning on the three advertising channels. There are 4 types of packets that the advertiser may send to start the discovery: ADV_SCAN_IND, ADV_DIRECT_IND, ADV_NONCONN_IND, andADV_IND. ADV_SCAN_IND is for scanning only. A device entering the scanning state (a scanner) can respond to it with a SCAN_REQ packet to request further information. The advertiser will then reply with a SCAN_RSP packet. ADV_DIRECT_IND is for fast connection setup. A device entering the initiating state (an initiator) can respond with CONNECT_REQ to quickly set up a connection with the advertiser. ADV_NONCONN_IND is for one-way advertising only. Subsequent scan or connect request is not allowed. ADV_IND is the general-purpose advertising packet. Scanner/initiator can reply with a scan/connect request. The discovery process between an advertiser and a scanner via ADV_SCAN_IND/ADV_IND - SCAN_REQ-SCAN_RSP exchange is the most lengthy one and is usually used as the example scenario for BLE discovery analysis. Our analysis in later sections also assumes this type of packet exchange. It can be easily modified to adapt to other types of advertising packet exchanges.</p><p><xref ref-type="fig" rid="fig1">Figure 1</xref> illustrates the timing sequence of advertising and scanning. An advertiser sends three identical ADV_IND packets sequentially over channels ch37, ch38, and ch39. This is called an advertising event (advEvent, in short). There is a fixed time gap between consecutive ADV_IND packets to allow for send/receive of corresponding SCAN_REQ and SCAN_RSP packets. We call it advertising duration (advDuration), specified to be no larger than 10 ms. Two adjacent advEvents are separated by a fixed advertising interval (advInterval) and a random advertising delay. advInterval can be chosen to be from 20 ms to 10.24 s, with increment in 0.625 ms. The random advertising delay is to decouple the possible correlation between advEvents from the same advertiser or from different advertisers. Without it, advertising/scanning channel mismatch or packet collisions may repeat over and over again. Random advertising delay is chosen uniformly from [0, 10 ms].</p><p>A scanner listens on channels ch37, ch38, ch39 alternately for advertising packets. It switches scanning channels at every scan interval (scanInterval). In each scanInterval, it listens only for a duration of the scan window (scanWindow). The idle time in the scanInterval can save energy and reduce reply competitions among multiple scanners, if any. When an advertiser advertises and a scanner scans on the same channel, and the advertising packet is successfully received by the scanner, the scanner will reply with a SCAN_REQ. The advertiser then replies with a SCAN_RSP to complete the discovery process.</p><p>For later analysis, we need a reference to the duration of a complete discovery process. We use the ADV_IND - SCAN_REQ - SCAN_RSP exchange as an example. The maximum lengths of ADV_IND, SCAN_REQ,SCAN_RSP packets are 47, 22, 47 bytes, respectively. At the 1Mbps channel rate, their transmission times are 376, 176, 376 us, respectively. There is also a 150 us IFS (inter-frame space) between packet transmissions. Therefore, a complete discovery process for this example takes 0.376 + 0.150 + 0.176 + 0.150 + 0.376 = 1.228 ms.</p></sec><sec id="s3"><title>3. Analyses on Successful Discovery</title><p>To facilitate comparisons with [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>], we adopt most of the mathematical symbols used there. They are listed in <xref ref-type="table" rid="table1">Table 1</xref>. Our analysis is applicable to the one advertiser and one scanner (1:1) scenario only.</p><sec id="s3_1"><title>3.1. Review of Prior Works</title><p><xref ref-type="fig" rid="fig2">Figure 2</xref> shows the time sequence of a BLE device A 1 as an advertiser, and another BLE device S 1 being a scanner. In this example, τ S I &gt; τ S W (discontinuous scanning), and τ S I &gt; τ W A . We notice that the arrival time of the first Ch37 ADV_IND packet falls within the Ch37 scanning window of device S 1 , but the second Ch37 ADV_IND packet arrives when device S 1 is in the power-saving state. To simplify the discussion, we temporarily assume τ S W = τ S I (continuous scanning). Under the assumption, device S 1 is always doing scanning and never enters the power-saving state. ADV_IND packets always arrive at one of the three scanning windows (<xref ref-type="fig" rid="fig3">Figure 3</xref>).</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Symbols used in this paper for BLE discovery analysis</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Notation</th><th align="center" valign="middle" >Meaning</th><th align="center" valign="middle" >Recommended Values</th></tr></thead><tr><td align="center" valign="middle" >τ W A</td><td align="center" valign="middle" >Length of advertising duration</td><td align="center" valign="middle" >≤10 ms</td></tr><tr><td align="center" valign="middle" >τ A I</td><td align="center" valign="middle" >Length of advertising interval</td><td align="center" valign="middle" >[20, 10, 240] ms</td></tr><tr><td align="center" valign="middle" >τ S I</td><td align="center" valign="middle" >Length of scanning interval</td><td align="center" valign="middle" >[2.5, 10, 240] ms</td></tr><tr><td align="center" valign="middle" >τ S W</td><td align="center" valign="middle" >Length of scanning window</td><td align="center" valign="middle" >[2.5, 10, 240] ms</td></tr><tr><td align="center" valign="middle" >T S</td><td align="center" valign="middle" >Time for discovery packets exchange</td><td align="center" valign="middle" >≤1.228 ms</td></tr><tr><td align="center" valign="middle" >τ S W ′</td><td align="center" valign="middle" >Length of effective scan window</td><td align="center" valign="middle" >τ S W ′ = τ S W − T S</td></tr><tr><td align="center" valign="middle" >t 0</td><td align="center" valign="middle" >Arrival time of ch37 ADV_IND packet</td><td align="center" valign="middle" ></td></tr><tr><td align="center" valign="middle" >α 1 , α 2 , α 3</td><td align="center" valign="middle" >Successful discovery probability on channel 37, 38, 39</td><td align="center" valign="middle" ></td></tr></tbody></table></table-wrap><p>This is the scenario considered in Section 4.1.1 of [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>]: 1:1 Network (one advertiser and one scanner. In [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>], four events are defined. Among them, two are relevant to the successful discovery in a 1:1 Network.</p><p>E 1 : S 1 is synchronous with A 1 , meaning a channel x (x = 37, 38, or 39) ADV_IND packet arrives when the scanner is also scanning channel x.</p><p>E 4 : S 1 has enough time to reply to ADV_IND before the current scan window ends.</p><p>In a 1:1 Network, the necessary and sufficient condition of a successful discovery is E 1 ∩ E 4 . In continuous scanning, Pr [ E 1 ] = τ S W / 3 τ S I = 1 / 3 since we assume τ S W = τ S I . For E 4 to occur, the remaining time in the scan window when the ADV_IND first arrives at the scanner must be greater than T S , the time required for the ADV_IND packet to be successfully received by S 1 and the subsequent SCAN_REQ and SCAN_RSP exchanges between A 1 and S 1 to be completed. Let t 0 be the arrival time of channel 37 ADV_IND packet. Hence, Pr [ E 4 ] = Pr [ τ S W − t 0 &gt; T S ] = Pr [ t 0 &lt; τ S W − T S ] = ( τ S W − T S ) / τ S I . Therefore, the probability that a channel 37 discovery is successful is</p><p>α 1 = Pr [ E 1 ∩ E 4 ] = Pr [ E 1 ] Pr [ E 4 ] = 1 / 3 ( τ S W − T S ) / τ S I (1)</p><p>(because E 1 and E 4 are independent events), which is identical to Equation (1) in [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>] and Equation (3) in [<xref ref-type="bibr" rid="scirp.106311-ref6">6</xref>].</p><p>Using the same argument that E 1 ∩ E 4 is what makes a successful discovery, the probability that the second (on channel 38) ADV_IND results in a successfully discovery is α 2 = Pr [ E 1 ∩ E 4 ] = 1 / 3 Pr [ τ S W − t 0 − τ W A &gt; T S ] = 1 / 3 Pr [ t 0 &lt; τ S W − τ W A − T S ] , or</p><p>α 2 = ( τ S W − τ W A − T S ) / 3 τ S I , (2)</p><p>which is Equation (2) in [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>] and Equation (4) in [<xref ref-type="bibr" rid="scirp.106311-ref6">6</xref>]. Similarly, the probability that the third (on channel 39) ADV_IND results in a successfully discovery is</p><p>α 3 = Pr [ E 1 ∩ E 4 ] = 1 / 3 Pr [ τ S W − t 0 − 2 τ W A &gt; T S ] = 1 / 3 Pr [ t 0 &lt; τ S W − 2 τ W A − T S ] = ( τ S W − 2 τ W A − T S ) / 3 τ S I .</p><p>In the above discussion, we assume τ S I &gt; τ W A . On the other hand, if we consider τ S I &lt; τ W A , <xref ref-type="fig" rid="fig4">Figure 4</xref> shows a possible scenario. α 1 remains unchanged as 1 / 3 ( τ S W − T S ) / τ S I , but α 2 = 1 / 3 Pr [ t 0 + τ W A &lt; τ S I + τ S W − T S ] = 1 / 3 Pr [ t 0 &lt; τ S I + τ S W − τ W A − T S ] , or</p><p>α 2 = ( τ S I + τ S W − τ W A − T S ) / 3 τ S I , (3)</p><p>which matches Equation (2) in [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>] and Equation (4) in [<xref ref-type="bibr" rid="scirp.106311-ref6">6</xref>]. It however is different from Equation (2) above. In other words, [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.106311-ref6">6</xref>] showed that α 2 and α 3 not only are different from α 1 , but are also dependent on the relation between τ S I and τ W A . On the other hand, [<xref ref-type="bibr" rid="scirp.106311-ref7">7</xref>] claimed that α 1 , α 2 , α 3 are equal.</p><p>It is necessary to have some explanations as to why the single-channel successful discovery probability is dependent on the relation between τ S I and τ W A , and also why there is disagreement between [<xref ref-type="bibr" rid="scirp.106311-ref7">7</xref>] and [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.106311-ref6">6</xref>]. There must be something wrong somewhere in the derivation of the successful discovery probabilities. We next show that successful discovery probabilities are independent of the relation between τ S I and τ W A , and in fact the three probabilities α 1 , α 2 , α 3 are equal.</p></sec><sec id="s3_2"><title>3.2. Probability of a Successful Single-Channel Discovery</title><p>We first use a simple argument to explain why successful single-channel discovery probabilities α 1 , α 2 , α 3 are equal. The conditions that the advertiser A 1 ’s Ch37 ADV_IND results in a successful discovery by the scanner S 1 are: 1) A 1 ’s Ch37 ADV_IND is successfully received by S 1 and 2) the subsequent exchange of SCAN_REQ and SCAN_RSP are also successful. We call the two conditions an event E c h 37 occurs. E c h 37 occurs when the arrival time ( t 0 ) of Ch37 ADV_IND falls within the Ch37 scan window but at least T S time before the scan window ends. Since the scan interval is periodically repeating at three times of the scan interval ( τ S I ), it suffices to consider a scan cycle τ S C ( = 3 τ S I ) , which t 0 might fall within. After a successful reception of the ADV_IND, the subsequent exchange of SCAN_REQ and SCAN_RSP will always be successful because there are no other devices to interfere with their transmission/reception. Therefore the probability that A 1 ’s Ch37 ADV_IND results in a successful discovery by S 1 , α 1 = ( τ S W − T S ) / τ S C = ( τ S W − T S ) / 3 τ S I . The argument and the result are no different from [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.106311-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.106311-ref7">7</xref>]. For ADV_IND event on Ch38, by considering that the arrival time of Ch38 ADV_IND at S 1 is also randomly distributed within τ S C , the probability that A 1 ’s Ch38 ADV_IND results in a successful discovery by S 1 is α 2 = ( τ S W − T S ) / 3 τ S I . Similarly for Ch39, α 3 = ( τ S W − T S ) / 3 τ S I . Though α 1 = α 2 = α 3 , their corresponding events are not independent.</p><p>What is wrong in the derivation of α 2 and α 3 in [<xref ref-type="bibr" rid="scirp.106311-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.106311-ref6">6</xref>] is that they assume the prior Ch37 ADV_IND arrival time ( t 0 ) is either in the S 1 ’s Ch38 (Ch39) scanning window (e.g., the second Ch38 ADV_IND in <xref ref-type="fig" rid="fig3">Figure 3</xref>), or in the S 1 ’s Ch37 scanning window (e.g., the first Ch38 ADV_IND in <xref ref-type="fig" rid="fig4">Figure 4</xref>). These are probabilities under certain implied conditions. In fact, t 0 can be in any scanning windows or even in the power-saving window for a successful Ch38 (or Ch39) discovery.</p></sec><sec id="s3_3"><title>3.3. Dependency between Adjacent Successful Discoveries</title><p>In this section, we first show that there is a dependency between adjacent successful discovery events. We then prove with rigorous probability derivations that successful single-channel discovery probabilities are equal. Previously we define E c h 37 as the event that a Ch37 discovery succeeds. Similarly, let E c h 38 , E c h 39 be the event that a Ch38, Ch39 discovery succeeds, respectively. Here E c h 37 , E c h 38 , E c h 39 are restricted to be the three successful discovery events (in the context of probability) in the same advertising event (advEvent). We now discuss the dependency of E c h 38 on E c h 37 . We do not apply any restriction to the relationship among τ W A , τ S W , τ S I , except that τ S W ≤ τ S I , by system design. Without loss of generality, let time 0 be the start time of S 1 ’s Ch37 scanning window which event E c h 37 occurs. t 0 falls within (0, τ S W − T S ). That is,</p><p>0 &lt; t 0 &lt; τ S W − T S (4)</p><p>Then event E c h 38 occurs if t 0 + τ W A falls within any one of the ( i τ S C + τ S I , i τ S C + τ S I + τ S W − T S ), i = 0 , 1 , 2 , 3 , ⋯ , or</p><p>i τ S C + τ S I − τ W A &lt; t 0 &lt; i τ S C + τ S I + τ S W − T S − τ W A (5)</p><p>The term i τ S C accounts for the multiple candidate Ch38 scanning windows after the first Ch37 scanning window. For example, consider i = 0. <xref ref-type="fig" rid="fig5">Figure 5</xref> shows a scenario where intervals specified by (4) and (5) overlap. <xref ref-type="fig" rid="fig5">Figure 5</xref> is a case with τ W A &gt; τ S I . The blue solid interval is due to (4) and the red dashed interval is due to (5) with i = 0. We note that the two intervals specified by (4) and (5) are of equal length. When τ W A = τ S I , the two intervals completely overlap. When τ W A &lt; τ S I , the red dashed interval shifted to the right and its left edge is greater than 0. For i&gt; 0, overlapping intervals also exist for larger values of τ W A .</p><p>Given Equation (4) (event E c h 37 occurs), Equation (5) may hold (i.e., event E c h 38 occurs) only when the two intervals specified by (4) and (5) overlap, or in other words, if (4)’s upper bound is greater (5)’s lower bound (expressed in Equation (6)) AND (5)’s upper bound is greater than (4)’s lower bound (expressed in Equation (7)).</p><p>τ S W − T S &gt; i τ S C + τ S I − τ W A ,or τ W A &gt; i τ S C + τ S I − ( τ S W − T S ) (6)</p><p>i τ S C + τ S I + τ S W − T S − τ W A &gt; 0 , or τ W A &lt; i τ S C + τ S I + ( τ S W − T S ) (7)</p><p>In the BLE specification, τ W A ≤ 10   ms , and the maximum possible T S = 1.228   ms . For the complete discovery procedure (ADV_IND, SCAN_REQ, and SCAN_RSP successfully finish their transmission and reception) to have a chance to succeed, both τ S W and τ W A must be greater than T S . That is, τ S W − T S &gt; 0 and τ W A − T S &gt; 0 . Define the effective scan window τ S W ′ = τ S W − T S . Then (6) and (7) can be combined into</p><p>i τ S C + τ S I − τ S W ′ &lt; τ W A &lt; i τ S C + τ S I + τ S W ′ (8)</p><p>Equation (8) specifies the possible intervals for τ W A such that event E c h 38 may</p><p>occur. We first consider i = 0. τ S I − τ S W ′ &lt; τ W A &lt; τ S I + τ S W ′ . There are two distinct cases.</p><p>1) τ S I − τ S W ′ ≤ τ W A ≤ τ S I : The intersection of the intervals specified by (4) and (5) is ( τ S I − τ W A , τ S W − T S ) .</p><p>Pr [ E c h 38 | E c h 37 ] = ( τ S W − T S − τ S I + τ W A ) / ( τ S W − T S ) .</p><p>2) τ S I &lt; τ W A ≤ τ S I + τ S W ′ : The intersection of the intervals specified by (4) and (5) is ( 0 , τ S I + τ S W − T S − τ W A ) .</p><p>Pr [ E c h 38 | E c h 37 ] = ( τ S I + τ S W − T S − τ W A ) / ( τ S W − T S ) .</p><p>We next consider i = 1. That is, E c h 38 may occur in the next scan cycle. τ S C + τ S I − τ S W ′ &lt; τ W A &lt; τ S C + τ S I + τ S W ′ .</p><p>3) τ S C + τ S I − τ S W ′ &lt; τ W A &lt; τ S C + τ S I : The intersection of the intervals specified by (4) and (5) is ( τ S C + τ S I − τ W A , τ S W − T S ) .</p><p>Pr [ E c h 38 | E c h 37 ] = ( τ S W − T S − τ S C − τ S I + τ W A ) / ( τ S W − T S ) .</p><p>1) τ S C + τ S I &lt; τ W A &lt; τ S C + τ S I + ( τ S W − T S ) : The intersection of the intervals specified by (4) and (5) is ( 0 , τ S C + τ S I + τ S W − T S − τ W A ) .</p><p>Pr [ E c h 38 | E c h 37 ] = ( τ S C + τ S I + τ S W − T S − τ W A ) / ( τ S W − T S ) .</p><p>Continue on. We consider i = 2 , 3 , 4 , ⋯ . That is, E c h 38 may occur in the third, fourth, fifth, … scan cycle. Following the same approach as above, it should not be too difficult to verify that there is a general formula for the conditional probability Pr [ E c h 38 | E c h 37 ] .</p><p>2) i τ S C + τ S I − τ S W ′ &lt; τ W A &lt; i τ S C + τ S I :</p><p>Pr [ E c h 38 | E c h 37 ] = ( τ S W − T S − i τ S C − τ S I + τ W A ) / ( τ S W − T S ) .</p><p>3) i τ S C + τ S I &lt; τ W A &lt; i τ S C + τ S I + τ S W ′ :</p><p>Pr [ E c h 38 | E c h 37 ] = ( i τ S C + τ S I + τ S W − T S − τ W A ) / ( τ S W − T S ) .</p><p><xref ref-type="fig" rid="fig6">Figure 6</xref> shows the conditional probability Pr [ E c h 38 | E c h 37 ] as a function of τ W A . Note that in the BLE specification, τ W A ≤ 10   ms , and τ S I ≥ τ S W &gt; T S = 1.228   ms . Since the successful discovery probability for a single channel is proportional to τ S W − T S , a reasonable τ S W value should be greater than 1.5 ms. Therefore in reality i τ S C + τ S I − τ S W ′ is greater than 10 ms if i&gt; 2. Hence the probability of E c h 38 occurring in the third scan cycle and after is negligible.</p><p>Next, we consider the case that E c h 37 does not occur, specified by E c h 37 &#175; . t 0 falls within ( τ S W − T S , 3 τ S I ). Then E 38 occurs if t 0 + τ W A falls within any one of the intervals ( i τ S C + τ S I , i τ S C + τ S I + τ S W − T S ), i = 0 , 1 , 2 , 3 , ⋯ , or</p><p>τ S W − T S &lt; t 0 &lt; 3 τ S I (9)</p><p>i τ S C + τ S I − τ W A &lt; t 0 &lt; i τ S C + τ S I + τ S W − T S − τ W A (10)</p><p>The condition that the two intervals specified by (9) and (10) overlap is</p><p>( i − 1 ) τ S C + τ S I &lt; τ W A &lt; i τ S C + τ S I , i = 0 , 1 , 2 , 3 , ⋯ (11)</p><p>The condition that the two intervals specified by (9) and (10) overlap is</p><p>( i − 1 ) τ S C + τ S I &lt; τ W A &lt; i τ S C + τ S I , i = 0 , 1 , 2 , 3 , ⋯ (11)</p><p>We first consideri = 0. Equation (11) becomes − 2 τ S I &lt; τ W A &lt; τ S I . But τ W A is always positive. We then consider two distinct cases.</p><p>1) 0 ≤ τ W A ≤ τ S I − τ S W ′ : The intersection of the intervals specified by (9) and (10) is ( τ S I − τ W A , τ S I − τ W A + τ S W − T S ) .</p><p>Pr [ E c h 38 | E c h 37 &#175; ] = ( τ S W − T S ) / ( 3 τ S I − τ S W + T S ) .</p><p>2) τ S I − τ S W ′ &lt; τ W A ≤ τ S I : The intersection of the intervals specified by (9) and (10) is ( τ S W − T S , τ S I + τ S W − T S − τ W A ) .</p><p>Pr [ E c h 38 | E c h 37 &#175; ] = ( τ S I − τ W A ) / ( 3 τ S I − τ S W + T S ) .</p><p>We next consider i = 1. Equation (11) becomes τ S I &lt; τ W A &lt; τ S C + τ S I . We consider three cases.</p><p>1) τ S I &lt; τ W A &lt; τ S I + τ S W ′ : The intersection of the intervals specified by (9) and (10) is ( τ S C + τ S I − τ W A , τ S C ) .</p><p>Pr [ E c h 38 | E c h 37 &#175; ] = ( τ W A − τ S I ) / ( 3 τ S I − τ S W + T S ) .</p><p>2) τ S I + τ S W ′ &lt; τ W A &lt; τ S C + τ S I − τ S W ′ : The intersection of the intervals specified by (9) and (10) is ( τ S C + τ S I − τ W A , τ S C + τ S I − τ W A + τ S W − T S ) .</p><p>Pr [ E c h 38 | E c h 37 &#175; ] = ( τ S W − T S ) / ( 3 τ S I − τ S W + T S ) .</p><p>3) τ S C + τ S I + τ S W ′ &lt; τ W A &lt; τ S C + τ S I : The intersection of the intervals specified by (9) and (10) is ( τ S W − T S , τ S C + τ S I + τ S W − T S − τ W A ) .</p><p>Pr [ E c h 38 | E c h 37 &#175; ] = ( τ S C + τ S I − τ W A ) / ( 3 τ S I − τ S W + T S ) .</p><p>Continue on. We consider i = 2 , 3 , 4 , ⋯ . Following the same approach as above, the general formula for the conditional probability Pr [ E c h 38 | E c h 37 &#175; ] is:</p><p>1) ( i − 1 ) τ S C + τ S I &lt; τ W A &lt; ( i − 1 ) τ S C + τ S I + τ S W ′</p><p>Pr [ E c h 38 | E c h 37 &#175; ] = ( τ W A − τ S I − ( i − 1 ) τ S C ) / ( 3 τ S I − τ S W + T S ) .</p><p>2) ( i − 1 ) τ S C + τ S I + τ S W ′ &lt; τ W A &lt; i τ S C + τ S I − τ S W ′ :</p><p>Pr [ E c h 38 | E c h 37 &#175; ] = ( τ S W − T S ) / ( 3 τ S I − τ S W + T S ) .</p><p>3) i τ S C + τ S I − τ S W ′ &lt; τ W A &lt; i τ S C + τ S I :</p><p>Pr [ E c h 38 | E c h 37 &#175; ] = ( i τ S C + τ S I − τ W A ) / ( 3 τ S I − τ S W + T S ) .</p><p><xref ref-type="fig" rid="fig7">Figure 7</xref> shows the conditional probability Pr [ E c h 38 | E c h 37 &#175; ] as a function of τ W A . We observe that it is to some degree complementary with Pr [ E c h 38 | E c h 37 ] in <xref ref-type="fig" rid="fig6">Figure 6</xref>.</p><p>We now verify that the unconditional ch38 discovery probability Pr [ E c h 38 ] is the same as the unconditional ch37 discovery probability Pr [ E c h 37 ] , regardless of the value of τ W A . Due to the periodicity of Pr [ E c h 38 | E c h 37 ] and Pr [ E c h 38 | E c h 37 &#175; ] , shown in <xref ref-type="fig" rid="fig6">Figure 6</xref> and <xref ref-type="fig" rid="fig7">Figure 7</xref>, we need only to consider three cases.</p><p>1) τ S I − τ S W ′ ≤ τ W A ≤ τ S I :</p><p>Pr [ E c h 38 ] = Pr [ E c h 38 | E c h 37 ] ⋅ Pr [ E c h 37 ] + Pr [ E c h 38 | E c h 37 &#175; ] ⋅ Pr [ E c h 37 &#175; ] = ( τ S W − T S − τ S I + τ W A ) / ( τ S W − T S ) ⋅ ( τ S W − T S ) / 3 τ S I     + ( τ S I − τ W A ) / ( 3 τ S I − τ S W + T S ) ⋅ ( 3 τ S I − τ S W + T S ) / 3 τ S I = ( τ S W − T S ) / 3 τ S I</p><p>2) τ S I &lt; τ W A ≤ τ S I + τ S W ′ :</p><p>Pr [ E c h 38 ] = Pr [ E c h 38 | E c h 37 ] ⋅ Pr [ E c h 37 ] + Pr [ E c h 38 | E c h 37 &#175; ] ⋅ Pr [ E c h 37 &#175; ] = ( τ S I + τ S W − T S − τ W A ) / ( τ S W − T S ) ⋅ ( τ S W − T S ) / 3 τ S I       + ( τ W A − τ S I ) / ( 3 τ S I − τ S W + T S ) ⋅ ( 3 τ S I − τ S W + T S ) / 3 τ S I = ( τ S W − T S ) / 3 τ S I</p><p>3) τ S I + τ S W ′ &lt; τ W A &lt; τ S C + τ S I − τ S W ′ :</p><p>Pr [ E c h 38 ] = Pr [ E c h 38 | E c h 37 ] ⋅ Pr [ E c h 37 ] + Pr [ E c h 38 | E c h 37 &#175; ] ⋅ Pr [ E c h 37 &#175; ] = 0 ⋅ ( τ S W − T S ) / 3 τ S I       + ( τ S W − T S ) / ( 3 τ S I − τ S W + T S ) ⋅ ( 3 τ S I − τ S W + T S ) / 3 τ S I = ( τ S W − T S ) / 3 τ S I</p><p>In <xref ref-type="fig" rid="fig6">Figure 6</xref>, we see that Pr [ E c h 38 | E c h 37 ] is not equal to Pr [ E c h 38 ] , except for few values of τ W A . It clearly shows that event E c h 38 and event E c h 37 cannot be treated as independent events.</p><p>As to the joint behavior of ch37 and ch38 discoveries, we expect both to complement each other for maximum discovery probability. It is the probability of E c h 37 ∪ E c h 38 .</p><p>Pr [ E c h 37 ∪ E c h 38 ] = Pr [ E c h 37 ] + Pr [ E c h 38 ∩ E c h 37 &#175; ] = Pr [ E c h 37 ] + Pr [ E c h 38 | E c h 37 &#175; ] ⋅ Pr [ E c h 37 &#175; ]</p><p><xref ref-type="fig" rid="fig8">Figure 8</xref> plots Pr [ E c h 37 ∪ E c h 38 ] as a function of τ W A . It shows that τ W A should be chosen to be not in ( i τ S C − τ S W ′ , i τ S C + τ S W ′ ) , i = 0 , 1 , 2 , 3 , ⋯ for maximum discovery probability regarding the combined ch37 and ch38 discovery. In these situations, E c h 37 and E c h 38 are disjoint events. If ch37 discover succeeds, ch38 discovery will not, and vice versa. It achieves the maximum possible successful discovery probability for two successive discovery events.</p></sec><sec id="s3_4"><title>3.4. Dependency between Non-Adjacent Successful Discoveries</title><p>We now discuss the dependency of E c h 39 on E c h 37 . Event E c h 37 occurs when t 0 falls within (0, τ S W − T S ), previously specified in Equation (4). Then event E c h 39 occurs if t 0 + 2 τ W A falls within any one of the ( i τ S C + 2 τ S I , i τ S C + 2 τ S I + τ S W − T S ), i = 0 , 1 , 2 , 3 , ⋯ , or</p><p>i τ S C + 2 τ S I − 2 τ W A &lt; t 0 &lt; i τ S C + 2 τ S I + τ S W − T S − 2 τ W A ,     i = 0 , 1 , 2 , 3 , ⋯ (12)</p><p>Similar to the derivation in Section 3.3, given Equation (4) (event E c h 37 occurs), Equation (12) may hold (i.e., event E c h 39 occurs) only when the two intervals specified by (4) and (12) overlap, or in other words, if (4)’s upper bound is greater (12)’s lower bound (expressed in Equation (13)) and (12)’s upper bound is greater than (4)’s lower bound (expressed in Equation (14)).</p><p>τ S W ′ &gt; i τ S C + 2 τ S I − 2 τ W A or τ W A &gt; i τ S C / 2 + τ S I − τ S W ′ / 2 (13)</p><p>i τ S C + 2 τ S I + τ S W ′ − 2 τ W A &gt; 0 or τ W A &lt; i τ S C / 2 + τ S I + τ S W ′ / 2 (14)</p><p>which can be combined into</p><p>i τ S C / 2 + τ S I − τ S W ′ / 2 &lt; τ W A &lt; i τ S C / 2 + τ S I + τ S W ′ / 2 ,     i = 0 , 1 , 2 , 3 , ⋯ (15)</p><p>Due to the space limitation we directly give the general formulas for the conditional probability Pr [ E c h 39 | E c h 37 ] . The derivations follow the same approach as in Section 3.3,</p><p>1) i τ S C / 2 + τ S I − τ S W ′ / 2 &lt; τ W A &lt; i τ S C / 2 + τ S I :</p><p>Pr [ E c h 39 | E c h 37 ] = ( τ S W − T S − i τ S C − 2 τ S I + 2 τ W A ) / ( τ S W − T S ) .</p><p>2) i τ S C / 2 + τ S I &lt; τ W A &lt; i τ S C / 2 + τ S I + τ S W ′ / 2 :</p><p>Pr [ E c h 39 | E c h 37 ] = ( i τ S C + 2 τ S I + τ S W − T S − 2 τ W A ) / ( τ S W − T S ) .</p><p>The general formulas for the conditional probability Pr [ E c h 39 | E c h 37 &#175; ] are:</p><p>1) ( i τ S C − τ S I ) / 2 &lt; τ W A &lt; ( i τ S C − τ S I ) / 2 + τ S W ′ / 2 , i = 1 , 2 , 3 , ⋯</p><p>Pr [ E c h 39 | E c h 37 &#175; ] = ( 2 τ W A + τ S I − i τ S C ) / ( 3 τ S I − τ S W + T S ) .</p><p>2) ( i τ S C − τ S I ) / 2 + τ S W ′ / 2 &lt; τ W A &lt; i τ S C / 2 + τ S I − τ S W ′ / 2 , i = 0 , 1 , 2 , 3 , ⋯</p><p>Pr [ E c h 39 | E c h 37 &#175; ] = ( τ S W − T S ) / ( 3 τ S I − τ S W + T S ) .</p><p>3) i τ S C / 2 + τ S I − τ S W ′ / 2 &lt; τ W A &lt; i τ S C / 2 + τ S I , i = 0 , 1 , 2 , 3 , ⋯</p><p>Pr [ E c h 39 | E c h 37 &#175; ] = ( i τ S C + 2 τ S I − 2 τ W A ) / ( 3 τ S I − τ S W + T S ) .</p><p><xref ref-type="fig" rid="fig9">Figure 9</xref> shows the conditional probabilities Pr [ E c h 39 | E c h 37 ] and</p><p>Pr [ E c h 39 | E c h 37 &#175; ] as a function of τ W A . They show repeating pattern at the cycle of 1.5 τ S I . Readers can also verify that the unconditional ch39 discovery probability Pr [ E c h 39 ] is the same as the unconditional ch37 discovery probability Pr [ E c h 37 ] , regardless of the value of τ W A .</p><p>Pr [ E c h 39 ] = Pr [ E c h 39 | E c h 37 ] ⋅ Pr [ E c h 37 ] + Pr [ E c h 39 | E c h 37 &#175; ] ⋅ Pr [ E c h 37 &#175; ] = ( τ S W − T S ) / 3 τ S I</p></sec><sec id="s3_5"><title>3.5. Probability of at Least one Successful Single-Channel Discovery in an Advertising Interval</title><p>That the three consecutive ADV_IND packets in an advEvent are transmitted on different channels is to maximize the probability of discovery and therefore speed up the discovery process. This is equivalent to maximizing the probability of a union event E c h 37 ∪ E c h 38 ∪ E c h 39 , representing that at least one single-channel discovery succeeds in an advEvent. We call it a successful advEvent discovery.</p><p>Pr [ E c h 37 ∪ E c h 38 ∪ E c h 39 ] = Pr [ E c h 37 ] + Pr [ E c h 38 ] + Pr [ E c h 39 ] − Pr [ E c h 37 ∩ E c h 38 ]       − Pr [ E c h 37 ∩ E c h 39 ] − Pr [ E c h 38 ∩ E c h 39 ] + Pr [ E c h 37 ∩ E c h 38 ∩ E c h 39 ]</p><p>We have known that Pr [ E c h 37 ] = Pr [ E c h 38 ] = Pr [ E c h 39 ] = ( τ S W − T S ) / 3 τ S I . Pr [ E c h 37 ∩ E c h 38 ] = Pr [ E c h 38 | E c h 37 ] ⋅ Pr [ E c h 37 ] , and is plotted in <xref ref-type="fig" rid="fig7">Figure 7</xref>. Pr [ E c h 38 ∩ E c h 39 ] can be derived similar to Pr [ E c h 37 ∩ E c h 38 ] . Pr [ E c h 37 ∩ E c h 39 ] = Pr [ E c h 39 | E c h 37 ] ⋅ Pr [ E c h 37 ] is also known because we have derived Pr [ E c h 39 | E c h 37 ] . What is unknown is Pr [ E c h 37 ∩ E c h 38 ∩ E c h 39 ] .</p><p>E c h 37 ∩ E c h 38 ∩ E c h 39 occurs when Equation (4), Equation (5), and Equation (12) hold. From earlier discussion in Section 3.3, Pr [ E c h 37 ∩ E c h 38 ] is non-zero when</p><p>i τ S C + τ S I − τ S W ′ &lt; τ W A &lt; i τ S C + τ S I + τ S W ′ , i = 0 , 1 , 2 , 3 , ⋯</p><p>Taking i = 0 for example, we discuss two situations: τ S I − τ S W ′ ≤ τ W A ≤ τ S I and τ S I &lt; τ W A ≤ τ S I + τ S W ′ .</p><p>1) τ S I − τ S W ′ ≤ τ W A ≤ τ S I : The intersection of the intervals specified by (4) and (5) is ( τ S I − τ W A , τ S W − T S ) . For Equation (12) to also hold ( E c h 39 occurs), t 0 must be in ( 2 τ S I − 2 τ W A , 2 τ S I − 2 τ W A + τ S W ′ ) . The intersection of these two intervals is ( 2 τ S I − 2 τ W A , τ S W − T S ) and τ W A is further restricted to be τ S I − τ S W ′ / 2 ≤ τ W A ≤ τ S I . Therefore, we have Pr [ E c h 39 | E c h 37 ∩ E c h 38 ] = ( τ S W − T S − 2 τ S I + 2 τ W A ) / ( τ S W − T S − τ S I + τ W A ) , for τ S I − τ S W ′ / 2 ≤ τ W A ≤ τ S I . Previously, we have found that</p><p>Pr [ E c h 38 ∩ E c h 37 ] = ( τ S W − T S − τ S I + τ W A ) / 3 τ S I .</p><p>Therefore Pr [ E c h 37 ∩ E c h 38 ∩ E c h 39 ] = ( τ S W − T S − 2 τ S I + 2 τ W A ) / 3 τ S I , for τ S I − τ S W ′ / 2 ≤ τ W A ≤ τ S I .</p><p>2) τ S I &lt; τ W A ≤ τ S I + τ S W ′ : The intersection of the intervals specified by (4) and (5) is ( 0 , τ S I + τ S W − T S − τ W A ) . For Equation (12) to also hold, t 0 must be in ( 2 τ S I − 2 τ W A , 2 τ S I − 2 τ W A + τ S W − T S ) . The intersection of these two intervals is ( 0 , 2 τ S I − 2 τ W A + τ S W − T S ) and τ W A is further restricted to be τ S I ≤ τ W A ≤ τ S I + τ S W ′ / 2 . Therefore, we have Pr [ E c h 39 | E c h 37 ∩ E c h 38 ] = ( τ S W − T S − 2 τ S I + 2 τ W A ) / ( τ S W − T S − τ S I + τ W A ) , for τ S I ≤ τ W A ≤ τ S I + τ S W ′ / 2 . Previously, we have found that</p><p>Pr [ E c h 38 ∩ E c h 37 ] = ( τ S I + τ S W − T S − τ W A ) / 3 τ S I .</p><p>Therefore Pr [ E c h 37 ∩ E c h 38 ∩ E c h 39 ] = ( τ S W − T S + 2 τ S I − 2 τ W A ) / 3 τ S I , for τ S I ≤ τ W A ≤ τ S I + τ S W ′ / 2 .</p><p>Using similar technique we can find other Pr [ E c h 37 ∩ E c h 38 ∩ E c h 39 ] with i = 1 , 2 , 3 , ⋯ . With them calculated, we can finally obtain Pr [ E c h 37 ∪ E c h 38 ∪ E c h 39 ] as</p><p>1) | τ W A − τ S I − i τ S C | ≤ τ S W − T S , i = 0 , 1 , 2 , 3 , ⋯</p><p>Pr [ E c h 37 ∪ E c h 38 ∪ E c h 39 ] = ( τ S W − T S + 2 | τ S I + i τ S C − τ W A | ) / 3 τ S I .</p><p>2) | τ W A − τ S I − i τ S C / 2 | ≤ ( τ S W − T S ) / 2 , i = 0 , 1 , 2 , 3 , ⋯</p><p>Pr [ E c h 37 ∪ E c h 38 ∪ E c h 39 ] = ( 2 τ S W − 2 T S + 2 τ S I + i τ S C − 2 τ W A ) / 3 τ S I .</p><p>3) otherwise,</p><p>Pr [ E c h 37 ∪ E c h 38 ∪ E c h 39 ] = ( τ S W − T S ) / τ S I</p><p>This is the main result of this paper. <xref ref-type="fig" rid="fig1">Figure 1</xref>0 plots Pr [ E c h 37 ∪ E c h 38 ∪ E c h 39 ] , the probability of a successful advEvent discovery, as a function of τ W A . When τ W A coincides with τ S I + i τ S C , the probability of a successful advEvent discovery is minimized. This is the ill-fated synchronization between advertising and scanning. At best, only one of the three single-channel discoveries is successful. When τ W A coincides with τ S I + ( 2 i + 1 ) τ S C / 2 , the probability of a successful advEvent discovery can be doubled from the minimum value. Two out of the three single-channel discoveries may be successful. When τ W A is at a suitable distance away from the above two sets of “saddle points”, the probability of a</p><p>successful advEvent discovery is maximized at ( τ S W − T S ) / τ S I , which is three times of the minimum value. In this case, the three single-channel discoveries are disjoint events. They complement one another to make the discovery most fruitful.</p><p><xref ref-type="fig" rid="fig1">Figure 1</xref>1 is a 3D plot of the probability of a successful advEvent discovery vs. advertising duration τ W A and scan interval τ S I . The scan window τ S W is set to be equal to the scan interval (continuous scanning). The surface plot shows three sets of saddle points. They correspond to τ W A = τ S I , 2.5 τ S I , and 4 τ S I , respectively. This result is in good agreement with that in <xref ref-type="fig" rid="fig1">Figure 1</xref>0.</p></sec></sec><sec id="s4"><title>4. Verification and Discussions</title><p>We wrote a python simulation program to verify the accuracy of the discovery probability analysis. In each simulation run with certain specified τ W A , τ S I , τ S W values, 100,000 advEvents were generated. Successful discoveries on channels 37, 38, 39 were individually recorded. This allowed us to obtain successful single-channel discovery probabilities Pr [ E c h 37 ] , Pr [ E c h 38 ] , and Pr [ E c h 39 ] . They were found to be nearly identical and very close to ( τ S W − T S ) / 3 τ S I (within the simulation accuracy tolerance) for all parameter values chosen. Successful discoveries from the advEvent point of view were also recorded. This allowed us to obtain successful advEvent discovery probabilities. They are compared with analytical results and one example is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>2, where τ W A is set to 10 ms and τ S I ranges from 2.5 ms to 50 ms. Simulation results (with</p><p>scan window resolution 1.25 ms) and analytical results (with scan window resolution 0.625 ms) match well both visually and actually (the difference has a mean value of 0.3 percent and standard deviation 0.48 percent). Again, the saddle points in <xref ref-type="fig" rid="fig1">Figure 1</xref>2 are around τ S I = 10   ms . This is also what the analysis predicted that τ W A = τ S I , 4 τ S I , 7 τ S I , ⋯ are where the successful discovery probability is minimized. That the simulation agrees well with analysis is expected because in the analysis we did not make any simplifying assumptions.</p><p>In Section 4, we show that the maximum successful advEvent discovery probability is ( τ S W − T S ) / τ S I . Since T S is a fixed value and scan window τ S W is bounded by scan interval τ S I , ( τ S W − T S ) / τ S I is maximized when τ S W is equal to τ S I and both as large as possible. This agrees with what we observed in <xref ref-type="fig" rid="fig1">Figure 1</xref>2 that the successful advEvent discovery probability is the highest when τ S W = τ S I = 50   ms . Since τ W A is limited to be within 10 ms, any value of τ S I greater than 20 ms has no danger of causing the ill-fated advertising/scanning synchronization (i.e., τ W A = τ S I , 4 τ S I , 7 τ S I , ⋯ ). This, however, is from the discovery probability point of view. If we also consider energy saving, scan window τ S W should not be too long. A balance between quick discovery and energy saving needs to be considered in determining the optimal parameter values.</p></sec><sec id="s5"><title>5. Conclusion</title><p>BLE has been in use for many years. However, how to configure its parameters for quick neighbor discovery has been troublesome for many implementers. We use rigorous probability derivations to clarify disagreements in prior works and also provide insights on how to configure parameters for maximizing discovery probability. To be specific, we show that the probabilities of successful discoveries on each of the three discovery channels are equal. But those three discovery events are dependent events. In addition, we show that there are several parameter settings that will cause low discovery probability. In particular, if the advertising duration τ W A is set to equal to some multiples of scan interval ( τ S I , 4 τ S I , 7 τ S I , ⋯ ), which we call ill-fated advertising/scanning synchronization, the discovery process will be the least efficient. For maximum discovery probability, the length of the scan window should be large, which leads to large scan interval too. However, this is not necessarily good for energy saving. Currently, our analysis applies to the 1:1 (one advertiser and one scanner) scenario. Future works are to extend it to multiple advertisers or multiple scanners. This study can also serve as a base for discovery latency and energy consumption analysis.</p></sec><sec id="s6"><title>Acknowledgements</title><p>This work was supported by grants from MOST (Most 108-2221-E-194-009-MY2, MOST 108-2218-E-194-007), Taiwan.</p></sec><sec id="s7"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s8"><title>Cite this paper</title><p>Hou, T.-C. and Huang, K.-C. (2020) Accurate Analysis on Bluetooth Low Energy Neighbor Discovery. Journal of Computer and Communications, 8, 231-250. https://doi.org/10.4236/jcc.2020.812020</p></sec></body><back><ref-list><title>References</title><ref id="scirp.106311-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Bluetooth SIG. (2010) Bluetooth Core Specification Version 4.0, July 2010.</mixed-citation></ref><ref id="scirp.106311-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Liu, J., Chen, C.F. and Ma, Y. (2012) Modeling and Performance Analysis of Device Discovery in Bluetooth Low Energy Networks. 2012 IEEE Global Communications Conference (Globecom), Anaheim, 3-7 December 2012, 1538-1543.</mixed-citation></ref><ref id="scirp.106311-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Liu, J., Chen, C.F. and Ma, Y. (2012) Modeling Neighbor Discovery in Bluetooth Low Energy Networks. IEEE Communications Letters, 16, 1439-1441. https://doi.org/10.1109/LCOMM.2012.073112.120877</mixed-citation></ref><ref id="scirp.106311-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Liu, J., Chen, C.F., Ma, Y. and Xu, Y. (2013) Adaptive Device Discovery in Bluetooth Low Energy Networks. 2013 IEEE 77th Vehicular Technology Conference (VTC Spring), Dresden, 2-5 June 2013, 1-5. https://doi.org/10.1109/VTCSpring.2013.6691855</mixed-citation></ref><ref id="scirp.106311-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Cho, K., Park, W., Hong, M., Park, G., Cho, W., Seo, J. and Han, K. (2015) Analysis of Latency Performance of Bluetooth Low Energy (BLE) Networks. Sensors, 2015, 15, 59-78. https://doi.org/10.3390/s150100059</mixed-citation></ref><ref id="scirp.106311-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Cho, K., Park, G., Cho, W., Seo, J. and Han, K. (2016) Performance Analysis of Device Discovery of Bluetooth Low Energy (BLE) Networks. Computer Communications, 81, 72-85. https://doi.org/10.1016/j.comcom.2015.10.008</mixed-citation></ref><ref id="scirp.106311-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Yang, T. and Tseng, H. (2017) Two-Way Communication with Wait-slot Scheme for Neighbor Discovery Process in Dense Bluetooth Low Energy Networks. 2017 13th International Conference on Network and Service Management (CNSM), Tokyo, 26-30 November 2017, 1-7. https://doi.org/10.23919/CNSM.2017.8255997</mixed-citation></ref><ref id="scirp.106311-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Shan, G. and Roh, B. (2018) Advertisement Interval to Minimize Discovery Time of Whole BLE Advertisers. IEEE Access, 6, 17817-17825. https://doi.org/10.1109/ACCESS.2018.2817343</mixed-citation></ref><ref id="scirp.106311-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Kindt, P.H., Yunge, D., Diemer, R. and Chakraborty, S. (2020) Energy Modeling for the Bluetooth Low Energy Protocol. ACM Transactions on Embedded Computing Systems, 19, Article No. 13. https://doi.org/10.1145/3379339</mixed-citation></ref><ref id="scirp.106311-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Seo, J. and Han, K. (2020) A Survey of Enhanced Device Discovery Schemes in Bluetooth Low Energy Networks. IETE Technical Review. https://doi.org/10.1080/02564602.2020.1742806</mixed-citation></ref></ref-list></back></article>