36
Mobile and Wireless Networking 2013 / 2014 192620010 Mobile & Wireless Networking Lecture 8: Bluetooth & Zigbee [Schiller, Section 7.5] [Reader, Part 7] [Optional: Wikipedia, “Bluetooth”] Geert Heijenk

192620010 Mobile & Wireless Networking

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

192620010 Mobile & Wireless Networking

Lecture 8:

Bluetooth & Zigbee

[Schiller, Section 7.5] [Reader, Part 7]

[Optional: Wikipedia, “Bluetooth”]

Geert Heijenk

Page 2: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

2

Outline of Lecture 10

q  Bluetooth q  General characteristics q  Piconets & scatternets q  Basic Access scheme q  Baseband (MAC layer) q  Higher layer protocols q  Profiles and Versions

q  Zigbee q  Zigbee vs. IEEE 802.15.4 q  Architecture & Topologies q  IEEE 802.15.4 MAC layer

Page 3: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

3

Bluetooth

Idea q  Universal radio interface for ad-hoc wireless connectivity q  Interconnecting computer and peripherals, handheld devices,

PDAs, cell phones q  Embedded in other devices, goal: 5€/device q  Short range (10 m), low power consumption, license-free 2.45 GHz

ISM q  Voice and data transmission, approx. 1 Mbit/s gross data rate

(original version)

One of the first modules (Ericsson).

Page 4: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

4

Bluetooth

History q  1994: Ericsson (Mattison/Haartsen), “MC-link” project q  Renaming of the project: Bluetooth according to Harald “Blåtand”

Gormsen [son of Gorm], King of Denmark in the 10th century q  1998: foundation of Bluetooth SIG, www.bluetooth.org q  2001: first consumer products for mass market, spec. version 1.1

released q  2005: 5 million chips / week q  2014: Cumulative product shipments appr. 3 billion

Special Interest Group

q  Original founding members: Ericsson, Intel, IBM, Nokia, Toshiba q  Added promoters: 3Com, Agere (was: Lucent), Microsoft, Motorola q  > 10000 members q  Common specification and certification of products

Page 5: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

5

Characteristics

2.4 GHz ISM band, 79 (23) RF channels, 1 MHz carrier spacing q  Channel 0: 2402 MHz … channel 78: 2480 MHz q  GFSK modulation (1Mbit/s), 1-100 mW transmit power q  π/4-DQPSK (2Mbit/s) and 8DPSK (3Mbit/s) for Bluetooth 2.0+EDR

FHSS and TDD q  Frequency hopping with 1600 hops/s q  Hopping sequence in a pseudo random fashion, determined by a

master q  Time division duplex for send/receive separation

Voice link – SCO (Synchronous Connection Oriented) q  FEC (forward error correction), no retransmission, 64 kbit/s duplex,

point-to-point, circuit switched Data link – ACL (Asynchronous ConnectionLess)

q  Asynchronous, fast acknowledge, point-to-multipoint, up to 433.9 kbit/s symmetric or 723.2/57.6 kbit/s asymmetric, packet switched

Topology q  Overlapping piconets (stars) forming a scatternet

Page 6: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

6

M=Master S=Slave

P=Parked SB=Standby

M S

P

SB

S

S

P

P

SB

Piconet

q  Collection of devices connected in an ad hoc fashion

q  One unit acts as master and the others as slaves for the lifetime of the piconet

q  Master determines hopping pattern, slaves have to synchronize

q  Each piconet has a unique hopping pattern

q  Participation in a piconet = synchronization to hopping sequence

q  Each piconet has one master and up to 7 simultaneous slaves (> 200 could be parked)

Page 7: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

7

Forming a piconet

q  All devices in a piconet hop together q  Master gives slaves its clock and device ID

l  Hopping pattern: determined by device ID (48 bit, unique worldwide) l  Phase in hopping pattern determined by clock

q  Addressing q  Active Member Address (AMA, 3 bit) q  Parked Member Address (PMA, 8 bit)

SB SB

SB

SB

SB

SB

SB

SB

SB

M S

P

SB

S

S

P

P

SB

¿

¸

¾ Á ¹

»

·

½

¸

»

»

» Á »

»

»

»

¸

Page 8: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

8

Scatternet

q  Linking of multiple co-located piconets through the sharing of common master or slave devices q  Devices can be slave in one piconet and master of another

q  Communication between piconets q  Devices jumping back and forth between the piconets

M=Master S=Slave P=Parked SB=Standby

M

S

P

SB

S

S

P

P

SB

M

S

S

P

SB

Piconets (each with a capacity of < 1 Mbit/s)

Page 9: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

9

Time

Frequency

0

78

Frequency hopping

Page 10: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

10

Bluetooth protocol stack

Radio

Baseband

Link Manager

Control

Host Controller Interface

Logical Link Control and Adaptation Protocol (L2CAP) Audio

TCS BIN SDP

OBEX

vCal/vCard

IP

NW apps.

TCP/UDP

BNEP

RFCOMM (serial line interface)

AT modem commands

telephony apps. audio apps. mgmnt. apps.

AT: attention sequence OBEX: object exchange TCS BIN: telephony control protocol specification – binary BNEP: Bluetooth network encapsulation protocol

SDP: service discovery protocol RFCOMM: radio frequency comm.

PPP

Page 11: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

11

Basic access scheme

q  79 hops (in Japan, Spain, and France 23) at a 1 Mhz spacing q  dwel time of 625 µs q  master determines the hopping sequence q  TDD

t

t

A

B

f(k) f(k+1) f(k+2)

625 µs

Page 12: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

12

S

Frequency selection during data transmission

fk

625 µs

fk+1 fk+2 fk+3 fk+4

fk+3 fk+4 fk

fk

fk+5

fk+5

fk+1 fk+6

fk+6

fk+6

M M M M

M

M M

M M

t

t

t

S S

S S

S

Page 13: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

13

Baseband

q  Piconet/channel definition q  Low-level packet definition

q  Access code l  Channel, device access, e.g., derived from master

q  Packet header l  1/3-FEC, active member address (broadcast + 7 slaves), link type,

alternating bit ARQ/SEQ, checksum

access code packet header payload 68(72) 54 0-2745 bits

AM address type flow ARQN SEQN HEC 3 4 1 1 1 8 bits

preamble sync. (trailer)

4 64 (4)

Page 14: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

14

Baseband data rates Payload User Symmetric Asymmetric Header Payload max. Rate max. Rate [kbit/s]

Type [byte] [byte] FEC CRC [kbit/s] Forward Reverse

DM1 1 0-17 2/3 yes 108.8 108.8 108.8

DH1 1 0-27 no yes 172.8 172.8 172.8

DM3 2 0-121 2/3 yes 258.1 387.2 54.4

DH3 2 0-183 no yes 390.4 585.6 86.4

DM5 2 0-224 2/3 yes 286.7 477.8 36.3

DH5 2 0-339 no yes 433.9 723.2 57.6

AUX1 1 0-29 no no 185.6 185.6 185.6

HV1 na 10 1/3 no 64.0

HV2 na 20 2/3 no 64.0

HV3 na 30 no no 64.0

DV 1 D 10+(0-9) D 2/3 D yes D 64.0+57.6 D

ACL

1 slot

3 slot

5 slot

SCO

Data Medium/High rate, High-quality Voice, Data and Voice

Page 15: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

15

SCO payload types

payload (30)

audio (30)

audio (10)

audio (10)

HV3

HV2

HV1

DV

FEC (20)

audio (20) FEC (10)

header (1) payload (0-9) 2/3 FEC CRC (2)

(bytes)

Page 16: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

16

ACL Payload types

payload (0-343)

header (1/2) payload (0-339) CRC (2)

header (1) payload (0-17) 2/3 FEC

header (1) payload (0-27)

header (2) payload (0-121) 2/3 FEC

header (2) payload (0-183)

header (2) payload (0-224) 2/3 FEC

header (2) payload (0-339) DH5

DM5

DH3

DM3

DH1

DM1

header (1) payload (0-29) AUX1

CRC (2)

CRC (2)

CRC (2)

CRC (2)

CRC (2)

CRC (2)

(bytes)

Page 17: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

17

Baseband link types

q  Polling-based TDD packet transmission q  625µs slots, master polls slaves

q  SCO (Synchronous Connection Oriented) – Voice q  Periodic single slot packet assignment, 64 kbit/s full-duplex, point-to-point

q  ACL (Asynchronous ConnectionLess) – Data q  Variable packet size (1,3,5 slots), asymmetric bandwidth, point-to-multipoint

MASTER

SLAVE 1

SLAVE 2

f6 f0

f1 f7

f12

f13 f19

f18 SCO SCO SCO SCO ACL

f5 f21

f4 f20 ACL ACL

f8

f9

f17

f14 ACL

Page 18: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

18

Robustness

q  Slow frequency hopping with hopping patterns determined by a master q  Protection from interference on certain frequencies q  Separation from other piconets (FH Spread Spectrum)

q  Retransmission q  ACL only, very fast

q  Forward Error Correction q  SCO and ACL

MASTER

SLAVE 1

SLAVE 2

A C C H F

G G

B D E

NAK ACK

Error in payload (not header!)

Page 19: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

19

Link manager protocol

q  Authentication, pairing and encryption q  Synchronization q  Capability negotiation q  Quality of service negotiation q  Power control q  State and transmission mode change

Page 20: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

20

Baseband states of a Bluetooth device

standby

inquiry page

connected AMA

transmit AMA

park PMA

hold AMA

sniff AMA

unconnected

connecting

active

low power

Standby: do nothing Inquire: search for other devices Page: connect to a specific device Connected: participate in a piconet

detach

Park: release AMA, get PMA Sniff: listen periodically, not each slot Hold: stop ACL, SCO still possible, possibly

participate in another piconet

Page 21: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

21

L2CAP - Logical Link Control and Adaptation Protocol

q  Simple data link protocol on top of baseband

q  Connection oriented, connectionless, and signalling channels

q  Protocol multiplexing q  RFCOMM, SDP, telephony control

q  Segmentation & reassembly q  Up to 64kbyte user data, 16 bit CRC used from baseband

q  QoS flow specification per channel q  Follows RFC 1363, specifies delay, jitter, bursts, bandwidth

q  Group abstraction q  Create/close group, add/remove member

Page 22: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

22

L2CAP logical channels

baseband

L2CAP

baseband

L2CAP

baseband

L2CAP

Slave Slave Master

ACL

2 d 1 d d 1 1 d 2 1

signalling connectionless connection-oriented

d d d

Page 23: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

23

L2CAP packet formats

length 2 bytes

CID=2 2

PSM ≥2

payload 0-65533

length 2 bytes

CID 2

payload 0-65535

length 2 bytes

CID=1 2

One or more commands

Connectionless PDU

Connection-oriented PDU

Signalling command PDU

code ID length data 1 1 2 ≥0

Page 24: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

24

Security

E3

E2

link key (128 bit)

encryption key (128 bit)

payload key

Keystream generator

Data Data Cipher data

Authentication key generation (possibly permanent storage)

Encryption key generation (temporary storage)

PIN (1-16 byte) User input (initialization)

Pairing

Authentication

Encryption

Ciphering

E3

E2

link key (128 bit)

encryption key (128 bit)

payload key

Keystream generator

PIN (1-16 byte)

Page 25: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

25

SDP – Service Discovery Protocol

q  Inquiry/response protocol for discovering services q  Searching for and browsing services in radio proximity q  Adapted to the highly dynamic environment q  Can be complemented by others like SLP, Jini, Salutation, … q  Defines discovery only, not the usage of services q  Caching of discovered services q  Gradual discovery

Page 26: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

26

Profiles

Represent default solutions for a certain usage model q  Vertical slice through the protocol stack q  Basis for interoperability

q  Generic Access Profile q  Service Discovery Application Profile q  Cordless Telephony Profile q  Intercom Profile q  Serial Port Profile q  Headset Profile q  Dial-up Networking Profile q  Fax Profile q  LAN Access Profile q  Generic Object Exchange Profile q  Object Push Profile q  File Transfer Profile q  Synchronization Profile

Additional Profiles Advanced Audio Distribution PAN Audio Video Remote Control Basic Printing Basic Imaging Extended Service Discovery Generic Audio Video Distribution Hands Free Hardcopy Cable Replacement

Profiles

Pro

toco

ls

Applications

Page 27: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

Example use of Bluetooth Profiles

27

Page 28: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

Bluetooth versions

Bluetooth 1.1 q  also IEEE Standard 802.15.1-2002 q  initial stable commercial standard

Bluetooth 1.2 q  also IEEE Standard 802.15.1-2005 q  eSCO (extended SCO): variable bitrates, retransmission for SCO q  Faster connection & discovery q  AFH (adaptive frequency hopping) to avoid interference

Bluetooth 2.0 + EDR (2004, no more IEEE) q  EDR (enhanced date rate) of 3.0 Mbit/s (2.1 Mbit/s net) for ACL and eSCO

using higher order modulation (GPSK à DQPSK / 8DPSK) q  lower power consumption due to shorter duty cycle

Bluetooth 2.1 + EDR (2007) q  better pairing support, e.g. using NFC q  improved security

Bluetooth 3.0 + HS (2009) q  Bluetooth 2.1 + EDR + IEEE 802.11a/g = 54 Mbit/s

Bluetooth 4.0 (2010) q  Classic Bluetooth + Bluetooth HS + Bluetooth Low Energy

Bluetooth 4.1 (2013)

Page 29: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

29

Outline of Lecture 10

q  Bluetooth q  General characteristics q  Piconets & scatternets q  Basic Access scheme q  Baseband (MAC layer) q  Higher layer protocols q  Profiles and Versions

q  Zigbee q  Zigbee vs. IEEE 802.15.4 q  Architecture & Topologies q  IEEE 802.15.4 MAC layer

Page 30: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

30

Zigbee / IEEE 802.15-4 Background

•  Low-Rate, Very Low-Power •  IEEE 802.15.4 for PHY and MAC •  Zigbee specifies higher layers

q  Low data rate solution with multi-month to multi-year battery life q  very low complexity q  range 10 - 75 meter q  Potential applications are sensors, interactive toys, smart badges,

remote controls, and home automation

Page 31: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

ZigBee

Relation to 802.15.4 similar to Bluetooth / 802.15.1 Pushed by Chipcon (now TI), Ember, Freescale (Motorola),

Honeywell, Mitsubishi, Motorola, Philips, Samsung… More than 260 members

q  about 15 promoters, 133 participants, 111 adopters q  must be member to commercially use ZigBee spec

ZigBee platforms comprise

q  IEEE 802.15.4 for layers 1 and 2 q  ZigBee protocol stack up to the applications

Page 32: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

802.15.4 Characteristics

q  16 channels in the 2.4 GHz ISM band (worldwide), 30 (was 10) channels in the 915 MHz US ISM band and 1 channel in the European 868 MHz band

q  Various Physical Layers q  Data rates of 20-250 kbit/s, latency down to 15 ms q  Data packets up to 127 bytes q  Master-Slave or Peer-to-Peer operation q  Up to 254 devices or 64516 simpler nodes q  CSMA/CA channel access, slotted (beacon) or unslotted q  Automatic network establishment

by a PAN (Personal Area Network) coordinator

32

Page 33: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

33

IEEE 802.15.4 Architecture

!"""#$%&'()*+,*-.)((/ 01230&345&6"781910!734&38"3&4"7:18;#<9387&+,*-=

!" 2>?@ABCD$&E&)((/&!"""*&3FF&ABCD$G&AHGHAIH%*

!"#$%&'()*+$,-&%'-%&&'.&-/0%1

234*00%5 ".6 -0%

+

(

) J

-

/

K

'

+)

+(

++

L

(

+-

)(

))

,

=&M BAG $&934 &2 >> A% BNO $> A

=&5 HI BPH

=&934 &2 >> A% BNO $> AG &&&

934 &!5 &)934 &!5 &J

934 &!5 &-

934 &!5 &/

934 &!5 &,

934 &!5 &K

+)

J

-

, /

(

934 &!5 &+ +

)

J

,

'

#$%&'()*+,-./0/1.2+344+56!7+8)*+,9,&0/1.2+344+:6;6<7+

8)*+.=0/1.2+344+"6<7+>?@+8)*+.9,&0/1.2+344+:6;6!6

!"#$%&'7)89:;234'5&<"=&'6%=>"-&=-$%&

9D@GBPOF&6H%BQR

9ST

632

'()*)&002

U??HA&0O@HAG

##2#

!"#$%! !&'(#$%!

'&'(#$%!')!$#$%!

Page 34: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

34

Reduced Function Device

Full Function Device (FFD)

Router (role of FFD)

PAN Coordinator (role of FFD)

Cluster Tree N.T (only 802.15.4,

not Zigbee)

Star N.T

IEEE 802.15.4 Topologies

Topologies:

Modes of operation: •  Beacon-enabled •  Non-beacon-enabled MAC frames

q  Beacon-enabled : 4 frame types l  Beacon frame l  Data frame l  Acknowledgment frame l  MAC command frame

q  Non-beacon-enabled : 2 frame types l  Data frame l  Acknowledgment frame

Mesh N.T Tree N.T

Page 35: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

35

IEEE 802.15.4 Basic MAC characteristics

Beacon-enabled networks (star / tree): q  use of a superframe structure based on beacons q  slotted CSMA-CA q  Guaranteed time slots (GTS) in a (contention-free period)

for time critical applications q  allows for low duty cycle operation q  beacon interval can range from 15 ms to 786 s Non-beacon enabled networks (only peer-to-peer): q  no coordinator q  (Un-slotted) CSMA-CA

Page 36: 192620010 Mobile & Wireless Networking

Mobile and Wireless Networking 2013 / 2014

36

IEEE 802.15.4 Beacon-enabled MAC

Beacon

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

GTS GTS Inactive

CAP CFP Beacon

SD: Superframe Duration

BI: Beacon Interval

CAP: Contention Access Period

CFP: Contention Free Period