1

I have a device connected to an ethernet switch, and my PCs NIC is connected to that switch as well. The device is sending multicast messages to 239.255.255.251 to which I am able to listen. My computer's IP address is 192.168.1.50, and the netmask is 255.0.0.0.

Shouldn't this not work?

5
  • 1
    The network mask has nothing to do with whatever problem you're having. – Ron Trunk Oct 21 '16 at 14:07
  • I'm not really having a problem due to the fact that the multicasting/listening actually works. I'm just generally asking the question about how the netmask would affect a UDP multicast. Surely something, somewhere in the chain must stop a multicast message at some point? – user2913869 Oct 21 '16 at 14:18
  • A router will stop the multicast message, but the default behaviour for a switch is to forward them to all ports. – Gerben Oct 21 '16 at 14:50
  • Btw, your netmask is a problem: only 192.168.0.0/16 is reserved for private use. Your /8 mask will prevent communication with 192.0.0.0/8 except for you local segment. – Zac67 Jun 24 '17 at 9:16
  • Did any of the answers help you? If so, you should accept an answer so that the question doesn't keep popping up forever, looking for an answer. – Ron Maupin Jul 9 '17 at 20:08
1

No, this should not not work, it should work.

Anyone in the layer 2 broadcast domain will be able to receive any multicast message sent in that domain. Unless you use vlans, anything attached to the switch can listen for all multicast groups. Routers do not forward multicast traffic, unless specifically configured to do so.

Subnet masks only tell your computer which IP addresses are in its local subnet, and which addresses are not. They have no role to play in multicast.

On the ethernet layer, the multicast group is mapped to a multicast MAC address. Switches will send traffic destined to a multicast MAC address to all ports (unless specifically configured no to do so).

To find the multicast MAC for your multicast group, first convert the IP address to binary:

239.255.255.251 = 11101111.11111111.11111111.11111011

The first 25 bits of a multicast MAC are always 00000001:00000000:01011110:0. This means they range from 01:00:5E:00:00:00 to 01:00:5E:7F:FF:FF.

To construct the multicast MAC, append the last 23 bits of the IP to the fixed first 25 bits of all multicast MACs. In this case, we get:

00000001:00000000:01011110:01111111:11111111:11111011

which is

01:00:5E:7F:FF:FB.

You may have noticed it is not possible to do the reverse mapping. All multicast IPs start with the 4 bits 1110, leaving 28 bits for 2^28 different multicast addresses. Since there is only room for 23 bits in the multicast MAC address, such a MAC corresponds to a group of 32 multicast IP addresses.

1

To add on to Gerben's response, there is an Individual/Group bit in the MAC address that the switch reads to see if the MAC is unicast or broadcast/multicast.

It is the least significant bit (furthest to the right) of the first byte:

00000001

1 = broadcast/multicast 0 = unicast

1
  • Least significant, mind you... ;-) – Zac67 Jun 24 '17 at 9:12
0

Muticast, like broadcast, is limited to the LAN on which it originated. It is bounded at layer-3 (routers). Multicast routing was developed to overcome this, but a router must support and have multicast routing enabled in order to route multicast traffic. Multicast routing is not the same as unicast routing. Your host's unicast address and mask have nothing to do with multicast. An application must subscribe to a multicast group in order to receive multicasts. A host can use IGMP to inform a multicast enabled router that it wants to receive multicasts for a group from a remote source, and some switches can listen to the IGMP messages in order to only send the multicasts to particular switch ports.

A full explanation of multicast is beyond the scope of this site.

0

If you are using something like Wireshark and with your network adapter in promiscuous mode, you can see any layer 2 traffic on the LAN. However your computer will not be able to communicate directly to that subnet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.