Bluetooth Classic
Bluetooth Low Energy (BLE) BLE Advanced
Bluetooth 4 Bluetooth 5
Copyright By PowCoder代写 加微信 powcoder
1. Bluetooth History: Wireless Personal Area Networks (WPANs) and IEEE 802.15 projects, Bluetooth Special Interest Group (SIG), Bluetooth Versions
2. Bluetooth Markets and Applications
3. Bluetooth Classic: Network Topology, Channel Structure, Modulation and Data Rates, Frequency Hopping, Packet Format, Operating States, Power Saving, Protocol Stack, Application Profiles
4. Bluetooth Low Energy (BLE): Channel Structure, Frequency Hopping, PHY, MAC
5. Bluetooth 5: PHY, Advertising, and Frequency Hopping Extensions
Wireless Personal Area Networks (WPANs)
q 10m or less 802.16e
Wide Area Network (WAN)
802.20 802.21 802.22 2G, 2.5G, 3G
Mobile Handoff WRAN Metropolitan Area Network (MAN)
802.16/WiMAX Fixed Wireless MAN
Local Area Network (LAN) 802.11 Wi-Fi
Personal Area Network (PAN)
802.15.1 802.15.4 802.15.6 Bluetooth ZigBee Body Area Networks
WPAN: Design Challenges
q Battery powered: Maximize battery life. A few hours to a few years on a coin cell.
q Dynamic topologies: Short duration connections and then device is turned off or goes to sleep
q No infrastructure: No access point or base station
q Avoid Interference due to larger powered LAN devices
q Simple and Extreme Interoperability: Billions of devices. More variety than LAN or MAN
q Low-cost: A few dollars
IEEE 802.15 Projects
q IEEE 802.15.1-2005: Bluetooth 1.2
q IEEE 802.15.4-2011: Low Rate (250kbps) WPAN – ZigBee
q IEEE 802.15.4f-2012: PHY for Active RFID
q IEEE 802.15.6-2012: Body Area Networking. Medical and entertainment. Low power
q IEEE 802.15.7-2011: Visible Light Communications
Bluetooth SIGàIEEE 802.15.1àBluetooth SIG q Started with Ericsson’s Bluetooth Project in 1994 for radio-
communication between cell phones over short distances
q Named after Danish king ̊tand (=Bluetooth) (AD 940-981) who was fond of blueberries
q Intel, IBM, Nokia, Toshiba, and Ericsson formed Bluetooth SIG in May 1998
q Version 1.0A of the specification came out in late 1999.
q IEEE 802.15.1 approved in early 2002 is based on Bluetooth
Later versions handled by Bluetooth SIG directly
q Key Features:
Ø Lower Power: 10 mA in standby, 50 mA while transmitting Ø Cheap: $5 per device
Ø Small: 9 mm2 single chips
Example of a Bluetooth Chipset
Bluetooth Versions
q Bluetooth 1.1: IEEE 802.15.1-2002
q Bluetooth 1.2: IEEE 802.15.1-2005. Adaptive frequency hopping
(avoid frequencies with interference).
q Bluetooth 2.0 + Enhanced Data Rate (EDR) (Nov 2004): 3 Mbps using DPSK. For video applications. Reduced power due to reduced duty cycle
q Bluetooth 4.0 (June 2010): Low energy. Smaller devices requiring longer battery life (several years). New incompatible PHY. Bluetooth Smart or BLE
q Bluetooth 5.0 (December 2016): Make BLE go faster and further.
The Rise of Bluetooth
Source: Bluetooth SIG
The Bluetooth Impact
Bluetooth Classic
Bluetooth Network Topology: Piconet
master slave
scatternet
q Piconet is formed by a master and many slaves (typically 1) Ø Up to 7 active slaves. Slaves can only transmit when requested
Ø Up to 255 parked slaves
q Active slaves are polled by master for transmission
q Any device can become a master (initiator becomes master)
q Each station gets an 8-bit parked address Þ 255 parked slaves/piconet
q A parked station can join in 2ms. Other stations can join in more time.
q Slaves can only transmit/receive to/from master. Slaves cannot talk to another slave in the piconet
q Scatter net: A device can participate in multiple Pico nets Þ Timeshare and must synchronize to the master of the current piconet. Active in one piconet, parked in another.
q Routing protocol not defined (a node can only talk to another node if within Bluetooth range of 10m)
Ref: P. Bhagwat, “Bluetooth Technology for short range wireless Apps,” IEEE Internet Computing, May-June 2001, pp. 96-103, ©2020
Bluetooth Operating Spectrum
Bluetooth Channels
fc =(2402+k)MHz; k=0,1,…,78
k: channel index (79 1-MHz wide channels)
Modulation and Data Rate
q Basic rate (BR):
Ø Binary Gaussian FSK (GFSK): 1 bit/symbol Ø Symbol duration = 1 μs: 1 Msps
Ø Data rate: 1 Mbps
q Enhanced data rate (EDR):
Ø Symbol duration is still 1 μs (1 Msps), but Ø μ/4-DQPSK; 2 bits/symbol; 2 Mbps
Ø 8DPSK: 3 bits/symbol; 3 Mbps
Time Time FSK GFSK
Frequency Hopping (1)
q Unlike WiFi, Bluetooth constantly switches channel within the same connection to avoid collisions with other nearby Bluetooth communications
q No two packets are transmitted on the same channel/frequency, but frequency is never switched in the middle of a packet transmission
q Such frequency switching is known as frequency hopping BT 1
Frequency Hopping (2)
q Bluetooth connections are slotted: packet transmission can start only at the beginning of a time slot
q 625 μs slots using a 312.5 μs (3200Hz) clock (1 slot = 2 clock ticks) q Time-division duplex (TDD)
Þ Downstream (master-to-slave) and upstream (slave-to-master) alternate q Master starts in even numbered slots only.
q Slaves start in odd numbered slots only
q Slaves can transmit right after receiving a packet from master
q Packets = 1 slot, 3 slot, or 5 slots long
q Enables master to start in even and slave in odd slots
q The frequency hop is skipped during a packet; frequency is hopped only at slot boundaries; at the beginning of the next slot after packet transmission/reception is complete; packet lengths may not align with slot boundaries
Frequency Hopping Illustrated
M=master, S = slave
Frequency Hopping Rate
1 frequency hop per packet: a packet can be 1,3, or 5 slot long (no hop in the middle of the packet); maximum FH rate = 1600Hz, minimum FH rate = 320Hz
q Consider a Bluetooth link where the master always transmits 3-slot packets. The transmission from the master is always followed up by a single-slot transmission from a slave. Assuming 625 μs slots, what is the effective frequency hopping rate (# of hopping per second)?
Answer: Given that frequency hopping cannot occur in the middle of a packet transmission, we only have 2 hops per 4 slots, or 1 hop per 2 slots.
The effective hopping rate = 1/(2x625x10-6) = 800 hops/s = 800Hz
Bluetooth Packet Format:
Basic Rate (BR)
q Packets can be up to five slots long. 5 slots =625×5=3125 μs.
Ø Maximum packet size = 72+54+2745 = 2871 μs Ø Some residual slot-time cannot be used (2871 < 3125)
q Access codes:
Ø Channel access code identifies the piconet
Ø Device access code for paging requests and response Ø Inquiry access code to discover units
q Header: member address (3b)+type code (4b)+flow control (1b)+ack/nack (1b)+sequence number (1b)+header error check (8b)=18b, which is encoded using 1/3 rate FEC resulting in 54b
q How many slots are needed to transmit a Bluetooth Basic Rate packet if the payload is (a) 400 bits, (b) 512 bits, and (c) 2400 bits. Assume that the non- payload portions do not change.
Ø Bluetooth transmissions are 1, 3, or 5 slots (2, 4, 6, etc. not allowed)
Ø Non-payload bits (max) = 54+72 = 126 bits
Ø Each slot can carry 625 bits at most
Ø (a) 400b payloadà400+126 = 526b packetà1 slot
Ø (b) 512b payloadà512+126 = 638b packetà2 slots would be sufficient, but will have to be padded for a 3-slot transmission (2-slot packets not allowed)
Ø (c) 2400b payloadà2400+126 = 2526b packetà5 slots ©2020
Bluetooth Packet Format:
Enhanced Data Rate (EDR)
q Modulation changes within the packet; facilitated by a guard interval lasting between 4.75 μs and 5.25 μs
q GFSK for Access Code and Header
q μ/4-DQPSK (2Mbps) or 8DPSK (3Mbps) after guard interval
q EDR payload can accommodate more data than BR, but still fits within maximum 5-slot due to higher data rates
Bluetooth Address Format
q The Bluetooth device address is a unique 48-bit address sent in the access code field of the packet header.
q The first (most significant) 24 bits represent the OUI (Organization Unique Identifier) or the Company ID
q The main purpose of the Bluetooth address is for identification and authentication, but
q The address is also used to seed the frequency hopping pseudorandom generator, to synchronize master and slave clocks, and to pair devices.
000666 = Roving Networks
Frequency Hopping with Pseudorandom Number Generator
q In Bluetooth Classic, FH is defined by a pseudorandom generating algorithm seeded with the following values
Ø UAP and LAP of the master device address, and Ø Bits 1-26 of the 28-bit Bluetooth clock
q The pseudorandom pattern would repeat itself after 227 hops Ø Would take 23.3 to repeat!
Ø In practice the pseudorandom sequence is never repeated
Bluetooth is both Time and Frequency
Synchronised
Illustration of Pseudorandom FH
Collision with
: fixed (non
adaptive) hopping
Collision Avoidance via
• Mark interfering channels as bad channels
• Avoid bad channels; hop between good channels only
• Minimum available (good) channels to hop = 20 (max. 79-20=59 channels can be marked as bad)
• AFH available only during Connected state (i.e., when two devices are exchanging data)
Adaptive FH (AFH)
AFH Illustration: hopping only between good channels
Channel assessment: RSSI/SNR, PER (left to chipset vendor; not specifid in standard)
q Black: used (by another piconet)
q White: available (good to use) q Yellow: Bad
Channel Map Master updates the map dynamically and sends it to slaves
Bluetooth Operational States
Disconnected Connecting
Active Low Power
Inquiry Transmit
Page Connected
Sniff Hold
q 8 distinct states grouped under 4 high-level states
q Standby: Initial state
q Inquiry: Master broadcasts an inquiry packet. Slaves scan for inquiries and respond with their address and clock after a random delay (CSMA/CA)
Bluetooth Operational States (Cont)
q Page: Master in page state invites a slave device to join the piconet. Slave enters page response state and sends page response to the master.
q Master informs slave about its clock and address so that slave can participate in piconet.
q Connected: A short 3-bit logical address (member address within control header field) is assigned for the slave
q Transmit: station is transmitting or receiving a packet
Standby Inquiry
Transmit Park
Page Connected
Bluetooth Connection Establishment Procedure
Inquiry and Paging Flow Diagram
IAC = inquiry access code
FHS = frequency hopping synchronization
Connection Established
Master (initiator)
Slave (remote device)
Inquiry Response (ADDR, CLK)
Page Response
Inquiry Broadcast (IAC)
FHS (ADDR, CLK)
POLL (3-bit ADDR)
Bluetooth Connection Establishment Procedure
Inquiry and Paging Frequency Hopping
q Inquiry/page hopping sequence
Ø Hop over 32 subset of 79 channels/frequencies (to speedup)
Ø 32 is divided into two 16-channel trains
Ø For inquiry, each train is repeated 256 times before switching to the other train; must have 3 train switches (1st à 2nd à 1st à 2nd): each train effectively repeated 256 x 2 times
Ø Master sends two inquiry/page packets using 2 different frequencies per slot (hops in the middle of the slot; hops frequency in 312.5μs!), and listens for
responses (both frequencies) in the following slots (to speed up)àeventually 2 frequencies covered in 2 slots
q Connection establish time
Ø 16 x 625 μs = 10 ms for completing a train once
Ø Inquiry time (maximum) = 256 x 4 x 10 ms = 10.24 s Ø There is an additional paging time
Power Saving Modes in Bluetooth
Three inactive (power-saving) states:
1. Hold: Go inactive for a single short period and become active after that
2. Sniff: Low-power mode. Slave listens periodically after fixed sniff intervals.
3. Park: Very Low-power mode. Gives up its 3-bit active member address and gets an 8-bit parked member address. Wake up periodically
and listen to beacons. Master broadcasts a train of beacons periodically
Bluetooth Protocol Stack
Application Middleware
q RF: Gaussian Frequency Shift Keying (GFSK) modulation
q Baseband: Frequency hop selection, connection, MAC
Time Time FSK GFSK
Applications (Profiles)
Host Controller Interface
Link Manager
Baseband Layer
q Each device has a 48-bit IEEE MAC address q 3 parts:
Ø Lower address part (LAP) – 24 bits
Ø Upper address part (UAP) – 8 bits
Ø Non-significant address part (NAP) - 16 bits
q UAP+NAP = Organizationally Unique Identifier (OUI) from IEEE
q LAP is used in identifying the piconet and other operations
q Clock runs at 3200 cycles/sec or 312.5 μs (twice the hop rate)
8b 16b 24b
Upper Address Part
Non-sig. Address Part
Lower Address Part
Bluetooth Protocol Stack (Cont)
q Link Manager: Negotiate parameters, Set up connections
q Logical Link Control and Adaptation Protocol (L2CAP):
Ø Protocol multiplexing
Ø Segmentation and reassembly
Ø Controls peak bandwidth, latency, and delay variation
q Host Controller Interface: Chip independent interface to Bluetooth chip. Allows same software to run on all chips.
q RFCOMM Layer: Presents a virtual serial port Ø Sets up a connection to another RFCOMM
q Service Discovery Protocol (SDP): Devices can discover the services offered and their parameters
Ø E.g., Bluetooth keyboard, Ø Bluetooth mouse
Ø Bluetooth headset
Applications (Profiles)
Host Controller Interface
Link Manager
Bluetooth Protocol Stack (Cont)
q Bluetooth Network Encapsulation Protocol (BNEP): To transport Ethernet/IP packets over Bluetooth
q IrDA Interoperability protocols: Allow existing IrDA applications to work w/o changes. IrDA object Exchange (IrOBEX) and Infrared Mobile Communication (IrMC) for synchronization
q Audio is carried over 64 kbps over SCO links over baseband
q Telephony control specification binary (TCS-BIN): Call control including group management (multiple extensions, call forwarding, and group calls)
Ø Telephony has both audio and control
Ø Bluetooth telephone very popular in cars
q Application Profiles: Set of algorithms, options, and parameters
Ø To support specific applications ©2020
Applications (Profiles)
Host Controller Interface
Link Manager
Application Profile Examples
q Headset Profile
q Global Navigation Satellite System Profile
q Hands-Free Profile
q Phone Book Access Profile
q SIM Access Profile
q Synchronization Profile
q Video Distribution Profile
q Blood Pressure Profile
q Cycling Power Profile
q Find Me Profile
q Heart Rate Profile
q Basic Printing Profile
q Dial-Up Networking Profile
q File Transfer Profile
With IoT, the list is expected to grow rapidly over the coming years
Ref: Bluetooth SIGn, “Adopted Bluetooth Profiles, Services, Protocols and Transports,”
https://www.bluetooth.org/en-us/specification/adopted-specifications
Connecting a wireless keyboard with HID Bluetooth profile
Bluetooth Low Energy (BLE)
Bluetooth 4
Bluetooth LE or BLE
q Low Energy: 1% to 50% of Bluetooth classic
q For short broadcast: Your body temperature, Heart rate, Wearables, sensors, automotive, industrial.
Not for voice/video, file transfers, ...
q Small messages: 1Mbps data rate but throughput not critical. q Battery life: In years from coin cells
q Simple: Star topology. No scatter nets, mesh, ...
q Lower cost than Bluetooth classic
q New protocol design based on Nokia’s WiBree technology Shares the same 2.4GHz radio as Bluetooth
Þ Dual mode chips
q Most smartphones (iPhone, Android, ...) have dual-mode chips ©2020
BLE Channels
q 40 2MHz-wide channels: 3 (37,38,39) for advertising and 37 (0-36) for data q Advertising channels specially selected to avoid interference with popular
default WiFi channels (1,6,11)
BLE Advertising Channels Avoiding Popular
BLE Modulation and Data rate
q Binary GFSK over 2MHz channel: More significant frequency separations for ‘0’ and ‘1’ allows longer range with low power
Ø Note that with Bluetooth Classic, channel bandwidth is only 1MHz, so frequency separations are smaller
q 1 million symbols per secondà1 Mbps data rate
Benefit of Advertising Channels
q BLE simplifies discovery and broadcasting by using only three advertising channels (instead of 32 channels for inquiry/paging in BT Classic)
q A BLE device can broadcast advertising beacons on these 3 channels giving information about the device, so other devices can connect, but can also broadcast some sensor data
q Data channels are used to exchange data bidirectionally between two devices
Connection Events and Connection Intervals
q In BLE connections, devices wake up periodically after every connection interval (CI) time; transmit some data (connection event) and then go back to sleep until the next connection event
q Send a short blank packet if no data to send during a connection event
q More than one packet can be sent during a connection event
q Connection interval time can vary from 7.5ms to 4s and is negotiated during connection set up
q Hop frequency (switch to different data channel) at each event
... fk+n Sleep Sleep
Time Data Transfer
BLE Frequency Hopping Algorithm
Ø Where h (hop increment) is a fixed value negotiated during connection setup
Ø Note: Data channels range from 0-36
q Example hopping sequence for h=10: 0à10à20à30à3à13
q Adaptive FH: If the hopping lands on a bad channel, the channel is remapped to a good channel using a channel remapping algorithm
q Fixed hopping instead of pseudorandom qfk+1=(fk +h)mod37
Algorithm #1
Bluetooth Smart Protocol Stack
Applications
Generic Access Profile
Generic Attribute Profile
Attribute Protocol
Security Manager
Logical Link Control and Adaptation Protocol
Host Controller Interface
Link Layer
Direct Test Mode
Physical Layer
Controller
Generic Attribute (GATT) Profile
q Defines data formats and interfaces with the Attribute Protocol
Ø Define attributes instead of applications (a major difference from Bluetooth
Classic); temperature, pressure, heart rates are examples of attributes Ø New applications can be supported by using appropriate attributes
q Type-Length-Value (TLV) encoding is used
q Each attribute has a 16-bit Universally Unique ID (UUID) standardized by
Bluetooth SIG
Ø 216=65 thousand unique attributes can be defined!
q 128-bit UUID if assigned by a manufacturer
Ø Manufacturers can define their own attributes and still interoperate
q Allows any
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com