Matter Group Communication

This section describes how Group Communication works in Matter.

Group Communication in the Matter standard refers to the ability of devices within a Matter network to communicate with multiple devices simultaneously using multicast messages. This is particularly useful for scenarios where a command needs to be sent to multiple devices at once, such as turning off all lights in a house or setting a scene.

Group setup

Devices are configured to be part of one or more groups. Each group is identified by a unique group ID. A device can be a member of multiple groups, and a group can include multiple devices.

Group Messaging

When a command needs to be sent to all devices in a group, the command initiator (a controller, a smartphone app, or another device) sends a multicast message addressed to the group ID. Only the devices that are members of that group will receive messages to or act on a message. Using Group Communication reduces network traffic because a single multicast message can reach multiple devices. This is more efficient than sending individual messages to each device. It also enhances scalability as adding more devices to a group does not increase the number of messages required for group-wide commands.

Note

Group Communication is by design not reliable, because it does not use any way of acknowledgment. Because of that, the device that sends the message cannot determine whether it reached all devices belonging to the group. Communication reliability depends on the underlying networking technology. For example, sleepy devices should not be targeted in the group messaging, as they will likely miss incoming messages, because their radio is inactive for most of the time. Multicast messages are not buffered by their parents, so they will not reach the destination.

Matter ensures that Group Communication is secure. Messages are encrypted, and only authorized devices within the group can decrypt and act on them. Security provisions are in place to manage who can add or remove devices from groups, preventing unauthorized control. Common use cases include lighting control (for example, turning all lights in a room or building on or off), temperature adjustments for HVAC systems in multiple zones, and scene setting where multiple device types perform coordinated actions (such as lights dim, blinds close, temperature adjusts).

In the Matter specification, managing Group Communication effectively and securely involves specific clusters such as the Group Cluster and the Group Key Management Cluster. These clusters play crucial roles in handling group configurations and ensuring secure communication within groups.

Group Cluster

The Group Cluster is primarily responsible for managing group memberships within devices. It allows devices to be added to or removed from groups and to query their group memberships. This cluster is essential for organizing devices into logical sets that can receive common commands, which is fundamental for scenarios like controlling multiple lights with a single command. Group Clusters should be supported only for devices that can receive groupcast communication.

The following are the key functions of a Group Cluster:

  • Add Group/Remove Group - These commands allow devices to be dynamically added to or removed from specific groups.

  • View Group Membership - Devices can report which groups they belong to, which is useful for controllers to make decisions about sending commands.

  • Capacity Management - The cluster handles the limitations on how many groups a device can be a member of, ensuring that device capabilities are not exceeded.

Group Key Management Cluster

The Group Key Management Cluster is crucial for the security aspect of Group Communication. It manages the encryption keys that are used to secure multicast messages sent to groups. This ensures that only the members of a group can read the messages intended for that group, maintaining confidentiality and integrity. A cluster should be supported for both the device that is a transmitter and the receiver of Group Communication.

The following are the key functions of a Group Key Management Cluster:

  • Key Set Creation and Distribution - This function involves generating and distributing the keys that will be used to encrypt and decrypt messages sent to the group. The distribution must be secure to prevent interception and unauthorized access.

  • Key Storage and Handling - Secure storage and handling of keys within devices are managed to prevent unauthorized access and ensure that keys are available when needed for encryption and decryption processes.

Example use cases

The following use cases demonstrate how you can manage the Group Communication settings using the chip-tool.

Settings for the chip-tool

Check first your settings, keysets and groups.

  • To see the Group Cluster and Group Key Management Cluster settings you can manage, use the following command:

    ./chip-tool groupsettings
    
    * show-groups
    * add-group
    * remove-group
    * show-keysets
    * bind-keyset
    * unbind-keyset
    * add-keysets
    * remove-keyset
    
  • To see the predefined keysets, use the following command:

    ./chip-tool groupsettings show-keysets
    ...
      +-------------------------------------------------------------------------------------+
      | Available KeySets :                                                                 |
      +-------------------------------------------------------------------------------------+
      | KeySet Id   |   Key Policy                                                          |
      | 0x1a3           Trust First                                                         |
      | 0x1a2           Cache and Sync                                                      |
      | 0x1a1           Cache and Sync                                                      |
      +-------------------------------------------------------------------------------------+
    
    where:
    
       KeySetId 0x1a3 Epochs keys:
           epochKey0 = d0d1d2d3d4d5d6d7d8d9dadbdcdddedf
           epochStartTime0 = 2220000
           epochKey1 = d1d1d2d3d4d5d6d7d8d9dadbdcdddedf
           epochStartTime1 = 2220001
           epochKey2 = d2d1d2d3d4d5d6d7d8d9dadbdcdddedf
           epochStartTime2 = 2220002
       KeySetId 0x1a2 Epochs keys:
           epochKey0 = d0d1d2d3d4d5d6d7d8d9dadbdcdddedf
           epochStartTime0 = 2220000
           epochKey1 = e0e1e2e3e4e5e6e7e8e9eaebecedeeef
           epochStartTime1 = 2220001
           epochKey2 = f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
           epochStartTime2 = 2220002
       KeySetId 0x1a1 Epochs keys:
           epochKey0 = a0a1a2a3a4a5a6a7a8a9aaabacadaeaf
           epochStartTime0 = 1110000
           epochKey1 = b0b1b2b3b4b5b6b7b8b9babbbcbdbebf
           epochStartTime1 = 1110001
           epochKey2 = c0c1c2c3c4c5c6c7c8c9cacbcccdcecf
           epochStartTime2 = 1110002
    
  • To see the groups, use the following command:

    ./chip-tool groupsettings show-groups
    ...
      +-------------------------------------------------------------------------------------+
      | Available Groups :                                                                  |
      +-------------------------------------------------------------------------------------+
      | Group Id   |  KeySet Id     |   Group Name                                          |
      | 0x101           0x1a1            Group #1                                           |
      | 0x102           0x1a2            Group #2                                           |
      | 0x103           0x1a3            Group #3                                           |
      +-------------------------------------------------------------------------------------+
    

Group Communication triggered from the controller

You need the chip-tool and the Matter: Light bulb sample to run through this use case.

Group Communication triggered from the accessory (Light Switch)

The initial settings for this use case are the following:

Light Bulb nodeid = 2
Light Switch nodeid = 1
Test group keyset
     groupKeySetID=258
     epochKey0=a0a1a2a3a4a5a6a7a8a9aaabacad7531
     epochStartTime0=1110000
     epochKey1=b0b1b2b3b4b5b6b7b8b9babbbcbd7531
     epochStartTime1=1110001
     epochKey2=c0c1c2c3c4c5c6c7c8c9cacbcccd7531
     epochStartTime2=1110002
Test group:
     groupId=30001
     name=Test_Group_30001

You need the following to run through this use case: