The Engineer’s Guide To Matter

Still have questions about Matter? Sick of the BS marketing guide to Matter? Well, strap in - below you will find a detailed technical guide to Matter, written by the curious for the curious. And if you’re not interested in the technical details - you can find our basic breakdown of Matter here.

After lots of research, reviewing GitHub repos, reading documentation, and scrolling endlessly online - the best docs we have found so far are from Google here. Much of this article is distilled from that documentation.

What is needed to run Matter?

First - what is NOT needed to run Matter? The Cloud. One of the most impressive aspects of this technology is that internet access, cloud platforms, or a terrible web application are NOT needed to run some Matter networks. Theoretically this can all be done locally. BUT, and there is always a but, Certified devices contain a set of certificates so the controller - your smartphone app like HomeKit -  will need to validate these against a distributed database of certs. In that regard, internet may be required for your controller, details are TBD, also who knows what the Controllers/Smartphone Apps will actually require).

So what all wireless/physical technology is needed to run Matter? Well a few actually.

However we first need to clarify one thing about Bluetooth - for a Matter device to join a Matter network it needs to go through a Commissioning process and this can be done over Bluetooth. HOWEVER if your device is only capable of supporting Bluetooth and cannot also support running the Thread stack, well, you are out of luck. Data exchange on the Matter network after commissioning does not support just Bluetooth. However, here is a list of the physical hardware that does support Matter:

  1. Bluetooth (USED FOR COMMISSIONING ONLY)
  2. Wifi (nordic is coming out with a wifi chip specifically designed with Matter in mind)
  3. Ethernet
  4. A radio capable of supporting an IEEE 802.11.15.4 running Thread

So your device needs to support at least one of the above physical methods to even join the Matter network.

If you are unfamiliar with Thread, here is information about what it is.

If you currently have a BLE device then hopefully it is also capable of running multi-protocol, like Nordic describes here or that SiLabs describes here.If so, then your devices can serve both as a normal BLE device AND a Matter device.

Next let's talk about Border Routers. First - if you plan on running a Matter network that is made up only of WiFi and/or Ethernet devices then you do NOT need a Border Router. However if you have a Thread capable devices, then you will need a Border Router in your Matter network to bridge your Thread device.

So what exactly is a Border Router?

The Thread Border Router is a device that provides connectivity from the IEEE 802.15.4 network to adjacent networks on other physical layers. This means it connects or "bridges" your devices running Thread to your local network (such as Wi-Fi or Ethernet). The actual hardware needed will likely consist of a device that supports:

Many of the examples you will read about online use a Raspberry Pi as a Thread Border Router, it even has official support.

When you want to add a new device to the Matter network, the Border Router holds the Operational Dataset (secure information about your Matter network) that is distributed to your new device through a Controller - like a smartphone app such as HomeKit, Google Home, etc during the Commissioning process over Bluetooth.

Some common pieces of hardware that currently act as Border Routers include:

  • Apple HomePod
  • Amazon Alexa
  • Google Hub

However, you can also run your own with a Raspberry Pi plus a Thread radio (like the Nordic NRF52840 or SiLabs EFR32).

Where does Matter live?

So now that you know about the physical hardware requirements for Matter, you may wonder where exactly Matter lives in your device stack?

Here is a diagram from Nordic that shows off the technologies it’s leveraging and how it is positioned with your application.

This figure shows Matter can run on any IPv6 transport and network layer.

What hardware runs Matter?

While there is no definitive list, we have pulled information from some of the semiconductor companies that are currently working on or are actively supporting Matter on their chips/dev kits, but there are many more:

What About Existing Devices?

Matter runs on any IPv6 transport and network layer. It also supports the bridging of other technologies such as Zigbee, BLE, Bluetooth Mesh, and Z-Wave. This means that devices that are based on those protocols may be operated as if they were a Matter device but will require a specific bridge device OR will require you to run your current device stack AND the Matter stack in a co-existent manner.

For instance, let's say you sell Z-Wave devices. You could integrate the Matter protocol into your Z Wave controller code, to bridge your Z-Wave network to your Matter network. This would obviously require some hardware and firmware updates though.

What is Matter’s Data Model and How do Devices Communicate?

To understand how Devices on a Matter network interact, it’s important to understand the Matter Data Model. The main components are: Nodes, Endpoints, Clusters, and Attributes, Commands, and Events.

Nodes

Nodes are unique and addressable resources within your device. Your device may consist of one or many Nodes, but unless your device is a Smartphone or Tablet, your device only has one Node. Pretty much all interactions within Matter are between Nodes.

Endpoints

Nodes are a collection of Endpoints. Each Endpoint encapsulates a set of features. For example, an Endpoint might relate to a lighting functionality.

Clusters

Inside of an Endpoint a Node might have one or more Clusters. These are group specific functionalities such as an on/off cluster for a light switch. A node can have multiple Endpoints.

Attributes, Commands, and Events

The last level of this hierarchy consists of Attributes, Commands, and Events.

Attributes are states held by the node. This could be on or off if the device is a light, or it could be the current level if the light is dimmable. They can even be the current firmware version the device is running. Attributes may be defined as different data types such as uint8, strings or arrays.

Commands are actions that can be performed on a device. Commands are verb-like, for example: “lock door” for a Door Lock cluster.

Events can be thought of as a record of past state transitions. Attributes are the current state, and events are a journal of past states that include a monotonically increasing counter, a timestamp, and a priority. Events allow capturing of state transitions or parts of the data model that are not readily achieved with attributes.

Each node will contain Endpoint 0 which holds the device utility clusters that enclose information such as: discovery, addressing, and diagnostics and software/firmware update. All endpoints outside of 0 will consist of Application Clusters that support the node’s main functionality. This means that Matter has DFU/OTA built-in.

So How does Matter actually work?

Commissioning

Matter’s Commissioning Procedure (called rendezvous) between the Matter Controller (smartphone app like HomeKit, Google Home, etc) and a Matter device, can be done via three methods:

  1. BLE
  2. Wifi AP provided by the device
  3. Ethernet when the device is already on the network

With these three methods the device can publish discovery packets letting the controller know that it can be commissioned. Once the controller has discovered the device, the device must give the controller the information to commission it onto the network.

This can be done in a few ways:

  • Via a QR code that the device displays or has a sticker attached to it
  • Using NFC, if the node hardware supports it
  • Or, the user can manually type it into the controller application

Once the device is on the network it will stop all BLE communication (if it was using it to be discovered) with the controller and start communication over IPv6 from here on out.

Here is an image from Infineon about what this would look like for the consumer:

Interaction

Now that we have defined the Data Model, how does communication to Matter devices actually work?

Nodes interact by:

  • Reading and Subscribing to Attributes and Events
  • Writing to Attributes
  • Invoking Commands

All of these above Actions are encapsulated within a Transaction, and a Transaction can contain multiple Actions.

Security

Matter uses various methods for encrypting and decrypting device communication. It uses Well-Tested standard algorithms such as ECC NIST P256 & AES-CCM-128. During the commissioning process the controller (smartphone app like HomeKit, Google Home, etc) and device share a set of key pairs that allow for secure communication between the device and controller. This is called a Fabric. Whenever a controller commissions another device it adds that device to the fabric and this allows secure communication between devices.

Summary

We’ve touched on what we believe are the main technical concepts of Matter - how it works, how to run it, and what supports it currently. Matter is complex, no doubt. It brings in all of the major tech companies to work together but that does not come without some drawbacks. There are additional features to Matter that we did not cover today including some very interesting functionalities but some of those details are not totally clear yet because the full specification has not been released publicly yet.

Here are a few more links that we found useful:

Blogs

Dev Resources

Resources

Gotchas

Here is a list of some extra credit information we found during our research:

  1. Flash size - its a big stack (~290k) this can be a limiting factor for some microcontrollers)- make sure that you have the space for the stack + your application code! For instance when we loaded up the Nordic example code on the NRF52840DK, 91% of the flash was used. This does not leave much room for a custom application, and would require an external flash chip for DFU).
  2. Right now Matter only supports Ethernet, Wifi, and Thread. If your device uses Cellular, LoRa Wan, Zigbee, etc, you will have to wait for official support or use a custom Bridge device as described above.
  3. Certification - this is one element that we did not go into detail about. You can submit your device to have official Matter certification so that you can put the Matter logo on your device/packaging. This process is another that is not 100% clear to us yet, but the official repo contains a certification test suite so you can run a pre-certification test before attempting official certification. Official certification will probably cost money and be required to be performed at an official test house.
  4. Border Routers - you can run your own if you want, using the official Thread images, or you may have one already if you have a HomePod, Alexa, or Google Hub, but you will want to confirm official Matter support for those. Again - this is only needed if you have any Thread devices on your network. This is not needed at all if you only have WiFi or Ethernet devices.
  5. Joining the CSA will be required if you want to release an official Matter device, and that membership starts at $7,000. There is a Free tier but there are limitations.
  6. The official specification has not been publicly released.

Michael Eatherly
Posted
Jul 18, 2022
by
Michael Eatherly
Or click here to learn more ->