There are many different smart home protocols in use in Smart homes today.
Because they all work differently it is very difficult to get these devices to work together hence the need to use smart home hubs like home assistant.
What is Matter?
The matter protocol is an attempt to simplify smart home set up and solve the problem of interoperability of smart home devices.
Matter is a royalty free standard supported by many of the leading players in the smart home market including Google, Amazon and Samsung.
How Does Matter Work
Matter is an IP based protocol (IPv6) that can use the existing wireless protocols – Wi-fi and Thread as well as the Ethernet protocol used on LANs.
Matter devices can also use Bluetooth for setup.
Matter is an application layer protocol relying on an underlying TCP/IP network as shown in the diagram taken from the specification
This application layer can itself be subdivided as shown in the diagram below:
Matter operates over IPv6 which is supported on Ethernet,Wi-fi and thread link level protocols.
Thread is known as a LLN (low power lossy network) and as such imposes limitations on the networking topology.
A single network could be represented by all Matter devices/nodes being connected to a single thread network or all devices connected to a Wi-Fi or Ethernet network.
In the case of Wi-Fi and Ethernet a mix of Wi-Fi and Ethernet is still treated as a single network.
A single network doesn’t require a border router to function.
These are created when thread networks are joined to Ethernet/Wi-Fi networks. The thread networks are known as periphery networks and this is shown in the figure below (taken from the specification).
A star network topology consists of multiple peripheral networks joined together by a central hub network.
The hub network will typically be a home network (Wi-Fi/Ethernet network), while the peripheral networks can be of any supported network type.
A peripheral network MUST always be joined directly to the hub network via one or more Border Routers.
Most networks will consists of a single main network and a single periphery network (thread network).
A matter network will consist of devices like smart phones,thermostats etc.
All devices have a well defined data hierarchical model comprised of nodes.
Each node consists of a number of endpoints. Endpoints themselves have clusters which contain the device attributes,commands and events.
Device>endpoints>clusters>attributes,commands and events.
The diagram below is taken for the Google developer site
Events are of interesting as they contain historical data. They are in effect a data log with timestamps.
Attributes are used to represent the current state e.g ON/OFF
Commands are verbs that cause an action e.g Toggle will change the state.
Clients and Servers
Nodes can functions as both clients and servers. A client will initiate an action and a serve will respond to an action.
This functionality is part of an endpoint. And so a node can contain a client endpoint and/or a server endpoint as shown in the diagram below:(taken from the Google developer docs).
The Descriptor Cluster -Endpoint 0
Every device has a descriptor cluster on endpoint 0. This cluster will provide a client with a full list of nodes and endpoints on the device that can be used to model the device.
Matter devices are arranged in fabrics. A Fabric is a collection of Matter devices that share a trusted root. The root is the Root CA (certificate authority) .
A fabric has a unique 64 bit ID and within the fabric, each node is uniquely identified by a Node ID.
A fabric ID is basically a Network ID.
As part of the commissioning process the fabric ID is assigned to each node. This allows the node to communicate with any other node in the fabric.
Related Tutorial and resources