multicast

From Noah.org
Jump to: navigation, search


mysterious

I have found multicast networking to be horrible. It sounds simple, but testing your own ad-hoc multicast applications can be mysterious. I think part of the problem can be with hidden state. The switches and routers in the network store state associated with multicast group IP addresses. This can cause tests to behave differently depending on the order they are run. Sometimes a multicast transmission will work in one direction, but not another.

Some IP address ranges in the multicast range appear to behave differently.

224.0.0.1
This group address has usually worked for me.
225.0.0.250
This group address is used in Python examples, mcast.py script, but it does not always work for me.
239.255.0.0
Reserved as Site-Local Scope, but this did not work.

IP address range

Multicast IP addresses are in the range 224.0.0.0/4, or 224.0.0.1 through 239.255.255.254. All multicast IP addresses start with the bits 0b1110 (0x0E).

Many IP addresses in this range are reserved by the IANA. For example, 224.0.0.5 is reserved for OSPF, and 224.0.0.12 is reserved for DHCP. It is best to check with the IANA IPv4 Multicast Address Space Registry list before experimenting with some random multicast IP address. Other address are not official, but are used by convention by some popular packages. For example, the JBoss AutoDiscoveryAddress is 230.0.0.4 (even though the IANA has this listed as Unusable Locally, so I'm not sure why JBoss uses this address by default. Perhaps I misunderstood the IANA documentation).

For experimentation you probably want to pick addresses in the ranges 239.192.0.0 to 239.251.255.255 (Organization-Local Scope) and 239.255.0.0 to 239.255.255.255 (Site-Local Scope). Start with the Site-Local Scope. These are defined in reserved as Administratively Scoped IP multicast addresses. See RFC 2365.

You can also limit the scope of your multicast packets by setting a short TTL in the packet. A setting of 1 or 2 is good for most local network experiments. This way you limit the range your bad packets will be seen.

MAC address range

Ethernet frames can also be specified as multicast. These frames will have the destination MAC address will have a the least significant bit set in the first octet. For example, 01-80-C2-00-00-00.