Stack Structure#

The Connect stack provides code organized into three functional layers, as shown in the following figure:

  • PHY (physical)

  • MAC (Media Access Control)

  • Network

The PHY and MAC layers are based on the IEEE 802.15.4-2011 standard (abbreviated to IEEE 802.15.4). The Network layer is based on a proprietary protocol.

Connect Stack LayersConnect Stack Layers

Additionally, the Connect Application Framework provides a complete tool and API infrastructure over the underlying stack layers. Functionality within the Application Framework and the Connect stack layers is provided in the form of individual building blocks called plugins. Details of the plugins for each layer are provided in the Silicon Labs Connect Application Framework API Reference included in the Connect stack documentation.

PHY and MAC Layers#

The IEEE 802.15.4 specification is a standard for wireless communication that defines the MAC and PHY operating at subGHz frequencies and in the 2.4GHz band. IEEE 802.15.4 was designed with low power in mind. The Connect stack is based on the IEEE 802.15.4 standard, however it does not fully comply with the standard. On the other hand, some of the difference is beneficial, as the Connect PHY is highly customizable (whereas the IEEE 802.15.4 specification is rigidly restrictive).

The 802.15.4 MAC layer is used for basic message handling and congestion control. The Connect network layer builds on these underlying mechanisms to provide end-to-end communications in the network. The MAC layer includes a CSMA/CA (Carrier Sense Multiple Access / Collision Avoidance) mechanism for devices to listen on and determine whether the active channel is clear, as well as handle retries and acknowledgement of messages for reliable communications between adjacent devices. The MAC layer also provides security functionality (authentication, encryption, and replay attack protection). The MAC auxiliary header indicates which security scheme is used for a given packet. Optional security schemes can be implemented through the AES (Advanced Encryption Standard) plugin. The destination node looks at the auxiliary header and uses the correct security scheme (if it supports it) to decrypt and authenticate the incoming packet. The Connect stack supports both short (2-byte) and long (8-byte) identifiers. A network is identified by a 2-byte PAN ID.

One of the characteristics derived from the need for low power and limiting the BER (Bit Error Rate) is enforcing smaller sized packets to be sent over the air. These can be up to a maximum of 127 bytes at the PHY layer payload. The MAC layer payload can vary depending on the security options and addressing type as illustrated in the figure below.

802.15.4 MAC Payload802.15.4 MAC Payload

Network Layer#

In extended star mode, the proprietary network layer provides network formation and full routing support, meaning every node in the network can communicate with any other node in the network in both directions. Routing is transparent to the application layer. Routing is not performed for direct devices.

The network formation functionality offers an association mechanism that, while similar to that in the 802.15.4 protocol, has been improved and made more secure by providing a special encrypted association request command not present in the 802.15.4 protocol. Network formation also includes centralized address allocation at the star coordinator. The network layer additionally provides APIs for commissioning node network parameters like node ID, PAN ID, channel, and transmission power. Direct devices can join to a network using the commissioning APIs. MAC devices can join to a network using either the standard 802.15.4 joining procedure or the commissioning APIs.

Application Framework#

The Connect Application Framework leverages the Ember Application Framework v6 and its bookkeeping functionality implemented in callbacks such as init(), tick(), and stackStatus(). Application Framework plugins can provide callbacks and can implement the callbacks of other plugins.

Functionality Blocks#

Every Connect application includes the following functionality blocks. The HAL (hardware abstraction layer) and Simulated EEPROM functionality blocks reside below the Connect stack. The PHY, event system, and message builder/parser functionality blocks are part of the stack itself.

  • HAL: Drivers for devices and their peripherals such as SPI (Serial Peripheral Interface), UART (Universal Asynchronous Receiver/Transmitter), timers, and so on.

  • Simulated EEPROM: Wear-leveled persistent storage of network and application data.

  • Event system: System that allows the stack and the application to schedule code to run after some specified time interval. Events are also useful when an ISR (Interrupt Service Routine) needs to initiate an action that should run outside the ISR context.

  • PHY: Software module that interfaces with the transceiver and provides basic radio TX, RX, and radio sleep functionality.

  • Message builder/parser: Provides a 15.4-like PHY/MAC packet format builder/parser and a proprietary network layer format builder/parser.

  • Dynamic memory allocation: A generic lightweight module that provides dynamic memory allocation and garbage collection.