-
Notifications
You must be signed in to change notification settings - Fork 822
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
Question on UDP multicast in mirrored mode and Wireshark #10735
Comments
I have been playing around with multicast in WSL for the last few hours and its not really convincing me that IGMP is working properly from inside of WSL at least in mirrored mode (i'll try NAT mode sometime soon). Using a similar config with If everything is in the same subnet multicast behavior will depend on how your switch handles multicast traffic. Basically, does it support IGMP Snooping and/or does it treat multicast like broadcast. In a L2 environment multicast might work or it might not. So lets get funky and move to an L3 routed multicast environment with PIM. With two VLANs 10 and 11 for instance also assume that PIM is correctly setup. If you start a multicast sender in VLAN 10 (/w ttl > 1 and verify there is now a Cisco mroute If I do a join from the host Windows system an IGMP join is sent and the Cisco will do its PIM/mroute magic, the data will start routing and Windows will see the traffic inside of Wireshark. If I look at Wireshark inside of WSL at this point I still do not see the traffic, it could be the Linux network stack is filtering the multicast traffic because it is not joined to the group (a guess). If I now do a join inside of WSL the data will being to show. Linux is getting the data because of the host Windows IGMP join because the Linux join doesn't really go anywhere. If the host Windows machine leaves the group while the WSL Linux machine is still joined WSL will stop receiving the traffic. So all of this kind of leads me to believe that the IGMP joins inside of WSL are getting eaten and not really being transmitted anywhere. Hope this helps! |
1 for userspace udp bind(include multicast),u need first bind udp socket,then tcpdump,is's expected behavior |
I've encountered something similar with ROS 2. Whenever ROS 2 nodes on a remote machine send multicast traffic (which is the default when there are multiple subscribers), subscribers running in WSL simply never receive the data. I wrote a barebones script to send and receive multicast packets (works on either Windows or Linux) (remove the .txt from the extension, for some reason Github won't accept a .py file) and tested it as both sender and receiver in all combinations of WSL, the host Windows OS, and a remote machine on the network. I watched the resulting network traffic using The specific commands I ran with the script are: python3 multicast.py --interface_ip <your IP address> send Receiveer: python3 multicast.py --interface_ip <your IP address> receive To capture only the relevant packets in tshark -i <name of your network interface, e.g. eth0> -f "igmp or dst port 7400" Note: 7400 is the default port used in the script, and in ROS 2. Here are the scenarios I found that do and don't work:
Usually*, WSL processes won't receive packets send from the surrounding Windows OS or from a remote machine, but it always receives packets send from within WSL. I don't recall ever getting a listener in Windows to receive a packet sent from within WSL. I believe there are at least two things going on here. First, I agree with @realumhelp that IGMP packets are not sent when processes try to join a multicast group in WSL. I confirmed this using For some reason, when both the sender and receiver are in WSL, the packets are delivered successfully, even though I also find that when I test behind a non-IGMP-snooping router (where therefore packets are delivered to all hosts unconditionally), the multicast packets sent from Windows or a remote host are visible to One final thing is the WSL-to-Windows case. Here, the Windows listener does send IGMP packets to the router, but it doesn't seem like it should matter because the sender is transmitting on the same NIC. In this case, |
When trying the new mirrored mode, I tried to receive UDP multicast.
This all works, except when I open Wireshark.
Wireshark on Windows is showing all the UDP packets that should come in every second.
Wireshark in WSL doesn't show any packets.
Only when I run for example a Python script to receive multicast, the packages also show up in Wireshark.
Is that expected behavior?
WSL version: 2.0.7.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
Windows version: 10.0.22631.2506
The text was updated successfully, but these errors were encountered: