Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet...

95
Beetle Sharing, flexibility and access control for Bluetooth Low Energy Amit Levy James Hong Laurynas Riliskis Philip Levis Keith Winstein Stanford University June 24, 2016 1 / 26

Transcript of Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet...

Page 1: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

BeetleSharing, flexibility and access control for Bluetooth Low Energy

Amit Levy James Hong Laurynas RiliskisPhilip Levis Keith Winstein

Stanford University

June 24, 2016

1 / 26

Page 2: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Grace

..

..

Strava

.

HrView

2 / 26

Page 3: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Grace

...

.

Strava

.

HrView

2 / 26

Page 4: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Grace

....

Strava

.

HrView

2 / 26

Page 5: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Grace

....

Strava

.

HrView

2 / 26

Page 6: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Grace

....

Strava

.

HrView

2 / 26

Page 7: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Grace

....

Strava

.

HrView

2 / 26

Page 8: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Grace

....

Strava

.

HrView

2 / 26

Page 9: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Fabian

..

..

BatteryMon

.

3 / 26

Page 10: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Fabian

...

.

BatteryMon

.

3 / 26

Page 11: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Fabian

....

BatteryMon

.

3 / 26

Page 12: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Fabian

....

BatteryMon

.

3 / 26

Page 13: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Esther

..

..

4 / 26

Page 14: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Esther

...

.

4 / 26

Page 15: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Esther

....

4 / 26

Page 16: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Meet Esther

....

4 / 26

Page 17: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

.......

Strava

...

OneTouch

...

Flux

No extensibility, no access control, limited communication

5 / 26

Page 18: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Limitations of Bluetooth Low Energy (BLE)

1. Applications must run on the gateway2. One application at a time3. All-or-nothing access

Peripherals need to be simple▶ Low cost▶ Low power▶ Hard to update

Gateway oblivious to peripheralfunctionality

▶ How to virtualize generally?▶ Who can access what?

6 / 26

Page 19: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

The gateway should enableflexible and safe sharing

7 / 26

Page 20: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Beetle

SharingApplications can safely share access to peripherals without explicitcoordination.

Access ControlUsers can specify fine-graned access policies on peripherals andapplications.

Communication flexiblityMany-to-many communication between peripherals, gatewayapplications and cloud applications.

Backwards compatibleDoesn’t require changes to existing peripherals or applications.

8 / 26

Page 21: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Current Gateways: Explicit support

Dedicated drivers understand a class of peripherals:

▶ Printers▶ Keyboards▶ Disks

Pros▶ Safe virtualization▶ Access control

Cons▶ Need a trusted module for

each device class▶ Has worked OK for

desktops, but does is scale?

9 / 26

Page 22: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Current Gateways: Explicit support

Dedicated drivers understand a class of peripherals:

▶ Printers▶ Keyboards▶ Disks

Pros▶ Safe virtualization▶ Access control

Cons▶ Need a trusted module for

each device class▶ Has worked OK for

desktops, but does is scale?

9 / 26

Page 23: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Current Gateways: Exclusive access from one application

For special case peripherals, gateway provides an exclusive, rawchannel:

▶ Oscilloscope, hardware debugger▶ USB breathalyzer, USB blood pressure monitor▶ Most IoT peripherals (door locks, lights, fitness bands)

Pros▶ Don’t need explicit support

for each new device class

Cons▶ Can’t allow multiple apps to

use peripheral▶ App gets complete control

over peripheral

10 / 26

Page 24: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Current Gateways: Exclusive access from one application

For special case peripherals, gateway provides an exclusive, rawchannel:

▶ Oscilloscope, hardware debugger▶ USB breathalyzer, USB blood pressure monitor▶ Most IoT peripherals (door locks, lights, fitness bands)

Pros▶ Don’t need explicit support

for each new device class

Cons▶ Can’t allow multiple apps to

use peripheral▶ App gets complete control

over peripheral

10 / 26

Page 25: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Current Gateway Systems

OS Explicit Driver Exclusive Access

HomeOS ✓Linux ✓ ✓(BLE sockets)Android ✓(Google Health) ✓iOS ✓(Health/HomeKit) ✓

Explicit supportImpractical for operatingsystems to anticipate newdevice functionality

vs. Exclusive accessNo sharing, no access control,inflexible communication

11 / 26

Page 26: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Bluetooth Low Energy application protocol

Attribute Protocol (ATT):▶ Key-type-value store▶ Transactional flow-control▶ READ, WRITE, NOTIFY,

FIND-BY-TYPE…

Generic Attribute Profile(GATT):

▶ Structure over attributes▶ Characteristic: Groups

attributes for a value▶ Services: Groups related

characteristicsExample, heart rate monitor

...

.

Find Char with UUID HRM

.

Char at handle 2

.

Read handle 2

.Char value at handle 4

. Read handle 4.157BPM

12 / 26

Page 27: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Bluetooth Low Energy application protocol

Attribute Protocol (ATT):▶ Key-type-value store▶ Transactional flow-control▶ READ, WRITE, NOTIFY,

FIND-BY-TYPE…

Generic Attribute Profile(GATT):

▶ Structure over attributes▶ Characteristic: Groups

attributes for a value▶ Services: Groups related

characteristicsExample, heart rate monitor

...

.

Find Char with UUID HRM

.

Char at handle 2

.

Read handle 2

.Char value at handle 4

. Read handle 4.157BPM

12 / 26

Page 28: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Bluetooth Low Energy application protocol

Attribute Protocol (ATT):▶ Key-type-value store▶ Transactional flow-control▶ READ, WRITE, NOTIFY,

FIND-BY-TYPE…

Generic Attribute Profile(GATT):

▶ Structure over attributes▶ Characteristic: Groups

attributes for a value▶ Services: Groups related

characteristics

Example, heart rate monitor

...

.

Find Char with UUID HRM

.

Char at handle 2

.

Read handle 2

.Char value at handle 4

. Read handle 4.157BPM

12 / 26

Page 29: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Bluetooth Low Energy application protocol

Attribute Protocol (ATT):▶ Key-type-value store▶ Transactional flow-control▶ READ, WRITE, NOTIFY,

FIND-BY-TYPE…

Generic Attribute Profile(GATT):

▶ Structure over attributes▶ Characteristic: Groups

attributes for a value▶ Services: Groups related

characteristicsExample, heart rate monitor

...

.

Find Char with UUID HRM

.

Char at handle 2

.

Read handle 2

.Char value at handle 4

. Read handle 4.157BPM

12 / 26

Page 30: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Bluetooth Low Energy application protocol

Attribute Protocol (ATT):▶ Key-type-value store▶ Transactional flow-control▶ READ, WRITE, NOTIFY,

FIND-BY-TYPE…

Generic Attribute Profile(GATT):

▶ Structure over attributes▶ Characteristic: Groups

attributes for a value▶ Services: Groups related

characteristicsExample, heart rate monitor

....

Find Char with UUID HRM

.

Char at handle 2

.

Read handle 2

.Char value at handle 4

. Read handle 4.157BPM

12 / 26

Page 31: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Bluetooth Low Energy application protocol

Attribute Protocol (ATT):▶ Key-type-value store▶ Transactional flow-control▶ READ, WRITE, NOTIFY,

FIND-BY-TYPE…

Generic Attribute Profile(GATT):

▶ Structure over attributes▶ Characteristic: Groups

attributes for a value▶ Services: Groups related

characteristicsExample, heart rate monitor

....

Find Char with UUID HRM

.

Char at handle 2

.

Read handle 2

.Char value at handle 4

. Read handle 4.157BPM

12 / 26

Page 32: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Bluetooth Low Energy application protocol

Attribute Protocol (ATT):▶ Key-type-value store▶ Transactional flow-control▶ READ, WRITE, NOTIFY,

FIND-BY-TYPE…

Generic Attribute Profile(GATT):

▶ Structure over attributes▶ Characteristic: Groups

attributes for a value▶ Services: Groups related

characteristicsExample, heart rate monitor

....

Find Char with UUID HRM

.

Char at handle 2

.

Read handle 2

.Char value at handle 4

. Read handle 4.157BPM

12 / 26

Page 33: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Bluetooth Low Energy application protocol

Attribute Protocol (ATT):▶ Key-type-value store▶ Transactional flow-control▶ READ, WRITE, NOTIFY,

FIND-BY-TYPE…

Generic Attribute Profile(GATT):

▶ Structure over attributes▶ Characteristic: Groups

attributes for a value▶ Services: Groups related

characteristicsExample, heart rate monitor

....

Find Char with UUID HRM

.

Char at handle 2

.

Read handle 2

.Char value at handle 4

. Read handle 4.157BPM

12 / 26

Page 34: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Bluetooth Low Energy application protocol

Attribute Protocol (ATT):▶ Key-type-value store▶ Transactional flow-control▶ READ, WRITE, NOTIFY,

FIND-BY-TYPE…

Generic Attribute Profile(GATT):

▶ Structure over attributes▶ Characteristic: Groups

attributes for a value▶ Services: Groups related

characteristicsExample, heart rate monitor

....

Find Char with UUID HRM

.

Char at handle 2

.

Read handle 2

.Char value at handle 4

. Read handle 4

.157BPM

12 / 26

Page 35: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Bluetooth Low Energy application protocol

Attribute Protocol (ATT):▶ Key-type-value store▶ Transactional flow-control▶ READ, WRITE, NOTIFY,

FIND-BY-TYPE…

Generic Attribute Profile(GATT):

▶ Structure over attributes▶ Characteristic: Groups

attributes for a value▶ Services: Groups related

characteristicsExample, heart rate monitor

....

Find Char with UUID HRM

.

Char at handle 2

.

Read handle 2

.Char value at handle 4

. Read handle 4.157BPM

12 / 26

Page 36: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Beetle: Key insight

BLE application protocol (GATT) is amenable to multiplexing:

▶ Unified data model▶ Standardized data types▶ Transactions are meaningful to applications

13 / 26

Page 37: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Beetle Architecture

.....

Kernel Bluetooth Driver

.....

Local apps

..Beetle

..Gateway

..

Peripherals

...

Virtual Devices

.

iForgotTheLights

14 / 26

Page 38: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Beetle Architecture

.....

Kernel Bluetooth Driver

.....

Local apps

..Beetle

..Gateway

..

Peripherals

..

.

Virtual Devices

.

iForgotTheLights

14 / 26

Page 39: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Beetle Architecture

.....

Kernel Bluetooth Driver

.....

Local apps

..Beetle

..Gateway

..

Peripherals

..

.

Virtual Devices

.

iForgotTheLights

14 / 26

Page 40: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Beetle Architecture

.....

Kernel Bluetooth Driver

.....

Local apps

..Beetle

..Gateway

..

Peripherals

..

.

Virtual Devices

.

iForgotTheLights

14 / 26

Page 41: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Beetle Architecture

.....

Kernel Bluetooth Driver

.....

Local apps

..Beetle

..Gateway

..

Peripherals

..

.

Virtual Devices

.

iForgotTheLights

14 / 26

Page 42: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Just speak GATT

Look like a peripheral to applications.

Look like a gateway to peripherals.

Provide:

▶ Sharing by multiplexing transactions from different clients▶ Access control by mapping handle space▶ Flexible communication by allowing transactions over any link

15 / 26

Page 43: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Sharing

....

Strava

.

HrView

.

READ REQ: 1

.READ REQ: 2

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.READ REQ: 2

.READ RESP: 2

.

READ RESP: 2

16 / 26

Page 44: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Sharing

....

Strava

.

HrView

.

READ REQ: 1

.READ REQ: 2

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.READ REQ: 2

.READ RESP: 2

.

READ RESP: 2

16 / 26

Page 45: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Sharing

....

Strava

.

HrView

.

READ REQ: 1

.READ REQ: 2

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.READ REQ: 2

.READ RESP: 2

.

READ RESP: 2

16 / 26

Page 46: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Sharing

....

Strava

.

HrView

.

READ REQ: 1

.READ REQ: 2

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.READ REQ: 2

.READ RESP: 2

.

READ RESP: 2

16 / 26

Page 47: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Sharing

....

Strava

.

HrView

.

READ REQ: 1

.READ REQ: 2

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.READ REQ: 2

.READ RESP: 2

.

READ RESP: 2

16 / 26

Page 48: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Sharing

....

Strava

.

HrView

.

READ REQ: 1

.READ REQ: 2

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.READ REQ: 2

.READ RESP: 2

.

READ RESP: 2

16 / 26

Page 49: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Sharing

....

Strava

.

HrView

.

READ REQ: 1

.READ REQ: 2

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.READ REQ: 2

.READ RESP: 2

.

READ RESP: 2

16 / 26

Page 50: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Sharing

....

Strava

.

HrView

.

READ REQ: 1

.READ REQ: 2

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.READ REQ: 2

.READ RESP: 2

.

READ RESP: 2

16 / 26

Page 51: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Sharing

....

Strava

.

HrView

.

READ REQ: 1

.READ REQ: 2

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.READ REQ: 2

.READ RESP: 2

.

READ RESP: 2

16 / 26

Page 52: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Access Control

...

..2 ..Glucose Char

..3 ..Glucose value

..6 ..Battery Char

..7 ..Battery value

.

.

..6 ..Battery Char

..7 ..Battery value

..

BatteryMon

.

READ REQ: 7

.

READ REQ: 7

.

READ REQ: 2

.

ERR

17 / 26

Page 53: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Access Control

...

..2 ..Glucose Char

..3 ..Glucose value

..6 ..Battery Char

..7 ..Battery value

.

.

..6 ..Battery Char

..7 ..Battery value

..

BatteryMon

.

READ REQ: 7

.

READ REQ: 7

.

READ REQ: 2

.

ERR

17 / 26

Page 54: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Access Control

...

..2 ..Glucose Char

..3 ..Glucose value

..6 ..Battery Char

..7 ..Battery value

.

.

..6 ..Battery Char

..7 ..Battery value

..

BatteryMon

.

READ REQ: 7

.

READ REQ: 7

.

READ REQ: 2

.

ERR

17 / 26

Page 55: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Access Control

...

..2 ..Glucose Char

..3 ..Glucose value

..6 ..Battery Char

..7 ..Battery value

.

.

..6 ..Battery Char

..7 ..Battery value

..

BatteryMon

.

READ REQ: 7

.

READ REQ: 7

.

READ REQ: 2

.

ERR

17 / 26

Page 56: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Access Control

...

..2 ..Glucose Char

..3 ..Glucose value

..6 ..Battery Char

..7 ..Battery value

.

.

..6 ..Battery Char

..7 ..Battery value

..

BatteryMon

.

READ REQ: 7

.

READ REQ: 7

.

READ REQ: 2

.

ERR

17 / 26

Page 57: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Virtual Devices: Access Control

...

..2 ..Glucose Char

..3 ..Glucose value

..6 ..Battery Char

..7 ..Battery value

.

.

..6 ..Battery Char

..7 ..Battery value

..

BatteryMon

.

READ REQ: 7

.

READ REQ: 7

.

READ REQ: 2

.

ERR

17 / 26

Page 58: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Implementation

Linux

▶ User-space daemon (C++)▶ Applications connect via UNIX domain or TCP sockets▶ Access control via database + browser interface

Android

▶ Modified Android’s Bluetooth Service app▶ Applications connect over Intents (IPC)▶ Access control via normal user control flow

18 / 26

Page 59: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Applications

▶ Multi-app Heart Rate Monitor▶ Battery Monitor▶ Generic Home Gateway ...

19 / 26

Page 60: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Performance

0

500

1000

1500

2000

10 100 1000

Late

ncy (

ms)

Connection Interval (ms)

Without Beetle

With Beetle

0

1000

2000

3000

4000

5000

6000

7000

8000

9000

10 100 1000

Late

ncy (

ms)

Connection Interval (ms)

Direct

Through Proxy

▶ One app to one peripheral – no significant overhead▶ 1.7x connection interval with/without Beetle

▶ Multi-client throughput depends on workload▶ Reads are linearly scalable via caching

▶ Peripheral-to-peripheral ~2-3x due to extra hop▶ Could be improved with better coordination by gateway

20 / 26

Page 61: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Limitations

▶ Bluetooth Low Energy specific▶ Relies on properties of the application layer protocol

▶ Peripherals must conform to GATT transactional semantics▶ But peripheral-specific virtual devices could mask violations

▶ Access control does not solve secure naming▶ Does not offer a management solution

▶ Complimentary to systems, like HomeOS

21 / 26

Page 62: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

DiscussionSafe and flexible peripheral sharingCan and should be provided first-class by the gateway

Lessons for protocol design

▶ Data model at the right abstraction level▶ Standardized data types▶ Global namespace

Lessons for BLE peripheral builders

▶ Don’t rely on exclusive access for semantics▶ One GATT transaction per application transaction

https://github.com/helena-project/beetle

22 / 26

Page 63: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

DiscussionSafe and flexible peripheral sharingCan and should be provided first-class by the gateway

Lessons for protocol design

▶ Data model at the right abstraction level▶ Standardized data types▶ Global namespace

Lessons for BLE peripheral builders

▶ Don’t rely on exclusive access for semantics▶ One GATT transaction per application transaction

https://github.com/helena-project/beetle

22 / 26

Page 64: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

DiscussionSafe and flexible peripheral sharingCan and should be provided first-class by the gateway

Lessons for protocol design

▶ Data model at the right abstraction level▶ Standardized data types▶ Global namespace

Lessons for BLE peripheral builders

▶ Don’t rely on exclusive access for semantics▶ One GATT transaction per application transaction

https://github.com/helena-project/beetle

22 / 26

Page 65: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

DiscussionSafe and flexible peripheral sharingCan and should be provided first-class by the gateway

Lessons for protocol design

▶ Data model at the right abstraction level▶ Standardized data types▶ Global namespace

Lessons for BLE peripheral builders

▶ Don’t rely on exclusive access for semantics▶ One GATT transaction per application transaction

https://github.com/helena-project/beetle22 / 26

Page 66: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Are corporations just evil?

..

..

23 / 26

Page 67: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Are corporations just evil?

...

.

23 / 26

Page 68: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Are corporations just evil?

....

23 / 26

Page 69: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Attribute Caching

....

app1

.

app2

.

READ REQ: 1

.READ REQ: 1

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.

READ RESP: 1

.

READ RESP: 1

24 / 26

Page 70: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Attribute Caching

....

app1

.

app2

.

READ REQ: 1

.READ REQ: 1

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.

READ RESP: 1

.

READ RESP: 1

24 / 26

Page 71: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Attribute Caching

....

app1

.

app2

.

READ REQ: 1

.READ REQ: 1

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.

READ RESP: 1

.

READ RESP: 1

24 / 26

Page 72: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Attribute Caching

....

app1

.

app2

.

READ REQ: 1

.READ REQ: 1

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.

READ RESP: 1

.

READ RESP: 1

24 / 26

Page 73: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Attribute Caching

....

app1

.

app2

.

READ REQ: 1

.READ REQ: 1

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.

READ RESP: 1

.

READ RESP: 1

24 / 26

Page 74: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Attribute Caching

....

app1

.

app2

.

READ REQ: 1

.READ REQ: 1

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.

READ RESP: 1

.

READ RESP: 1

24 / 26

Page 75: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Attribute Caching

....

app1

.

app2

.

READ REQ: 1

.READ REQ: 1

.READ REQ: 1

.READ RESP: 1

. READ RESP: 1

.

READ RESP: 1

.

READ RESP: 1

24 / 26

Page 76: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 77: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 78: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 79: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 80: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 81: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 82: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 83: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 84: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 85: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 86: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 87: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 88: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 89: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 90: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 91: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 92: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 93: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 94: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Handling Subscriptions

....

app1

.

app2

.

Subscriptions:

.

.

SUBSCRIBE

.

app1

.SUBSCRIBE

.NOTIFY

. NOTIFY

.SUBSCRIBE

.

app2

.NOTIFY

. NOTIFY

.

NOTIFY

.UNSUBSCRIBE

.

UNSUBSCRIBE

.UNSUBSCRIBE

25 / 26

Page 95: Beetle - Sharing, flexibility and access control for ...Meet Esther.. 4/26. Meet Esther. 4/26. Meet Esther. 4/26. Strava OneTouch Flux No extensibility, no access control, limited

Performance: Caching

100

1000

10000

20 40 60 80 100 120 140 160 180

99th

%tile

late

ncy p

er

req

uest

# concurrent requests

Without Caching

With Caching

26 / 26