mld
TRANSCRIPT
Technology Introduction IP Multicast MLD
1
MLD
Introduction to MLD
Multicast listener discovery protocol (MLD) is used by an IPv6 router to discover the presence of multicast listeners on directly-attached subnets. Multicast listeners are nodes wishing to receive multicast packets.
Through MLD, the router can learn whether there are any IPv6 multicast listeners on directly-connected subnets, put corresponding records in the database, and maintain timers related to IPv6 multicast addresses.
Routers running MLD use an IPv6 unicast link-local address as the source address to send MLD messages. MLD messages are Internet control message protocol for IPv6 (ICMPv6) messages. All MLD messages are confined to the local subnet, with a hop count of 1.
MLD Versions
So far, two MLD versions are available:
MLDv1 (defined in RFC 2710), which is derived from IGMPv2. MLDv2 (defined in RFC 3810), which is derived from IGMPv3.
How MLDv1 Works
MLDv1 implements IPv6 multicast listener management based on the query/response mechanism.
MLDv1 uses two types of query messages:
I. MLD querier election
Of multiple IPv6 multicast routers on the same subnet, all the routers can hear MLD listener report messages (often referred to as reports) from hosts, but only one router is needed for sending MLD query messages (often referred to as queries). So, a querier election mechanism is required to determine which router will act as the MLD querier on the subnet.
1) Initially, every MLD router assumes itself as the querier and sends MLD general query messages (often referred to as general queries) to all hosts and routers on the local subnet (the destination address is FF02::1).
2) Upon hearing a general query, every MLD router compares the source IPv6 address of the query message with its own interface address. After comparison, the router with the lowest IPv6 address wins the querier election and all other routers become non-queriers.
Technology Introduction IP Multicast MLD
2
3) All the non-queriers start a timer, known as “other querier present timer”. If a router receives an MLD query from the querier before the timer expires, it resets this timer; otherwise, it assumes the querier to have timed out and initiates a new querier election process.
II. Joining an IPv6 multicast group
QueryReport
Querier
Host C(G1)
Host A(G2)
Host B(G1)
Ethernet
Router A Router B
Figure 1 Joining IPv6 multicast groups
Assume that Host B and Host C are expected to receive IPv6 multicast data addressed to IPv6 multicast group G1, while Host A is expected to receive IPv6 multicast data addressed to G2, as shown in Figure 1. The basic process that the hosts join the IPv6 multicast groups is as follows:
1) The MLD querier (Router B in the figure) periodically multicasts MLD queries (with the destination address of FF02::1) to all hosts and routers on the local subnet.
2) Upon receiving a query message, Host B or Host C (the delay timer of whichever expires first) sends an MLD report to the IPv6 multicast group address of G1, to announce its interest in G1. Assume it is Host B that sends the report message.
3) Host C, which is on the same subnet, hears the report from Host B for joining G1. Upon hearing the report, Host C will suppress itself from sending a report message for the same IPv6 multicast group, because the MLD routers (Router A and Router B) already know that at least one host on the local subnet is interested in G1. This mechanism, known as MLD report suppression, helps reduce traffic over the local subnet.
4) At the same time, because Host A is interested in G2, it sends a report to the IPv6 multicast group address of G2.
Technology Introduction IP Multicast MLD
3
5) Through the above-mentioned query/report process, the MLD routers learn that members of G1 and G2 are attached to the local subnet, and generate (*, G1) and (*, G2) multicast forwarding entries, which will be the basis for subsequent IPv6 multicast forwarding, where * represents any IPv6 multicast source.
6) When the IPv6 multicast data addressed to G1 or G2 reaches an MLD router, because the (*, G1) and (*, G2) multicast forwarding entries exist on the MLD router, the router forwards the IPv6 multicast data to the local subnet, and then the receivers on the subnet receive the data.
III. Leaving an IPv6 multicast group
When a host leaves a multicast group:
1) This host sends a done message to all IPv6 multicast routers (the destination address is FF02::2) on the local subnet.
2) Upon receiving the leave message, the querier sends a configurable number of multicast-address-specific queries to the group being left. The destination address field and group address field of the message are both filled with the address of the IPv6 multicast group being queried.
3) One of the remaining members, if any on the subnet, of the group being queried should send a report within the time of the maximum response delay set in the query messages.
4) If the querier receives a report for the group within the maximum response delay time, it will maintain the memberships of the IPv6 multicast group; otherwise, the querier will assume that no hosts on the subnet are still interested in IPv6 multicast traffic addressed to that group and will stop maintaining the memberships of the group.
How MLDv2 Works
Compared with MLDv1, MLDv2 provides the following new features:
I. IPv6 multicast group filtering
In addition to multicast-address-specific queries, MLDv2 has introduced IPv6 multicast source filtering modes (Include and Exclude), so that a host not only can join a designated IPv6 multicast group but also can explicitly specify to receive or reject IPv6 multicast data from a designated IPv6 multicast source. When a host joins an IPv6 multicast group G:
If it needs to receive IPv6 multicast data from specific IPv6 multicast sources like S1, S2, …, it sends a report with the Filter-Mode denoted as “Include Sources (S1, S2, ……).
If it needs to reject IPv6 multicast data from specific IPv6 multicast sources like S1, S2, …, it sends a report with the Filter-Mode denoted as “Exclude Sources (S1, S2, ……).
Technology Introduction IP Multicast MLD
4
As shown in I. Figure 2, the network comprises two IPv6 multicast sources, Source 1 (S1) and Source 2 (S2), both of which can send IPv6 multicast data to IPv6 multicast group G. Host B is interested only in the IPv6 multicast data that Source 1 sends to G but not in the data from Source 2.
Source 2
Receiver
Host A
Host B
Host C
Packets (S1,G)
Packets (S2,G)
Source 1
Figure 2 Flow paths of source-and-group-specific multicast traffic
In the case of MLDv1, Host B cannot select IPv6 multicast sources when it joins IPv6 multicast group G. Therefore, IPv6 multicast streams from both Source 1 and Source 2 will flow to Host B whether it needs them or not.
When MLDv2 is running on the hosts and routers, Host B can explicitly express its interest in the IPv6 multicast data Source 1 sends to G (denoted as (S1, G)), rather than the IPv6 multicast data Source 2 sends to G (denoted as (S2, G)). Thus, only IPv6 multicast data from Source 1 will be delivered to Host B.
II. MLD state
A multicast router running MLDv2 maintains the multicast address state per multicast address per attached subnet. The multicast address state consists of the following:
Filter mode: The router keeps tracing the Include or Exclude state. List of sources: The router keeps tracing the newly added or deleted IPv6
multicast source. Timers: Filter timer (the time the router waits before switching to the Include
mode after an IPv6 multicast address times out), source timer (for source recording), and so on.
III. Receiver host state listening
By listening to the state of receiver hosts, a multicast router running MLDv2 records and maintains information of hosts joining the source group on the attached subnet.
Technology Introduction IP Multicast MLD
5
MLD Message Types
The following descriptions are based on MLDv2 messages.
I. MLD query message
An MLD querier learns the multicast listening state of neighbor interfaces by sending MLD query messages. Figure 3 shows the format of an MLD query message. The dark blue area in the figure shows the format of an MLDv1 message.
Multicast Address (128 bits)
Type = 130 Code
0 7 15 31
Checksum
Maximum Response Delay Reserved
Reserved S QRV QQIC Number of Sources (n)
...
3 4
Source Address [1] (128 bits)
Source Address [n] (128 bits)
Figure 3 Format of MLDv2 query message
Table 1 describes the fields in Figure 3.
Table 1 Description on fields in an MLDv2 query message
Field Description
Type = 130 Message type. For a query message, this field is set to 130.
Code Initialized to zero
Checksum Standard IPv6 checksum
Technology Introduction IP Multicast MLD
6
Field Description
Maximum Response Delay Maximum response delay allowed before a host sends a report message
Reserved Reserved field and initialized to zero
Multicast Address
This field is set to 0 in a general query message.
It is set to a specific IPv6 multicast address in a multicast-address-specific query message or multicast-address-and-source-specific query message.
S Flag indicating whether a router updates the timer for suppression after receiving a query message.
QRV Querier’s Robustness Variable
QQIC Querier’s Query Interval Code
Number of Sources
This field is set to 0 in a general query message or a multicast-address-specific query message.
This field represents the number of source addresses in a multicast-address-and-source-specific query message
Source Address( i )
IPv6 multicast source address in a multicast-address-specific query message (i = 1, 2, .., n, where n represents the number of multicast source addresses.)
II. MLD report message
A host sends an MLD report message to report the current multicast listening state Figure 4 shows the format of an MLD report message.
Technology Introduction IP Multicast MLD
7
Type = 143 Code
0 7 15 31
Checksum
Reserved Number of Multicast Address Records (m)
...
Multicast Address Record [1]
Multicast Address Record [m]
Figure 4 Format of MLDv2 report message
Table 2 describes the fields in Figure 4.
Table 2 Description on fields in an MLDv2 report message
Field Description
Type = 143 Message type. For a report message, this field is set to 143.
Reserved The Reserved fields are set to 0 on transmission and ignored on reception.
Checksum Standard IPv6 checksum
Number of Multicast Address Records This field indicates how many IPv6 multicast address records are present in this report message.
Multicast Address Record(i)
This field represents information of each IPv6 multicast address the host listens to on the interface from which the report message is sent, including record type, IPv6 multicast address, and IPv6 multicast source address on the sender (i= 1, 2, ... m, where m represents the number of IPv6 multicast address records).
Technology Introduction IP Multicast MLD
8
Protocols and Standards
MLD is documented in:
RFC 2710: Multicast Listener Discovery (MLD) for IPv6 RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for IPv6