ot-br-posix icon indicating copy to clipboard operation
ot-br-posix copied to clipboard

[openwrt] add mdns support

Open bukepo opened this issue 4 years ago • 7 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. The current OpenWRT build doesn't publish Thread mDNS.

Describe the solution you'd like A clear and concise description of what you want to happen. Integrate with mdnsd

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Integrate with umdns

Additional context Add any other context or screenshots about the feature request here.

bukepo avatar May 19 '20 08:05 bukepo

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. The current OpenWRT build doesn't publish Thread mDNS.

Describe the solution you'd like A clear and concise description of what you want to happen. Integrate with mdnsd

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Integrate with umdns

Additional context Add any other context or screenshots about the feature request here.

Hi, do i need any more configuration after installing umdns? Thank you.

mrninhvn avatar Feb 28 '22 06:02 mrninhvn

@mrninhvn mdns support on OpenWRT platform is missing, it will be great if you could contribute!

wgtdkp avatar Feb 28 '22 06:02 wgtdkp

@mrninhvn mdns support on OpenWRT platform is missing, it will be great if you could contribute!

I still don't quite understand, How will the lack of mdns affect? I have 2 border routers, 1 running on openwrt and 1 running on raspberry, openwrt border router cannot run alone without the raspberry router.

mrninhvn avatar Feb 28 '22 06:02 mrninhvn

@mrninhvn mdns support on OpenWRT platform is missing, it will be great if you could contribute!

Hi, Can you tell me what is missing exactly and what did we have to implement if we need to make it working on OpenWRT ?

Currently I have a problem but I don't really know if it's related to it.

My setup:

  • Openthread Border Router is running on a OpenWRT device.
  • Matter controller is running on the same OpenWRT device.

Problem:

When I commision a Matter device in the openthread network: it fails when the matter stack try to discover the device just after the ConnectNetworkResponse (succeed). In fact, this is the moment when the device is connected to the thread network and the Matter stack try to discover the device using mDNS to finish the commissioning.

Notes:

  • The device is in the thread network because I can ping it (with fd11:22:xxxx IPV6)
  • When I try to discover the device, i get no results:
avahi-browse _matter._tcp -r
  • The avahi-daemon display messages like this sometimes:
sendmsg() to ff02::fb failed: Network is unreachable

Questions:

  • Why mDNS packets are not transmit to the thread network like other packets ?
  • Do we really need OTBR_MDNS to do it ?
  • Why ?

caipiblack avatar Mar 03 '22 16:03 caipiblack

@mrninhvn

I have 2 border routers, 1 running on openwrt and 1 running on raspberry, openwrt border router cannot run alone without the raspberry router.

What do you mean openwrt border router cannot not run? What's the phenomenon? What's you detail setup?


@caipiblack you need to provide an implementation of the mdns.hpp interface for openWRT. Just as mdns_avahi.cpp for Linux/Raspberry Pi and mdns_mdnssd.cpp for Mac OS. You should use OTBR_MDNS to specify which mDNS implementation should be used for your platform when building OTBR.

wgtdkp avatar Mar 04 '22 02:03 wgtdkp

@caipiblack For why we need a mDNS implementation:

  1. The Thread interface doesn't process multicast packets to handle mDNS queries.
  2. In Thread network, we use the unicast SRP protocol to register services to the Border Router. This is for avoiding multicast packets in Thread network as it will exhaust battery of end devices.
  3. End devices' SRP services are registered to a SRP server running on the Border Router.
  4. There is an Advertising Proxy which helps publish the SRP services on the infrastructure link (e.g. WiFi and Ethernet) as mDNS services.
  5. Hosts (or mobile devices) on the infrastructure link uses mDNS queries to discover the services registered by end devices.
  6. The Advertising Proxy requires a mDNS implementation to publish the SRP services on the infrastructure link.

wgtdkp avatar Mar 04 '22 03:03 wgtdkp

What do you mean openwrt border router cannot not run? What's the phenomenon? What's you detail setup?

I got same problem with @caipiblack, thread device can ping to router, but can't ping to wifi device and vice versa.

mrninhvn avatar Mar 04 '22 04:03 mrninhvn

Update:

Since this pull-request ot-br-posix works with avahi backend for mDNS stuffs.

We can also discover thread devices using avahi-browse from the router or the LAN network of the router.

Is there anything else to check ? Is there still something to do ?

caipiblack avatar Apr 13 '23 09:04 caipiblack

@caipiblack , thanks for helping to address this issue.

We can also discover thread devices using avahi-browse from the router or the LAN network of the router.

This validates the Advertising Proxy, where Thread devices can publish services and devices on the LAN can discover those services.

Is there anything else to check ?

We should also validate the other direction - Discovery Proxy, where Thread devices can discover services on published by devices on the LAN.

jwhui avatar Apr 13 '23 15:04 jwhui

Closing stale issue.

jwhui avatar Jun 27 '23 22:06 jwhui