# Performance Evaluation of Bluetooth Low Energy: A Systematic Review
## 2 BLE Functioning
### BLE Communication
#### 2.2.2 Connections  
A _connection_ is a permanent, periodical data exchange of packets between two devices [52]. The _connection_ is private, and it could also be protected with security provisions. In _connections_, there are two different roles involved, defined in the GAP [57]:  
* The _Central (master)_ scans for connectable advertising packets and initiates the _connection_. When the _connection_ is active, the _central_ manages all the setting and starts a periodical packet exchanges. * The _Peripheral (slave)_ periodically sends connectable advertising packets and accepts _connections_ initiated by the _master_. When the _connection_ is established, it follows the settings exposed by the _central_ and exchanges data with it. As already said in Section 2.2.1, the beginning of a _connection_ works as a _broadcasting_ mode. In this case, the _broadcaster_, which sends connectable advertising packets, is also called the _responder_ and will become the _slave_, while the _observer_ is also called the _initiator_ and will become the _master_, as described in Section 2.1.5. The setup of a _connection_[59] is shown in Figure 7. Before the _connection_ starts, the _peripheral_ is in advertising mode and sends connectable advertising packets, while the _central_ unit is in discovery mode, looking for some connectable packet from any reachable _slave_. As soon as the _master_ finds the _slave_, it sends a _connection_ request, and after the _peripheral_ accepts the request, the _connection_ is created. At this moment, the two modules can communicate, sending data packages between them; it is important to notice that, although the _connection_ parameters are set only by the _master_, data can be sent by both roles during each _connEvent_; it only depends on the properties of the _characteristics_ (Section 2.1.7). Figure 6: This figure shows how the advertising and scanning mechanisms work. In the upper part is shown the _scanner_; it scans on the three advertising channels (37, 38, 39, colored respectively in blue, red and green), switching the scanning channel within a period called \(\mathrm{T}_{scanInterval}\). The effective scanning period, per each channel, lasts for a time called \(\mathrm{T}_{scanWindow}\). On the other hand, the _advertiser_, shown in the bottom part of the Figure, sends a burst of three advertising packets, one for each advertising channel, with a specific period (\(\mathrm{T}_{advInterval}\)). Figure 7: This figure shows how two devices (A and B) communicate through BLE. The two vertical blue lines on the left represent the _Host_ layer and the LL of the device A, while the two lines on the right represent the same two layers relative to the device B. Blue arrows represent the communication messages between layers and devices. The black arrow on the left shows that the time increments scrolling the figure to the bottom. Red braces indicate the specific role of the devices A and B during the different parts of the communication. Part (**a**) of the figure shows the _advertising_ mechanism, in which the _advertiser_ (B) sends a message from the _Host_ to the LL in order to enable the sending of advertising packets. The _scanner_ (A) receives these packets and prepares itself for the _connection_. In (**b**) is shown the _connection_ establishment where the _initiator_ (A) sends a message in order to create the _connection_, firstly from the _Host_ to its own LL and then to the other device, the _responder_ (B). At the end, if the _connection_ is established correctly, the two LLs send a message to the respective _Host_ layers in order to confirm the correct creation of the _connection_. Starting from (**c**), the _connection_ is created, and the two devices are called _master_ (A) and _slave_ (B). In (**c**), the _master_ sends data packets to the _slave_, writing on a writable _characteristic_. In this case, data packets are sent from the _master Host_ layer to its own LL and then to the _slave_.