Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] OpenThread and number of multicast addresses (OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS) #27631

Open
dtodor opened this issue Jul 5, 2023 · 11 comments
Labels
bug Something isn't working efr32 needs triage spec Mismatch between spec and implementation

Comments

@dtodor
Copy link

dtodor commented Jul 5, 2023

Reproduction steps

What is the minimal/expected number of multicast addresses for Thread devices? We are testing group communication with an EFR32 board, and we cannot use more then 2 groups, which I guess results from this definition:

https://github.com/openthread/openthread/blob/6736ef267673d1e15d528067c3433377597a02b2/src/core/config/ip6.h#L57

When the device is started with more then 2 groups set up, we can see the following output:

[00:00:00.738][info  ][SVR] Joining Multicast groups
[00:00:00.740][info  ][IN] Joining Multicast Group with address UDP:[ff35:40:fd00:0:0:0:100:7d0]:5540
[00:00:00.742][info  ][IN] Joining Multicast Group with address UDP:[ff35:40:fd00:0:0:0:100:7d1]:5540
[00:00:00.745][info  ][IN] Joining Multicast Group with address UDP:[ff35:40:fd00:0:0:0:100:bb8]:5540
[00:00:00.745][error ][SVR] Error when trying to join Group 3000 of fabric index 1 : 4000003

Bug prevalence

Always reproducible

GitHub hash of the SDK that was being used

e278aa4

Platform

efr32

Platform Version(s)

No response

Anything else?

No response

@dtodor dtodor added bug Something isn't working needs triage labels Jul 5, 2023
@cjandhyala
Copy link
Contributor

@dtodor The MaxGroupsPerFabric attribute in the Group Key Management Cluster will have the number that maximum number of groups that the node supports per fabric

@dtodor
Copy link
Author

dtodor commented Jul 6, 2023

The EFR32 device reports the following values:

OperationalCredentials::SupportedFabrics = 5
GroupKeyManagement::MaxGroupsPerFabric = 4

So the value of OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS should be 20, right? Currently there is a discrepancy - we can add and configure more than 2 groups, but joining more than 2 multicast groups fails.

@dtodor
Copy link
Author

dtodor commented Jul 6, 2023

BTW, what about changing the name of the MaxGroupKeysPerFabric attribute to MaxGroupKeysetsPerFabric:

11.2.7.4. MaxGroupKeysPerFabric Attribute
This attribute SHALL indicate the maximum number of group key sets this node supports per fab­ric. 
The value of this attribute SHALL be set according to the minimum number of group key sets to support
as specified in Group Limits.

@bzbarsky-apple
Copy link
Contributor

BTW, what about changing the name of the MaxGroupKeysPerFabric attribute to MaxGroupKeysetsPerFabric:

This would have been a reasonable suggestion a year ago, but at this point there's a bunch of shipping API with the existing name.

Past that, the spec says:

A node SHALL support one IPv6 multicast group membership for every operational group it supports.

so if something has 5 supported fabrics and 4 groups per fabric, but only allows 2 multicast addresses, then it's very much non-conformant.

@Damian-Nordic should we be setting OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS as needed when we compile openthread?

@bzbarsky-apple bzbarsky-apple added the spec Mismatch between spec and implementation label Jul 6, 2023
@Damian-Nordic
Copy link
Contributor

@bzbarsky-apple Yes, that seems right that OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS should be increased.

@bzbarsky-apple
Copy link
Contributor

I guess my question was whether we can have it automatically set based on the other two constants.

@Damian-Nordic
Copy link
Contributor

Oh, then the problem might be that most device manufacturers don't build OpenThread from sources but use OpenThread libraries built and certified by platform vendors (to take advantage of certification by inheritance). So I guess platform vendors must simply ensure that they configure a sane value for OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS in the libraries they provide.

@dtodor
Copy link
Author

dtodor commented Jul 9, 2023

I think it would be important to have the Matter SDK examples correctly configured and running according to the specification. It might very well be the case that the device manufacturers are not aware of this restriction. I will perform some tests with certified devices and report back.

@dtodor
Copy link
Author

dtodor commented Jul 12, 2023

I just did some tests with a Matter certified device. The device reports:

GroupKeyManagement::MaxGroupsPerFabric: 3
GroupKeyManagement::MaxGroupKeysPerFabric: 3
AccessControl::AccessControlEntriesPerFabric: 3
AccessControl::SubjectsPerAccessControlEntry: 4

I am able to add more than 3 groups without any errors. The device is controllable only with the first group. I think this is a Nordic device, not sure though:

BasicInformation::DataModelRevision: 1
BasicInformation::VendorName: Eve Systems
BasicInformation::ProductName: Eve Energy 20EBO8301
BasicInformation::HardwareVersion: 1
BasicInformation::SoftwareVersion: 6200
BasicInformation::SoftwareVersionString: 3.1.0

@dtodor
Copy link
Author

dtodor commented Jul 12, 2023

I just saw that there is a newer software version (3.2.1) for this device, will update it and redo the tests.

@dtodor
Copy link
Author

dtodor commented Jul 12, 2023

OK, with the newest software the device behaves in the same way - only one of the added group addresses works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working efr32 needs triage spec Mismatch between spec and implementation
Projects
Development

No branches or pull requests

4 participants