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

OpenThread Border Router - Container runs multiple mDNS stacks #2280

Closed
kevinanderson1 opened this issue May 10, 2024 · 1 comment · Fixed by #2282
Closed

OpenThread Border Router - Container runs multiple mDNS stacks #2280

kevinanderson1 opened this issue May 10, 2024 · 1 comment · Fixed by #2282

Comments

@kevinanderson1
Copy link
Contributor

Describe the bug

The container at docker.io/openthread/otbr:latest runs avahi-daemon and mdns resulting in mdns name conflicts.

To Reproduce

  1. Git commit id: docker.io/openthread/otbr@sha256:3e46f5096405149aa13da8485f8a9dabb9a3cdaaf3e85f2a89217c116cc0bca2
  2. IEEE 802.15.4 hardware platform: Raspberry Pi 4 - nrf52840 MDK
  3. Build steps: Run the OTBR image in host networking mode.
  4. Network topology: The Pi is connected to a WiFi network
  5. Verify two stacks are present with ss -lpntu | grep 5353
ss -lpntu | grep 5353
udp    UNCONN   0        0                 0.0.0.0:5353           0.0.0.0:*      users:(("avahi-daemon",pid=118,fd=13))                                         
udp    UNCONN   0        0                 0.0.0.0:5353           0.0.0.0:*      users:(("mdnsd",pid=103,fd=6))                                                 
udp    UNCONN   0        0                    [::]:5353              [::]:*      users:(("mdnsd",pid=103,fd=7))                                                 
udp    UNCONN   0        0                    [::]:5353              [::]:*      users:(("avahi-daemon",pid=118,fd=14))

I'm using the following systemd quadlet to run the container.

[Unit]
Description=OpenThread Border Router Server
After=local-fs.target

[Container]
ContainerName=openthread
HostName=openthread
Exec=-B wlan0 --radio-url 'spinel+hdlc+uart:///dev/serial/by-id/usb-Nordic_Semiconductor_nRF528xx_OpenThread_Device_F9B3763E293A-if00?uart-baudrate=115200' trel://wlan0
Image=docker.io/openthread/otbr:latest
Network=host
PodmanArgs=--privileged
PodmanArgs=--dns=127.0.0.1
Environment=INFRA_IF_NAME=wlan0
Environment=WEB_GUI=1
Volume=/var/lib/container-data/openthread/thread:/var/lib/thread:Z
Volume=/dev/serial/by-id/usb-Nordic_Semiconductor_nRF528xx_OpenThread_Device_F9B3763E293A-if00:/dev/serial/by-id/usb-Nordic_Semiconductor_nRF528xx_OpenThread_Device_F9B3763E293A-if00

[Service]
Restart=on-failure

[Install]
WantedBy=multi-user.target

Expected behavior
The container to run and not experience host name conflicts resulting in mDNS withdraws and publishing under new host names.

Console/log output

openthread avahi-daemon[131]: New relevant interface wlan0.IPv4 for mDNS.
openthread avahi-daemon[131]: Joining mDNS multicast group on interface lo.IPv6 with address ::1.
openthread avahi-daemon[131]: New relevant interface lo.IPv6 for mDNS.
openthread avahi-daemon[131]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
openthread avahi-daemon[131]: New relevant interface lo.IPv4 for mDNS.
openthread avahi-daemon[131]: Network interface enumeration completed.
openthread avahi-daemon[131]: Registering new address record for fdb2:2856:e6c:cd7c:da55:1399:472a:fa5d on wlan0.*.
openthread avahi-daemon[131]: Registering new address record for 192.168.101.109 on wlan0.IPv4.
openthread avahi-daemon[131]: Registering new address record for ::1 on lo.*.
openthread avahi-daemon[131]: Registering new address record for 127.0.0.1 on lo.IPv4.
openthread avahi-daemon[131]: Withdrawing address record for fdb2:2856:e6c:cd7c:da55:1399:472a:fa5d on wlan0.
openthread avahi-daemon[131]: Withdrawing address record for 192.168.101.109 on wlan0.
openthread avahi-daemon[131]: Withdrawing address record for ::1 on lo.
openthread avahi-daemon[131]: Host name conflict, retrying with openthread-2
openthread avahi-daemon[131]: Registering new address record for fdb2:2856:e6c:cd7c:da55:1399:472a:fa5d on wlan0.*.
openthread avahi-daemon[131]: Registering new address record for 192.168.101.109 on wlan0.IPv4.
openthread avahi-daemon[131]: Registering new address record for ::1 on lo.*.
openthread avahi-daemon[131]: Registering new address record for 127.0.0.1 on lo.IPv4.

Additional context Add any other context about the problem here.
None

** Additional Comments**
It appears mdnsd is the default mdns stack based on the contents of the Dockerfile. Would it be safe to just disable the avahi-daemon from starting by default? I'd be willing to take an attempt at a PR to resolve the issue if this is confirmed as a valid bug.

@wgtdkp
Copy link
Member

wgtdkp commented May 10, 2024

It appears mdnsd is the default mdns stack based on the contents of the Dockerfile. Would it be safe to just disable the avahi-daemon from starting by default? I'd be willing to take an attempt at a PR to resolve the issue if this is confirmed as a valid bug.

Sounds good to disable avahi in docker. Contributions are welcome!

kevinanderson1 added a commit to kevinanderson1/ot-br-posix that referenced this issue May 10, 2024
Ensure the Avahi daemon is installed and started only when
OTBR_MDNS == "avahi". This prevents multiple mDNS stacks from
running especially in container environments.
kevinanderson1 added a commit to kevinanderson1/ot-br-posix that referenced this issue May 10, 2024
Ensure the Avahi daemon is installed and started only when
OTBR_MDNS == "avahi". This prevents multiple mDNS stacks from
running especially in container environments.
kevinanderson1 added a commit to kevinanderson1/ot-br-posix that referenced this issue May 10, 2024
Ensure the Avahi daemon is installed and started only when
OTBR_MDNS == "avahi". This prevents multiple mDNS stacks from
running especially in container environments.
kevinanderson1 added a commit to kevinanderson1/ot-br-posix that referenced this issue May 11, 2024
Ensure the Avahi daemon is installed and started only when
OTBR_MDNS == "avahi". This prevents multiple mDNS stacks from
running especially in container environments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants