This topic describes how to use an Enterprise Edition transit router to create and manage a multicast network.
Background information
Before you create a multicast network, we recommend that you understand how multicast works, networking modes, the billing rules, and the limits. For more information, see the Multicast overview.
Procedure
Static mode
Step 1: Prepare the environment
Create an Enterprise Edition transit router in the region where you want to create a multicast network, and enable multicast for the transit router. For more information, see Create a transit router.
ImportantMulticast is supported by Enterprise Edition transit routers only in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Ulanqab), China (Shenzhen), China (Chengdu), China (Hong Kong), Japan (Tokyo), Singapore, Germany (Frankfurt), UK (London), US (Virginia), and US (Silicon Valley).
You can enable multicast functionality only when creating a new Enterprise Edition transit router instance. If your transit outer is in a region that supports multicast but this feature is unavailable, you can delete the existing router and create a new one. For more information about how to delete an Enterprise Edition transit router, see Delete a transit router.
Use the Enterprise Edition transit router to connect the virtual private clouds (VPCs) for which you want to enable multicast. For more information, see Use Enterprise Edition transit routers to enable intra-region communication between on-premises and cloud networks and Use Enterprise Edition transit routers to connect VPCs across regions and accounts.
Step 2: Create a multicast domain
You must create a multicast domain and associate it with one or more vSwitches to specify the scope of the multicast network. Only resources in the network can transmit and receive multicast packets.
Log on to the CEN console.
On the Instances page, click the ID of the CEN instance that you want to manage.
On the tab, click the ID of the transit router that you want to manage.
On the details page of the transit router, click the Multicast tab, and choose Create Multicast Domain.
In the Create Multicast Domain dialog box, set the following parameters, and click OK.
Parameter
Description
Transit Router
The ID of the transit router in the selected region is displayed by default.
Multicast Domain Name
Enter a name for the multicast domain.
Multicast Domain Feature
The IGMP feature is enabled by default for the multicast domain. This allows hosts to dynamically join or leave the multicast groups.
In the static mode, this feature can be disabled.
In the IGMP mode, this feature must be enabled and cannot be disabled.
VPC
Select the VPCs that you want to associate with the multicast domain.
vSwitch
Select the vSwitches that you want to associate with the multicast domain.
You can select one or more vSwitches.
Description
Enter a description for the multicast domain.
Tag
Configure tags for the multicast domain.
Tag Key: The tag key cannot be an empty string. The tag key can be up to 64 characters in length. The key cannot start with
acs:
oraliyun
or containhttp://
orhttps://
.Tag Value: The tag value can be an empty string. The tag value can be up to 128 characters in length. The tag value cannot start with
acs:
oraliyun
or containhttp://
orhttps://
.
Multiple tags can be added to the multicast domain. For more information about tags, see Tag.
If you need to associate with vSwitches in multiple VPCs, see Associate with a vSwitch in What to do next.
Step 3: Add a multicast source
After you create a multicast domain, you must add a multicast source and specify a multicast group for the multicast source. After you add a multicast source, it transmits multicast packets to the multicast group. Members in the multicast group can receive multicast packets sent from the multicast source.
Log on to the CEN console.
On the Instances page, click the ID of the CEN instance that you want to manage.
On the tab, click the ID of the transit router that you want to manage.
On the details page of the transit router, click the Multicast tab, and click the ID of the multicast domain in the left-side section on the Multicast tab.
In the Multicast Domain Details section, select the Multicast Groups tab and click Add Multicast Source.
On the Add Multicast Source page, set the following parameters and click OK.
Parameter
Description
Basic Information
Transit Router
The ID of the transit router in the selected region is displayed by default.
Multicast Domain
The ID of the selected multicast domain is displayed by default.
Multicast Group Info
Multicast Group
Select the multicast group to which you want to add the multicast source. Valid values:
Create Multicast Group: If no multicast group is created in the selected multicast domain, you can select this option and enter an IP address. The system automatically creates a multicast group.
NoteThe IP address of the multicast group cannot be modified after the multicast group is created.
Select Multicast Group: If you want to use an existing multicast group in the selected multicast domain, select this option and select a multicast group.
New Multicast Group IP
Enter the IP address for the new multicast group. The valid range is 224.0.1.0 to 239.255.255.254.
Important224.0.0.0 to 224.0.0.255 are reserved IP addresses for the system and cannot be used for the multicast group
Each multicast group is identified by a unique multicast IP address.
You must specify an IP address only if you select Create Multicast Group.
Multicast Group
Select an existing multicast group.
The multicast source is added to the selected multicast group.
You can select an existing multicast group only if you select Select Multicast Group.
Multicast Source Information
Resource Type
Select the type of multicast source. Default value: ENI.
You can specify only Elastic Network Interface (ENIs) that are associated with Elastic Compute Service (ECS) instances as multicast sources. The system uses the primary private IP address of the specified ENI to transmit multicast packets to the multicast group.
You can specify at most five ENIs as multicast sources at each time.
vSwitch
Select the vSwitch where the multicast source is located.
ENIs
Select an ENI, which is the multicast source.
If you select Add as Multicast Member, the ENI is also specified as a multicast member in the multicast group.
Step 4: Add multicast members
If you do not specify a multicast member when you add a multicast source, you can perform the following operations to add multicast members. Only members in the multicast group can receive multicast packets sent from the multicast source. The multicast members receive multicast packets only from the multicast group to which the members belong.
Log on to the CEN console.
On the Instances page, click the ID of the CEN instance that you want to manage.
On the tab, click the ID of the transit router that you want to manage.
On the details page of the transit router, click the Multicast tab, and click the ID of the multicast domain in the left-side section on the Multicast tab.
In the Multicast Domain Details section, click the Multicast Groups tab, and click Add Group Member.
On the Add Group Member page, set the following parameters and click OK.
Parameter
Description
Basic Information
Transit Router
The ID of the transit router in the selected region is displayed by default.
Multicast Domain
The ID of the selected multicast domain is displayed by default.
Multicast Group Info
Select Multicast Group
Select the multicast group to which you want to add members. Valid values:
Create Multicast Group: If no multicast group is created in the selected multicast domain, you can select this option and enter an IP address. The system automatically creates a multicast group.
NoteThe IP address of the multicast group cannot be modified after the multicast group is created.
Select Multicast Group: If you want to use an existing multicast group in the selected multicast domain, select this option and select a multicast group.
New Multicast Group IP
Enter an IP address for the multicast group to be created. Valid values: 224.0.1.0 to 239.255.255.254.
Important224.0.0.0 to 224.0.0.255 are reserved IP addresses for the system and cannot be used for the multicast group
Each multicast group is identified by its IP address.
You must specify an IP address only if you select Create Multicast Group.
Select Multicast Group
Select an existing multicast group.
You can select an existing multicast group only if you select Select Multicast Group.
Multicast Member Information
Resource Type
Select the type of multicast member. Valid values:
ENI: Select the ENIs of vSwitches. This is the default value.
You can specify only ENIs that are associated with ECS instances as multicast members. The system uses the primary private IP address of the specified ENI to receive multicast packets.
You can click Add ENI to add more ENIs.
Inter-region Multicast Domain: Select a multicast domain of a transit router that supports inter-region communication.
After you select a multicast domain of a transit router that supports inter-region communication, members in the multicast group that have the same IP address as the current multicast group are added to the current multicast group.
For example, Multicast Domain 1 in the China (Hangzhou) region has a multicast group (Group A). Multicast Domain 2 in the China (Shanghai) region also has a multicast group (Group A). Group A in Multicast Domain 1 has the same IP address as Group A in Multicast Domain 2. Group A in Multicast Domain 2 contains members. You want to add members to Group A in Multicast Domain 1. You can set the Resource Type to Inter-region Multicast Domain and select Multicast Domain 2 in the China (Shanghai) region. In this case, members of Group A in Multicast Domain 2 are added to Group A in Multicast Domain 1. The members can receive multicast packets from Group A in Multicast Domain 1.
ImportantBefore you select Inter-region Multicast Domain, make sure that the following requirements are met:
The regions for which you want to enable multicast can communicate with each other over inter-region connections.
The local region has a multicast group whose IP address is the same as a multicast group in the peer region. The multicast group in the peer region contains members.
You can add multicast members from a different region but you cannot add multicast sources from a different region.
If inter-regional multicast members are already added to the local multicast domain, you cannot add local members to the inter-regional multicast domain. In a given multicast group, adding inter-regional members is only permitted on one side, either local or in a inter-regional multicast domain.
vSwitch
Select the vSwitch of the multicast member.
You must choose a vSwitch if you select ENI.
Elastic Network Interface (ENI)
Select ENIs, which are multicast members.
You can specify ENIs as multicast members only if you select ENI.
If you select Add as Multicast Source, the ENI is also specified as a multicast source in the multicast group.
You can specify at most five multicast members at each time. If you select a resource in a VPC that belongs to another Alibaba Cloud account, you can specify one or more ENIs only in one VPC as multicast members. You cannot specify ENIs in different VPCs that belong to another Alibaba Cloud account.
Transit Router
Select the peer transit router instance.
You must specify a peer transit router only if you select Inter-region Multicast Domain.
Peer Multicast Domain
Select a peer multicast domain.
You must select a peer multicast domain only if you select Inter-region Multicast Domain.
IGMP mode
The IGMP mode is in beta testing and is only available to users on the whitelist.
Step 1: Prepare the environment
Create an Enterprise Edition transit router in the region where you want to create a multicast network, and enable multicast for the transit router. For more information, see Create a transit router.
ImportantMulticast is supported by Enterprise Edition transit routers only in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Ulanqab), China (Shenzhen), China (Chengdu), China (Hong Kong), Japan (Tokyo), Singapore, Germany (Frankfurt), UK (London), US (Virginia), and US (Silicon Valley).
You can enable multicast functionality only when creating a new Enterprise Edition transit router instance. If your transit outer is in a region that supports multicast but this feature is unavailable, you can delete the existing router and create a new one. For more information about how to delete an Enterprise Edition transit router, see Delete a transit router.
Use the Enterprise Edition transit router to connect the virtual private clouds (VPCs) for which you want to enable multicast. For more information, see Use Enterprise Edition transit routers to enable intra-region communication between on-premises and cloud networks and Use Enterprise Edition transit routers to connect VPCs across regions and accounts.
Step 2: Create a multicast domain
Create a multicast domain and associate it with vSwitches to determine the multicast network scope. Only the resources associated with the vSwitches of the multicast domain can send and receive multicast traffic.
Log on to the CEN console.
On the Instances page, click the ID of the CEN instance that you want to manage.
On the tab, click the ID of the transit router that you want to manage.
On the details page of the transit router, click the Multicast tab, and choose Create Multicast Domain.
In the Create Multicast Domain dialog box, set the following parameters, and click OK.
Parameter
Description
Transit Router
The ID of the transit router in the selected region is displayed by default.
Multicast Domain Name
Enter a name for the multicast domain.
Multicast Domain Feature
The IGMP feature is enabled by default for the multicast domain. This allows hosts to dynamically join or leave the multicast groups.
In the static mode, this feature can be disabled.
In the IGMP mode, this feature must be enabled and cannot be disabled.
VPC
Select the VPCs that you want to associate with the multicast domain.
vSwitch
Select the vSwitches that you want to associate with the multicast domain.
You can select one or more vSwitches.
Description
Enter a description for the multicast domain.
Tag
Configure tags for the multicast domain.
Tag Key: The tag key cannot be an empty string. The tag key can be up to 64 characters in length. The key cannot start with
acs:
oraliyun
or containhttp://
orhttps://
.Tag Value: The tag value can be an empty string. The tag value can be up to 128 characters in length. The tag value cannot start with
acs:
oraliyun
or containhttp://
orhttps://
.
Multiple tags can be added to the multicast domain. For more information about tags, see Tag.
If you need to associate with vSwitches in multiple VPCs, see Associate with a vSwitch in What to do next.
Step 3: Specify multicast sources and members
Upon creating a multicast domain, you can deploy multicast applications in the VPC and configure ECS instances for them to join the multicast group. ECS instances become both multicast sources and members upon joining.
To join the multicast network, hosts must be compatible with the IGMPv2 protocol. Alibaba Cloud ECS instances (Alibaba Cloud Linux 3.2104 LTS 64-bit image) support IGMPv2 by default.
The valid IP address range for multicast groups is from 224.0.1.0 to 239.255.255.254. Addresses between 224.0.0.0 and 224.0.0.255 are reserved for the system.
If ECS instances have more than one ENI, these ENIs can link to different multicast groups.
The following example describes how to add two ECS instances in a VPC, ECS1 and ECS2, to a multicast group 239.1.1.1. Both ECS instances are equipped with Alibaba Cloud Linux 3.2104 LTS 64-bit image.
Modify the security group rules for ECS1 and ECS2 to permit IGMP messages. For more information, see View security group rules and Add a security group rule.
Log on to ECS1 instance. For more information, see Overview of ECS remote connection methods.
Run the following command on ECS1 to join the multicast group 239.1.1.1 and start receiving its traffic.
socat STDIO udp4-recv:8000,ip-add-membership=239.1.1.1:eth0 # "8000" is the port for receiving multicast traffic # "239.1.1.1" is the IP address of the multicast group # "eth0" specifies the interface to join multicast group # If the system does not recognize the socat command, install it with the following command: # sudo yum install socat
Log on to ECS2 and run the preceding command to join the multicast group 239.1.1.1. When you complete the configuration, you can view the multicast sources and members that are automatically created by the transit router on the multicast domain details page.
After completing these steps, resources in the same multicast group and domain under the same transit router can communicate through the multicast network. However, resources in the same group under different transit routers cannot. To enable communication across regions, you need to complete Step 4: Statically specify inter-region multicast members.
NoteMulticast communication is not supported for different domains of the same transit router. Only resources that belong to the same multicast group of inter-region transit routers can communicate with each other.
Step 4: Statically specify cross-region multicast members
You can skip the step if the VPCs of the multicast network are in the same region.
If the VPCs of the multicast network are in different regions, you must statically specify inter-regional group members after configuring the ECS instances to enable communication. For more information, see Step 4: Add multicast members.
For example, you need to enable multicast communication between VPC1 in Germany (Frankfurt) and VPC2 in the UK (London). After you configure ECS instances in the VPCs, resources in the same multicast group in each VPC can communicate over the multicast network. However, resources in the same multicast groups of VPC1 and VPC2 cannot achieve network interconnectivity. You need to specify the inter-region multicast domain for VPC1 or VPC2 to enable communication between two VPCs.
Step 5: Test network connectivity
After setting up the sources and members, you can test the multicast network connectivity. ECS1 and ECS2 created in Step 3 are used in this example.
Ensure that ECS1 and ECS2 are in the same multicast group as described in Step 3. Keep the remote connection windows open.
Join the multicast group by running the command
socat STDIO udp4-recv:8000,ip-add-membership=239.1.1.1:eth0
. Do not suspend (by pressing Ctrl+Z) or terminate (by pressing Ctrl+C) the process. Suspending the process prevents the viewing of the multicast traffic even if the ECS instances join the multicast group. Termination requires re-executing the command to join the multicast group.If the socat process is suspended, resume it with the following commands.
# To list all background tasks, use: jobs # To resume a specific task, such as task 1, use: fg %1
Log on to ECS1 in a new window and 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 # "239.1.1.1" is the IP address of multicast group # "8000" is the destination port for multicast traffic # "172.16.10.165" is the interface IP address of ECS that sends multicast traffic
The returned messages show that ECS1 and ECS2 receive the multicast traffic, which verifies the multicast network connectivity.
ECS1
ECS2
What to do next
Action | Description and Prerequisite | Step |
Associate with a vSwitch | After you create a multicast domain, you can associate it with one or more vSwitches to specify the scope of the multicast network. |
You can repeat the preceding steps to associate the multicast domain with vSwitches of different VPCs. |
Disassociate from a vSwitch | You can disassociate a vSwitch from the multicast domain if it is no longer needed. Before you delete a vSwitch, make sure that the following requirements are met:
|
|
Remove members from a multicast group | If you no longer want a member in a multicast group to receive multicast packets, you can remove it from the group. The multicast members created through IGMP cannot be manually removed. You need to configure the multicast members, such as terminating the process of joining the multicast group. Important IGMP is currently in beta testing and is only available to users on the whitelist |
|
Delete a multicast source | If you no longer want a multicast source to transmit multicast packets, you can delete the multicast source. The multicast source created through IGMP does not support manual deletion. You need to configure it in the multicast source, such as terminating the process of joining a multicast group. Important IGMP is currently in beta testing and is only available to users on the whitelist |
|
Delete a multicast domain | If you no longer need a multicast network, you can delete the multicast domain associated with it. Make sure that the following conditions are met:
|
|
Enable IGMP for multicast domain | If IGMP is not enabled when creating the multicast domain, you can enable it separately. Once enabled, it cannot be disabled. Important IGMP is currently in beta testing and is only available to users on the whitelist. |
|
References
Multicast domain
CreateTransitRouterMulticastDomain: Establish a multicast domain.
ModifyTransitRouterMulticastDomain: Update the name and description of an existing multicast domain.
DeleteTransitRouterMulticastDomain: Remove a multicast domain.
ListTransitRouterMulticastDomains: Retrieve details about multicast domains.
AssociateTransitRouterMulticastDomain: Link VPC switches to a multicast domain.
DisassociateTransitRouterMulticastDomain: Unlink VPC switches from a multicast domain.
ListTransitRouterMulticastDomainAssociations: Examine multicast domain associations.
ListTransitRouterMulticastDomainVSwitches: Access information on VPC switches associated with multicast domains.
Multicast sources and multicast members
RegisterTransitRouterMulticastGroupSources: Establish multicast sources.
DeregisterTransitRouterMulticastGroupSources: Remove multicast sources.
RegisterTransitRouterMulticastGroupMembers: Establish multicast members.
DeregisterTransitRouterMulticastGroupMembers: Remove multicast members.
ListGrantVSwitchEnis: Query eligible ENIs in a VPC for multicast sources or members.
ListTransitRouterMulticastGroups: Retrieve information on multicast domains' members and sources.