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

Multicast to Docker-Container #241

Open
jeffrson opened this issue Aug 11, 2023 · 1 comment
Open

Multicast to Docker-Container #241

jeffrson opened this issue Aug 11, 2023 · 1 comment

Comments

@jeffrson
Copy link

I read #121 and my situation is similar, except that I tried the solution (forward accept) and it still doesn't work :-(

I have a docker container running:
docker run --rm -it -p 2222:2222/udp -v $(pwd):/usr/src/app -w /usr/src/app node:alpine sh
In this container I have a node.js script that receives multicast on the host just fine.

I installed pimd 2.3.2 and ran it by sudo /usr/sbin/pimd -d -f -c /etc/pimd.conf 2>&1 | grep 230.185, in order to grep for the multicast address I'm interested in. The log starts with these lines as soon as I run my script:

09:16:09.357 accept_group_report(): igmp_src 172.17.0.2 ssm_src 0.0.0.0 group 230.185.192.108 report_type 34
09:16:09.357 Set delete timer for group: 230.185.192.108
09:16:09.358 SM group order from  172.17.0.2 (*,230.185.192.108)
09:16:09.358 create group entry, group 230.185.192.108
09:16:09.358 Adding vif 1 for group 230.185.192.108
09:16:10.241 accept_group_report(): igmp_src 172.17.0.2 ssm_src 0.0.0.0 group 230.185.192.108 report_type 34
09:16:10.241 Set delete timer for group: 230.185.192.108
09:16:10.241 Adding vif 1 for group 230.185.192.108
INADDR_ANY       230.185.192.108  192.168.100.21   WC RP
INADDR_ANY       230.185.192.108  192.168.100.21   WC RP
INADDR_ANY       230.185.192.108  192.168.100.21   WC RP
09:16:24.289 accept_group_report(): igmp_src 172.17.0.2 ssm_src 0.0.0.0 group 230.185.192.108 report_type 34
09:16:24.290 Set delete timer for group: 230.185.192.108
09:16:24.290 Adding vif 1 for group 230.185.192.108
INADDR_ANY       230.185.192.108  192.168.100.21   WC RP

tcpdump on the host shows incoming UDP packets, however inside the container it doesn't:
tcpdump -i eth0 -s0 -vv host 230.185.192.108

sudo pimd -r shows this:

Virtual Interface Table ======================================================
Vif  Local Address    Subnet              Thresh  Flags      Neighbors
---  ---------------  ------------------  ------  ---------  -----------------
  0  192.168.100.21   192.168.100/22           1  DR NO-NBR
  1  172.17.0.1       172.17                   1  DR NO-NBR
  2  192.168.100.21   register_vif0            1

 Vif  SSM Group        Sources

Multicast Routing Table ======================================================
...
----------------------------------- (*,G) ------------------------------------
Source           Group            RP Address       Flags
---------------  ---------------  ---------------  ---------------------------
INADDR_ANY       230.185.192.108  192.168.100.21   WC RP
Joined   oifs: ...
Pruned   oifs: ...
Leaves   oifs: .l.
Asserted oifs: ...
Outgoing oifs: .o.
Incoming     : ..I

TIMERS:  Entry    JP    RS  Assert VIFS:  0  1  2
             0    50     0       0        0  0  0
----------------------------------- (S,G) ------------------------------------
...

Network interfaces have "MULTICAST" - static routes with smcroute work. Did I miss something to set up for pimd?

@jeffrson
Copy link
Author

jeffrson commented Aug 11, 2023

Oh - it starts working as soon as the sender joins the multicast group as well. I always assumed this is only necessary for listeners, while the sender just uses the group as destination address. Hmm.

Furthermore, I really need sudo iptables --policy FORWARD ACCEPT. Is this a recommended solution? It's apparently not necessary for smcroute.

Finally, I tried pimd though smcroute works, because smcroute had a certain problem after installation (Debian/Ubuntu systemd): it does not recognize the docker0 interface when it's started. Surely because docker is started after smcroute or because it takes some more time. Unfortunately, pimd seems to have the same problem. It only works if I restart the service from terminal after first login after reboot. Any idea how this could be solved? Should pimd rescan network interfaces?

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

No branches or pull requests

1 participant