title: not seeing UDP multicast messages from another device
body: <p>I have a Windows machine where I have two scripts that send and receive messages via UDP multicast (on the same machine). I have a C and Python3 implementation of this. The Python3 one looks like this:</p>
  
  <p>sender.py</p>
  
  <pre><code>import socket
  
  MCAST_GRP = '239.1.1.1'
  MCAST_PORT = 1234
  
  sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
  sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
  print("Sending")
  sock.sendto(bytearray("str()", "utf-8"), (MCAST_GRP, MCAST_PORT))
  
  data, address = sock.recvfrom(1024)
  print('received %s bytes from %s' % (len(data), address))
  print(data)
  </code></pre>
  
  <p>receiver.py</p>
  
  <pre><code>import socket
  import struct
  import sys
  
  multicast_group = '239.1.1.1'
  server_address = ('', 1234)
  
  # Create the socket
  sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  
  # Bind to the server address
  sock.bind(server_address)
  
  # Tell the operating system to add the socket to the multicast group
  # on all interfaces.
  group = socket.inet_aton(multicast_group)
  mreq = struct.pack('4sL', group, socket.INADDR_ANY)
  sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
  
  # Receive/respond loop
  while True:
      print('\nwaiting to receive message')
      data, address = sock.recvfrom(1024)
  
      print('received %s bytes from %s' % (len(data), address))
      print(data)
  
      print('sending acknowledgement to', address)
      sock.sendto(bytearray("ack", "utf-8"), address)
  </code></pre>
  
  <p>I have another physical device hooked up to the same machine but I cannot receive any messages from it with my programs. I can see that Wireshark is seeing the messages from the other physical device, these messages are coming over the <code>eth0</code> interface to the same IP and Port. I know that the traffic generated by my scripts is on the <code>VirtualBox Host-Only Network</code>. I am not sure if that could cause the issue of me not seeing the UDP multicast messages from the external device.</p>
  
  <p>I have tested it on a Linux machine as well (latest kali version) but could not receive any messages from the external device as well.</p>
  
  <p>If I am missing some information, please let me know.</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>My setup is as follows:
  I am running a native Windows 10 machine. To this machine is a device connected that is running some OS I don't know. I am only able to send and receive messages from it. I can send Ethernet, TCP, and IPv4 packets over the physical ethernet port on my Windows 10 machine by specifying the software I am using for this to use eth0 and a defined IP(v4) address I assigned to that port in the network adapter settings (192.168.1.100)</p>
  
  <p>The scripts are running on the same Windows 10 machine that is also connected to the device. They are sending on this interface <code>VirtualBox Host-Only Network</code> but I don't know why. I did not configure anything like this. I assume that the interface should not be a problem because that is how UDP Multicast works (I am not sure of that so if I am mistaken please let me know!)</p>
  
  <p>A sample output of the sender looks like this:</p>
  
  <pre><code>Sending
  received 3 bytes from ('192.168.56.1', 3000)
  b'ack'
  
  Process finished with exit code 0
  </code></pre>
  
  <p>and the receiver:</p>
  
  <pre><code>waiting to receive message
  received 5 bytes from ('192.168.56.1', 55132)
  b'robot'
  sending acknowledgement to ('192.168.56.1', 55132)
  
  waiting to receive message
  </code></pre>
  
  <p>I hope that clarifies the setup. If there is still information missing please let me know!</p>