Multicast

From AN!Wiki
Jump to: navigation, search

 AN!Wiki :: Multicast

Multicast is a networking protocol where one host can send a message to a special multicast IP address and one or more network devices can listen for and receive those messages.

Contents

Overview

Multicast is very useful in broadcasting information to a number of interested parties on a network. Good examples would be streaming audio where the server would send the audio stream to a special IP address and not concern itself with whom may want to listen to the audio stream. In turn, clients who want to "tune in" to the music stream could then tell a switch "please send me any packets destined for this IP address".

In reality, no device actually has that IP address. Instead, this IP address acts like a "group ID". Continuing with the music example, you can think of the multicast IP address as something like a radio station frequency. The source sends information out on that "frequency" (multicast IP address) and has no concern about how many people might be tuning in. In turn, if you want to listen to that radio transmission, you would "tune in" by setting your radio to listen to that radio frequency (subscribing the the multicast IP address). Whether you were the only listener, or just another one of many listeners would not matter.

Use

Multicast works by taking advantage of the existing IPv4 networking infrastructure, and it does so in something of a weird fashion. As you read, keep in mind that things are a little confusing because multicast was "shoe-horned" in to an existing technology.

For the rest of this article, let's use the multicast IP address of 239.255.0.1. We'll not worry about port numbers yet, but make a mental note that they are used in multicast. We'll discuss that later.

Publisher

Raw Notes

These are my raw notes. This section will go away as this article matures.

Multicast...
 
Multicast address range: 224.0.0.0 to 239.255.255.255
Range: 224.0.0.0/24 is for local multicast only and will never route (TTL is 1)
Range: 232.0.0.0/8 for IPv4 or FF3x::/96 is reserved for single-source multicast
Range: 233.0.0.0/8 was assinged for GLOP. Should avoid if possible.
 
 
IP:  Start with '1110'
MAC: Start with '01:00:5E:xx:xx:xx'
 
 
IP Address
                           |------------------ 32 bits -------------|
      Multicast prefix --> |--| |------------- 28 bits -------------|
      Ambiguous bits ---------> |-----||------ MAC, 23 bits --------|
Binary:                    1110 1111  1111 1111  0000 0000  0000 0001
Hex:                          E    F     F    F     0    0     0    1
Decimal:                         239        255          0          1
 
MAC Address
     |-- Multicast prefix, 25 bits ---||-- Maps from IP - 23 bits --| 
Bin: 0000 0001  0000 0000  0101 1110  0111 1111  0000 0000  0000 0001
Hex:    0    1     0    0     5    E     7    F     0    0     0    1
 
 
IP:        239.255.0.1
           ef.ff.00.01
MAC: 01:00:5E:7F:00:01
              |
              \- Anything here is ambiguous
 
                     | Dotted Decimal | Hexadecimal       | Binary
---------------------+----------------+-------------------+------------------------------------------------------------------
Multicast IP address |    239.255.0.1 |       EF.FF.00.01 |                       1110 1111  1111 1111  0000 0000  0000 0001
Maps to MAC address  | 1.0.94.127.0.1 | 01:00:5E:7F:00:01 | 0000 0001  0000 0000  0101 1110  0111 1111  0000 0000  0000 0001
 
 
 
Given the multicast IP address of '239.255.0.1', you should *not* use any of the other IP addresses 
in the table below. This is because all of these IP addresses will map to the same multicast MAC
address '01:00:5E:7F:00:01'.
 
     |-----| Ambiguous bits                | IP Address
-------------------------------------------+-------------
1110 0000  0111 1111  0000 0000  0000 0001 | 224.127.0.1
1110 0000  1111 1111  0000 0000  0000 0001 | 224.255.0.1
1110 0001  0111 1111  0000 0000  0000 0001 | 225.127.0.1
1110 0001  1111 1111  0000 0000  0000 0001 | 225.255.0.1
1110 0010  0111 1111  0000 0000  0000 0001 | 226.127.0.1
1110 0010  1111 1111  0000 0000  0000 0001 | 226.255.0.1
1110 0011  0111 1111  0000 0000  0000 0001 | 227.127.0.1
1110 0011  1111 1111  0000 0000  0000 0001 | 227.255.0.1
1110 0100  0111 1111  0000 0000  0000 0001 | 228.127.0.1
1110 0100  1111 1111  0000 0000  0000 0001 | 228.255.0.1
1110 0101  0111 1111  0000 0000  0000 0001 | 229.127.0.1
1110 0101  1111 1111  0000 0000  0000 0001 | 229.255.0.1
1110 0110  0111 1111  0000 0000  0000 0001 | 230.127.0.1
1110 0110  1111 1111  0000 0000  0000 0001 | 230.255.0.1
1110 0111  0111 1111  0000 0000  0000 0001 | 231.127.0.1
1110 0111  1111 1111  0000 0000  0000 0001 | 231.255.0.1
1110 1000  0111 1111  0000 0000  0000 0001 | 232.127.0.1
1110 1000  1111 1111  0000 0000  0000 0001 | 232.255.0.1
1110 1001  0111 1111  0000 0000  0000 0001 | 233.127.0.1
1110 1001  1111 1111  0000 0000  0000 0001 | 233.255.0.1
1110 1010  0111 1111  0000 0000  0000 0001 | 234.127.0.1
1110 1010  1111 1111  0000 0000  0000 0001 | 234.255.0.1
1110 1011  0111 1111  0000 0000  0000 0001 | 235.127.0.1
1110 1011  1111 1111  0000 0000  0000 0001 | 235.255.0.1
1110 1100  0111 1111  0000 0000  0000 0001 | 236.127.0.1
1110 1100  1111 1111  0000 0000  0000 0001 | 236.255.0.1
1110 1101  0111 1111  0000 0000  0000 0001 | 237.127.0.1
1110 1101  1111 1111  0000 0000  0000 0001 | 237.255.0.1
1110 1110  0111 1111  0000 0000  0000 0001 | 238.127.0.1
1110 1110  1111 1111  0000 0000  0000 0001 | 238.255.0.1
1110 1111  0111 1111  0000 0000  0000 0001 | 239.127.0.1
1110 1111  1111 1111  0000 0000  0000 0001 | 239.255.0.1 <- In-use IP address

References

From here:

There are several subtle points that often deserve consideration when assigning multicast addresses. We've collected these as advice and rationale here.
* Avoid 224.0.0.x--Traffic to addresses of the form 224.0.0.x is often flooded to all switch ports. This address range is reserved for link-local uses. Many routing protocols assume that all traffic within this range will be received by all routers on the network. Hence (at least all Cisco) switches flood traffic within this range. The flooding behavior overrides the normal selective forwarding behavior of a multicast-aware switch (e.g. IGMP snooping, CGMP, etc.).
* Watch for 32:1 overlap--32 non-contiguous IP multicast addresses are mapped onto each Ethernet multicast address. A receiver that joins a single IP multicast group implicitly joins 31 others due to this overlap. Of course, filtering in the operating system discards undesired multicast traffic from applications, but NIC bandwidth and CPU resources are nonetheless consumed discarding it. The overlap occurs in the 5 high-order bits, so it's best to use the 23 low-order bits to make distinct multicast streams unique. For example, IP multicast addresses in the range 239.0.0.0 to 239.127.255.255 all map to unique Ethernet multicast addresses. However, IP multicast address 239.128.0.0 maps to the same Ethernet multicast address as 239.0.0.0, 239.128.0.1 maps to the same Ethernet multicast address as 239.0.0.1, etc.
* Avoid x.0.0.y and x.128.0.y--Combining the above two considerations, it's best to avoid using IP multicast addresses of the form x.0.0.y and x.128.0.y since they all map onto the range of Ethernet multicast addresses that are flooded to all switch ports.
* Watch for address assignment conflicts--IANA administers Internet multicast addresses. Potential conflicts with Internet multicast address assignments can be avoided by using GLOP addressing ( AS required) or administratively scoped addresses. Such addresses can be safely used on a network connected to the Internet without fear of conflict with multicast sources originating on the Internet. Administratively scoped addresses are roughly analogous to the unicast address space for private internets. Site-local multicast addresses are of the form 239.255.x.y, but can grow down to 239.252.x.y if needed. Organization-local multicast addresses are of the form 239.192-251.x.y, but can grow down to 239.x.y.z if needed.

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Us: Alteeve's Niche! Support: Mailing List IRC: #clusterlabs on Freenode   © Alteeve's Niche! Inc. 1997-2017
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.
Personal tools
Namespaces

Variants
Actions
Navigation
projects
Toolbox