The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the...

60
The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II – Advanced Topics) Lecture about Wireless Personal Area Networks Mario Di Francesco Department of Computer Science and Engineering, Aalto University Department of Computer Science and Engineering, University of Texas at Arlington October 2, 2013

Transcript of The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the...

Page 1: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

The IEEE 802.15.4 Standardand the ZigBee SpecificationsCourse T-110.5111 (Computer Networks II – Advanced Topics)Lecture about Wireless Personal Area Networks

Mario Di Francesco

Department of Computer Science and Engineering, Aalto UniversityDepartment of Computer Science and Engineering, University of Texas at Arlington

October 2, 2013

Page 2: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

The IEEE 802.15.4 Standard

IEEE 802.15.4 and ZigBee 2/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 3: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Architecture and objectives

Physical layer

Data link layer

Network layer

Upper layers

IEEE 802.2 LLC

SSCS

Other LLC

IEEE 802.15.4 MACIEEE 802.15.4

868/915 MHz PHYIEEE 802.15.42400 MHz PHY

Architecture

� two physical (PHY) layer� MAC layer� ZigBee for the upper layers

Objectives� low-rate� low-power� low-complexity

IEEE 802.15.4 and ZigBee 3/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 4: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Components

Full Function Device(FFD)

Implements the entire standard

� Coordinatormanages (part of) thenetwork

� PAN coordinatormanages the whole PAN(unique in the network)

� (Regular) Devicecommunicates with FFDsand/or RFDs

Reduced Function Device(RFD)

Implements a reduced portion ofthe standard

� cannot be a (PAN)coordinator

� only communicates withFFDs

IEEE 802.15.4 and ZigBee 4/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 5: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Topology

Star

C

FFD

RFD

PANCoordinator

C

� all messages flow throughthe center (hub) of the star

Peer-to-peer

C

� neighboring nodes cancommunicate directly

� only available to FFDs

IEEE 802.15.4 and ZigBee 5/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 6: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Radio and modulation (1 of 2)

Two distinct physical layers� PHY 868/915 MHz� PHY 2400 MHz

Shared features� direct sequence spread spectrum (DSSS)� ISM (Industrial, Scientific and Medical) bands

IEEE 802.15.4 and ZigBee 6/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 7: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Radio and modulation (2 of 2)

PHY 868/915 MHz

2 MHz

868.0 868.6 902.0 928.0

Channel 0 Channels 1-10

f (MHz)

� 868 MHz (Europe)1 channel (20 kbps)

� 915 MHz (USA)8 channel (40 kbps)

� differential encoding(1 sym = 1 bit)

� BPSK encoding

PHY 2400 MHz

Channels 11-26

2400.0 2483.5

f (MHz)

5 MHz

� 16 channels� 250 kbps bandwidth� orthogonal encoding

(1 sym = 4 bits)� O-QPSK modulation

IEEE 802.15.4 and ZigBee 7/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 8: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Format of the PHY frame

PreambleStart-of-frame

delimiterFrame length PHY Service Data Unit (PSDU)

4 bytes 1 byte 1 byte ≤ 127 bytes

Synchronization Header PHY Header

PHY Protocol Data Unit (PPDU)

Header

� synchronization preamble� delimiter of the PHY frame� frame length

Payload� is the same as the MSDU� maximum size of 127 bytes

IEEE 802.15.4 and ZigBee 8/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 9: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Available primitives

Transceiver modes� RX_ON active

in receive mode� TX_ON active

in transmit mode� TRX_OFF inactive

(idle mode)

Channel Selection

Energy Detection (ED)

Link Quality Indication(LQI)

� “quality” of received frames� SNR, ED, or both

Clear Channel Assessment(CCA)

Different modes

1. energy above threshold2. carrier sense only3. combination of 1 and 2

IEEE 802.15.4 and ZigBee 9/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 10: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Addressing modes

PAN address� PANs can be co-located� 16 bits chosen by the PAN coordinator

Device address� 64-bit IEEE Extended Unique Identifier (EUI-64)

– 24-bit Organizationally Unique Identifier (OUI)– 40 bits assigned by the manufacturer

� 16-bit short address– assigned by the PAN coordinator during association

Overhead reduction� flag in the frame control field

IEEE 802.15.4 and ZigBee 10/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 11: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Format of the MAC frame

Framecontrol

Sequencenumber

Addressing fields Payload

2 bytes 1 byte Variable

MAC Header MAC Footer

MAC Protocol Data Unit (MPDU)

≤ 20 bytes

Frame checksequence

2 bytes

MAC Service Data Unit (MSDU)

Header

� frame control� sequence number� addressing fields

Frame payload

Footer� frame check sequence

(FCS) ITU-T CRC-16

IEEE 802.15.4 and ZigBee 11/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 12: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Frame types

Beacon frame� synchronization and management of the PAN

– list of devices with pending messages– superframe parameters

Acknowledgment frame

MAC payload

MAC command� command identifier (1 byte)� command payload

IEEE 802.15.4 and ZigBee 12/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 13: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Channel access methods

MAC

Non-beacon enabled Beacon enabled

Superframe Structure

Contention free

Reserved time slot

Contention based

Slotted CSMA-CA

Contention based

Unslotted CSMA-CA

IEEE 802.15.4 and ZigBee 13/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 14: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Superframe structure

GTS GTS

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

CAP CFP

SD = aBaseSuperFrameDuration*2SO sym

BI = aBaseSuperFrameDuration*2BO sym

Inactive

Active

Beacon Beacon

IEEE 802.15.4 and ZigBee 14/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 15: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Active period

Contention Access Period (CAP)� always present in the superframe� immediately follows the beacon� slotted CSMA-CA protocol

Contention Free Period (CFP)� optional� contiguous slots at the end of the superframe� without CSMA-CA

All transactions end within the CAP (CFP)

IEEE 802.15.4 and ZigBee 15/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 16: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Superframe parameters

Beacon interval

BI = aBaseSuperFrameDuration· 2BO sym

� interval between subsequent beacons� 0 ≤ BO ≤ 14, if BO = 15 no beacons

Superframe duration

SD = aBaseSuperFrameDuration· 2SO sym

� duration of the active part� 0 ≤ SO ≤ BO ≤ 14, if SO = 15 only active period

(no duty-cycle)

aBaseSuperFrameDuration = 960 sym ≈ 32 µs (2.4 GHz PHY)

IEEE 802.15.4 and ZigBee 16/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 17: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Synchronization

Tracking mode� the device gets the first beacon� then activates the transceiver before the subsequent one

Non tracking mode� the device only gets a single beacon� it has to reactivate the transceiver for at most

aBaseSuperframeDuration· (2BO + 1) sym

Orphaned device� does not detect beacons for aMaxLostBeacons (4) superframes

IEEE 802.15.4 and ZigBee 17/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 18: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

GTS management

Features of GTSs� unidirectional� at most 7, all in the CFP� each spanning one or more contiguous slots

GTS allocation� managed by the PAN coordinator

– the device requests a GTS to the PAN coordinator– the PAN coordinator decides whether to assign it or not

� advertised in the GTS parameters of the superframe� not always possible

– no GTS available– cannot reduce the size of the CAP further

IEEE 802.15.4 and ZigBee 18/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 19: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Frame spacing

Frames need to be separated by an Inter Frame Space (IFS)

Long frame Another frame

LIFS

Short frame Another frame

SIFS

� if pframe ≤ aMaxSIFSFrameSize (18) bytesthen SIFS (Short IFS) ≥ aMinSIFSPeriod (12) sym

� if pframe > aMaxSIFSFrameSize bytesthen LIFS (Long IFS) ≥ aMinLIFSPeriod (40) sym

IEEE 802.15.4 and ZigBee 19/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 20: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

The CSMA-CA algorithm

Common features� wait before transmitting� without RTS/CTS

Two variants� slotted (beacon enabled mode CAP)� unslotted (non-beacon enabled mode)

Features� backoff period slot of 20 sym (6= superframe slot)� slotted variant aligns rx/tx to backoff periods

IEEE 802.15.4 and ZigBee 20/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 21: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Initialization

CSMA-CA

NB=0

CW=2

Battery LifeExtension?

BE=min(2,macMinBE)

BE=macMinBE

Yes

No

Parameters� NB number of backoffs

(i.e., backoff attempts)� CW contention window� BE backoff exponent� macMinBE = 3 (default)

Battery Life Extension� power saving mode

IEEE 802.15.4 and ZigBee 21/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 22: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Main loop

Delay for a randombackoff period

∈ [0, 2BE-1]

Perform CCAon backoff period

boundary

Channel idle?

CW=2, NB=NB+1BE=min(BE+1,

aMaxBE)CW=CW-1

NB >macMaxCSMA

Backoffs?CW=0?

SuccessFailure

Yes

No

Yes

No

Yes

No

Slotted mode� waiting and CCAs

are aligned to backoffperiods

� two CCAs before tx� backoff timer stopped at the

end of the CAP andreactivated at the beginningof the subsequent one

In both cases� default max backoffs is 4

IEEE 802.15.4 and ZigBee 22/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 23: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Channel access example

Slotted CSMA-CA

DataaUnitBackoffPeriod

Backoff

SuperframeSlot

12 13 14 15 0 1 2

B

Backoff Backoff Data

Packetarrival

Backoff

CCA

Backoff timerpaused

C

A

B

IEEE 802.15.4 and ZigBee 23/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 24: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Communication reliability

CRC (FCS) check� CRC-16 computed over header and payload� checked against the FCS

Acks and retransmissions� at most aMaxFrameRetries = 3� ack waiting time is macAckWaitDuration (54 sym)

IEEE 802.15.4 and ZigBee 24/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 25: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Acks and retransmissions

Ack timing

Frame Ack

tack

Frame

tack

aUnitBackoffPeriodAck

� tack = aTurnAroundTime (unslotted)� aTurnAroundTime ≤ tack ≤

aTurnAroundTime + aUnitBackoffPeriod (slotted)� tack < SIFS < LIFS, at most aMaxFrameRetries = 3

IEEE 802.15.4 and ZigBee 25/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 26: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Sending data

Beacon enabled (CAP)

Coordinator Device

Data

Acknowledgement

Beacon

Non-beacon enabled

Coordinator Device

Data

Acknowledgement

IEEE 802.15.4 and ZigBee 26/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 27: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Receiving data (indirect transfer)Beacon enabled (CAP)

Coordinator Device

Beacon

Data request

Acknowledgement

Data

Acknowledgement

Non-beacon enabled

Coordinator Device

Data request

Acknowledgement

Data

Acknowledgement

IEEE 802.15.4 and ZigBee 27/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 28: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Peer-to-peer communications

We have previously considered� star topology� FFD or RFD devices

Peer-to-peer topology� only between FFDs� according to the tx case already seen

in the non-beacon enabled mode� synchronization not defined by the standard

IEEE 802.15.4 and ZigBee 28/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 29: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Security

Unsecured mode� no security� delegated to the upper layers

ACL mode� based on Access Control Lists

Secured mode� access control� anti-replay protection� confidentiality and integrity of messages

IEEE 802.15.4 and ZigBee 29/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 30: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Scanning modes

ED channel scan (only FFDs)� ED of the PHY layer

Active channel scan (only FFDs)� sends a beacon request command� waits for a reply

Passive channel scan� waits for a beacon

Orphan channel scan� resynchronization of orphaned nodes

IEEE 802.15.4 and ZigBee 30/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 31: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

PAN creation

FFD intending to be a PAN coordinator� starts an active channel scan� selects a (possibly unused) channel� selects a PAN identifier� starts transmitting beacons (in the beacon-enabled mode)

PAN identifier conflict� detection and resolution are supported by the MAC layer

IEEE 802.15.4 and ZigBee 31/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 32: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Association

Coordinator Device

Association request

Acknowledgement

Acknowledgement

Data request

Association response

Acknowledgement

Message exchange� the first ack does not imply

that the request has beenaccepted

� it depends on availableresources

� replies obtained as anindirect transmission

� maximum waiting timeaResponseWaitTime(30720 sym)

IEEE 802.15.4 and ZigBee 32/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 33: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Dissociation

Coordinator Device

Dissociation notification

Acknowledgement

Acknowledgement

Data request

Disassociation notification

Acknowledgement

Spontaneous

Coordinatordriven

Spontaneous� decided by the device� ack not really needed

Forced� decided by the coordinator� indirect transfer� ack not really needed

IEEE 802.15.4 and ZigBee 33/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 34: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

References

E. Callaway et al., Home Networking with IEEE 802.15.4: ADeveloping Standard for Low-Rate Wireless Personal AreaNetworks, IEEE Communications Magazine, August 2002

IEEE 802.15.4, Part 15.4: Wireless Medium Access Control(MAC) and Physical Layer (PHY) Specifications for Low-RateWireless Personal Area Networks (LR-WPANs), May 2003

Paolo Baronti, Prashant Pillai, Vince W.C. Chook, StefanoChessa, Alberto Gotta, Y. Fun Hu, Wireless sensor networks: Asurvey on the state of the art and the 802.15.4 and ZigBeestandards, Computer Communications, Volume 30, Issue 7, 26May 2007, Pages 1655–1695

IEEE 802.15.4 and ZigBee 34/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 35: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

The ZigBee specifications

IEEE 802.15.4 and ZigBee 35/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 36: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

The ZigBee consortium

Wireless Control That Simply Works

Objectives� interoperability between

platforms of differentvendors

� low-energy� low-cost� high node density

Reference scenarios� industrial and commercial� consumer electronics and

PC peripherals� personal healthcare and

home automation

IEEE 802.15.4 and ZigBee 36/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 37: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

The protocol stack (1 of 2)

IEEE 802.15.4

defined

ZigBeeTM Alliancedefined

End manufacturerdefined

Layerfunction

Layerinterface

Physical (PHY) Layer

Medium Access Control (MAC) Layer

Network (NWK) Layer

-

Application Support Sublayer (APS)

APS Message

BrokerASL Security

Management

APS Security

Management

Reflector

Management

Application

Object 240Application

Object 1

Application (APL) Layer

ZigBee Device Object

(ZDO)

Endpoint 240

APSDE-SAP

Endpoint 1

APSDE-SAP

Endpoint 0

APSDE-SAP

NLDE-SAP

MLDE-SAPMLME-SAP

PD-SAP PLME-SAP

NWK Security

Management

NWK Message

Broker

Routing

Management

Network

Management

2.4 GHz Radio 868/915 MHz

di

Security

Service

Provider

ZD

O P

ub

licIn

terfaces

Application FrameworkZ

DO

Managem

ent Plane

AP

SM

E-S

AP

NL

ME

-SA

P

IEEE 802.15.4 and ZigBee 37/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 38: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

The protocol stack (2 of 2)

The layers� Application layer (APL)

– service discovery– binding between devices and services– communication modes

� Network layer (NWK)– network topology– addressing and routing

� physical and MAC layers defined by the IEEE 802.15.4 standard

Other elements� ZDO Management Plane� Security Service Provider

IEEE 802.15.4 and ZigBee 38/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 39: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

ZigBee device model

Type Description Elements

ApplicationDevice Type

Type of device from theuser perspective

Motion detection sen-sor, light switch, etc.

ZigBee LogicalDevice Type

Type of device from thenetwork perspective

Network coordinator,router, end device

IEEE 802.15.4Device Type

Type of ZigBee hard-ware (radio) platform

Full Function Device,Reduced Function De-vice

� ZigBee products are a combination ofApplication, Logical e Physical Device Types

� how to combine the different Device Typesis defined by the vendor or by a profile

IEEE 802.15.4 and ZigBee 39/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 40: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

The application layer (APL)

Sublayers� Application Framework (AF)

– contains the higher layer application components(application objects) defined by the vendor

� Application Support Layer (APS)– links the application layer to the network layer

� ZigBee Device Object (ZDO)– is a special application object with management purposes

IEEE 802.15.4 and ZigBee 40/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 41: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

General concepts (1 of 2)

Profile� an agreement over messages, formats and actions

adopted by the applications running on different devicesto create a given distributed application

Component� a physical object and the corresponding application profile

ZigBee device� a (set of) component(s) sharing a ZigBee transceiver� each device has a unique 64-bit IEEE address

and a 16-bit network address

IEEE 802.15.4 and ZigBee 41/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 42: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

General concepts (2 of 2)

Attribute� an entity representing a physical quantity or state

Endpoint� a specific (sub)component within a ZigBee device� each device supports up to 240 endpoints

with distinct addresses

Cluster� container of attributes or a message� has a unique 8-bit address within a certain profile

IEEE 802.15.4 and ZigBee 42/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 43: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Sample addressing at the application layer

ZigBee DeviceZigBeeRadio

ZigBee Device

ZigBeeRadio

Home Control Profile� light control (on/off)� dimmer� motion detection

Legend

Endpoint

Link

Cluster

IEEE 802.15.4 and ZigBee 43/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 44: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Application Framework (1 of 2)

Features� contains application objects� provides two data services

– key value pair service (KVP)– messsage service (MSG)

Observations� exploits services made available by the APS� control and management of application objects

are handled by the ZigBee Device Object (ZDO)

IEEE 802.15.4 and ZigBee 44/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 45: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Application Framework (2 of 2)

Key Value Pair (KVP) service� allows to manipulate attributes defined

within the application objects� takes an approach based on state variables with transitions

– get, get response commands– set, event (and eventual response) commands

� uses data structures in compressed XML format

Message (MSG) service� allows the application profile to use its own frame format� has more flexibility than the KVP apprach

IEEE 802.15.4 and ZigBee 45/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 46: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

The application support layer (APS)

Objective� interfacing the application layer (AP) with the network layer

Features� generation of messages at the application layer (APDUs)� binding between devices and services� transport of APDUs between different devices

IEEE 802.15.4 and ZigBee 46/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 47: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Message transmission

Message format

Octets: 1 0/1 0/1 0/2 0/1 Variable

Frame control

Destination end-point

ClusterIdentifier

ProfileIdentifier

Source endpointFrame payload

Addressing fields

APS header APS payload

Transmission modes� direct or indirect transmissions� unicast or broadcast transmissions� acknowlegments and (optional) retransmissions

IEEE 802.15.4 and ZigBee 47/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 48: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Binding

Definition� creation of a unidirectional link between devices and endpoints� every devices keeps a binding table with entries in the format

(as, es, cs) = {(ad1, ed1), (ad2, ed2), . . . , (adn, edn)}

where

as address of the source device in the link

es endpoint of the source device in the link

cs cluster identifier used in the link

adi the i-th destination device address in the link

edi the i-th destination endpoint address in the link

IEEE 802.15.4 and ZigBee 48/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 49: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Features of the NWK layer

Objectives� ensures the proper functioning of the MAC layer� provides an interface to the application level

Major features� services for creating a PAN (ZigBee Coordinator )� services for device association (ZigBee Router and End Devices )� logical address assignment and routing (ZigBee Router )

IEEE 802.15.4 and ZigBee 49/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 50: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Network management

Network creation, device association and dissociation� high-level primitives of the IEEE 802.15.4 standard

Additional functions� message filtering� broadcast transmissions

Message format

Octets: 2 2 2 1 1 Variable

Frame Con-trol

Destination Address

SourceAddress

Radiusa

aCCB Comment #125

Sequence Numberb

Frame Payload

Routing Fields

NWK Header NWK Payload

IEEE 802.15.4 and ZigBee 50/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 51: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

ZigBee devices

ZigBee Coordinator� manages the entire network� PAN coordinator in IEEE 802.15.4 (FFD )

ZigBee Router� manages device association� routes the messages to devices� coordinator in IEEE 802.15.4 (FFD )

ZigBee End Device� regular device in the network� RFD or FFD in IEEE 802.15.4

IEEE 802.15.4 and ZigBee 51/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 52: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Network topologies

Tree network� non beacon-enabled mode of IEEE 802.15.4� beacon-enabled mode of IEEE 802.15.4

– active periods of different superframes should not interfere

Beacon Interval

Inactive Period

Superframe Duration

Beacon CAP

Mesh network� corresponds to the peer-to-peer network of IEEE 802.15.4� devices cannot use IEEE 802.15.4 beacons

IEEE 802.15.4 and ZigBee 52/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 53: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Distributed address assignment (1 of 2)

Used in tree networks (nwkUseTreeAddrAlloc = TRUE)

Parameters

Cm max number of children (per parent) nwkMaxChildren

Lm maximum depth of the tree nwkMaxDepth

Rm max number of routers (per parent) nwkMaxRouters

The address block assigned by each parent at level d to their own(child) routers is

Cskip(d) =

1 + Cm · (Lm − d − 1) if Rm = 1

1 + Cm − Rm − Cm · R Lm−d−1m

1− Rmotherwise

IEEE 802.15.4 and ZigBee 53/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 54: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Distributed address assignment (2 of 2)

Parent node� accepts children if Cskip(d) > 0� uses Cskip(d) as offset for router childrens� the n-th address An is given by

An = Aparent + Cskip(d) · Rm + n

with 1 ≤ n ≤ (Cm − Rm) and Aparent the parent address

Observations� addresses are sequentially assigned� a block of addresses cannot be shared between multiple devices

– one parent can run out of addresseswhile another parent has unused addresses

IEEE 802.15.4 and ZigBee 54/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 55: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Address assigned by upper layers

Used in the general case (nwkUseTreeAddrAlloc = FALSE)

Layer above the network� picks the block of addresses to assign� next address to assign nwkNextAddress� number of available addresses nwkAvailableAddresses� step used when assigning addresses nwkAddressIncrement

Algorithm� a router accepts associations if nwkAvailableAddresses > 0� the device is assigned the address nwkNextAddress� the router decrements nwkAvailableAddresses

and adds nwkAddressIncrement to nwkNextAddress

IEEE 802.15.4 and ZigBee 55/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 56: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Hierarchical routing

Finding the descendants� D is a descendant of A (at level d) if

A < D < A + Cskip(d − 1)

Forwarding towards descendants� if D is an End Device1 the next hop is N = D� if D is a Router the next hop is

N = A + 1 +

⌊D − (A + 1)

Cskip(d)

⌋· Cskip(d)

1 I.e., D > A + Rm · Cskip(d)

IEEE 802.15.4 and ZigBee 56/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 57: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Table-driven routing

Features� uses a simplified version of the

Ad Hoc On Demand Distance Vector Routing (AODV) protocol� every device with enough memory resources

keeps a routing table

Hybrid solution� hierarchical and table-driven routing can be used together

– if the destination is in the routing tablethen the corresponding entry is used

– if the destination is not known and the routing table has roomfor a new entry then the device starts route discovery

– otherwise messages are routed along the tree

IEEE 802.15.4 and ZigBee 57/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 58: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Routing metric (1 of 2)

Definitions

P path of length L, i.e., (D1,D2, . . . ,DL)

(Di ,Di+1) link (sub-path of length 2)

C(Di ,Di+1) cost of the link (Di ,Di+1)

Cost of a link� cost of a link l

[0, 1, . . . , 7] 3 C{l} =

7

min(

7, round(

1p4

l

))where pl is the probability of delivering a message over link l

IEEE 802.15.4 and ZigBee 58/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 59: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

Routing metric (2 of 2)

Path cost� path cost

C{P} =L−1∑i=1

C{(Di ,Di+1)}

Observations� pl can be estimated

through the LQI of IEEE 802.15.4� use of the metric

– route discovery– route maintenance

IEEE 802.15.4 and ZigBee 59/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture

Page 60: The IEEE 802.15.4 Standard and the ZigBee Specifications · The IEEE 802.15.4 Standard and the ZigBee Specifications Course T-110.5111 (Computer Networks II ... IEEE 802.15.4 and

References

ZigBee Alliance, ZigBee Specification, Version 1.0, December2004

Don Sturek, ZigBee V1.0 Architecture Overview, ZigBee OpenHouse Presentations, Oslo, June 2005

Ian Marsden, Network Layer Technical Overview, ZigBee OpenHouse Presentations, Oslo, June 2005

Paolo Baronti, Prashant Pillai, Vince W.C. Chook, StefanoChessa, Alberto Gotta, Y. Fun Hu, Wireless sensor networks: Asurvey on the state of the art and the 802.15.4 and ZigBeestandards, Computer Communications, Volume 30, Issue 7, 26May 2007, Pages 1655–1695

IEEE 802.15.4 and ZigBee 60/60M. Di Francesco October 2, 2013Aalto University T-110.5111 WPAN Lecture