Multicast in AWS using AWS Transit Gateway

By May 15, 2020 May 18th, 2020 AWS, Blogs, Powerlearnings

Written by Aparna M, Associate Solutions Architect at Powerupcloud Technologies.

Multicast is a communication protocol used for delivering a single stream of data to multiple receiving computers simultaneously.

Now AWS Transit Gateway multicast makes it easy for customers to build multicast applications in the cloud and distribute data across thousands of connected Virtual Private Cloud networks. Multicast delivers a single stream of data to many users simultaneously. It is a preferred protocol to stream multimedia content and subscription data such as news articles and stock quotes, to a group of subscribers.

Now let’s understand the key concepts of Multicast:

  1. Multicast domain – Multicast domain allows the segmentation of a multicast network into different domains and makes the transit gateway act as multiple multicast routers. This is defined at the subnet level.
  2. Multicast Group – A multicast group is used to identify a set of sources and receivers that will send and receive the same multicast traffic. It is identified by a group IP address.
  3. Multicast source – An elastic network interface associated with a supported EC2 instance that sends multicast traffic.
  4. Multicast group member – An elastic network interface associated with a supported EC2 instance that receives multicast traffic. A multicast group has multiple group members.

Key Considerations for setting up Multicast in AWS:

  • Create a new transit gateway to enable multicast
  • You cannot share multicast-enabled transit gateways with other accounts
  • Internet Group Management Protocol (IGMP) (IGMP) support for managing group membership is not supported right now
  • A subnet can only be in one multicast domain.
  • If you use a non-Nitro instance, you must disable the Source/Dest check. 
  • A non-Nitro instance cannot be a multicast sender.

Let’s walkthrough how to set up multicast via AWS Console.

Create a Transit gateway for multicast:

In order to create a transit gateway multicast follow the below steps:

  1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  2. On the navigation pane, choose Create Transit Gateway.
  3. For Name tag, enter a name to identify the Transit gateway.
  4. Enable Multicast support.
  5. Choose Create Transit Gateway.

Create a Transit Gateway Multicast Domain

  1. On the navigation pane, choose the Transit Gateway Multicast.
  2. Choose Create Transit Gateway Multicast domain.
  3. (Optional) For Name tag, enter a name to identify the domain.
  4. For Transit Gateway ID, select the transit gateway that processes the multicast traffic.
  5. Choose Create Transit Gateway multicast domain.

Associate VPC Attachments and Subnets with a Transit Gateway Multicast Domain

To associate VPC attachments with a transit gateway multicast domain using the console

  1. On the navigation pane, choose Transit Gateway Multicast.
  2. Select the transit gateway multicast domain, and then choose ActionsCreate association.

3. For Transit Gateway ID, select the transit gateway attachment.

4. For Choose subnets to associate, select the subnets to include in the domain.

5. Choose Create association.

Register Sources with a Multicast Group

In order to register sources for transit gateway multicast:

  1. On the navigation pane, choose Transit Gateway Multicast.
  2. Select the transit gateway multicast domain, and then choose ActionsAdd group sources.
  3. For Group IP address, enter either the IPv4 CIDR block or IPv6 CIDR block to assign to the multicast domain. IP range must be in 224.0.0.0/4.
  4. Under Choose network interfaces, select the multicast sender’s (ec2 servers) network interfaces.
  5. Choose Add sources.

Register Members with a Multicast Group

To register members in the transit gateway multicast:

  1. On the navigation pane, choose Transit Gateway Multicast.
  2. Select the transit gateway multicast domain, and then choose ActionsAdd group members.
  3. For Group IP address, enter either the IPv4 CIDR block or IPv6 CIDR block to assign to the multicast domain. Specify the same multi cast IP specified while adding source.
  4. Under Choose network interfaces, select the multicast receivers'(ec2 server) network interfaces.
  5. Choose Add members.

Modify Security groups of the Member servers(receivers):

  1. Allow inbound traffic on Custom UDP port 5001

Once your setup is completed follow the below steps to test the multicast routing.

  1. Login to all the Source and member servers.
  2. Make sure you install iperf package in all your servers in order to test the functionality
  3. Run the below command in the Source Machine
iperf -s -u -B 224.0.0.50 -i 1

– 224.0.0.50 will be your multicast group IP provided during the setup

  1. Run the below command in all the member servers
iperf -c 224.0.0.50 -u -T 32 -t 100 -i 1

Once you start sending the data from the source server simultaneously that can be seen across all members. Below is the screenshot for your reference.

Conclusion

This blog helps you to host multicast applications on AWS leveraging AWS Transit gateway. Hope you found it useful.

Leave a Reply