Understanding Zigbee MAC Layer Frames
Advertisement
As mentioned in the Zigbee protocol stack, the Zigbee MAC layer frame is composed of a MAC header, MAC payload, and FCS (Frame Check Sequence). The diagram below depicts the generic MAC frame format adopted in Zigbee technology at the MAC layer. This part is also referred to as MPDU (MAC Protocol Data Unit). This gets embedded into the PPDU (Physical Protocol Data Unit) frame of Zigbee.
Generic MAC Frame Format
Octets: | 2 | 1 | 0/2 | 0/2/8 | 0/2 | 0/2/8 | Var | 2 |
---|---|---|---|---|---|---|---|---|
Frame control | Sequence number | Destination PAN ID | Destination Address | Source PAN ID | Source Address | Frame Payload | FCS | |
MHR | MAC Payload | MFR | ||||||
Addressing fields |
The generic MAC layer frame has a frame control field of 2 octets. It carries useful information such as frame type, source and destination addressing modes. Frame type specifies whether the frame is a beacon frame, data frame, ACK of data, MAC command frame, etc. The same is outlined in the ‘Frame type subfield’ table below with 3 bits.
Frame Control Field
Bits: | 0-2 | 3 | 4 | 5 | 6 | 7-9 | 10-11 | 12-13 | 14-15 |
---|---|---|---|---|---|---|---|---|---|
Frame type | Security enabled | Frame pending | Ack. Request | Intra PAN | Reserved | Dest. Addressing mode | Reserved | Source Addressing mode |
Frame Type Subfield
Frame type value (b2,b1,b0) | Description |
---|---|
000 | Beacon frame |
001 | Data frame |
010 | Acknowledgement |
011 | MAC command |
100-111 | Reserved |
As shown below, the beacon frame carries the frame control field and addressing fields along with the sequence number. It is broadcasted to obtain the PAN ID of nearby Zigbee devices.
Beacon Frame Format
Octets: | 2 | 1 | 4/10 | 2 | var | var | var | 2 |
---|---|---|---|---|---|---|---|---|
Frame control | Sequence number | Addressing fields | Superframe specification | GTS fields | Pending address fields | Beacon payload | FCS | |
MHR | MAC Payload | MFR |
Once a connection is established, the data frame carries data. The format of the data frame is similar to the generic MAC frame format and is shown in the table below.
Data Frame Format
Octets: | 2 | 1 | Section 7.2.2.2.1 IEEE 802.15.4 | Variable | 2 |
---|---|---|---|---|---|
Frame control | Sequence number | Addressing fields | Data Payload | FCS | |
MHR | MAC Payload | MFR |
Acknowledgement Frame Format
Octets: | 2 | 1 | 2 |
---|---|---|---|
Frame control | Sequence number | FCS | |
MHR | MFR |
MAC Command Frame Format
Octets: | 2 | 1 | Section 7.2.2.4.1 IEEE 802.15.4 | 1 | Variable | 2 |
---|---|---|---|---|---|---|
Frame control | Sequence number | Addressing fields | Command Frame Identifier | Command Payload | FCS | |
MHR | MAC Payload | MFR |
Zigbee protocol supports different command frames for different use cases as mentioned below in the table.
MAC Command Frames
Command Frame ID | Command frame |
---|---|
0x01 | Association request (Tx) |
0x02 | Association response (Rx) |
0x03 | Disassociation notification (Tx,Rx) |
0x04 | Data request (Tx) |
0x05 | PAN ID conflict notification (Tx) |
0x06 | Orphan notification (Tx) |
0x07 | Beacon request (Tx) |
0x08 | Coordinator realignment (Rx) |
0x09 | GTS Request |
0x0a-0xFF | Reserved |