58
BLUETOOTH LOW ENERGY Flavia Martelli [email protected] Wireless Sensor Networks

Handouts WSNs BT-LE

Embed Size (px)

Citation preview

Page 1: Handouts WSNs BT-LE

BLUETOOTH LOW ENERGY

Flavia Martelli

[email protected]

Wireless Sensor Networks

Page 2: Handouts WSNs BT-LE

Outline

• Introduction

• Applications

• Architecture

• Topology

• Controller specifications:

– Physical Layer

– Link Layer

• Host specifications: upper layers

• Products on the market

2

Page 3: Handouts WSNs BT-LE

Introduction (1/2)

Bluetooth: • Wireless technology for short-range communication

• Replacement to cables connecting portable and/or fixed electronic

devices

• Key features:

worldwide operation

robustness

low power consumption

low cost

interoperability

3

Page 4: Handouts WSNs BT-LE

Introduction (2/2)

Bluetooth Core Specification v4.0 (adopted 30 June 2010)

• Two main configurations

1. Basic Rate (BR)

Optional Enhanced Data Rate (EDR) and Alternate MAC and PHY

(AMP) extensions

2. Low Energy (LE)

Lower power consumption devices operated with coin cell batteries

Lower complexity

Lower cost

Lower data rates

4

Page 5: Handouts WSNs BT-LE

Applications (1/7)

Automotive

5

Page 6: Handouts WSNs BT-LE

Applications (2/7)

Sports and fitness

6

Page 7: Handouts WSNs BT-LE

Applications (3/7)

Healthcare

7

Page 8: Handouts WSNs BT-LE

Applications (4/7)

Entertainment

8

Page 9: Handouts WSNs BT-LE

Applications (5/7)

Home automation

9

Page 10: Handouts WSNs BT-LE

Applications (6/7)

Security and proximity

10

Page 11: Handouts WSNs BT-LE

Applications (7/7)

Advertising

11

YOU ARE

HERE

Page 12: Handouts WSNs BT-LE

12

Architecture

Generic Access

Profile (GAP)

PU

ID

Re

mo

te

Co

ntro

l

Pro

xim

ity

He

art R

ate

Generic Attribute Profile (GATT) Security Manager

Protocol (SMP) Attribute Protocol (ATT)

Logical Link Control and Adaptation Protocol (L2CAP)

Host Controller Interface (HCI)

Link Layer (LL)

Physical Layer (PHY)

Page 13: Handouts WSNs BT-LE

Implementation modes

• Single-mode (stand-alone) implementation:

targeted at low power consumption and small size

devices

• Dual-mode implementation: extension to a classic

Bluetooth radio, targeted at mobile phones and

PCs

13

Dual-mode

device LE single-mode

device LE single-mode

device

Page 14: Handouts WSNs BT-LE

Network topology

• Piconet: star topology

• Broadcast group

14

Master

Slaves

Advertiser

Scanners

Page 15: Handouts WSNs BT-LE

Controller specification

15

Generic

Access

Profile

(GAP)

PU

ID

Rem

ote

Contro

l

Pro

xim

ity

Heart

Rate

Generic Attribute

Profile (GATT) Security

Manager

Protocol

(SMP) Attribute Protocol

(ATT)

Logical Link Control and Adaptation

Protocol (L2CAP)

Host Controller Interface (HCI)

Link Layer (LL)

Physical Layer (PHY)

Page 16: Handouts WSNs BT-LE

Physical Layer (1/2)

• Modulation: Gaussian Frequency Shift Keying

(GFSK)

Bandwidth-bit period product: BT = 0.5

Modulation index: 0.45 < h < 0.55

Bit-rate: Rb = 1Mbit/s

• Transmission power: -20 dBm < Ptx < + 10 dBm

• Receiver sensitivity: -70 dBm

[BER < 0.1%]

16

Page 17: Handouts WSNs BT-LE

Physical Layer (2/2)

• Band: ISM @ 2.4 GHz

40 channels of 2 MHz

f = 2402 + i*2 MHz, i=0,…,39

17

Page 18: Handouts WSNs BT-LE

PHY performance (1/2)

BLUETOOTH

LOW

ENERGY

18

Page 19: Handouts WSNs BT-LE

PHY performance (2/2)

Normalized

power

spectrum [dB] 1.5 Rb 802.15.4 3 MHz

Bluetooth LE 1.5 MHz

19

Page 20: Handouts WSNs BT-LE

Controller specification

20

Generic

Access

Profile

(GAP)

PU

ID

Rem

ote

Contro

l

Pro

xim

ity

Heart

Rate

Generic Attribute

Profile (GATT) Security

Manager

Protocol

(SMP) Attribute Protocol

(ATT)

Logical Link Control and Adaptation

Protocol (L2CAP)

Host Controller Interface (HCI)

Link Layer (LL)

Physical Layer (PHY)

Page 21: Handouts WSNs BT-LE

21

Link Layer: state machine

Advertiser

Tx Advertising packets

Initiator

Listen to Advertising

packets and respond to

initiate a connection

Slave/Master

Tx/Rx data packets

Scanner

Listen to Advertising packets

Page 22: Handouts WSNs BT-LE

Link Layer: channels

• RF Channels are allocated into two types:

1. Advertising physical channel (i = 0, 12, 39):

discovering devices, initiating a connection, broadcasting

data

2. Data physical channel (the other 37 RF channels):

communication between connected devices

22

MH

z

24

02

2

40

4

24

06

2

40

8

24

10

2

41

2

24

14

2416

24

18

2

42

0

24

22

2

42

4

24

26

2

42

8

24

30

2

43

2

24

34

2

43

6

24

38

2

44

0

24

42

2

44

4

24

46

2

44

8

24

50

2

45

2

24

54

2

45

6

24

58

2

46

0

24

62

2

46

4

24

66

2

46

8

24

70

2

47

2

2474

24

76

2

47

8

24

80

Adv

37

38

39

Data

0

1

2

3

4

5

6

7

8

9

10

11

1

2

13

1

4

15

1

6

17

1

8

19

2

0

21

2

2

23

2

4

25

2

6

27

2

8

29

3

0

31

3

2

33

34

35

3

6

Page 23: Handouts WSNs BT-LE

Link Layer: events

• Advertising events

• Connection events

23

t

t

Page 24: Handouts WSNs BT-LE

24

Passive scanning

Advertisement

Advertisement

Advertisement

Advertisement

Advertisement

Advertisement

Found

device

Scanner Advertiser

Channel (x)

Channel (y)

Channel (z)

Page 25: Handouts WSNs BT-LE

25

Active scanning

Advertisement

Scan Request

Scan Response

(name, services) Found device

(name, services)

Scanner Advertiser

Page 26: Handouts WSNs BT-LE

26

Broadcasting data

Advertisement (data)

Found device

(data)

Scanner Advertiser

Advertisement (data)

Advertisement (data)

Advertisement (data)

Advertisement (data)

Advertisement (data)

Page 27: Handouts WSNs BT-LE

27

Initiating a connection

Advertisement

Initiator Advertiser

Connect Request

"poll"

Data

Ack

Master Slave

"null"

Communication

event interval

Channel (x)

Channel (y)

Page 28: Handouts WSNs BT-LE

28

Link Layer: PDU

Preamble Access

Address PDU Header PDU Payload CRC

1 byte 4 bytes 2 bytes variable (0 – 37

bytes) 3 bytes

• Identifies a LL connection between

two devices

• Fixed sequence for advertising PDUs

• Error checking

• Frequency synchronization

• Symbol timing estimation

• Automatic gain control

01010101

or

10101010

Page 29: Handouts WSNs BT-LE

29

Link Layer: advertising PDU

Preamble Access

Address PDU Header PDU Payload CRC

1 byte 4 bytes 2 bytes variable (0 – 37

bytes) 3 bytes

PDU type Res. TxAdd RxAdd Length Res.

4 bits 2 bits 1 bit 1 bit 6 bits 2 bits

PDU type Packet name PDU type Packet name

0000 ADV_IND 0011 SCAN_REQ

0001 ADV_DIRECT_IND 0100 SCAN_RSP

0010 ADV_NONCONN_IND 0101 CONNECT_REQ

0110 ADV_SCAN_IND other Reserved

Page 30: Handouts WSNs BT-LE

30

Link Layer: data PDU

Preamble Access

Address PDU Header PDU Payload CRC

1 byte 4 bytes 2 bytes variable (0 – 37

bytes) 3 bytes

LLID NESN SN MD Res. Length Res.

2 bits 1 bit 1 bit 1 bit 3 bits 5 bits 3 bit

Logical Link Identifier:

data or control PDU

Next expected sequence

number and sequence number:

• Acknowledgment

• Flow control

More Data bit

LLID Packet type

00 Reserved

01 LL Data PDU: continuation fragment of an L2CAP message or empty PDU

10 LL Data PDU: start of an L2CAP message

11 LL Control PDU

Page 31: Handouts WSNs BT-LE

HCI specification

31

Generic

Access

Profile

(GAP)

PU

ID

Rem

ote

Contro

l

Pro

xim

ity

Heart

Rate

Generic Attribute

Profile (GATT) Security

Manager

Protocol

(SMP) Attribute Protocol

(ATT)

Logical Link Control and Adaptation

Protocol (L2CAP)

Host Controller Interface (HCI)

Link Layer (LL)

Physical Layer (PHY)

Page 32: Handouts WSNs BT-LE

Host Controller Interface

• The HCI provides a uniform interface method of

accessing Bluetooth Controller‟s capabilities

(command PHY and LL, access hardware status,

control registers)

• Optional implementation

• Possibility of realizing separate Host and Controller

interoperability of different subsystems

32

Page 33: Handouts WSNs BT-LE

Host specification

33

Generic

Access

Profile

(GAP)

PU

ID

Rem

ote

Contro

l

Pro

xim

ity

Heart

Rate

Generic Attribute

Profile (GATT) Security

Manager

Protocol

(SMP) Attribute Protocol

(ATT)

Logical Link Control and Adaptation

Protocol (L2CAP)

Host Controller Interface (HCI)

Link Layer (LL)

Physical Layer (PHY)

Page 34: Handouts WSNs BT-LE

L2CAP (1/2)

• L2CAP provides connection-oriented and

connection-less data services to upper layer

protocols

– Protocol multiplexing capability (not in case of LE only

Controller)

– Segmentation and reassembly

– Per-channel flow control and retransmission

34

Page 35: Handouts WSNs BT-LE

L2CAP (2/2)

• PDU format

35

Length CID Payload

2 bytes 2 bytes Variable (as specified in „Length‟)

• 0x0004 = Attribute Protocol

• 0x0005 = LE L2CAP Signaling channel

• 0x0006 = Security Manager Protocol

Page 36: Handouts WSNs BT-LE

Host specification

36

Generic

Access

Profile

(GAP)

PU

ID

Rem

ote

Contro

l

Pro

xim

ity

Heart

Rate

Generic Attribute

Profile (GATT) Security

Manager

Protocol

(SMP) Attribute Protocol

(ATT)

Logical Link Control and Adaptation

Protocol (L2CAP)

Host Controller Interface (HCI)

Link Layer (LL)

Physical Layer (PHY)

Page 37: Handouts WSNs BT-LE

Attribute Protocol (1/2)

• Attribute is „data‟ – Value with a meaning (UUID), permissions (read/write),

that is addressable by a handle

Attributes expose data on a remote device

• ATT is a peer-to-peer protocol between a server

and a client

– Server: contains attributes, receives requests, executes,

responds, can indicate values

– Client: sends requests, commands, waits for responses,

can confirm indications

37

Page 38: Handouts WSNs BT-LE

Attribute Protocol (2/2)

• Operations on attributes

– Push: the server sends the data to the client when it

changes or according to configuration

– Pull: a client request the data from the server when it

needs it

– Set: configuring a server (actuator)

– Broadcast: the server periodically broadcast the data

(using LL advertising PDUs)

– Get: the client requests for attributes handles and UUID

to discover the services that the server offers

38

Page 39: Handouts WSNs BT-LE

Host specification

39

Generic

Access

Profile

(GAP)

PU

ID

Rem

ote

Contro

l

Pro

xim

ity

Heart

Rate

Generic Attribute

Profile (GATT) Security

Manager

Protocol

(SMP) Attribute Protocol

(ATT)

Logical Link Control and Adaptation

Protocol (L2CAP)

Host Controller Interface (HCI)

Link Layer (LL)

Physical Layer (PHY)

Page 40: Handouts WSNs BT-LE

Generic Attribute Profile

• The GATT profile is designed to be used by an

application or another profile

• It defines how to use the ATT Protocol to discover,

read, write and obtain indications of server

attributes, as well as configuring broadcast of

attributes

• Attributes are grouped in services

– service = collection of data and associated behaviors

– characteristic = value used in a service along with

properties and descriptors (how it is accessed, displayed

and represented)

40

Page 41: Handouts WSNs BT-LE

Host specification

41

Generic

Access

Profile

(GAP)

PU

ID

Rem

ote

Contro

l

Pro

xim

ity

Heart

Rate

Generic Attribute

Profile (GATT) Security

Manager

Protocol

(SMP) Attribute Protocol

(ATT)

Logical Link Control and Adaptation

Protocol (L2CAP)

Host Controller Interface (HCI)

Link Layer (LL)

Physical Layer (PHY)

Page 42: Handouts WSNs BT-LE

Generic Access Profile

• A bluetooth profile defines the required functions

and features of each layer in the Bluetooth system

• GAP: base profile implemented by all devices

– Basic requirements of a device

– Description of behaviours and methods for device

discovery, connection establishment, security,

authentication, association models, service discovery

– Four LE device roles:

Broadcaster

Observer

Peripheral

Central

42

Page 43: Handouts WSNs BT-LE

Host specification

43

Generic

Access

Profile

(GAP)

PU

ID

Rem

ote

Contro

l

Pro

xim

ity

Heart

Rate

Generic Attribute

Profile (GATT) Security

Manager

Protocol

(SMP) Attribute Protocol

(ATT)

Logical Link Control and Adaptation

Protocol (L2CAP)

Host Controller Interface (HCI)

Link Layer (LL)

Physical Layer (PHY)

Page 44: Handouts WSNs BT-LE

Device profiles

• Profiles can be organized in a hierarchy

• Application profile: top level profile that describes

application interoperability

44

Application Profile #1

Generic Profile #1

GAP

Page 45: Handouts WSNs BT-LE

Security specifications

45

Generic

Access

Profile

(GAP)

PU

ID

Rem

ote

Contro

l

Pro

xim

ity

Heart

Rate

Generic Attribute

Profile (GATT) Security

Manager

Protocol

(SMP) Attribute Protocol

(ATT)

Logical Link Control and Adaptation

Protocol (L2CAP)

Host Controller Interface (HCI)

Link Layer (LL)

Physical Layer (PHY)

Page 46: Handouts WSNs BT-LE

Security (1/4)

• Bluetooth Low Energy provides

– Eavesdropping protection

– Man In The Middle protection

– Privacy of devices

• Security functions are split between host and

controller

– Controller LL: encryption and authentication

– Host SMP: security protocol

46

Page 47: Handouts WSNs BT-LE

Security (2/4)

Encryption and authentication

• AES128 – CCM cryptography

• Both hardware and software solutions

• A Message Integrity Check field is included in

every encrypted PDU at the end of the payload

• Bit stream process:

47

Page 48: Handouts WSNs BT-LE

SMP_SECURITY_INFORMATION

Security (3/4)

SMP

• Defines how to setup a secure link

– Key management and exchange

48

SMP_PAIRING_REQUEST

Master Slave

Pairing over SMP

Phase 1

Non secure LL connection established

SMP_PAIRING_RESPONSE

Establishment of encrypted connection with key

generated in Phase 2

SMP_IDENTITY_INFORMATION

Phase 2

Phase 3

(optional)

Page 49: Handouts WSNs BT-LE

Security (4/4)

Privacy

• Feature used to prevent device tracking

• Two types of address

1. Public: IEEE MAC address

2. Random: obtained through a hash function from the

IRK (Identity Resolving Key)

• Random addresses may be resolved only

knowing the IRK

• Random addresses may be changed frequently in

time

49

Page 50: Handouts WSNs BT-LE

Products on the market (1/7)

• NORDIC nRF8001

– Integrates both Controller and Host

– Serial interface to support external application

microcontrollers

– Designed for Peripheral role devices

– Temperature sensor

50

Page 51: Handouts WSNs BT-LE

Products on the market (2/7)

• Texas Instrument CC2540

– Integrates Controller, Host and Application

– Peripherals to interface with analog and digital sensors

– Single mode device

– Mini development kit includes:

CC 2540 Keyfob (LE slave), with an accelerometer sensor

CC2540 USB Dongle (LE master)

99 $

51

Page 52: Handouts WSNs BT-LE

Products on the market (3/7)

• BLUEGIGA BLE 112 Low Energy Module

– Integrates Controller, Host and Application space for

customer applications (no external processor needed)

– Hardware interfaces to connect sensors and/or simple

user interfaces

– Single mode device

– Designed for master and slave roles

– Battery monitor and temperature sensor

52

Page 53: Handouts WSNs BT-LE

Products on the market (4/7)

• BLUEGIGA BLED 112 Low Energy USB Dongle

– Integrates Controller, Host and Application

– Single mode USB device enabling LE connectivity for

PCs and other devices having a USB port

– BLE 112 Starter Kit includes:

2 BLE112 Modules

2 BLED112 USB Dongles

440 $

53

Page 54: Handouts WSNs BT-LE

Products on the market (5/7)

Device

Tx power [dBm] Rx

sensitivity

[dBm]

Current consumption Power supply [V]

min max Tx

(@ 0

dBm)

Rx sleep min max

NORDIC

nRF8001 - 18 0 - 87

13

mA

14.5

mA 0.5 µA 1.9 3.6

TI CC2540 - 20 + 4 - 93 27

mA

19.6

mA 0.4 µA 2 3.6

BLUEGIGA

BLE 112 /

BLED 112

- 23 + 4 - 93 27

mA

22.1

mA 0.4 µA 2 3.6

54

Page 55: Handouts WSNs BT-LE

Products on the market (6/7)

• Dayton Industrial Co. Ltd Heart Rate Belt

– Based on nRF8001 chip

– “Heart rate monitors are one of the first and most sought

after use cases for Bluetooth low energy” [Johnson

Chan, Product Engineering Manager at Dayton]

55

Page 56: Handouts WSNs BT-LE

Products on the market (7/7)

• Casio G-SHOCK Watch

– Automatic correct time update

– Incoming calls and messages notification

56

Page 57: Handouts WSNs BT-LE

References

• Specification of the Bluetooth System, version 4.0,

available at www.bluetooth.org, June 2010

• www.bluetooth.com

• www.ti.com

• www.nordicsemi.com

• www.bluegiga.com

• http://world.casio.com/news/2011/watch_prototype/

57

Page 58: Handouts WSNs BT-LE

Flavia Martelli

[email protected]

+39 051 20 93549