Manual:Multicast Detailed Example
Manual:Multicast Detailed Example
Multicast Addressing
For IPv4, multicast addresses are in the range 224.0.0.0 to 239.255.255.255 inclusive. Addresses within 232.0.0.0/8
are reserved for SSM usage. Addresses in 239.0.0.0/8 are ASM addresses defined for varying sizes of limited scope.
Addresses within 224.0.0.0/24 are considered link-local and are forwarded between subnets. Mostly these addresses
are used by applications that do not require communication to other networks. Here are some assigned hostgroup
addresses by the internet assigned numbers authority (IANA):
• 224.0.0.1 - All systems on the subnet
• 224.0.0.2 - All routers on the subnet
• 224.0.0.9 - For RIPv2
• 224.0.0.14 - For VRRP
• 224.0.1.1 - Network time protocol (NTP)
The internet assigned numbers authority (IANA) allocates ethernet addresses from 01:00:5E:00:00:00 through
01:00:5E:7F:FF:FF for multicasting, therefore leaving only 23 bits available for the multicast group ID.
Manual:Multicast detailed example 2
IGMP
When a receiver joins a multicast group, the multicast routers serving that receiver's subnet need to know that the
receiver has joined so that they can arrange for multicast traffic destined for that group to reach this subnet. The
Internet Group Management Protocol (IGMP) is a link-local protocol for IPv4 that communicates this information
between receivers and routers. The same role for IPv6 is performed by the Multicast Listener Discovery protocol
(MLD).
The basic IGMP mechanism works as follows. When a multicast receiver joins a multicast group it multicasts an
IGMP Join message onto the subnet on which it is joining. The local routers receive this join, and cause multicast
traffic destined for the group to reach this subnet. Periodically one of the local routers sends a IGMP Query message
onto the subnet. If there are multiple multicast routers on the subnet, then one of them is elected as the sole querier
for that subnet. In response to an IGMP query, receivers respond by refreshing their IGMP Join. If the join is not
refreshed in response to queries, then the state is removed, and multicast traffic for this group ceases to reach this
subnet.
There are three different versions of IGMP:
• IGMP version 1 functions as described above.
• IGMP version 2 adds support for IGMP Leave messages to allow fast leave from a multicast group.
• IGMP version 3 adds support for source include and exclude lists, to allow a receiver in indicate that it only wants
to hear traffic from certain sources, or not receive traffic from certain sources.
A multicast data sender just starts sending data destined for a multicast group. The sender's local router (DR) takes
those data packets, unicast-encapsulates them, and sends them directly to the RP. The RP receives these encapsulated
data packets, decapsulates them, and forwards them onto the shared tree. The packets then follow the (*,G) multicast
tree state in the routers on the RP Tree, being replicated wherever the RP Tree branches, and eventually reaching all
the receivers for that multicast group. The process of encapsulating data packets to the RP is called registering, and
the encapsulation packets are known as PIM Register packets. At the end of phase one, multicast traffic is flowing
encapsulated to the RP, and then natively over the RP tree to the multicast receivers.
receiver will be receiving traffic from S along the shortest-path tree between the receiver and S. In addition, the RP
is receiving the traffic from S, but this traffic is no longer reaching the receiver along the RP tree. As far as the
receiver is concerned, this is the final distribution tree.
RP Discovery
PIM-SM routers need to know the address of the RP for each group for which they have (*,G) state. This address is
obtained either through a bootstrap mechanism or through static configuration. One dynamic way to do this is to use
the Bootstrap Router (BSR) mechanism. One router in each PIM-SM domain is elected the Bootstrap Router through
a simple election process. All the routers in the domain that are configured to be candidates to be RPs periodically
unicast their candidacy to the BSR. From the candidates, the BSR picks an RP-set, and periodically announces this
set in a Bootstrap message. Bootstrap messages are flooded hop-by-hop throughout the domain until all routers in the
domain know the RP-Set. To map a group to an RP, a router hashes the group address into the RP-set using an
order-preserving hash function (one that minimizes changes if the RP-Set changes). The resulting RP is the one that
it uses as the RP for that group.
Example
Almost minimal setup where multicast routing is necessary:
• multicast sender (server);
• multicast receiver (client);
• two routers running PIM between them.
Multicast traffic in this example will be destined to address 224.0.1.20
Traffic flow:
Sender -- (subnet I) --> Router A -- (subnet II) --> Router B -- (subnet III) --> Receiver
You may also need to configure alternative-subnets on upstream interface - in case if the multicast sender address
is in an IP subnet that is not directly reachable from the local router.
Manual:Multicast detailed example 6
Start sender and receiver programs. You can either write simple programs yourself, or use any of these:
• MGEN is a program that can be used to send or receive multicast traffic, etc: http://cs.itd.nrl.navy.mil/work/
mgen/index.php
• Alternatively, mtest is a bare-bones sender/receiver program available from: http://netweb.usc.edu/pim/pimd/
And hey, it works! Client should receive data now.
Caveats
• Route metric cannot be configured, 0xffff is always used instead (important for PIM asserts). Route distance
(from FIB or static MRIB) is used as "metric preference" and can be only in range 0..255.
• Scope zones are not supported.
• It is unclear whether Linux kernel fully supports IGMPv3.
FAQ
Q. Does MT support Source Specific Multicast (SSM)?
A. Yes, SSM is a part of PIM-SM specification and we support it.
Q. Is support for PIM-DM planned?
A. No, as PIM-SM performs good in almost every setup, both sparse and dense.
Manual:Multicast detailed example 7
References
1. XORP User Manual, chapters 13 - 16 [2]
2. Multicast tutorial. Deals with multicast addressing IGMP, PIM-SM / SSM, MSDP and MBGP [3]
3. RFC 2236: Internet Group Management Protocol, Version 2 [4]
4. RFC 3376: Internet Group Management Protocol, Version 3 [5]
5. RFC 4601: Protocol Independent Multicast - Sparse Mode (PIM-SM): Protocol Specification (Revised) [6]
6. RFC 5059: Bootstrap Router (BSR) Mechanism for PIM [7]
References
[1] http:/ / www. xorp. org
[2] http:/ / www. xorp. org/ releases/ current/ docs/ user_manual/ user_manual. pdf
[3] http:/ / www. garr. it/ emc_training/ tutorials/ mcast_tutorial. pdf
[4] http:/ / www. ietf. org/ rfc/ rfc2236. txt
[5] http:/ / www. ietf. org/ rfc/ rfc3376. txt
[6] http:/ / www. ietf. org/ rfc/ rfc4601. txt
[7] http:/ / www. ietf. org/ rfc/ rfc5059. txt
Article Sources and Contributors 8