Skip to main content
Background Image
  1. Mobile_systems/

Bluetooth

·615 words·3 mins· ·
Mobile systems - This article is part of a series.
Part 5: This Article

Protocol for PAN communication, based on 2.4 frequencies band,it aims to the following goals:

  • low cost device
  • low distance communication
  • voice and data management

This comes with the cost of lower bandwidth so lower data transfer rate

Protocol stack
#

Bluetooth is a complex stack of protocols at different layer and devices can implement only a subset of functionality and not all

Architecture
#

Bluetooth architecture is called PICO-NET where a node plays the role of master and manages the communication with the other nodes and between nodes

flowchart TD A[MASTER] B[node] C[node] D[node] A --> B & D & C

Where:

  • there is always a unique master node
  • maximum of 7 active nodes
  • communication happens on a single channel using frequency hopping

Preparation phase
#

In order to communicate 2 nodes need to complete a preparation phase in order to construct the topology, this phase is spit in 2 sub-phases:

  • INQUIRY PHASE a node start the discovery of nearby nodes and become the master
  • PAGING PHASE master establish a bidirectional communication channel in frequency hopping with the slave nodes
flowchart TD subgraph inquiry mode A((master)) end subgraph inquiry scan mode B((slave1)) C((slave2)) D((slave3)) end subgraph nodes out of range E((node1)) F((node2)) end A --> B A --> C A --> D

One of the main constraint of Bluetooth communication is that nodes need to have their clock synchronized, this is done by imposing the master clock to the slaves that adapts their clocks

Communication with master
#

Time is divided by time slots in which only 2 nodes can communicate This is done in order to avoid collisions

The master decide which node can communicate, the master can communicate in all the odd slots

Sco channels
#

SCO packets are sent in pre-allocated time slots, in order to guarantee a fixed bandwidth (must have for audio streaming applications). In order to avoid the consumption of all time slots the master can establish 3 SCO channels at the same time, in this mode re transmissions are not allowed

Acl channels
#

ACL packets are best effort communication with no guaranteed bandwidth this allow for higher bandwidth, it also support asymmetric bandwidth allocation for the 2 directions. In this connection types the slave can transmit only if in the previous time slot has received a packet from the master, in this mode retransmissions are allowed

Multi hop communication (scatter net)
#

Bluetooth supports communication between PICO-NETs if the range allows it

flowchart TD subgraph piconet1 A[1] B[2] C[3] end subgraph piconet2 D[4] E[5] F[6] end A <--> B & C D <--> E & F A <--> D

In this configuration a node for each net is selected as the gateway that can forward traffic to the other net. This is a possibility allowed by the protocol but it’s not implemented for performance reasons

Service discovery protocol
#

Bluetooth has a discovery protocol in order to identify nodes in the range, this allows also to discover what service the device can offer

Bluetooth low energy ble
#

Improvements in energy consumption with the same performances different set of channels (40 2-MHz channels). Within a channel, data is transmitted using Gaussian frequency shift modulation. Bitrate is 1 Mbit/s, and the maximum transmit power is 10 mW

The main difference is in the protocol of discovery and advertisement on the availability for piconets which is based on discovery packet broadcasting

All BLE devices implements the generic attribute (GATT) profile

Bluetooth vs wifi
#

WIFI BLUETOOTH
multi node communication point to point communication only
no discovery needed need of discovery phase in order to communicate with a node
communication can be done in broadcast mode no efficient broadcast support
Matteo Longhi
Author
Matteo Longhi
I’m a software engineer with a passion for Music, food, dogs, videogames and open source software, i’m currently working as a devops engineer
Mobile systems - This article is part of a series.
Part 5: This Article