project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.22k stars 1.92k forks source link

[BUG][OT Multicast] Matter device with OT interface and router role fails to respond to multicast ping #30122

Open mihai-ignat opened 8 months ago

mihai-ignat commented 8 months ago

Reproduction steps

I am running the OpenThread certification on a Matter device that is capable of having the router role. I came across issues during some tests because the device fails to respond to multicast pings addressed on Link-Local All Nodes address (FF02::1), Link-Local All Routers address (FF02::2)] and Link-Local All Thread Nodes multicast address.

Looking into the issue, I found that the OT stack registers the addresses correctly and the pings are received by the device .They are processed in HandleEchoRequest in icmp6.cpp from OT stack, but they fail to pass the condition: VerifyOrExit(ShouldHandleEchoRequest(aMessageInfo) || aMessageInfo.GetSockAddr().GetIid().IsLocator());

Looking into this failure, I came across that ShouldHandleEchoRequest returns OT_ICMP6_ECHO_HANDLER_DISABLED, which is odd for a router device. The setting was traced to a call in template <class ImplClass> CHIP_ERROR GenericThreadStackManagerImpl_OpenThread_LwIP<ImplClass>::DoInit(otInstance * otInst), the call being: // Disable automatic echo mode in OpenThread. otIcmp6SetEchoMode(Impl()->OTInstance(), OT_ICMP6_ECHO_HANDLER_DISABLED);

This leads me to believe that the stack's ICMP module is misconfigured and otIcmp6SetEchoMode with OT_ICMP6_ECHO_HANDLER_ALL needs to be called for devices with router role.

Bug prevalence

Every time

GitHub hash of the SDK that was being used

1890490c964fa2abe85e0ef6e677b1c8b3f6859c

Platform

other

Platform Version(s)

No response

Anything else?

No response

bzbarsky-apple commented 8 months ago

I am running the OpenThread certification on a Matter device that is capable of having the router role.

I suspect GenericThreadStackManagerImpl_OpenThread_LwIP.cpp was not really written to work for such a device; it looks like it was initially added for a specific device and then never touched again.

Probably what we need is some config setting for whether the device is a router role, and conditional behavior in this file...

@Damian-Nordic

mihai-ignat commented 8 months ago

@bzbarsky-apple @Damian-Nordic , do you have any comments or updates?

Damian-Nordic commented 8 months ago

@mihai-ignat Which platform is this device based on? We do not disable ICMP6 on our platform (nRF Connect), but our platform is not LWIP-based, so you would need to get comments on that from platform maintainers that use LWIP. If you have access to the CSA slack, it would probably be the best to ask on #tsg-tt-sw-platform-announce channel, if anyone objects removing this line.

mihai-ignat commented 8 months ago

The device is based on NXP RT1060. I have access, but I cannot find the specific channel, trying on #tsg-tt-software-development. Thanks.