class: title, smokescreen, shelf, bottom, no-footer background-image: url(images/wireless.jpeg) # 181U Spring 2020 ## Low Energy Wireless Communications (BLE and Lora) <style> h1 { border-bottom: 8px solid rgb(32,67,143); border-radius: 2px; width: 90%; } .smokescreen h1 { border-bottom: none; } .small.remark-slide-content.compact {font-size:1.4rem} .smaller.remark-slide-content.compact {font-size:1.1rem} .small-code.remark-slide-content.compact code {font-size:1.0rem} .very-small-code.remark-slide-content.compact code {font-size:0.9rem} .line-numbers{ /* Set "line-numbers-counter" to 0 */ counter-reset: line-numbers-counter; } .line-numbers .remark-code-line::before { /* Increment "line-numbers-counter" by 1 */ counter-increment: line-numbers-counter; content: counter(line-numbers-counter); text-align: right; width: 20px; border-right: 1px solid #aaa; display: inline-block; margin-right: 10px; padding: 0 5px; } </style> --- layout: true .footer[ - 181U - See acknowledgements ] --- class: compact # Agenda <audio controls> <source src="audio/lowenergy_2.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Battery powered devices require low-energy radio * Bluetooth Low Energy -- short distance, medium throughput * LoRa -- long distance, very-low throughput --- class: compact # Bluetooth Low Energy (BLE) <audio controls> <source src="audio/lowenergy_3.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Based on IEEE 802.15.1 * Subset of Bluetooth 4.0 * Smart Mesh * Wide OS support * Used in smartphones, tablets, smart watches, ... --- class: compact # BLE Relationship to Bluetooth <audio controls> <source src="audio/lowenergy_4.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * New - efficient discovery/connection procedures - very short packets - asymmetric design for peripherals - client/server architecture * Old - Reuse Bluetooth radio architecture - Reuse logical and physical transports --- class: compact # Basic Concepts <audio controls> <source src="audio/lowenergy_5.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Everything has **State** - server devices expose their state * Clients can use the state exposed on servers - read: e.g., get current temperature - write: e.g., increase set point temperature * Servers can notify clients when state updates --- class: compact # Stack Architecture <audio controls> <source src="audio/lowenergy_6.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-10-55-32.png# w-50pct) --- class: compact # Physical Layer <audio controls> <source src="audio/lowenergy_7.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Uses 2.4 GHz ISM Band - Industrial Scientific Medical band - License Free – with certain rules - 2400 MHz to 2483.5 MHz * Used by many other standards - IEEE 802.11, IEEE 802.15 - and many proprietary radios --- class: compact # 40 Physical Channels <audio controls> <source src="audio/lowenergy_8.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-10-59-09.png# w-60pct) --- class: compact # Phy Summary <audio controls> <source src="audio/lowenergy_9.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * 2.4 GHz GFSK * 40 channels - 2 MHz channel spacing - 2402 MHz to 2480 MHz * Range - 50m to further than 150 m --- class: compact # Link Layer <audio controls> <source src="audio/lowenergy_10.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Link Layer State Machine - can have multiple state machines active in device * Link Layer Channels - Advertising Channels & Data Channels - Advertising Packets & Data Packets * Link Layer Control Procedures --- class: compact # Link Layer State Machine <audio controls> <source src="audio/lowenergy_11.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-11-03-40.png# w-60pct) --- class: compact # Link Layer Channels <audio controls> <source src="audio/lowenergy_12.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Advertising Channels - Advertising Channel Packets - Used for Discoverability / Connectability - Used for Broadcasting / Observing * Data Channels - Data Channel Packets - Used to send application data in Connection --- class: compact # Link Layer Channels <audio controls> <source src="audio/lowenergy_13.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-11-06-29.png# w-60pct) --- class: compact # Scanning <audio controls> <source src="audio/lowenergy_14.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-10pct) ![](images/2020-04-16-11-08-18.png# w-50pct) (Passive scanning shown; another mode is active scanning) --- class: compact # Connections <audio controls> <source src="audio/lowenergy_15.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-11-10-44.png# w-60pct) --- class: compact # Topology <audio controls> <source src="audio/lowenergy_16.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-11-12-28.png# w-40pct) --- class: compact # Connections <audio controls> <source src="audio/lowenergy_17.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Used to send application data reliably, robustly * Includes - ultra low power connection mode - adaptive frequency hopping - connection supervision timeout --- class: compact # Connection Events <audio controls> <source src="audio/lowenergy_18.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-11-15-13.png# w-60pct) --- class: compact # Maximum Data Rate <audio controls> <source src="audio/lowenergy_19.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Asymmetric Tx/Rx Packet Sequence - 328 + 150 + 80 + 150 = 708 μs * Transmitting 27 octets of application data - ~305 kbps ![](images/space.png# w-10pct) ![](images/2020-04-16-11-16-35.png# w-80pct) --- class: compact # Link Layer Encryption <audio controls> <source src="audio/lowenergy_20.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> Uses AES 128 encryption block and CCM as defined by RFC 3610 ![](images/space.png# w-20pct) ![](images/2020-04-16-11-18-35.png# w-60pct) --- class: compact # Attribute Protocol <audio controls> <source src="audio/lowenergy_21.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-11-21-30.png# w-50pct) --- class: compact # Attribute Protocol (ATT) <audio controls> <source src="audio/lowenergy_22.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Client Server Architecture - servers have data - clients request data to/from servers * Protocol Methods - request, response, command, - notification, indication, confirmation --- class: compact # Servers Expose Data Using Attributes <audio controls> <source src="audio/lowenergy_23.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/2020-04-16-11-24-39.png# w-50pct fr) * Attributes have values - array of octets - 0 to 512 octets in length - can be fixed or variable length --- class: compact # Attributes are Addressable <audio controls> <source src="audio/lowenergy_24.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Each attribute has a “handle” - used to address an individual attribute by a client * Clients use handles to address attributes - Read (0x0022) => 0x04 ; Read (0x0098) => 0x0802 ![](images/space.png# w-20pct) ![](images/2020-04-16-11-26-45.png# w-60pct) --- class: compact # Attributes are Typed <audio controls> <source src="audio/lowenergy_25.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Attributes have a type - type is a «UUID», determines what the value means * Types are defined by “Characteristic Specifications” - or Generic Access Profile or Generic Attribute Profile ![](images/space.png# w-20pct) ![](images/2020-04-16-11-29-58.png# w-60pct) --- class: compact # Attributes are Typed (Example) <audio controls> <source src="audio/lowenergy_26.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * «Battery State» * defined by “Battery State Characteristic” specification - enumerated value -0x04 = Discharging ![](images/space.png# w-20pct) ![](images/2020-04-16-11-32-42.png# w-60pct) --- class: compact # Attribute Permissions <audio controls> <source src="audio/lowenergy_27.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Attributes values may be: - readable / not readable - writeable / not writeable - readable & writeable / not readable & not writeable * Attribute values may require: - authentication to read / write - authorization to read / write - encryption / pairing with sufficient strength to read / write --- class: compact # Protocol Methods <audio controls> <source src="audio/lowenergy_28.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-10pct) ![](images/2020-04-16-11-36-00.png# w-80pct) --- class: compact,small # Generic Attribute Protocol (GATT) <audio controls> <source src="audio/lowenergy_29.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-30pct) ![](images/2020-04-16-11-37-58.png# w-40pct) BLE is complicated by many pre-defined *profiles*. If you want to build a "standard" device (for example a thermostat), this simplifies the process. Introducing a new type of device is *complicated*. --- class: compact # Generic Access Profile <audio controls> <source src="audio/lowenergy_30.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-30pct) ![](images/2020-04-16-11-40-57.png# w-40pct) Generic access profile (and protocols) define the ways clients and servers interact. --- class: compact,col-2 # Building Applications -- Two Approaches <audio controls> <source src="audio/lowenergy_31.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> * Use Standard Services - defined by Bluetooth SIG - includes lots of useful things - battery - heart rate - temperature - Great interoperability - Vast “app” ecosystem <br> * Define Your Own Service - using 128-bit UUIDs - you can do what you want - motor controls - custom sensors - calibration - Closed ecosystems - Few supporting apps --- class: compact # The Energy-Range Tradeoff <audio controls> <source src="audio/lowenergy_32.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-21-32.png# w-50pct) BLE is low energy, but limited range (10's of meters) --- class: compact # LoRa and SigFox Offer an alternative <audio controls> <source src="audio/lowenergy_33.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-24-23.png# w-50pct) These technologies trade bit-rate for range. Very useful for slowly changing sensors. --- class: compact # Link Budget is measured in dBM <audio controls> <source src="audio/lowenergy_34.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-28-07.png# w-50pct) --- class: compact # LoRa allows trading bit-rate for range <audio controls> <source src="audio/lowenergy_35.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-30-09.png# w-50pct) --- class: compact # Relationship between bit rate and range <audio controls> <source src="audio/lowenergy_36.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-31-05.png# w-60pct) --- class: compact # There is no free lunch ! <audio controls> <source src="audio/lowenergy_37.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-32-23.png# w-60pct) --- class: compact # LoRa is based on a clever modulation strategy <audio controls> <source src="audio/lowenergy_38.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-34-48.png# w-60pct) --- class: compact # LoRa Physical Layer <audio controls> <source src="audio/lowenergy_39.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-36-38.png# w-60pct) --- class: compact # Spreading factor vs Duration <audio controls> <source src="audio/lowenergy_40.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-37-50.png# w-60pct) --- class: compact # LoRaWAN <audio controls> <source src="audio/lowenergy_41.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-10pct) ![](images/2020-04-16-13-39-43.png# w-40pct) ![](images/space.png# w-1-12th) ![](images/2020-04-16-13-40-10.png# w-20pct) --- class: compact # LoRaWAN Architecture <audio controls> <source src="audio/lowenergy_42.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-43-12.png# w-60pct) --- class: compact <audio controls> <source src="audio/lowenergy_43.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-20pct) ![](images/2020-04-16-13-49-55.png# w-60pct) --- class: compact # WaziUP <audio controls> <source src="audio/lowenergy_44.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-1-12th) ![](images/2020-04-16-13-53-50.png# w-30pct) ![](images/space.png# w-1-12th) ![](images/2020-04-16-13-54-33.png# w-30pct) ![](images/space.png# w-30pct) ![](images/2020-04-16-13-55-44.png# w-30pct) --- class: compact # WaziUP Platform <audio controls> <source src="audio/lowenergy_45.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> ![](images/space.png# w-1-12th) ![](images/2020-04-16-13-57-10.png# w-40pct) ![](images/2020-04-16-13-58-32.png# w-40pct) --- class: compact # Summary * Acknowledgements -- Slide Material drawn from: - "Wireless standards for IoT" by Ermanno Pietrosemoli: http://wireless.ictp.it/school_2019/slides/WirelessstandardsforIoT.pdf - "An Introduction to Bluetooth low energy" by Robin Heydon: https://datatracker.ietf.org/meeting/interim-2016-t2trg-02/materials/slides-interim-2016-t2trg-2-7 - "Low-power, long-range radio technologies for Internet-of-Things" by IRD/UMMISCO–Yaoundé: http://cpham.perso.univ-pau.fr/LORA/WAZIUP/UMMISCO-LPWAN-review.pdf - Cover image "https://www.led-professional.com/technology/standardization/zigbee-alliance-and-thread-group-join-force#&gid=1&pid=1" - "WAZIUP: A low-cost infrastructure for deploying IoT in developing countries", Congduc Pham, AbdurRahim, Philippe Cousin. AFRICOMM16