IEEE 802.15.4-Zigbee
IEEE 802.15.4-Zigbee
ZigBee
What is ZigBee?
• ZigBee is a ad-hoc networking technology for
LR-WPAN (Low Rate WPAN)
• Based On IEEE 802.15.4 standard that defines
the PHY and Mac Layers for ZigBee.
• Intended for 2.45 GHz, 868 MHz and 915 MHz
Band.
Zigbee Characteristics
• Low in cost, complexity & power
consumption
• Intended to network inexpensive devices
• Data rates touch
– 250Kbps for 2.45 GHz band
– 40 Kbps 915 MHz band
– 20Kbps for 868 MHz band
802.15.4 Architecture
Upper Layers
IEEE 802.2
IEEE 802.15.4 SSCS
LLC, Type I
Customer
Application
Application Interface
Network Layer
ZigBee Alliance
Data Link Layer
MAC Layer
IEEE
MAC Layer
PHY Layer
ZigBee
Silicon Application
Stack
Bluetooth Protocol Stack
Group Call
User Interface
Intercom
Cordless
vMessage
Headset
Networking
Dial-up
vNote
vCard
vCal
Fax Service
Discovery
Telephony OBEX Protocol
Control
RFCOMM
Protocol
(Serial Port)
HOST
L2CAP
Host Control Interface
Voice
Link Manager
Link Controller
MODULE
Baseband
RF
Bluetooth
Silicon Applications
Stack
Range Estimation
Network coordinator
Network node
IEEE node
Communications flow
Virtual links
Supported Traffic Types
• Periodic data
– Application defined rate
• Intermittent
– Basic communication
• Sets up a network
• Receives constantly
The Network Node
• Searches for available networks
• Transfers data from its application as
necessary
• Determines whether data is pending
• Requests data from the network
coordinator
• Can sleep for extended periods
Star Topology
PAN
coordinator
Master/slave
FFD
PAN
coordinators
RFD
ZigBee Network Devices
Cluster Tree Network
Network Architecture
Types of PAN
• Non-Beacon Enabled PAN
Un-slotted CSMA/CA
• Beacon Enabled PAN
Slotted CSMA/CA
Superframe Structures
• A superframe is formed by the PAN
coordinator to synchronize network
reception and transmission.
Traffic-Modes
Beacon mode:
Non-Beacon mode:
• Coordinator/routers
have to stay awake
(robust power supply
needed)
• Heterogeneous
network
• Asymmetric power
MAC Sublayer Services
• MAC Data Service and
• MAC Management Service
Features of MAC sublayer
• Beacon management
• Channel access
• GTS management,
• Frame validation
• Acknowledged frame delivery
• Association and
• Disassociation
Superframe Structure
• Superframe is bounded by network beacons
and is divided into 16 equally sized slots
• Beacon frame is sent in the first slot of each
superframe
• If a coordinator does not want to use the
superframe structure, it may turn off the
beacon transmissions
• Beacons are used to synchronize the
attached devices, to identify the PAN and to
describe the structure of superframes.
Superframe
• Superframe can have an active and an inactive
portion
• During the inactive portion, the coordinator shall not
interact with its PAN and may enter a low-power
mode
• Active portion portion consists of contention access
period (CAP) and contention free period (CFP)
• Any device wishing to communicate during the CAP
shall compete with other devices using a slotted
CSMA/CA mechanism
Guaranteed Time Slots (GTS)
• On the other hand, the CFP contains
guaranteed time slots (GTSs)
• GTSs always appear at the end of the active
superframe starting at a slot boundary
immediately following the CAP.
• The PAN coordinator may allocate up to
seven of these GTSs and a GTS can occupy
more than one slot period.
GTS
• A GTS allows a device to operate on the
channel within a portion of the superframe
that is dedicated exclusively to that device.
• A device shall attempt to allocate and use a
GTS only if it is currently tracking the
beacons.
• A GTS shall be allocated only by the PAN
coordinator and it shall be used only for
communications between the PAN
coordinator and a device
Superframe
• The duration of different portions of the superframe
are described by the values of macBeaconOrder
and macSuperFrameOrder
• macBeaconOrder describes the interval at which
the coordinator shall transmit its beacon frames
• The beacon interval, BI, is related to the
macBeaconOrder, BO
Superframe
• The active portion of each superframe is
divided into a equally spaced slots of fixed
duration 2SOaBaseSlotDuration
• Composed of three parts: a beacon, a CAP
and CFP
• The beacon is transmitted at the start of
slot 0 without the use of CSMA
• The CAP starts immediately after the
beacon
CFP
• The CFP, if present, shall start on a slot
boundary immediately following the CAP and
extends to the end of the active portion of the
superframe
• The length of the CFP is determined by the
total length of all of the combined GTSs
• No transmissions within the CFP shall use a
CSMA/CA mechanism
CFP
• A device transmitting in the CFP shall ensure that
its transmissions are complete one IFS period
before the end of its GTS.
• IFS time is the amount of time necessary to
process the received packet by the PHY.
• Transmitted frames shall be followed by an IFS
period.
• The length of IFS depends on the size of the frame
that has just been transmitted.
• Frames of up to aMaxSIFSFrameSize in length
shall be followed by a SIFS whereas frames of
greater length shall be followed by a LIFS (Always)
Optional Frame Structure
Battery life
extension GTS 2
GTS 3 GTS 1
15ms * 2n
where 0 n 14
Contention
Access by any node using CSMA/CA
period
Guaranteed
Reserved for nodes requiring guaranteed bandwidth [n = 0].
Time Slot
Optional Frame Structure
SO = Superframe order
BO = Beacon order
Inactive Period
15ms * 2SO
where 0 SO 14
15ms * 2BO
where SO BO 14
Network Transmitted by PAN coordinator. Contains network information,
beacon frame structure and notification of pending node messages.
Beacon
extension Space reserved for beacon growth due to pending node messages
period
Contention
Access by any node using CSMA/CA
period
Guaranteed
Reserved for nodes requiring guaranteed bandwidth [n = 0].
Time Slot
No Superframe
• The PANs that do not wish to use the
superframe in a nonbeacon-enabled shall
set both macBeaconOrder and
macSuperFrameOrder to 15
• In this kind of network
– a coordinator shall not transmit any beacons
– all transmissions except the acknowledgement
frame shall use unslotted CSMA-CA to access
channel
– GTSs shall not be permitted
Zigbee Frame Types
• Beacon Frame (Frame Type field 000)
• Data Frame (001)
• Acknowledgement Frame (010)
• MAC Command Frame (011)
General MAC Frame Format
Octets:2 1 0/2 0/2/8 0/2 0/2/8 variable 2
Destination Source
Destination Source Frame
Frame Sequence PAN PAN Frame
address address check
control number identifier identifier payload
sequence
Addressing fields
MAC
MAC header MAC footer
payload
Unacknowledged transmission
MCPS-DATA.request
Data frame
MCPS-DATA.indication
MCPS-DATA.confirm
Indirect Data Transfer
Message Sequence Diagram
Coordinator Coordinator Device Device
higher layer MAC MAC higher layer
MCPS-DATA.request
(indirect)
Beacon frame
Data request
Acknowledgement
Data frame
Acknowledgment
MCPS-DATA.indication
MCPS-DATA.confirm
Starting and Maintaining PANs
• A PAN shall be started by an FFD only after
an active channel or ED channel scan has
been performed and a suitable PAN identifier
selection has been made.
• The active scan allows the FFD to locate any
coordinator transmitting beacon frames
within its POS (personal operating space).
• An ED scan allows the FFD obtain a
measure of the peak energy in each
requested channel.
Starting and Maintaining PANs…
• An active channel scan is requested over a
specified set of logical channels.
• For each logical channel, the device shall
first switch to the channel and send a
beacon request command.
• The device shall then enable its receiver for at
most aBaseSuperframeDuration * (2n +1)
symbols, where n is between 0 and 14.
– During this time, the device shall reject all non-
beacon frames and record the information
contained in all unique beacons in a PAN
descriptor structure.
Starting and Maintaining PANs…
• If the coordinator of a beacon-enabled PAN
receives the beacon request command, it shall
ignore the command and continue transmitting
its beacons as usual.
• If the coordinator of a non-beacon-enabled PAN
receives this command, it shall transmit a single
beacon frame using unslotted CSMA-CA.
• The active scan on a particular channel
terminates when the number of PAN
descriptors stored equals implementation-
specified maximum
Passive Scan
Device Device Coordinator
higher layer MAC MAC
MLME-SCAN.request
st
Set 1 Channel
ScanDuration
Beacon
nd
Set 2 Channel
MLME-SCAN.confirm
Active Scan
Device Device Coordinator
higher layer MAC MAC
MLME-SCAN.request
st
Set 1 Channel
Beacon request
CSMA
ScanDuration Beacon
nd
Set 2 Channel
Beacon request
MLME-SCAN.confirm
Starting and Maintaining PANs…
• An ED scan allows the FFD obtain a
measure of the peak energy in each
requested channel.
• During the ED scan, the MAC sublayer shall
discard all frames received over the PHY
data service.
– An ED scan is performed over a set of logical
channels.
– For each logical channel, repeatedly perform an
ED measurement for aBaseSuperframeDuration
(2n + 1) where n is the value of the
scanDuration.
Starting and Maintaining PANs…
• The maximum ED measurement obtained
during this period shall be noted before
moving onto the next channel in the channel
list.
• The ED scan shall terminate when either the
number of channel ED measurements stored
equals the implementation-specified
maximum or energy has been measured on
each of the specified logical channels.
Beacon Generation
• FFD may either operate in a beaconless mode or
may begin beacon transmissions either as the
PAN coordinator or as a device on a previously
established PAN.
• An FFD that is not the PAN coordinator shall
begin transmitting beacon frames only when it
has successfully associated with a PAN.
• This primitive also includes macBeaconOrder
and macSuperFrameOrder parameters that
determine the duration of the beacon interval and
the duration of the active and inactive portions.
Management Service
• Access to the PIB
• Association / disassociation
• GTS allocation
• Message pending
• Node notification
• Network scanning/start
• Network synchronization/search
MAC Management Primitives
Primitive Request Confirm Indication Response
MLME-GET Required Required
MLME-SET Required Required
MLME-ASSOCIATE Required Required Optional for RFD Optional for RFD
MLME-DISASSOCIATE Required Required Required
MLME-GTS Optional for RFD Optional for RFD Optional for RFD
MLME-BEACON-NOTIFY Required
MLME-POLL Required Required
MLME-COMM-STATUS Required
MLME-ORPHAN Optional for RFD Optional for RFD
MLME-SCAN Required Required
MLME-START Optional for RFD Optional for RFD
MLME-RX-ENABLE Required Required
MLME-SYNC Required
MLME-SYNC-LOSS Required
MLME-RESET Required Required
Association
• Association of a device starts after having
completed either an active channel scan or a
passive channel scan.
• The passive scan, like an active scan, allows a
device to locate any coordinator transmitting
beacon frames within its POS
• Beacon request command is not required for
passive scan.
• The results of the channel scan are then used to
choose a suitable PAN.
• A device shall attempt to associate only with a PAN
that is currently allowing association.
Association
• Following the selection of a PAN with which to
associate, the next higher layers request that
MLME configures the phyCurrentChannel to the
appropriate logical channel on which to associate,
macPANId to the identifier of the PAN with which
to associate and macCoordExtendedAddress or
macCoordShortAddress to the address of the
coordinator with which it associates.
• An unassociated device shall initiate the
association procedure by sending an associate
request command to the coordinator of an
existing PAN.
Association
Message Sequence Diagram
Device Device Coordinator Coordinator
higher layer MAC MAC higher layer
Acknowledgment
MLME-ASSOCIATE.indication
aResponseWaitTime
MLME-ASSOCIATE.response
Data request
Acknowledgment
Association response
Acknowledgement
MLME-ASSOCIATE.confirm MLME-COMM-STATUS.indication
Disassociation
• When a coordinator wants one of its associated devices to leave
the PAN, it shall send the disassociation notification command to
the device using indirect transmission.
– Upon reception of the packet, the device should send the acknowledgement
frame.
– Even if the ack is not received, the coordinator shall consider the device
disassociated.
• If an associated device wants to leave the PAN, it shall send a
disassociation notification command to the coordinator.
– Upon reception, the coordinator sends ack.
– Even if the ack is not received, the device shall consider itself disassociated.
• An associated device shall disassociate itself by removing all
references to the PAN.
• A coordinator shall disassociate a device by removing all
references to that device.
Disassociation
Message Sequence Diagram
=
Originator Originator Recipient Recipient
higher layer MAC MAC higher layer
MLME-DISASSOCIATE.request
Disassociation notification
Acknowledgment
MLME-DISASSOCIATE.confirm MLME-DISASSOCIATE.indication
Data Polling
Message Sequence Chart
MLME-POLL.request
Data request
Acknowledgment (FP = 0)
MLME-POLL.confirm
MLME-POLL.request
Data request
Acknowledgment (FP = 1)
Data
Acknowledgement
MLME-POLL.confirm
MCPS-DATA.indication
=
Coordinator Coordinator Device
higher layer MAC MAC
Orphan notification
MLME-ORPHAN.indication
MLME-ORPHAN.response
Coordinator realignment
MLME-COMM-STATUS.indication
Slotted CSMA Procedure
Slotted CSMA
Delay for
random(2BE - 1) unit
NB = 0, CW = 0 backoff periods
Y Perform CCA on
Battery life BE = lesser of
backoff period
extension? (2, macMinBE)
boundary
N
BE = macMinBE Y
Channel idle?
N NB> N
macMaxCSMABackoffs CW = 0?
?
Used in beacon enabled networks. Y Y
Failure Success
Un-slotted CSMA Procedure
Un-slotted CSMA
NB = 0,
BE = macMinBE
Perform CCA
Y
Channel idle?
NB = NB+1,
BE = min(BE+1, aMaxBE)
N NB>
macMaxCSMABackoffs
?
Failure Success