0% found this document useful (0 votes)
23 views78 pages

IEEE 802.15.4-Zigbee

Uploaded by

Anuj Ruhela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views78 pages

IEEE 802.15.4-Zigbee

Uploaded by

Anuj Ruhela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 78

IEEE 802.15.

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

IEEE 802.15.4 MAC

IEEE 802.15.4 IEEE 802.15.4


868/915 MHz 2400 MHz
PHY PHY
Typical Implementation
Protocol Features
• Master/slave topology
• Automatic network configuration
• Dynamic slave device addressing
• Virtual peer-to-peer links (pairing)
• Full handshaking for packet transfers
• Power management features
• Up to 254 (+ master) network nodes
Protocol Features Cont...
• CSMA-CA channel access mechanism
• 28kbps (Optional) & 200kbps (actual) data
throughput
• Service discovery
• Low impact internet capability
ZigBee Protocol Stack

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

0dBm 10dBm 20dBm


250kbps
13 29 66
28kbps
23 54 134
Network Topology
Star and Mesh

Network coordinator
Network node
IEEE node

Communications flow
Virtual links
Supported Traffic Types
• Periodic data
– Application defined rate

• Intermittent
– Basic communication

• Repetitive low latency data


– Allocation of guaranteed time slots
Managing PANs
• Channel scanning (ED, active, passive,
orphan)
• PAN ID conflict detection and resolution
• Starting a PAN
• Sending beacons
• Device discovery
• Device association/disassociation
• Synchronization (beacon/non-beacon)
• Orphaned device realignment
IEEE 802.15.4 Device Classes
• Full function device (FFD)
– Any topology
– Network coordinator capable
– Talks to any other device
• Reduced function device (RFD)
– Limited to star topology
– Cannot become a network coordinator
– Talks only to a network coordinator
– Very simple implementation
IEEE 802.15.4 Definitions
• Network Device: An RFD or FFD implementation
containing an IEEE 802.15.4 medium access
control and physical interface to the wireless
medium.
• Coordinator: An FFD with network device
functionality that provides coordination and other
services to the network.
• PAN Coordinator: A coordinator that is the
principal controller of the PAN. A network has
exactly one PAN coordinator.
The Network Coordinator
• Transmits network beacons

• Sets up a network

• Manages network nodes

• Stores network node information

• Routes messages between paired nodes

• 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

RFD Communications flow


Peer-Peer Topology

PAN
coordinators

Point to point Cluster tree


FFD
Communications flow
RFD
Combined Topology

FFD Communications flow

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:

• Beacon send periodically


• Coordinator and end
device can go to sleep
• Lowest energy
consumption
• Precise timing needed
• Beacon period (ms-m)
Traffic-Modes

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

Contention Access Period Contention Free Period


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

15ms * 2n
where 0  n  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
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

Bits: 0-2 3 4 5 6 7-9 10-11 12-13 14-15


Dest. Source
Sequrity Frame
Frame type Ack. Req. Intra PAN Reserved addressing Reserved addressing
enabled pending
mode mode

Frame control field


Beacon Frame Format

Octets:2 1 4 or 10 2 variable variable variable 2


Beacon Pending Frame
Frame Source address Superframe GTS
sequence address Beacon payload check
control information specification fields
number fields sequence
MAC
MAC header MAC payload
footer

Bits: 0-3 4-7 8-11 12 13 14 15


Beacon Superframe Final CAP Battery life PAN Association
Reserved
order order slot extension coordinator permit
MAC Command Frame
Octets:2 1 4 to 20 1 variable 2
Data Frame
Frame Address Command
sequence Command payload check
control information type
number sequence
MAC
MAC header MAC payload
footer

• Command Frame Types


– Association request (0x01)  Orphan Notification
– Association response  Beacon request
– Disassociation notification  Coordinator realignment
– Data request  GTS request (0x09)
– PAN ID conflict notification
CSMA-CA Algorithm
• If superframe structure is used in the PAN, then
slotted CSMA-CA shall be used.
• If beacons are not being used in the PAN or a
beacon cannot be located in a beacon-enabled
network, unslotted CSMA-CA algorithm is used.
• In both cases, the algorithm is implemented using
units of time called backoff periods, which is equal
to aUnitBackoffPeriod symbols.
CSMA/CA …
• In slotted CSMA-CA channel access
mechanism, the backoff period boundaries of
every device in the PAN are aligned with the
superframe slot boundaries of the PAN
coordinator.
• In slotted CSMA-CA, each time a device wishes
to transmit data frames during the CAP, it shall
locate the boundary of the next backoff period.
• In unslotted CSMA-CA, the backoff periods of
one device do not need to be synchronized to
the backoff periods of another device.
Data Service
• Data transfer to neighboring devices
– Acknowledged or unacknowledged
– Direct or indirect
– Using GTS service
• Maximum data length (MSDU)
aMaxMACFrameSize (102 bytes)
• The applications transfers are completely
controlled by the devices on a PAN rather
than by the coordinator
• This provides the energy-conservation feature
of the ZigBee network
Data Transfer
• Three types of data transfer transactions
exist:
• from a coordinator to a device,
• from a device to a coordinator and
• between two peer devices
• The mechanism for each of these transfers
depend on whether the network supports the
transmission of beacons.
Data Transfer
• When a device wishes to transfer data in a
nonbeacon-enabled network, it simply
transmits its data frame, using the unslotted
CSMA-CA, to the coordinator.
• There is also an optional acknowledgement
at the end.
Data Transfer – Beakon Enabled
• When a device wishes to transfer data to a
coordinator in a beacon-enabled network, it
first listens for the network beacon
• When the beacon is found, it synchronizes to
the superframe structure.
• At the right time, it transmits its data frame,
using slotted CSMA-CA, to the coordinator.
• There is also an optional acknowledgement
at the end.
Data Frame Format
Octets:2 1 4 to 20 variable 2
Data Frame
Frame Address
sequence Data payload check
control information
number sequence
MAC
MAC header MAC Payload
footer

Acknowledgement Frame Format


Octets:2 1 2
Data Frame
Frame
sequence check
control
number sequence
MAC
MAC header
footer
Inter-frame Spacing
Acknowledged transmission

Long frame ACK Short frame ACK


tack LIFS tack SIFS

Unacknowledged transmission

Long frame Short frame


LIFS SIFS

aTurnaroundTime  tack  (aTurnaroundTime (12 symbols) + aUnitBackoffPeriod (20 symbols))


LIFS > aMaxLIFSPeriod (40 symbols)
SIFS > aMacSIFSPeriod (12 symbols)

For frames ≤ aMaxSIFSFrameSize use short inter-frame spacing (SIFS)


For frames > aMaxSIFSFrameSize use long inter-frame spacing (LIFS)
MAC Data Primitives

Primitive Request Confirm Indication Response

MCPS-DATA Required Required Required

Optional for Optional for


MCPS-PURGE
RFD RFD
Data Transfer
Message Sequence Diagram

Originator Originator Recipient Recipient


higher layer MAC MAC higher layer

MCPS-DATA.request
Data frame

Acknowledgment (if requested)

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

MLME-ASSOCIATE.request Association request

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

Device Device Coordinator


higher layer MAC MAC

MLME-POLL.request

Data request

Acknowledgment (FP = 0)

MLME-POLL.confirm

No data pending at the coordinator


Synchronization
• For PANs supporting beacons, synchronization is
performed by receiving and decoding beacon frames.
• For PANs not supporting beacons, the
synchronization is performed by polling the
coordinator for data.
• In a beacon enabled network, devices shall be
permitted to acquire synchronization only with
beacons containing the PAN identifier specified in
macPANId.
• If tracking is specified in the MLME-SYNC.request
primitive, the device shall attempt to acquire the
beacon and keep track of it by regular and timely
activation of its receiver.
Synchronization
• If a beacon frame containing the current PAN
identifier of the device is not received, the
MLME shall repeat the search.
• In a nonbeacon-enabled network, the devices
shall be able to poll the coordinator for data at
the discretion of the next higher layer.
• On receipt of MLME-POLL.request primitive,
the MLME follow the procedure for extracting
pending data from the coordinator.
Orphan Handling
• If the next higher layer receives repeated
communication failures following its requests to
transmit data, it may conclude that it has been
orphaned.
• A single communications failure occurs when a
device transaction fails to reach the coordinator, i.e.
an acknowledgement is not received after
aMaxFrameRetries attempts at sending data.
• If the next higher layer concluded that the device
has been orphaned, it may either reset the MAC
sublayer and perform the association procedure or
perform the orphaned device realignment procedure.
Data Polling
Message Sequence Chart

Device Device Coordinator


higher layer MAC MAC

MLME-POLL.request
Data request

Acknowledgment (FP = 1)

Data

Acknowledgement
MLME-POLL.confirm

MCPS-DATA.indication

Data pending at the coordinator


Orphaning
Message Sequence Diagram

=
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?

Locate backoff CW = 2, NB = NB+1, CW = CW - 1


period boundary BE = min(BE+1, aMaxBE)

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

Used in non-beacon Delay for


networks. random(2BE - 1) unit
backoff periods

Perform CCA

Y
Channel idle?

NB = NB+1,
BE = min(BE+1, aMaxBE)

N NB>
macMaxCSMABackoffs
?

Failure Success

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy