Skip to main content

BLE Fundamentals

Bluetooth Low Energy (BLE) is a wireless communication protocol for energy-efficient IoT devices. This chapter explains the fundamental concepts.

BLE vs. Bluetooth Classic

PropertyBluetooth ClassicBLE
Introduction1999 (v1.0)2010 (v4.0)
Range~100m~100m
Data Rate1-3 Mbps125 kbps - 2 Mbps
Latency100+ ms6 ms
Power ConsumptionHighUltra-low
ApplicationAudio, FilesSensors, IoT

BLE Stack

Layers Explained

LayerAbbreviationFunction
Physical LayerPHY2.4 GHz ISM band, GFSK modulation, 40 channels
Link LayerLLAdvertising, Scanning, Connection Management, Encryption
L2CAPL2CAPLogical Link Control - Multiplexing, Fragmentation
ATTATTAttribute Protocol - Client-Server data model
GATTGATTGeneric Attribute Profile - Services and Characteristics
GAPGAPGeneric Access Profile - Discovery, Connection
SMPSMPSecurity Manager Protocol - Pairing, Bonding

BLE State Machine

State Descriptions

StateDescriptionTypical Role
StandbyNo radio activity, minimal powerAll
AdvertisingSends periodic advertising packets on channels 37, 38, 39Peripheral
ScanningReceives advertising packetsCentral
InitiatingWaits for advertising from specific deviceCentral
ConnectionActive bidirectional data connectionBoth

Roles in BLE

RoleFunctionExamples
CentralInitiates connection, controls timingSmartphone, Computer
PeripheralAdvertises, provides dataSensors, Wearables
BroadcasterAdvertising only, no connectionBeacons
ObserverScanning only, no connectionPresence Detection

Advertising

Peripherals send advertising packets on three advertising channels:

Advertising Types

PDU TypeConnectableScannableUse Case
ADV_INDStandard
ADV_DIRECT_INDFast Reconnection
ADV_NONCONN_INDBeacons
ADV_SCAN_INDBroadcast with data

Security-Relevant Properties

What BLE Does NOT Do Automatically

Important

BLE is not secure by default!

PropertyDefault StateConsequence
EncryptionOffData readable in plaintext
AuthenticationOffAnyone can connect
IntegrityOff (without encryption)Data can be manipulated
PrivacyLimitedMAC tracking possible
AuthorizationNoneAll characteristics open

Common Developer Mistakes

MistakeDescriptionConsequence
Just Works PairingNo additional authenticationMITM attacks possible
No Access ControlsCharacteristics without security levelAnyone can read/write
Sensitive Data in AdvertisingWeight, ID, etc. publicPrivacy violation
Hardcoded KeysKeys in app/firmwareEasy extraction
Weak EncryptionXOR, Base64, ROT13Trivial to break

Further Reading