Zig Bee Technology
Zig Bee Technology
Patrick Kinney
Kinney Consulting LLC
Chair of IEEE 802.15.4 Task Group
Secretary of ZigBee BoD
Chair of ZigBee Building Automation Profile WG
Each of these traffic types mandates different attributes from the MAC. The
IEEE802.15.4 MAC is flexible enough to handle each of these types.
• Periodic data can be handled using the beaconing system whereby the
sensor will wake up for the beacon, check for any messages and then go
back to sleep.
• Intermittent data can be handled either in a beaconless system or in a
disconnected fashion. In a disconnected operation the device will only
attach to the network when it needs to communicate saving significant
energy.
• Low latency applications may choose to the guaranteed time slot (GTS)
option. GTS is a method of QoS in that it allows each device a specific
duration of time each Superframe to do whatever it wishes to do without
contention or latency.
There are two physical device types for the lowest system cost
To allow vendors to supply the lowest possible cost devices the IEEE standard
defines two types of devices: full function devices and reduced function
devices
Full function device (FFD)
Can function in any topology
Capable of being the Network coordinator
• Capable of being a coordinator
Can talk to any other device
PAN
Coordinator
Frame Structure
The frame structures have been designed to keep the complexity to a minimum
while at the same time making them sufficiently robust for transmission on a
noisy channel. Each successive protocol layer adds to the structure with layer-
specific headers and footers.
The IEEE 802.15.4 MAC defines four frame structures:
• A beacon frame, used by a coordinator to transmit beacons.
• A data frame, used for all transfers of data.
• An acknowledgment frame, used for confirming successful frame reception.
• A MAC command frame, used for handling all MAC peer entity control
transfers.
The data frame is illustrated below:
The Physical Protocol Data Unit is the total information sent over the air. As
shown in the illustration above the Physical layer adds the following overhead:
Preamble Sequence 4 Octets
Start of Frame Delimiter 1 Octet
Frame Length 1 Octet
In summary the total overhead for a single packet is therefore 15 -31 octets (120
bits); depending upon the addressing scheme used (short or 64 bit addresses).
Please note that these numbers do not include any security overhead.
For low latency applications or applications requiring specific data bandwidth, the
PAN coordinator may dedicate portions of the active superframe to that
application. These portions are called guaranteed time slots (GTSs). The
guaranteed time slots comprise the contention free period (CFP), which always
appears at the end of the active superframe starting at a slot boundary immediately
following the CAP, as shown in Figure 5. The PAN coordinator may allocate up
to seven of these GTSs and a GTS may occupy more than one slot period.
However, a sufficient portion of the CAP shall remain for contention based access
of other networked devices or new devices wishing to join the network. All
contention based transactions shall be complete before the CFP begins. Also each
device transmitting in a GTS shall ensure that its transaction is complete before
the time of the next GTS or the end of the CFP.
Security
When security of MAC layer frames is desired, ZigBee uses MAC layer security
to secure MAC command, beacon, and acknowledgement frames. ZigBee may
secure messages transmitted over a single hop using secured MAC data frames,
but for multi-hop messaging ZigBee relies upon upper layers (such as the NWK
layer) for security. The MAC layer uses the Advanced Encryption Standard (AES)
[10] as its core cryptographic algorithm and describes a variety of security suites
that use the AES algorithm. These suites can protect the confidentiality, integrity,
and authenticity of MAC frames. The MAC layer does the security processing, but
the upper layers, which set up the keys and determine the security levels to use,
control this processing. When the MAC layer transmits (receives) a frame with
security enabled, it looks at the destination (source) of the frame, retrieves the key
associated with that destination (source), and then uses this key to process the
frame according to the security suite designated for the key being used. Each key
is associated with a single security suite and the MAC frame header has a bit that
specifies whether security for a frame is enabled or disabled.
When transmitting a frame, if integrity is required, the MAC header and payload
data are used in calculations to create a Message Integrity Code (MIC) consisting
of 4, 8, or 16 octets. The MIC is right appended to the MAC payload. If
confidentiality is required, the MAC frame payload is also left appended with
frame and sequence counts (data used to form a nonce). The nonce is used when
encrypting the payload and also ensures freshness to prevent replay attacks. Upon
receipt of a frame, if a MIC is present, it is verified and if the payload is
encrypted, it is decrypted. Sending devices will increase the frame count with
every message sent and receiving devices will keep track of the last received
count from each sending device. If a message with an old count is detected, it is
flagged with a security error. The MAC layer security suites are based on three
modes of operation. Encryption at the MAC layer is done using AES in Counter
(CTR) mode and integrity is done using AES in Cipher Block Chaining (CBC-
MAC) mode [16]. A combination of encryption and integrity is done using a
mixture of CTR and CBC- MAC modes called the CCM mode.
The NWK layer also makes use of the Advanced Encryption Standard (AES).
However, unlike the MAC layer, the security suites are all based on the CCM*
mode of operation. The CCM* mode of operation is a minor modification of the
CCM mode used by the MAC layer. It includes all of the capabilities of CCM and
additionally offers encryption-only and integrity-only capabilities. These extra
capabilities simplify the NWK layer security by eliminating the need for CTR and
- 10 Kinney Consulting LLC
[email protected]
Communications Design Conference 2 October 2003
CBC-MAC modes. Also, the use of CCM* in all security suites allows a single
key to be used for different suites. Since a key is not strictly bound to a single
security suite, an application has the flexibility to specify the actual security suite
to apply to each NWK frame, not just whether security is enabled or disabled
When the NWK layer transmits (receives) a frame using a particular security suite
it uses the Security Services Provider (SSP) to process the frame. The SSP looks
at the destination (source) of the frame, retrieves the key associated with that
destination (source), and then applies the security suite to the frame. The SSP
provides the NWK layer with a primitive to apply security to outgoing frames and
a primitive to verify and remove security from incoming frames. The NWK layer
is responsible for the security processing, but the upper layers control the
processing by setting up the keys and determining which CCM* security suite to
use for each frame.
Similar to the MAC layer frame format, a frame sequence count and MIC may be
added to secure a NWK frame.
ZigBee Stack
Network Layer
The responsibilities of the ZigBee NWK layer include:
Starting a network: The ability to successfully establish a new network.
Joining and leaving a network: The ability to gain membership (join) or
relinquish membership (leave) a network.
Configuring a new device: The ability to sufficiently configure the stack for
operation as required.
Addressing: The ability of a ZigBee coordinator to assign addresses to devices
joining the network.
Synchronization within a network: The ability for a device to achieve
synchronization with another device either through tracking beacons or by
polling.
Security: applying security to outgoing frames and removing security to
terminating frames
Routing: routing frames to their intended destinations.
Network Summary
The network layer builds upon the IEEE 802.15.4 MAC’s features to allow
extensibility of coverage. Additional clusters can be added; networks can be
consolidated or split up.
Application layer
The ZigBee application layer consists of the APS sub-layer, the ZDO and the
manufacturer-defined application objects. The responsibilities of the APS sub-
layer include maintaining tables for binding, which is the ability to match two
devices together based on their services and their needs, and forwarding messages
between bound devices. Another responsibility of the APS sub-layer is discovery,
which is the ability to determine which other devices are operating in the personal
operating space of a device. The responsibilities of the ZDO include defining the
role of the device within the network (e.g., ZigBee coordinator or end device),
initiating and/or responding to binding requests and establishing a secure
relationship between network devices. The manufacturer-defined application
objects implement the actual applications according to the ZigBee-defined
application descriptions
800
700
600
500
Data Rate (kb/s)
400
300
200
100
0
1 12 23 34 45 56 67 78 89 100 111 122 133 144 155 166 177 188 199 210 221 232 243 254 265 276 287 298 309 320 331
Packet Size (bytes)
Timing Considerations
ZigBee
Conclusion:
ZigBee devices can quickly attach, exchange information, detach, and then
go to deep sleep to achieve a very long battery life. Bluetooth devices
require about ~100X the energy for this operation.
Power Considerations
ZigBee
2+ years from ‘normal’ batteries
Designed to optimize slave power requirements
Bluetooth
Power model as a mobile phone (regular daily charging)
Designed to maximize ad-hoc functionality
Result:
~ 45,140 data transmissions for Bluetooth
~ 4,269,670 data transmissions for ZigBee
Battery drain conclusion: ZigBee has an inherent advantage for these modes
of operation due to its short attach time and/or its ability to remain in the
sleep mode for long periods.
Comparison Summary
ZigBee and Bluetooth are two solutions for two different
application areas.
• The differences are from their approach to their desired application.
Bluetooth has addressed a voice application by embodying a fast
frequency hopping system with a master slave protocol. ZigBee
has addressed sensors, controls, and other short message
applications by embodying a direct sequence system with a star or
peer to peer protocols.
• Minor changes to Bluetooth or ZigBee won’t change their inherent
behavior or characteristics. The different behaviors come from
architectural differences.