1. Introduction
Bluetooth low energy (BLE) is a personal LAN technology designed by Bluetooth special interest group (SIG). The specialty of BLE is as a short-range, cellular Internet of Things (IoT) wireless solution geared for a wireless world that demands ultra-low power usage [
1].
As the number of the BLE devices increases, the performance of the neighbor discovery process (NDP) could have a significant impact on users’ experiences and devices’ life spans. It is validated that the parameters in the NDP, such as advertising interval, scan interval, and scan window, have a critical impact on two interdependent performance metrics: the discovery latency and the energy consumption. Both BLE 4.0 and BLE 5.0 provide a wide range of parameter options that support the requirements of IoT applications. To maximize the lifetime of the devices and meet the requirements of a given application, it is necessary to provide a method that can appropriately select parameters. As a result of its practical importance, academic efforts have been devoted to proposing analytical models that can optimize the parameter settings in the BLE NDP and obtain the best possible performance.
In [
2,
3], Cho et al. proposed a discovery latency and energy consumption model to analyze the performance of BLE neighbor discovery protocol. In contrast to other models, multiple advertisers were considered in the network. The simulation results showed that the parameters and the number of advertisers had a significant impact on the NDP performance. However, the analysis was given under the assumption of a continuous scanning scenario.
In [
4], Liu et al. revealed, for the first time, the relationship between the discovery latency and the parameter settings in BLE neighbor discovery. The analyzed model was based on the effective scan window and was further enhanced in [
5] to analyze the energy consumption during the neighbor discovery process. However, the model was constrained by the parameter range and only applied with the condition that the scan window was longer than advertising interval.
In [
6], Philipp et al. proposed a sensitivity analytical model of different parameters on the energy consumption and evaluated the accuracy of the model using both discrete event simulations and actual measurements. In [
7], Liendo et al. presented an extension of the model in [
6] and a parameter optimization method to obtain the best parameter settings according to the application requirements.
In [
8], a new analytical model was presented to characterize the performance of the BLE NDP with respect to the whole discovery time and energy consumption to provide the best parameter settings. Meanwhile, Liendo et al. proposed the neighbor discovery parameter optimization method to minimize the energy consumption for a wider range of IoT use cases in [
9].
The above research was all based on probabilistic models, which, in some cases, limited the performance analysis. These probabilistic models could not capture the peaks in the advertising events, which exist in the measurements. Therefore, the probabilistic models’ results have accuracy problems.
An analytical model was suggested in [
10] to obtain an upper bound for the discovery capacity. According to the measurements, additional scanning gaps that reduced the discovery capabilities were found in the scanning process. On the basis of the measurement and simulation results, the paper provided a guideline to select the desired parameter values.
Similar to [
10], considering the scanning gaps, the real device behavior of BLE scannable undirected advertising events were experimentally modeled in [
11], based on the new features of BLE 5.0 to characterize this new device discovery process. The discovery probability and discovery latency were fully analyzed under several advertising and scanning scenarios.
As described in [
12], according to the Chinese remainder theorem (CRT), it was proved that two nodes would have some overlapping radio on-time within a bounded number of periods, even if they were running under the asynchronous neighbor discovery protocol.
The authors of [
13] were the first to apply CRT to analyze the bounded latency of the BLE NDP for in-vehicle networks. The experiments in [
13] showed that the BLE with coprime parameter values had a low discovery latency. However, there were no detailed energy performance analyses on the impact of parameter settings.
The most recent work using the CRT to model the NDP in [
14] enhanced the analysis of the mean discovery latency and the energy consumption. However, the model is also based on the effective scan window, which only works when the advertising interval is smaller than the effective scan window.
Enlightened by the experimental models and CRT models in [
12,
14], this paper proposes an analytical energy model of the BLE NDP based on CRT to optimize the parameter settings for energy-sensitive IoT applications. The main contributions of this paper are listed as follows:
Most previous works regarding the performance analysis of NDP used the probabilistic method. In this paper, we apply the Chinese reminder theory to model the neighbor discovery protocol in BLE networks, which is an effective way to solve the periodic interval problem;
Unlike the previous work in [
14], we introduce an energy consumption expression related to CRT for both an advertising event and a scanning event, and characterize the energy consumption covering all parameter ranges, including the case when the advertising interval is larger than the scan interval;
Instead of using the effective scan window model proposed in previous works, we apply CRT to the distributed channels, without the constraint of the parameter settings;
In order to validate the model, a real testbed was set up to measure the discovery latency and average current during the NDP.
The remainder of the paper is organized as follows.
Section 2 briefly reviews the basic NDP (B-NDP) that is specified in [
15] and the advanced NDP (A-NDP) in BLE 5.0 [
16]. In
Section 3, we propose an analytical energy model based on CRT and derive the average energy consumption for the NDP. The statistics results from the model and the measurement results are presented and discussed in
Section 4. Finally, the paper concludes with
Section 5.
2. Background
According to BLE 4.0 [
1], the nodes in BLE networks have different roles based on their discovery states. Advertisers are the devices working in advertising mode, and scanners and initiators are the devices in scanning and initiating modes, respectively. In the advertising mode, the devices advertise packets in the advertising channels periodically, and then listen for responses from scanners with the channel order of 37-38-39. With the same channel order, the scanners periodically scan and wait for the advertising packets. Once the scanner receives the advertising information and is ready to connect with the advertisers, it turns into the initiator.
Figure 1 shows the basic neighbor discovery process based on the BLE 5.0 [
16]. Advertisers and scanners utilize the three primary channels (37-38-39) to send advertising packages and scan. Meanwhile, the key difference between the two versions is that during an AdvInterval period, each advertising packet Adv_PDU only contains ADV_EXT_IND and AuxPTR. These packages provide offset and channel messages instead of advertising data. Scanners will receive AUX_ADV_IND packages according to the offset on one specific data channel X (from Channel 0 to Channel 36). An AUX_ADV_IND package containing advertising data is a new package that is defined in BLE 5.0.
The BLE 5.0 specifies a wider range of feasible parameter values for the NDP than BLE 4.0, such as the AdvInterval, ScanWindow, and ScanInterval.
AdvInterval is one of the key parameters in neighbor discovery configuration, which determines the interval time between two consecutive advertising events. In an advertising event, the advertisers transmit the packets in the three predefined channels respectively. The time that the advertiser spends in each channel is denoted as . The fixed interval and a pseudorandom delay are two parts of the AdvInterval.
ScanInterval
denotes the period time that the scanning event happens in the three advertising channels. ScanWindow
is a fixed duration for scanners to scan and listen in the scanning state.
Table 1 shows the list of the significant parameters for neighbor discovery that are specified in BLE 5.0, and these parameters have a wide range thus providing the BLE network with the abilities necessary to support a variety of applications.
As a result, the wide range of parameters cause problems in terms of finding the appropriate initial settings to meet the requirements of different BLE applications. The focus of our study is to analyze the impact of the parameters on the performance of neighbor discovery of BLE.
4. Experimental Results
In this section, to validate the analytical models, we have developed a BLE energy measurement program, which fully complies with the BLE specification 4.2, on a real testbed using the Texas Instruments SimpleLink Bluetooth low energy CC2540dk-mini kit with the Software Development Kit BLE-Stack [
18]. The included key fob board operates as a BLE peripheral device, and contains modifiable software that can be tailored towards different parameters. A CC2540 USB Dongle acting as a master connects to a PC’s USB port. Using BTool (Windows PC application) along with the included CC2540 USB Dongle, the BLE stack can be tested and verified while developing the custom test program. When the devices being tested are set up properly, a few simple hardware modifications are required to implement the current measurement. The detailed implementation steps can be found in [
19]. The architecture of the testbed is shown in
Figure 5.
During the measurement experiments, we use the USB Dongle and the BTool to capture the BLE packets, and utilize a DC power analyzer to measure the current and record the time of advertising events during the discovery process [
20]. Since the average current is the value that is highly dependent on the parameter settings, the average power consumption can be calculated from the average current consumption for the advertising and the discover latency. In the experiments, the central device starts at a random time to discover the advertiser. The typical experimental procedure is to fix two parameters and to vary the other one. The measurements for every parameter setting is repeated 30 times to calculate the average current.
In the experiments, the starting times of the scanner and the advertiser are randomly chosen from the intervals
and
. The other default parameter configurations are given according to [
5,
6] in
Table 4.
Figure 6 shows the modeled statistics of the average energy consumption for the advertiser during the NDP, with AdvInterval ranging from 0.02 to 10.24 s; ScanInterval
= 1.28 s, 2.56 s, 5.12 s, 10.24 s; and ScanWindow
= 1.28 s.
Figure 7 shows the detailed results of both the measured and modeled statistics with AdvInterval ranging from 0.02 to 4 s. The measurement results show the same pattern as the results that were obtained from the model.
Figure 6 and
Figure 7 reveal some interesting results. Contrary to the intuition that more frequent advertising leads to larger energy consumption, periodic high energy consumption could be observed in the analysis results and the measurements. In addition, increasing the value of the AdvInterval does not increase the energy if peaks are avoided. However, a higher ScanInterval leads to a larger range of maximums and minimums of the peaks. Using CRT, it can be shown that the largest solution is for a pair of advertisers and scanners in a duty cycle, which happens periodically in every
. Furthermore, in this case when
, there is a possibility that the scanner missed the advertiser during the specific scan period, and the energy consumption of the idle advertising when
increases significantly, as showed in
Figure 7 when ScanWindow
= 1.28 s and ScanInterval
= 10.24 s.
Consequently, the peaks show a very large average energy consumption, which should be avoided during the configuration. Similar results were observed in the previous discovery latency analysis works of [
6,
7,
17]. In addition, it is noted that the larger ScanInterval can lead to a larger range between the maximum value and the minimum value of the average energy consumption with a fixed ScanWindow. As a result, one should be more cautious and choose the AdvInterval accordingly if the requirement needs a large ScanInterval.
Figure 8 shows the results compared with the model in [
14] when ScanInterval
= 10.24 s and ScanWindow
= 1.28 s. It is obvious that the results from the model proposed in this paper has a higher accuracy than the model in [
14], especially when
. This is because the model in [
14] was based on the effective ScanWindow
. In model [
14], the effective ScanWindow
, and
denotes the advertising time on one channel during an advertising event. When
, it leads to the failure of the analysis in the model based on the effective ScanWindow.
Figure 9 shows the expected energy consumption of the advertiser during a discovery process by varying the ScanInterval for different ScanWindows and with a fixed AdvInterval of
= 5.12 s. As can be seen, the results from the measurement and results that were obtained from the model are close. The curves show that for each ScanWindow, the energy consumption steadily increases when the ScanInterval increases from 0.02 to 10.24 s. Meanwhile, from the comparison of the three situations, when
, it is easy to achieve a low energy consumption for advertisers. Furthermore, for larger ScanWindows, the ScanInterval has less impact on the energy consumption of advertisers. The reason is that the larger ScanWindow reduces the energy of idle advertising events.
Figure 10 illustrates the results of the energy consumption versus varied ScanWindows ranging from 0 to
for different ScanIntervals and a fixed AdvInterval of
= 5.12 s. We compared the results from the model to the measurements, and they are also close.
The figures clearly show that as the ScanWindow increases, the energy consumption has a steep decrease when 0.2 s. This can be explained by the fact that the ScanWindow mainly affects the chance for advertisers and scanners to cross on one of the advertising channels. When the ScanWindow is large enough, the ScanWindow has a simple impact on the energy consumption. However, when the ScanWindow is less than one specific value, the larger ScanInterval will require more energy from the advertisers due to the higher frequency of idle advertising.
In summary, the experimental results validate the model and characterize the energy consumption for the BLE parameters. In the meantime, from the experimental results, it can be stated that there is a principle to properly set the parameters to meet the requirements of a given IoT application. For devices with frequent advertising events, a good trade-off is to set , and if a large scanInterval is needed, we suggest using continuous scanning to achieve the fastest possible discovery and the smallest possible energy consumption. For devices that are expected to achieve the longest life spans with longer idle-advertising, a good choice is to set and possibly a lower ScanInterval.