Skip to content

Commit 8fdaf7e

Browse files
peknisrlubos
authored andcommitted
doc: Matter protocol: add Group Communication
Describing how to set up Group Communication between the controller and a sample in the Matter protocol documentation. ref: KRKNWK-17365 Signed-off-by: Pekka Niskanen <[email protected]>
1 parent 1a9195d commit 8fdaf7e

File tree

4 files changed

+272
-0
lines changed

4 files changed

+272
-0
lines changed

doc/nrf/links.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
.. _`Matter nRF Connect releases`: https://github.com/nrfconnect/sdk-connectedhomeip/releases
147147
.. _`Matter SDK tagged as v1.0.0`: https://github.com/project-chip/connectedhomeip/releases/tag/v1.0.0
148148
.. _`Testing with Apple Devices`: https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/darwin.md
149+
.. _`chip-tool`: https://docs.nordicsemi.com/bundle/ncs-latest/page/matter/chip_tool_guide.html
149150

150151
.. _`CoreMark GitHub`: https://github.com/eembc/coremark
151152

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
.. _ug_matter_group_communication:
2+
3+
Matter Group Communication
4+
##########################
5+
6+
.. contents::
7+
:local:
8+
:depth: 2
9+
10+
This section describes how Group Communication works in Matter.
11+
12+
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.
13+
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.
14+
15+
Group setup
16+
***********
17+
18+
Devices are configured to be part of one or more groups.
19+
Each group is identified by a unique group ID.
20+
A device can be a member of multiple groups, and a group can include multiple devices.
21+
22+
Group Messaging
23+
***************
24+
25+
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.
26+
Only the devices that are members of that group will receive messages to or act on a message.
27+
Using Group Communication reduces network traffic because a single multicast message can reach multiple devices.
28+
This is more efficient than sending individual messages to each device.
29+
It also enhances scalability as adding more devices to a group does not increase the number of messages required for group-wide commands.
30+
31+
.. note::
32+
33+
Group Communication is by design not reliable, because it does not use any way of acknowledgment.
34+
Because of that, the device that sends the message cannot determine whether it reached all devices belonging to the group.
35+
Communication reliability depends on the underlying networking technology.
36+
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.
37+
Multicast messages are not buffered by their parents, so they will not reach the destination.
38+
39+
Matter ensures that Group Communication is secure.
40+
Messages are encrypted, and only authorized devices within the group can decrypt and act on them.
41+
Security provisions are in place to manage who can add or remove devices from groups, preventing unauthorized control.
42+
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).
43+
44+
In the Matter specification, managing Group Communication effectively and securely involves specific clusters such as the Group Cluster and the Group Key Management Cluster.
45+
These clusters play crucial roles in handling group configurations and ensuring secure communication within groups.
46+
47+
Group Cluster
48+
=============
49+
50+
The Group Cluster is primarily responsible for managing group memberships within devices.
51+
It allows devices to be added to or removed from groups and to query their group memberships.
52+
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.
53+
Group Clusters should be supported only for devices that can receive groupcast communication.
54+
55+
The following are the key functions of a Group Cluster:
56+
57+
* Add Group/Remove Group - These commands allow devices to be dynamically added to or removed from specific groups.
58+
* View Group Membership - Devices can report which groups they belong to, which is useful for controllers to make decisions about sending commands.
59+
* 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.
60+
61+
Group Key Management Cluster
62+
============================
63+
64+
The Group Key Management Cluster is crucial for the security aspect of Group Communication.
65+
It manages the encryption keys that are used to secure multicast messages sent to groups.
66+
This ensures that only the members of a group can read the messages intended for that group, maintaining confidentiality and integrity.
67+
A cluster should be supported for both the device that is a transmitter and the receiver of Group Communication.
68+
69+
The following are the key functions of a Group Key Management Cluster:
70+
71+
* 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.
72+
The distribution must be secure to prevent interception and unauthorized access.
73+
* 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.
74+
75+
Example use cases
76+
*****************
77+
78+
The following use cases demonstrate how you can manage the Group Communication settings using the ``chip-tool``.
79+
80+
Settings for the ``chip-tool``
81+
==============================
82+
83+
Check first your settings, keysets and groups.
84+
85+
* To see the Group Cluster and Group Key Management Cluster settings you can manage, use the following command:
86+
87+
.. code-block:: none
88+
89+
./chip-tool groupsettings
90+
91+
* show-groups
92+
* add-group
93+
* remove-group
94+
* show-keysets
95+
* bind-keyset
96+
* unbind-keyset
97+
* add-keysets
98+
* remove-keyset
99+
100+
101+
* To see the predefined keysets, use the following command:
102+
103+
.. code-block:: none
104+
105+
./chip-tool groupsettings show-keysets
106+
...
107+
+-------------------------------------------------------------------------------------+
108+
| Available KeySets : |
109+
+-------------------------------------------------------------------------------------+
110+
| KeySet Id | Key Policy |
111+
| 0x1a3 Trust First |
112+
| 0x1a2 Cache and Sync |
113+
| 0x1a1 Cache and Sync |
114+
+-------------------------------------------------------------------------------------+
115+
116+
where:
117+
118+
KeySetId 0x1a3 Epochs keys:
119+
epochKey0 = d0d1d2d3d4d5d6d7d8d9dadbdcdddedf
120+
epochStartTime0 = 2220000
121+
epochKey1 = d1d1d2d3d4d5d6d7d8d9dadbdcdddedf
122+
epochStartTime1 = 2220001
123+
epochKey2 = d2d1d2d3d4d5d6d7d8d9dadbdcdddedf
124+
epochStartTime2 = 2220002
125+
KeySetId 0x1a2 Epochs keys:
126+
epochKey0 = d0d1d2d3d4d5d6d7d8d9dadbdcdddedf
127+
epochStartTime0 = 2220000
128+
epochKey1 = e0e1e2e3e4e5e6e7e8e9eaebecedeeef
129+
epochStartTime1 = 2220001
130+
epochKey2 = f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
131+
epochStartTime2 = 2220002
132+
KeySetId 0x1a1 Epochs keys:
133+
epochKey0 = a0a1a2a3a4a5a6a7a8a9aaabacadaeaf
134+
epochStartTime0 = 1110000
135+
epochKey1 = b0b1b2b3b4b5b6b7b8b9babbbcbdbebf
136+
epochStartTime1 = 1110001
137+
epochKey2 = c0c1c2c3c4c5c6c7c8c9cacbcccdcecf
138+
epochStartTime2 = 1110002
139+
140+
* To see the groups, use the following command:
141+
142+
.. code-block:: none
143+
144+
./chip-tool groupsettings show-groups
145+
...
146+
+-------------------------------------------------------------------------------------+
147+
| Available Groups : |
148+
+-------------------------------------------------------------------------------------+
149+
| Group Id | KeySet Id | Group Name |
150+
| 0x101 0x1a1 Group #1 |
151+
| 0x102 0x1a2 Group #2 |
152+
| 0x103 0x1a3 Group #3 |
153+
+-------------------------------------------------------------------------------------+
154+
155+
Group Communication triggered from the controller
156+
=================================================
157+
158+
.. tabs::
159+
160+
.. group-tab:: Nodes
161+
162+
You need the `chip-tool`_ and the :ref:`matter_light_bulb_sample` sample to run through this use case.
163+
164+
.. group-tab:: Precondition
165+
166+
Commission the Light Bulb to the same fabric as the chip-tool.
167+
168+
.. group-tab:: Steps
169+
170+
Complete the following steps to create a custom group based on a custom keyset and start Group Communication:
171+
172+
1. Generate a custom keyset::
173+
174+
./chip-tool groupsettings add-keysets 0xabcd 0 3330000 hex:0123456789abcdef0123456789abcdef
175+
./chip-tool groupsettings bind-keyset 0xdcba 0xabcd
176+
177+
#. Set the keyset on the Light Bulb based on generated controller's group settings::
178+
179+
./chip-tool groupkeymanagement key-set-write '{"groupKeySetID":"0xabcd","groupKeySecurityPolicy":0,"epochKey0":"0123456789abcdef0123456789abcdef","epochStartTime0":"3330000","epochKey1":"0123456789abcdef0123456789abcdee","epochStartTime1":"3330001","epochKey2":"0123456789abcdef0123456789abcded","epochStartTime2":"3330002"}' 1 0
180+
181+
#. Set the keyset to the group map::
182+
183+
./chip-tool groupkeymanagement write group-key-map '[{"groupId":"0xdcba","groupKeySetID":"0xabcd","fabricIndex":"1"}]' 1 0
184+
185+
#. Add the group on the application endpoint (endpoint 1 includes the on/off cluster)::
186+
187+
./chip-tool groups add-group 0xdcba Custom_Group 1 1
188+
189+
#. Set the ACL to permit the Group Communication from a specific group ID::
190+
191+
./chip-tool accesscontrol write acl '[{"fabricIndex":"1","privilege":"5","authMode":"2","subjects":["112233"],"targets":null},{"fabricIndex":"1","privilege":"3","authMode":"3","subjects":["0xdcba"],"targets":[{"cluster":null,"endpoint":"1","deviceType":null}]}]' 1 0
192+
193+
#. Send a command to toggle on/off on the application endpoint (endpoint 1 includes the on/off cluster)::
194+
195+
./chip-tool onoff toggle 0xffffffffffffdcba 1
196+
197+
**LED2** (nRF53 and nRF52 Series devices) or **LED1** (nRF54 Series devices) on the Light Bulb should now change the state.
198+
199+
Group Communication triggered from the accessory (Light Switch)
200+
===============================================================
201+
202+
The initial settings for this use case are the following:
203+
204+
.. code-block:: none
205+
206+
Light Bulb nodeid = 2
207+
Light Switch nodeid = 1
208+
Test group keyset
209+
groupKeySetID=258
210+
epochKey0=a0a1a2a3a4a5a6a7a8a9aaabacad7531
211+
epochStartTime0=1110000
212+
epochKey1=b0b1b2b3b4b5b6b7b8b9babbbcbd7531
213+
epochStartTime1=1110001
214+
epochKey2=c0c1c2c3c4c5c6c7c8c9cacbcccd7531
215+
epochStartTime2=1110002
216+
Test group:
217+
groupId=30001
218+
name=Test_Group_30001
219+
220+
.. tabs::
221+
222+
.. group-tab:: Nodes
223+
224+
You need the following to run through this use case:
225+
226+
* The `chip-tool`_
227+
* The :ref:`matter_light_bulb_sample` sample
228+
* The :ref:`matter_light_switch_sample` sample
229+
230+
.. group-tab:: Precondition
231+
232+
Commission the Light Bulb and Light Switch to the same fabric as the chip-tool.
233+
234+
.. group-tab:: Steps
235+
236+
Complete the following steps to start Group Communication:
237+
238+
1. Set the group settings on the on/off client (Light Switch)::
239+
240+
./chip-tool groupkeymanagement key-set-write '{"groupKeySetID":"258","groupKeySecurityPolicy":0,"epochKey0":"a0a1a2a3a4a5a6a7a8a9aaabacad7531","epochStartTime0":"1110000","epochKey1":"b0b1b2b3b4b5b6b7b8b9babbbcbd7531","epochStartTime1":"1110001","epochKey2":"c0c1c2c3c4c5c6c7c8c9cacbcccd7531","epochStartTime2":"1110002"}' 1 0
241+
242+
#. Set the keyset to the group map on the on/off client (Light Switch)::
243+
244+
./chip-tool groupkeymanagement write group-key-map '[{"groupId":"30001","groupKeySetID":"258","fabricIndex":"1"}]' 1 0
245+
246+
#. Set the same group settings on the on/off server (Light Bulb)::
247+
248+
./chip-tool groupkeymanagement key-set-write '{"groupKeySetID":"258","groupKeySecurityPolicy":0,"epochKey0":"a0a1a2a3a4a5a6a7a8a9aaabacad7531","epochStartTime0":"1110000","epochKey1":"b0b1b2b3b4b5b6b7b8b9babbbcbd7531","epochStartTime1":"1110001","epochKey2":"c0c1c2c3c4c5c6c7c8c9cacbcccd7531","epochStartTime2":"1110002"}' 2 0
249+
250+
#. Set the keyset to the group map on the on/off server (Light Bulb)::
251+
252+
./chip-tool groupkeymanagement write group-key-map '[{"groupId":"30001","groupKeySetID":"258","fabricIndex":"1"}]' 2 0
253+
254+
#. Add the group to the Light Bulb application endpoint (endpoint 1 includes the on/off cluster)::
255+
256+
./chip-tool groups add-group 30001 Test_Group_30001 2 1
257+
258+
#. Set the binding to the on/off client (Light Switch)::
259+
260+
./chip-tool binding write binding '[{"fabricIndex":"1","group":"30001"}]' 1 1
261+
262+
#. Set ACL on the on/off server (Light Bulb)::
263+
264+
./chip-tool accesscontrol write acl '[{"fabricIndex":1,"privilege":5,"authMode":2,"subjects":[112233],"targets":null},{"fabricIndex":1,"privilege":3,"authMode":3,"subjects":[30001],"targets":[{"cluster":null,"endpoint":1,"deviceType":null}]}]' 2 0
265+
266+
#. Click button **2** (nRF53 and nRF52 Series devices) or button **1** (nRF54 Series devices) on the Light Switch to send the toggle message.
267+
268+
**LED2** (nRF53 and nRF52 Series devices) or **LED1** (nRF54 Series devices) on the Light Bulb should now change the state.

doc/nrf/protocols/matter/overview/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ The following pages provide a brief overview of the Matter structure, in accorda
3737
security
3838
commissioning
3939
multi_fabrics
40+
group_communication
4041
dfu
4142
bridge
4243
dev_model

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ Gazell
138138
Matter
139139
------
140140

141+
* Added a new documentation page :ref:`ug_matter_group_communication` in the :ref:`ug_matter_intro_overview`.
142+
141143
* Disabled the :ref:`mpsl` before performing factory reset to speed up the process.
142144

143145
Matter fork

0 commit comments

Comments
 (0)