Method of Configuring both Layer 2 and Layer 3 Multicast on S Series Switches and Common Problems in the Configuration
- Overview
- Prerequisites
- What Is Both Configuration of Layer 2 and Layer 3 Multicast Services
- How to Configure Both Layer 2 and Layer 3 Multicast
- Common Problems in the Configuration of both Layer 2 and Layer 3 Multicast (IGMPv2)
- Common Problems in the Configuration of both Layer 2 and Layer 3 Multicast (IGMPv3)
- Summary About the Configuration of both Layer 2 and Layer 3 Multicast in Typical Scenarios
Overview
A network usually needs to transmit both Layer 2 and Layer 3 multicast traffic. Configuration errors may lead to Layer 2 broadcast of multicast traffic or even failure to forward multicast traffic. This document provides detailed guidance for configuring both Layer 2 and Layer 3 multicast services, common problems in the configuration, and suggestions on the use of the IGMP snooping function.
Prerequisites
This document uses Huawei S7700 series switches as an example to describe how to configure both Layer 2 and Layer 3 multicast and provides analysis for common problems in the configuration. The configuration may vary depending on the switch series and version. For details, see the product documentation for the corresponding series and version.
What Is Both Configuration of Layer 2 and Layer 3 Multicast Services
In most cases, multicast packets must pass through Layer 2 switching devices between multicast receivers and Layer 3 multicast routers. After a router forwards multicast packets to a switch, the switch forwards the multicast packets to multicast receivers. Destination addresses of multicast packets are multicast group addresses and cannot be learned by a Layer 2 switch. Therefore, when a Layer 2 switch receives multicast packets from a router, it broadcasts the packets in the broadcast domain. All hosts in the broadcast domain receive the multicast packets, regardless of whether they are group members. This wastes network bandwidth and brings security risks.
Internet Group Management Protocol Snooping (IGMP snooping) effectively resolves this problem. IGMP snooping is an IPv4 Layer 2 multicast protocol. The protocol maintains outbound interface information of multicast packets by snooping on multicast protocol packets (for example, IGMP messages or PIM Hello messages) exchanged between a Layer 3 multicast device and user hosts. Based on the outbound interface information, IGMP snooping creates Layer 2 multicast forwarding entries, and uses the entries to manage and control multicast packet forwarding at the data link layer. In this way, it prevents multicast data from being broadcast on Layer 2 networks.
On the network shown in Figure 1-1, the access switch (SwitchA) is not only a Layer 2 switch, as Layer 3 multicast is also configured on its' VLANIF interface. SwitchA performs Layer 3 multicast forwarding by default, and the inbound and outbound interfaces for multicast data packets are VLANIF interfaces. Multicast data packets are broadcast in the VLAN as there is no accurate physical interface information. In this scenario, IGMP snooping must be configured in the corresponding VLAN to enable Layer 2 multicast, so accurate Layer 2 forwarding can be implemented in the VLAN. In this scenario, both Layer 2 and Layer 3 multicast services are configured on the access switch. Multicast traffic is diverted to the access switch through Layer 3 multicast, and then accurately forwarded to multicast receivers through Layer 2 multicast.
How to Configure Both Layer 2 and Layer 3 Multicast
Networking Requirements
On the network shown in Figure 1-2, the multicast source sends multicast data to SwitchA (access switch) through the multicast router. The interface GE1/0/1 of SwitchA is connected to the multicast source and belongs to VLAN 10. There are four multicast receivers on the network. Receivers A and B belong to VLAN 10, and receivers C and D belong to VLAN 20. The customer wants to configure both Layer 2 and Layer 3 multicast on SwitchA so that the four receivers can all receive multicast traffic.
Assume that the multicast address of the service flow is network segment 239.X.X.X (not in the SSM group address range) and the switch runs IGMPv2 (default IGMP version).
Configuration Roadmap
The configuration roadmap is as follows:
- Enable multicast routing globally on SwitchA.
- Enable PIM on the uplink interface VLANIF 10 (the interface connected to the router) of SwitchA.
- Enable PIM and IGMP on the downlink interface VLANIF 20 (the interface connected to receivers) of SwitchA.
- Enable IGMP snooping globally on SwitchA, and enable IGMP snooping in both VLAN 10 and VLAN 20.
Configuration Procedure
Perform the following steps to configure basic functions for Layer 2 and Layer 3 multicast services. This document provides only key configurations for Layer 2 and Layer 3 multicast services.
- Enable multicast routing globally on SwitchA.
<SwitchA> system-view [SwitchA] multicast routing-enable
- Enable PIM and IGMP on the uplink interface VLANIF 10 (the interface connected to the router) of SwitchA.
[SwitchA] interface vlanif 10 [SwitchA-Vlanif10] pim sm [SwitchA-Vlanif10] igmp enable [SwitchA-Vlanif10] quit
- Enable PIM and IGMP on the downlink interface VLANIF 20 (the interface connected to receivers) of SwitchA.
[SwitchA] interface vlanif 20 [SwitchA-Vlanif20] pim sm [SwitchA-Vlanif20] igmp enable [SwitchA-Vlanif20] quit
- Enable IGMP snooping globally on SwitchA, and enable IGMP snooping in both VLAN 10 and VLAN 20.
[SwitchA] igmp-snooping enable [SwitchA]] vlan 10 [SwitchA-vlan10] igmp-snooping enable [SwitchA-Vlanif10] quit [SwitchA] vlan 20 [SwitchA-vlan20] igmp-snooping enable [SwitchA-vlan20] quit
If the multicast address of the service flow is network segment 232.X.X.X, in addition to the preceding configuration, run the igmp version 3 command in the VLANIF interface view to change the IGMP version on the VLANIF interfaces to IGMPv3. For details, see Summary About the Configuration of both Layer 2 and Layer 3 Multicast in Typical Scenarios.
Common Problems in the Configuration of both Layer 2 and Layer 3 Multicast (IGMPv2)
This section describes common problems in the configuration of both Layer 2 multicast and Layer 3 multicast on a switch. Figure 1-3 shows the networking diagram, which is based on networking requirements and configurations described in How to Configure Both Layer 2 and Layer 3 Multicast.
- Common problem 1: If IGMP snooping is not enabled in VLAN 20, the following problem may occur:
Users in VLAN 20 can still receive multicast traffic, but the multicast traffic is broadcast in VLAN 20, so all physical interfaces in VLAN 20 can receive the multicast traffic. However, the multicast traffic cannot be accurately forwarded based on physical interfaces.
- Common problem 2: If IGMP snooping is not enabled in VLAN 10, the following problem may occur:
Users in VLAN 10 cannot receive multicast traffic due to the following reasons:
In this scenario, the multicast source also belongs to VLAN 10, and PIM-SM is enabled in the VLANIF 10 interface view using the pim sm command. The 239.X.X.X group address is in the ASM (any source) group address range. The device does not forward the multicast traffic received on VLANIF 10 unless the traffic matches Layer 2 or Layer 3 entries.
Layer 3 multicast involves only Layer 3 interfaces. The PIM protocol requires that the outbound interface and inbound interface of a multicast packet must not be the same. That is, a multicast packet that enters into a switch through VLANIF 10 cannot be forwarded out through VLANIF 10. Therefore, SwitchA does not generate a Layer 3 multicast forwarding entry with VLANIF 10 as the outbound interface. As a result, multicast packets that arrive at SwitchA will be terminated because there are no outbound interfaces for them.
For Layer 2 multicast, IGMP snooping is not configured in VLAN 10 on SwitchA, so SwitchA does not generate Layer 2 forwarding entries. As a result, multicast data packets cannot be forwarded after reaching SwitchA because there are no matching Layer 2 forwarding entries .
If PIM-SM is disabled on the VLANIF 10 interface, SwitchA broadcasts the received multicast data packets in VLAN 10, so all the users in VLAN 10 can receive the multicast traffic. Disabling PIM-SIM on VLANIF 10, however, affects Layer 3 multicast in other VLANs. Therefore, this configuration is not recommended.
Common Problems in the Configuration of both Layer 2 and Layer 3 Multicast (IGMPv3)
This section describes common problems in the configuration of both Layer 2 multicast and Layer 3 multicast on a switch running IGMPv3. Figure 1-4 shows the networking diagram, which is based on networking requirements and configurations described in How to Configure Both Layer 2 and Layer 3 Multicast.
Assume that the following modifications are made on the networking requirements and configurations described in How to Configure Both Layer 2 and Layer 3 Multicast:
- Set the multicast address of the service flow to 232.X.X.X (default SSM group address).
- Run the igmp version 3 command in the VLANIF 10 view to change the IGMP version on the interface to IGMPv3. (By default, the VLANIF interface runs IGMPv2.)
- Disable IGMP snooping in VLAN 10.
If other configurations remain unchanged, users in VLAN 10 can receive multicast traffic (broadcast transmission) because of the following:
The multicast group address on the 232.X.X.X network segment is in the SSM group address range. When the VLANIF 10 interface on which PIM-SM is configured receives multicast traffic, no Layer 3 (S, G) entries will be created. Instead, the switch generates Layer 3 (S, G) entries after receiving IGMPv3 Report messages with specified source addresses.
- If matching Layer 3 (S, G) entries exist, the switch forwards multicast traffic based on the Layer 3 (S, G) entries. All the users in VLAN 10 can receive the multicast traffic.
- If there are no matching Layer 3 (S, G) entries, SwitchA broadcasts received multicast traffic in VLAN 10, so all the users in VLAN 10 can receive the multicast traffic.
- If IGMP snooping is enabled in VLAN 10, the switch forwards multicast traffic through the outbound interface in the matching Layer 2 entry, so all the users in VLAN 10 can receive the multicast traffic.
Summary About the Configuration of both Layer 2 and Layer 3 Multicast in Typical Scenarios
IGMP snooping can snoop on both IGMP messages and PIM Hello messages. In multicast services, IGMP snooping can be used in the following ways:
- 1. IGMP snooping can be enabled in a VLAN as a Layer 2 multicast function, without being used together with IGMP.
- 2. When both Layer 2 multicast and Layer 3 multicast are enabled on a switch, IGMP snooping can be configured to implement accurate multicast forwarding at Layer 3.
IGMP snooping processes IGMP messages independently regardless of whether IGMP is enabled at Layer 3. When both Layer 2 multicast and Layer 3 multicast are enabled on a switch, Layer 2 multicast interacts with Layer 3 multicast to transmit the physical port information snooped in Layer 2 multicast to Layer 3 multicast. This prevents Layer 3 multicast data packets from being broadcast in VLANs.
When both Layer 2 multicast and Layer 3 multicast are enabled on a switch, ensure that multicast entries and outbound interface information can be generated at both Layer 2 and Layer 3. Otherwise, multicast traffic may fail to be forwarded. For different multicast group addresses of service flows, the switch may or may not generate IGMP snooping entries, depending on the IGMP version running on it. Users need to plan proper multicast group addresses based on the IGMP versions used on their networks. The following table provides details about the scenarios.
Multicast Group Address |
IGMPv2 |
IGMPv3 Specified Source Address |
IGMPv3 Without Specified Source Address |
---|---|---|---|
Non-232.X.X.X group address (ASM group address by default) |
Scenario 1: IGMP snooping entries can be generated. |
Scenario 3: IGMP snooping entries cannot be generated. |
Scenario 5: IGMP snooping entries can be generated. |
232.X.X.X group address (SSM group address by default) |
Scenario 2: IGMP snooping entries cannot be generated. |
Scenario 4: IGMP snooping entries can be generated. |
Scenario 6: IGMP snooping entries cannot be generated. |
The following provides key configurations for the six scenarios based on the network topology shown in Figure 1-5.
Scenario 1: IGMPv2 + non-232.X.X.X multicast address
This is a typical scenario, and you need to ensure that the device is running IGMPv2.
The detailed configuration procedure is as follows:
- Enable multicast routing globally on SwitchA.
<SwitchA> system-view [SwitchA] multicast routing-enable
- Enable PIM on the uplink interface VLANIF 10 (the interface connected to the router) of SwitchA. If there are receivers in the VLAN corresponding to VLANIF 10, configure IGMP on VLANIF 10.
[SwitchA] interface vlanif 10 [SwitchA-Vlanif10] pim sm [SwitchA-Vlanif10] igmp enable [SwitchA-Vlanif10] quit
- Enable PIM and IGMP on the downlink interface VLANIF 20 (the interface connected to receivers) of SwitchA.
[SwitchA] interface vlanif 20 [SwitchA-Vlanif20] pim sm [SwitchA-Vlanif20] igmp enable [SwitchA-Vlanif20] quit
- Enable IGMP snooping globally on SwitchA, and enable IGMP snooping in both VLAN 10 and VLAN 20.
[SwitchA] igmp-snooping enable [SwitchA]] vlan 10 [SwitchA-vlan10] igmp-snooping enable [SwitchA-Vlanif10] quit [SwitchA] vlan 20 [SwitchA-vlan20] igmp-snooping enable [SwitchA-vlan20] quit
Scenario 2: IGMPv2 + 232.X.X.X multicast address
In this scenario, pay attention to the following:
By default, the 232.X.X.X multicast group address is reserved for SSM. A VLANIF interface runs IGMPv2 by default and does not generate IGMP snooping entries. Therefore, you need to add the 232.X.X.X multicast group address to the ASM group address range, configure the SSM group address range for Layer 3 multicast using the ssm-policy command, and configure the SSM group address range for Layer 2 multicast using the igmp-snooping ssm-policy command.
The detailed configuration procedure is as follows:
- Enable multicast routing globally on SwitchA.
<SwitchA> system-view [SwitchA] multicast routing-enable
- Enable PIM on the uplink interface VLANIF 10 (the interface connected to the router) of SwitchA. If there are receivers in the VLAN corresponding to VLANIF 10, configure IGMP on VLANIF 10.
[SwitchA] interface vlanif 10 [SwitchA-Vlanif10] pim sm [SwitchA-Vlanif10] igmp enable [SwitchA-Vlanif10] quit
- Enable PIM and IGMP on the downlink interface VLANIF 20 (the interface connected to receivers) of SwitchA.
[SwitchA] interface vlanif 20 [SwitchA-Vlanif20] pim sm [SwitchA-Vlanif20] igmp enable [SwitchA-Vlanif20] quit
- Enable IGMP snooping globally on SwitchA, and enable IGMP snooping in both VLAN 10 and VLAN 20.
[SwitchA] igmp-snooping enable [SwitchA]] vlan 10 [SwitchA-vlan10] igmp-snooping enable [SwitchA-Vlanif10] quit [SwitchA] vlan 20 [SwitchA-vlan20] igmp-snooping enable [SwitchA-vlan20] quit
- Add the 232.X.X.X multicast group address to the ASM group address range, configure the SSM group address range for Layer 3 multicast using the ssm-policy command, and configure the SSM group address range for Layer 2 multicast using the igmp-snooping ssm-policy command.
[SwitchA] acl number 2000 //Configure an ACL to specify the multicast group address. [SwitchA-acl-basic-2000] //If you want to add group address 232.X.X.X to the ASM group address range, leave the address in the ACL empty. [SwitchA-acl-basic-2000] quit [SwitchA] pim [SwitchA-pim] ssm-policy 2000 //Configure an SSM policy for Layer 3 multicast. [SwitchA-pim] quit [SwitchA]] vlan 10 [SwitchA]-vlan10] igmp-snooping ssm-policy 2000 //Configure an SSM policy for Layer 2 multicast. [SwitchA]] vlan 20 [SwitchA]-vlan20] igmp-snooping ssm-policy 2000 //Configure an SSM policy for Layer 2 multicast. [SwitchA]-vlan20] quit
Scenario 3: IGMPv3 + non-232.X.X.X multicast address + specified source address
In this scenario, pay attention to the following:
- A switch runs IGMPv2 by default. Therefore, you need to run the igmp version 3 command in the VLANIF interface view to change the IGMP version on the VLANIF interface to IGMPv3, and run the igmp-snooping version 3 command in the VLAN view to change the IGMP snooping version in the VLAN to IGMPv3.
- By default, a non-232.X.X.X group address is an ASM group address. A VLANIF interface running IGMPv3 does not generate IGMP snooping entries when the source address is specified in IGMP Report messages. Therefore, you need to add the non-232.X.X.X multicast group address to the SSM group address range, configure the SSM group address range for Layer 3 multicast using the ssm-policy command, and configure the SSM group address range for Layer 2 multicast using the igmp-snooping ssm-policy command.
The detailed configuration procedure is as follows:
- Enable multicast routing globally on SwitchA.
<SwitchA> system-view [SwitchA] multicast routing-enable
- Enable PIM on the uplink interface VLANIF 10 (the interface connected to the router) of SwitchA. If there are receivers in the VLAN corresponding to VLANIF 10, configure IGMP on VLANIF 10.
[SwitchA] interface vlanif 10 [SwitchA-Vlanif10] pim sm [SwitchA-Vlanif10] igmp enable [SwitchA-Vlanif10] igmp version 3 //Set the IGMP version to IGMPv3. [SwitchA-Vlanif10] quit
- Enable PIM and IGMP on the downlink interface VLANIF 20 (the interface connected to receivers) of SwitchA and set the IGMP version to IGMPv3.
[SwitchA] interface vlanif 20 [SwitchA-Vlanif20] pim sm [SwitchA-Vlanif20] igmp enable [SwitchA-Vlanif20] igmp version 3 //Set the IGMP version to IGMPv3. [SwitchA-Vlanif20] quit
- Enable IGMP snooping globally on SwitchA, enable IGMP snooping in VLAN 10 and VLAN 20, and change the IGMP snooping version in the two VLANs to IGMPv3.
[SwitchA] igmp-snooping enable [SwitchA]] vlan 10 [SwitchA-vlan10] igmp-snooping enable [SwitchA-vlan10] igmp-snooping version 3 //Change the IGMP snooping version in VLAN 10 to IGMPv3. [SwitchA-Vlanif10] quit [SwitchA] vlan 20 [SwitchA-vlan20] igmp-snooping enable [SwitchA-vlan20] igmp-snooping version 3 //Change the IGMP snooping version in VLAN 20 to IGMPv3. [SwitchA-vlan20] quit
- Add the non-232.X.X.X group address to the SSM group address range, configure the SSM group address range for Layer 3 multicast using the ssm-policy command, and configure the SSM group address range for Layer 2 multicast using the igmp-snooping ssm-policy command.
[SwitchA] acl number 2000 //Configure an ACL to specify the multicast group address. [SwitchA-acl-basic-2000] rule permit source 239.1.1.0 0.0.0.255 // This example assumes that the multicast address of the service flow is 239.1.1.0/24. [SwitchA-acl-basic-2000] quit [SwitchA] pim [SwitchA-pim] ssm-policy 2000 //Configure an SSM policy for Layer 3 multicast. [SwitchA-pim] quit [SwitchA]] vlan 10 [SwitchA]-vlan10] igmp-snooping ssm-policy 2000 //Configure an SSM policy for Layer 2 multicast. [SwitchA]] vlan 20 [SwitchA]-vlan20] igmp-snooping ssm-policy 2000 //Configure an SSM policy for Layer 2 multicast. [SwitchA-vlan20] quit
Scenario 3: IGMPv3 + 232.X.X.X multicast address + specified source address
In this scenario, pay attention to the following:
A switch runs IGMPv2 by default. Therefore, you need to run the igmp version 3 command in the VLANIF interface view to change the IGMP version on the VLANIF interface to IGMPv3, and run the igmp-snooping version 3 command in the VLAN view to change the IGMP snooping version in the VLAN to IGMPv3.
The detailed configuration procedure is as follows:
- Enable multicast routing globally on SwitchA.
<SwitchA> system-view [SwitchA] multicast routing-enable
- Enable PIM on the uplink interface VLANIF 10 (the interface connected to the router) of SwitchA. If there are receivers in the VLAN corresponding to VLANIF 10, configure IGMP on VLANIF 10.
[SwitchA] interface vlanif 10 [SwitchA-Vlanif10] pim sm [SwitchA-Vlanif10] igmp enable [SwitchA-Vlanif10] igmp version 3 //Set the IGMP version to IGMPv3. [SwitchA-Vlanif10] quit
- Enable PIM and IGMP on the downlink interface VLANIF 20 (the interface connected to receivers) of SwitchA and set the IGMP version to IGMPv3.
[SwitchA] interface vlanif 20 [SwitchA-Vlanif20] pim sm [SwitchA-Vlanif20] igmp enable [SwitchA-Vlanif20] igmp version 3 //Set the IGMP version to IGMPv3. [SwitchA-Vlanif20] quit
- Enable IGMP snooping globally on SwitchA, enable IGMP snooping in VLAN 10 and VLAN 20, and change the IGMP snooping version in the two VLANs to IGMPv3.
[SwitchA] igmp-snooping enable [SwitchA]] vlan 10 [SwitchA-vlan10] igmp-snooping enable [SwitchA-vlan10] igmp-snooping version 3 //Change the IGMP snooping version in VLAN 10 to IGMPv3. [SwitchA-Vlanif10] quit [SwitchA] vlan 20 [SwitchA-vlan20] igmp-snooping enable [SwitchA-vlan20] igmp-snooping version 3 //Change the IGMP snooping version in VLAN 20 to IGMPv3. [SwitchA-vlan20] quit
Scenario 5: IGMPv3 + non-232.X.X.X multicast address + without specified source address
The configuration method in this scenario is similar to that in scenario 1. You simply need to run the igmp version 3 command in the VLANIF interface view to change the IGMP version on the VLANIF interface to IGMPv3 and run the igmp-snooping version 3 command in the VLAN view
to change the IGMP snooping version in the VLAN to IGMPv3.
Scenario 6: IGMPv3 + 232.X.X.X multicast address + without specified source address
The configuration method in this scenario is similar to that in scenario 2. You simply need to run the igmp version 3 command in the VLANIF interface view to change the IGMP version on the VLANIF interface to IGMPv3 and run the igmp-snooping version 3 command in the VLAN view
to change the IGMP snooping version in the VLAN to IGMPv3.