Create and manage a multicast network

更新时间:
复制 MD 格式

This topic describes how to create and manage a multicast network using an Enterprise Edition transit router.

Background

Before you create a multicast network, you should understand the features, networking, billing, and limits of multicast on Enterprise Edition transit routers. For more information, see Multicast management.

Procedure

Static mode

Step 1: Prepare the environment

  1. Create an Enterprise Edition transit router in the region where you want to build the multicast network and enable the multicast feature. For more information, see Create a transit router instance.

    Important
    • The multicast feature is supported only by Enterprise Edition transit routers in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Ulanqab), China (Shenzhen), China (Chengdu), China (Hohhot), China (Hong Kong), Japan (Tokyo), Singapore, Germany (Frankfurt), UK (London), US (Virginia), and US (Silicon Valley).

    • You can enable the multicast feature only when you create an Enterprise Edition transit router instance. If you have an Enterprise Edition transit router in a region that supports multicast but you cannot use the multicast feature, delete the transit router instance and create a new one. For more information about how to delete an Enterprise Edition transit router instance, see Delete a transit router instance.

  2. Connect the VPCs that you want to include in the multicast network using an Enterprise Edition transit router. For more information, see Connect on-premises data centers to VPCs or Create a cross-account VPC-to-VPC connection.

Step 2: Create a multicast domain

To define the scope of a multicast network, create a multicast domain and associate it with one or more vSwitches. Only resources within the associated vSwitches can send and receive multicast traffic.

  1. Log on to the CEN console.

  2. On the CEN Instance page, click the ID of the CEN instance that you want to manage.

  3. On the Basic Settings > Transit Router tab, click the ID of the transit router instance.

  4. On the details page of the transit router instance, click the Multicast tab, and then click Create Multicast Domain.

  5. In the Create Multicast Domain dialog box, configure the parameters and click OK.

    Parameter

    Description

    Transit Router

    The ID of the transit router instance in the current region is displayed.

    Multicast Domain Name

    Enter a name for the multicast domain.

    Multicast Domain Features

    Specifies whether to enable the Internet Group Management Protocol (IGMP) feature for the multicast domain. When enabled, hosts can use the IGMP protocol to dynamically join or leave a multicast group. This feature is enabled by default.

    • If you are creating a multicast network in static mode, you can disable this feature.

    • If you are creating a multicast network in IGMP mode, you must enable this feature. Once enabled, this feature cannot be disabled.

    VPC

    Select the VPC to associate with the multicast domain.

    vSwitch

    Select the vSwitch to associate with the multicast domain.

    Description

    Enter a description for the multicast domain.

    Tag

    Set a tag for the multicast domain.

    • Tag key: cannot be an empty string. The key can be up to 64 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

    • Tag value: can be an empty string. The value can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

    You can add multiple tags to a multicast domain. For more information, see Tags.

    To associate vSwitches from multiple VPCs, see Associate a vSwitch in More operations.

Step 3: Create a multicast source

After creating a multicast domain, you must add a multicast source and assign it to a multicast group. The source then sends traffic to the group, where it can be received by all multicast members.

  1. Log on to the CEN console.

  2. On the CEN Instance page, click the ID of the CEN instance that you want to manage.

  3. On the Basic Settings > Transit Router tab, click the ID of the transit router instance.

  4. On the transit router instance details page, click the Multicast tab. Then, in the left pane of the Multicast tab, click the multicast domain ID.

  5. In the Multicast domain details section, click the Multicast Groups tab, and then click Add Multicast Source.

  6. On the Add Multicast Source page, configure the parameters and click OK.

    Parameter

    Description

    Basic Settings

    Transit Router

    The ID of the transit router instance in the current region is displayed.

    Multicast Domain

    The ID of the selected multicast domain is displayed.

    Multicast Group Info

    Multicast Group

    Select the multicast group for the multicast source. Valid values:

    • Create Multicast Group: If no multicast group exists in the selected multicast domain, select this option and enter an IP address. The system automatically creates a multicast group.

      Note

      After a multicast group is created, you cannot change its IP address.

    • Select Multicast Group: If a multicast group already exists in the domain, select this option to add a source to the existing group.

    New Multicast Group IP

    Enter the IP address for the new multicast group. The valid IP address range is 224.0.0.128 to 239.255.255.254.

    Important

    The IP address range from 224.0.0.0 to 224.0.0.127 is reserved and cannot be used for multicast groups.

    Each multicast group is identified by a multicast IP address.

    This parameter is required only if you select Create Multicast Group.

    Multicast Group

    Select an existing multicast group.

    The new multicast source will belong to the selected multicast group.

    This parameter is required only if you select Select Multicast Group.

    Multicast Source Info

    Resource Type

    Select the resource type of the multicast source. The default value is ENI.

    Currently, only an elastic network interface (ENI) attached to an ECS instance can serve as a multicast source. The system uses the primary private IP address of the ENI to send multicast traffic to the multicast group.

    You can specify up to five ENIs as multicast sources at a time.

    vSwitch

    Select the vSwitch where the multicast source is located.

    ENI

    Select the ENI to use as the multicast source.

    If you select the Add as Multicast Member checkbox, the ENI is also added as a multicast member to the same multicast group.

Step 4: Add a multicast member

If you did not specify a multicast member when you created the multicast source, follow these steps to add one. A resource must be a multicast member to receive multicast traffic. Multicast members can receive traffic only from the multicast group they belong to.

  1. Log on to the CEN console.

  2. On the CEN Instance page, click the ID of the CEN instance that you want to manage.

  3. On the Basic Settings > Transit Router tab, click the ID of the transit router instance.

  4. On the transit router instance details page, click the Multicast tab. Then, in the left pane of the Multicast tab, click the multicast domain ID.

  5. In the Multicast domain details section, click the Multicast Groups tab, and then click Add Group Member.

  6. On the Add Group Member page, configure the parameters and click OK.

    Parameter

    Description

    Basic Settings

    Transit Router

    The ID of the transit router instance in the current region is displayed.

    Multicast Domain

    The ID of the selected multicast domain is displayed.

    Multicast Group Info

    Multicast Group

    Select the multicast group for the multicast member. Valid values:

    • Create Multicast Group: If no multicast group exists in the current multicast domain, select this option and enter the IP address for the new multicast group. The system automatically creates a multicast group.

      Note

      After a multicast group is created, you cannot change its IP address.

    • Select Multicast Group: If multicast groups already exist in the current multicast domain, you can select this option to create multicast members for a specified multicast group.

    New Multicast Group IP

    Enter the IP address for the new multicast group. The valid IP address range is 224.0.0.128 to 239.255.255.254.

    Important

    The IP address range from 224.0.0.0 to 224.0.0.127 is reserved and cannot be used for multicast groups.

    Each multicast group is identified by a multicast IP address.

    This parameter is required only if you select Create Multicast Group.

    Multicast Group

    Select an existing multicast group.

    This parameter is required only if you select Select Multicast Group.

    Group Member Info

    Resource Type

    Select the resource type of the multicast member. Valid values:

    • ENI (default): Select an ENI that is deployed in a vSwitch.

      Currently, only an elastic network interface (ENI) attached to an ECS instance can serve as a multicast member. The system uses the primary private IP address of the ENI to receive multicast traffic.

      Click Add ENI to add multiple ENIs.

    • Inter-region Multicast: Select a multicast domain that belongs to a transit router in another region.

      When you select a multicast domain in another region, the members of the multicast group with the same IP address in that domain become members of the current multicast group.

      Example: Multicast group A exists in multicast domain 1 in the China (Hangzhou) region. Another multicast group A that has the same multicast IP address exists in multicast domain 2 in the China (Shanghai) region, and this group already has members. To add a multicast member to group A in domain 1, you can select Inter-region Multicast as the resource type and select multicast domain 2 in the China (Shanghai) region. After the operation is complete, the members of group A in domain 2 become members of group A in domain 1, which allows them to receive multicast traffic from the group.

      Important
      • Before you select Inter-region Multicast, make sure that the following conditions are met:

        • An active inter-region connection exists between the two regions.

        • A multicast group with the same IP address exists in the peer region and contains members.

      • You can add multicast members across regions, but you cannot add multicast sources across regions.

      • For a specific multicast group, you can add inter-region members in only one direction. If you add members from a peer domain to your local domain, you cannot add members from your local domain to the peer domain for the same group.

    vSwitch

    Select the vSwitch where the multicast member is located.

    This parameter is required only if you select ENI as the resource type.

    ENI

    Select the ENI to use as the multicast member.

    This parameter is required only if you select ENI as the resource type.

    • If you select the Add as Multicast Source checkbox, the ENI is also added as a multicast source to the same multicast group.

    • You can specify up to five multicast members at a time. When adding members from a cross-account VPC, you can select ENIs from only a single cross-account VPC in one operation.

    Transit Router

    Select the peer transit router instance.

    This parameter is required only if you select Inter-region Multicast as the resource type.

    Peer Multicast Domain

    Select a multicast domain of the peer transit router instance.

    This parameter is required only if you select Inter-region Multicast as the resource type.

IGMP mode

Step 1: Prepare the environment

  1. Create an Enterprise Edition transit router in the region where you want to build the multicast network and enable the multicast feature. For more information, see Create a transit router instance.

    Important
    • The multicast feature is supported only by Enterprise Edition transit routers in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Ulanqab), China (Shenzhen), China (Chengdu), China (Hohhot), China (Hong Kong), Japan (Tokyo), Singapore, Germany (Frankfurt), UK (London), US (Virginia), and US (Silicon Valley).

    • You can enable the multicast feature only when you create an Enterprise Edition transit router instance. If you have an Enterprise Edition transit router in a region that supports multicast but you cannot use the multicast feature, delete the transit router instance and create a new one. For more information about how to delete an Enterprise Edition transit router instance, see Delete a transit router instance.

  2. Connect the VPCs that you want to include in the multicast network using an Enterprise Edition transit router. For more information, see Connect on-premises data centers to VPCs or Create a cross-account VPC-to-VPC connection.

Step 2: Create a multicast domain

To define the scope of a multicast network, create a multicast domain and associate it with one or more vSwitches. Only resources within the associated vSwitches can send and receive multicast traffic.

  1. Log on to the CEN console.

  2. On the CEN Instance page, click the ID of the CEN instance that you want to manage.

  3. On the Basic Settings > Transit Router tab, click the ID of the transit router instance.

  4. On the details page of the transit router instance, click the Multicast tab, and then click Create Multicast Domain.

  5. In the Create Multicast Domain dialog box, configure the parameters and click OK.

    Parameter

    Description

    Transit Router

    The ID of the transit router instance in the current region is displayed.

    Multicast Domain Name

    Enter a name for the multicast domain.

    Multicast Domain Features

    Specifies whether to enable the Internet Group Management Protocol (IGMP) feature for the multicast domain. When enabled, hosts can use the IGMP protocol to dynamically join or leave a multicast group. This feature is enabled by default.

    • If you are creating a multicast network in static mode, you can disable this feature.

    • If you are creating a multicast network in IGMP mode, you must enable this feature. Once enabled, this feature cannot be disabled.

    VPC

    Select the VPC to associate with the multicast domain.

    vSwitch

    Select the vSwitch to associate with the multicast domain.

    Description

    Enter a description for the multicast domain.

    Tag

    Set a tag for the multicast domain.

    • Tag key: cannot be an empty string. The key can be up to 64 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

    • Tag value: can be an empty string. The value can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

    You can add multiple tags to a multicast domain. For more information, see Tags.

    To associate vSwitches from multiple VPCs, see Associate a vSwitch in More operations.

Step 3: Specify the multicast source and members

After you create the multicast domain, you can deploy multicast applications in your VPC and configure the ECS instances that need to join the multicast network. An ECS instance that successfully joins a multicast group becomes both a multicast source and a multicast member.

Note
  • Hosts that join the multicast network must support Internet Group Management Protocol v2 (IGMPv2). ECS instances that use the Alibaba Cloud Linux 3.2104 LTS 64-bit image support IGMPv2 by default.

  • The IP address of a multicast group must be in the range of 224.0.0.128 to 239.255.255.254. The IP address range from 224.0.0.0 to 224.0.0.127 is reserved and cannot be used for multicast groups.

  • If an ECS instance has multiple elastic network interfaces (ENIs), the ENIs can join different multicast groups.

The following example shows how to add ECS1 and ECS2 to the multicast group 239.1.1.1. Both ECS instances are in the same VPC and use the Alibaba Cloud Linux 3.2104 LTS 64-bit image.

  1. Configure security group rules for ECS1 and ECS2 to allow IGMP messages. For more information, see Query security group rules and Add a security group rule.

  2. Log on to the ECS1 instance. For more information, see Connection methods.

  3. On the ECS1 instance, run the following command to join the multicast group 239.1.1.1 and receive its traffic.

    socat STDIO udp4-recv:8000,ip-add-membership=239.1.1.1:eth0
    Note

    While the command is running, do not enter any input. Otherwise, socat reports an "invalid argument" error and exits.

    Parameter description:

    "8000" is the port for receiving multicast traffic.

    "239.1.1.1" is the IP address of the multicast group.

    "eth0" is the network interface that joins the multicast group.

    When you run the command above, if the system indicates that the socat command is not supported, you can install socat by running the sudo yum install socat command.

    Log on to the ECS2 instance and use the preceding command to add the instance to the multicast group (239.1.1.1). After the configuration is complete, you can see that the transit router has automatically created a multicast source and a multicast member. On the Multicast tab of the transit router, view the Multicast Domain Details. On the Multicast Group sub-tab, you can find multiple entries for the 239.1.1.1 multicast group. The status of all entries is Available, the multicast source type is IGMPv2, and the resource type is VPC.

    At this point, resources within the same multicast group and domain can communicate (for example, ECS1 and ECS2). However, communication across regions is not yet enabled. To enable cross-region multicast communication between VPCs, proceed to Step 4: Statically specify inter-region multicast members.

    Note

    Multicast communication is not supported between different multicast domains under the same transit router. For inter-region multicast, only resources that belong to the same multicast group can communicate.

Step 4: Statically specify inter-region multicast members

  • You can skip this step if you need to establish a multicast network only between VPCs in the same region.

  • If you need to establish a multicast network between VPCs across different regions, you must statically specify inter-region multicast members in the multicast domain after you configure the ECS instances. This enables multicast communication between the cross-region VPCs. For more information, see Static mode - Step 4: Add a multicast member.

    For example, VPC1 in the Germany (Frankfurt) region needs to communicate with VPC2 in the UK (London) region. Although members within each VPC's group can communicate with each other, they cannot communicate across regions. To enable this, you must add the peer multicast domain (for VPC2) as a member in VPC1's domain, or vice versa.

    On the Create Multicast Member page, in the Multicast Group Information area, select Use Existing Multicast Group and select the target multicast group IP (such as 239.1.1.1) from the drop-down list. In the Multicast Member Information area, set Resource Type to Inter-region Multicast Domain. Then, in the Select Inter-Region Multicast Domain area, select the transit router and multicast domain of the peer region, such as Germany (Frankfurt).

Step 5: Test multicast connectivity

After the multicast source and members are ready, you can test the multicast network connectivity. This section continues with the example of ECS1 and ECS2 from Step 3.

  1. Make sure that ECS1 and ECS2 have joined the same multicast group as described in Step 3. Keep the terminal windows for both instances open.

    After you join a multicast group on an ECS instance by using the socat STDIO udp4-recv:8000,ip-add-membership=239.1.1.1:eth0 command, do not suspend the process (for example, by pressing Ctrl+Z) or kill the process (for example, by pressing Ctrl+C). If the process is suspended, the ECS instance successfully joins the multicast group, but you cannot observe the traffic sent by the multicast group. If the process is killed, you need to run the command again to join the multicast group.

    If the socat process is suspended, you can run the following commands to bring it to the foreground.

    # Run the following command to view all background jobs.
    jobs
    # Run the following command to resume a specific job. "1" indicates the job ID.
    fg %1    
  2. Open a new terminal window and log on to the ECS1 instance. On ECS1, run the following command to send traffic to the multicast group.

    while :; do echo "hello multicast from host `hostname` at `date`" | socat STDIO udp4-sendto:239.1.1.1:8000,ip-multicast-if=172.16.10.165,ip-multicast-ttl=32; sleep 1; done
    Note

    Parameter description:

    "239.1.1.1" is the IP address of the multicast group.

    "8000" is the destination port for the multicast traffic.

    "172.16.10.165" is the IP address of the network interface on ECS1 that sends multicast traffic, which is the IP address of the multicast source.

    You will see that both ECS1 and ECS2 receive the multicast traffic, confirming that the multicast network is connected.

    ECS1

    On ECS1 (172.16.10.165), run the following command to join the multicast group and receive messages to verify connectivity:

    [root@iZd7oxxxwrZ ~]#
    [root@iZd7oxxxwrZ ~]#
    [root@iZd7oxxxwrZ ~]# socat STDIO udp4-recv:8000,ip-add-membership=239.1.1.1:172.16.10.165
    hello multicast from host iZd7o37xxxrZ at Sun Sep 29 02:51:40 PM CST 2024
    hello multicast from host iZd7o37xxxrZ at Sun Sep 29 02:51:42 PM CST 2024
    hello multicast from host iZd7o37xxxrZ at Sun Sep 29 02:51:43 PM CST 2024
    hello multicast from host iZd7o37xxxrZ at Sun Sep 29 02:51:45 PM CST 2024
    hello multicast from host iZd7o37xxxrZ at Sun Sep 29 02:51:46 PM CST 2024
    hello multicast from host iZd7o37xxxrZ at Sun Sep 29 02:51:48 PM CST 2024
    hello multicast from host iZd7o37xxxrZ at Sun Sep 29 02:51:49 PM CST 2024
    hello multicast from host iZd7o37xxxrZ at Sun Sep 29 02:51:51 PM CST 2024
    hello multicast from host iZd7o37xxxrZ at Sun Sep 29 02:51:52 PM CST 2024
    hello multicast from host iZd7o37xxxrZ at Sun Sep 29 02:51:54 PM CST 2024

    ECS2

    On ECS2 (IP address 10.33.10.59), run the following command to join the multicast group and receive messages to verify connectivity:

    # Run on ECS2
    socat STDIO udp4-recv:8000,ip-add-membership=239.1.1.1:10.33.10.59
    # Expected output (indicates successful receipt of multicast messages):
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:40 PM CST 2024
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:42 PM CST 2024
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:43 PM CST 2024
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:45 PM CST 2024
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:46 PM CST 2024
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:48 PM CST 2024
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:49 PM CST 2024
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:51 PM CST 2024
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:52 PM CST 2024
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:54 PM CST 2024
    hello multicast from host iZd7o37xxxnwk2fwrZ at Sun Sep 29 02:51:55 PM CST 2024
  3. After the test is complete, you can press Ctrl+C on each ECS to terminate the sending or receiving of multicast traffic and end the test.

More operations

Actions

Description and prerequisites

Steps

Associate a vSwitch

After you create a multicast domain, you can associate vSwitches with it to expand the scope of the multicast network.

  1. On the transit router instance details page, click the Multicast tab, and then in the left area of the Multicast tab, click the multicast domain ID.

  2. In the Multicast domain details section, click the vSwitch tab, and then click Associate with vSwitch.

  3. In the Associate with vSwitch dialog box, select a VPC and a vSwitch, and then click OK.

    You can select multiple vSwitches within the same VPC.

If you need to associate vSwitches from multiple VPCs, repeat these steps for each VPC.

Disassociate a vSwitch

If resources in a vSwitch no longer need to be part of the multicast network, you can disassociate the vSwitch from the multicast domain.

Before you disassociate a vSwitch, make sure that the following conditions are met:

  • No multicast sources exist in the vSwitch. To delete a multicast source, see Delete a multicast source in this section.

  • No multicast members exist in the vSwitch. To delete a multicast member, see Remove a group member in this section.

  1. On the transit router instance details page, click the Multicast tab, and then in the left area of the Multicast tab, click the multicast domain ID.

  2. In the Multicast domain details section, click the vSwitch tab. Find the vSwitch that you want to manage and click Disassociate in the Actions column.

  3. In the message that appears, confirm the information and click OK.

Remove a group member

If a multicast member no longer needs to receive multicast traffic, you can remove it from the multicast group.

You cannot manually delete members created in IGMP mode. The member must leave the group (for example, by stopping the process that was used to join), after which it is automatically removed.

  1. On the transit router instance details page, click the Multicast tab, and then in the left area of the Multicast tab, click the multicast domain ID.

  2. In the Multicast domain details section, click the Multicast Groups tab. Find the multicast member that you want to delete and click Delete in the Actions column.

    A resource with a Group Member Type of Static is a multicast member.

  3. In the Remove Group Member dialog box, click OK.

Delete a multicast source

If a multicast source no longer needs to send multicast traffic, you can delete it from the multicast group.

You cannot manually delete multicast sources that are created in IGMP mode. You must configure the multicast source to leave the group, for example, by stopping the process that was used to join the group.

  1. On the transit router instance details page, click the Multicast tab, and then in the left area of the Multicast tab, click the multicast domain ID.

  2. In the Multicast domain details section, click the Multicast Groups tab. Find the multicast source that you want to delete and click Delete in the Actions column.

    A resource with a Multicast Source Type of Static is a multicast source.

  3. In the Delete Multicast Source dialog box, click OK.

Delete a multicast domain

If you no longer need a multicast network, you can delete the corresponding multicast domain.

Before you delete a multicast domain, make sure that the following conditions are met:

  • The multicast domain is not associated with any vSwitches. To disassociate a vSwitch, see Disassociate a vSwitch in this section.

  • No multicast sources or members exist in the multicast domain. For more information, see Delete a multicast source and Remove a group member in this section.

  1. On the transit router instance details page, click the Multicast tab, and then in the left area of the Multicast tab, click the multicast domain ID.

  2. In the upper-right corner of the Multicast domain details section, click Delete.

  3. In the Delete Multicast Domain dialog box, click OK.

Enable the IGMP feature for a multicast domain

If you did not enable the IGMP feature when the multicast domain was created, you can enable it later. Once enabled, this feature cannot be disabled.

  1. On the transit router instance details page, click the Multicast tab, and then in the left area of the Multicast tab, click the multicast domain ID.

  2. In the Multicast domain details section, find Multicast Domain Features and click Edit.

  3. In the dialog box that appears, select Support IGMPv2 and click OK.

Related documents

Multicast domain

Multicast source and multicast member