BLE Protocol Basic
The architecture of Bluetooth
Application
Host
GAP(generic access profile)
GATT(generic attribute profile)
L2CAP(Logical Link Control and Adaptation Protocol)
ATT(Attribute Protocol)
SM(Security Manager)
HCI(Host Controller Interface)
Controller
HCI(host controller interface)
LL(link layer)
PHY(physical layer)
LL Layer :
CRC, encryption, data whitening
Roles:
advertiser,Scanner, Master and Slave
Device Address:
48bits,MAC(Media Access Control Addres)
public device address, no change during the lifetime
random device address, when bonding it can use random device address to attach MITM
Advertising Packet,
Connectable(non-connectable)
Scannable(Non-scannable), scan request
direct ability, direct(undirected)
Connections,
link layer allow “changing the connection parameter” and Encryption
HCI(host controller interface)
a standard protocol that allow for communication between a host and a controller to take place across a serial interface.
define HCI as a set of commands and events for host and control to interact with each other.
L2CAP(logical layer and Adaptation protocol) :
for as protocol multiplexer and encapsulate into standard BLE packet format(fragmentation and recombination same as TCP).
A. ATT - data exchange in BLE application
simple client/server protocol , each server contain data organized in the form of attributes, each of which is assigned a 16bit attribute handle, a universally unique identifier(UUID) , a set of permission and a value.
use attribute handle to identifier used to access an attribute value.
use UUID to spacifier the type and the data.
Att operations:
Error Handling, Server Configuration(Exchange MTU request/Respond) , Find Information(find information request/response,by handle range ; Find by Type Value ,by UUID and value), Read /Write Operations , Queued Write and Server Initiate,asynchronously push attribute value to client
B.SM - Security Manager
framework to generate and distribute security keys between peer.
to trust the identity of the remote device to hide the public bluetooth address.
Security Manager support threes procedures:
i .pairing , for temporary command security encryption key
ii. bonding, generation and exchange of permanent security key
iii. encryption re-establishment, how to use key in subsquent connection to re-establish a secure,encrypted connect .
Pairing ShortTerm Key , STK generation method
a, Just Work
b.passkey key display
c.OOB
security mechanisms level ( for during the connect and advertising procedure)
d. Encryption, all packet transmitted over an establish connection.
e.privacy, allow an advertiser to hide its public bluetooth address
f. signing,
security keys,
1. Encryption Information(Long Term Key,LTK) and Master Identification(EDIV,Rand)
128 bit encryption key shared by both sides(LTK) along with two value(EDIV,Rand) acting as its identifier.
2.Identity information(Identity resolving key or IRK) and Identity address information(address type and bluetooth device address) which to implement privacy: to generate and resolve resolvable address.
3.Signing Information
each key is asymmetrical and thus each bond information stored between two device can contain up to two instance of each key.
GATT( generic attribute profile)
build on the attribute protocol(ATT ) and add a hierarchy and data abstraction. it defined how data is organized and exchange between application.metadata
GAP(generic Access profile)
dicate how device interact with each other at a lower level ,outside of the actuarial protocol stack.
GAP established difference set of rules and concepts to regulate and standardize the low lovel operation of devices.
1. role and interaction between them
2.operational modes and transitions across those
3.operation procedure to achieve consistent and interoperable communication
4.security aspects,including security modes and procedures
5.additional data formats for non protocol data