|
1 | 1 | # AWS Transit Gateway Multicast Demo
|
2 | 2 |
|
3 |
| -This demo uses an environment in the AWS us-east-1 region containing the following resources: |
| 3 | +This guide helps you creating an environment to demonstrate the AWS Transit Gateway Multicast feature. The environment will be in the AWS us-east-1 region, containing the following resources: |
4 | 4 |
|
5 |
| -* A VPC with public and private subnets across three AZs. |
| 5 | +* A VPC with public and private subnets across two AZs. |
6 | 6 | * A Linux Bastion Host, accessible using SSM Session Manager and to be used as the multicast traffic source.
|
7 | 7 | * An AutoScaling Group with 3 instances, accessible using SSM Session Manager and to be used as the multicast traffic receivers.
|
8 | 8 | * A Transit Gateway with Multicast support.
|
@@ -54,22 +54,75 @@ Select the domain you created above, open the **Associations** tab and click **C
|
54 | 54 |
|
55 | 55 | ## Add a multicast source
|
56 | 56 |
|
57 |
| -Go to the EC2 console and take a note of the Bastion Host instance ID, we'll need the ID to identify the ENI we are adding as a multicast domain source. |
58 |
| -TODO |
| 57 | +From the [Transit Gateway Mulicast console](https://console.aws.amazon.com/vpc/home?region=us-east-1#TransitGatewayMulticastDomains:sort=transitGatewayMulticastDomainId), select the multicast domain you created earlier. Click the **Groups** tab and click **Add source**. Enter `239.0.0.1` in the **Group IP Address** field. In the **Choose network interfaces** filter field type `BastionHost`, select the ENI. Click the **Add sources** button to complete the operation. |
| 58 | + |
| 59 | + |
59 | 60 |
|
60 | 61 | ## Add multicast members
|
61 | 62 |
|
62 |
| -Go to the EC2 console and take a note of the ASG instance IDs, we'll need the IDs to identify the ENIs we are adding as multicast domain destinations. |
63 |
| -TODO |
| 63 | +From the [Transit Gateway Mulicast console](https://console.aws.amazon.com/vpc/home?region=us-east-1#TransitGatewayMulticastDomains:sort=transitGatewayMulticastDomainId), select the multicast domain you created earlier. Click the **Groups** tab and click **Add member**. Enter `239.0.0.1` in the **Group IP Address** field. In the **Choose network interfaces** filter field type `ASGLINUX` (these are the instances in the Autoscaling group), select all thhe ENIs. Click the **Add Members** button to complete the operation. |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +## Start terminal sessions to the source and members intances |
| 68 | + |
| 69 | +Now that you have a one source and multiple members, you will use `iperf`, `omping`, and a Python sample application to test connectivity and bandwidth between the EC2 instances in the multicast domain. |
| 70 | + |
| 71 | +Open the EC2 console, select the [BastionHost instance](https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:search=BastionHost;sort=instanceState) and click **Connect**. For Connection method, select **Session Manager** and click **Connect**. Leave this session tab open. |
| 72 | + |
| 73 | +Open the EC2 console, select the [McdemoCdkStack/ASGLINUX](https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:search=BastionHost;sort=instanceState) one at the time and click **Connect**. For Connection method, select **Session Manager** and click **Connect**. Leave these sessions tabs open. |
| 74 | + |
| 75 | +You should now have four browser windows/tabs with sessions established to the source and member instances. |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +## Test multicast connectivity using `iperf` |
| 80 | + |
| 81 | +Start `iperf` servers in each of the instances part of the Autoscaling Group, these are the instances that will receive traffic from the source (BastionHost). Use the command below to listen for UDP multicast traffic on the group address `239.0.0.1` |
| 82 | + |
| 83 | +`iperf -s -u -B 239.0.0.1` |
| 84 | + |
| 85 | +Start an `iperf` client in the BastionHost (source) instance. Use the command below to send UDP multicast traffic to the group address `239.0.0.1` |
| 86 | + |
| 87 | +`iperf -u -c 239.0.0.1` |
| 88 | + |
| 89 | +You can also add parameters to `iperf` to create parallel connections, how long the test will run for, and how much bandwidth per connection to use. The command below will create a client with 10 connections, for 30 seconds, and 1Gb/s per connection. |
| 90 | + |
| 91 | +`iperf -u -c 239.0.0.1 -t 30 -P 10 -b 1G` |
| 92 | + |
| 93 | +To stop the `iperf` servers press CTRL+C twice. |
| 94 | + |
| 95 | +## Test multicast connectivity using Python |
| 96 | + |
| 97 | +The instances contain two Python scripts, a sender script to run in the BastionHost and a receiver script to run in the AutoScaling instances. |
| 98 | + |
| 99 | +In the Autoscaling group instances (receivers) terminal sessions, execute the following: |
| 100 | + |
| 101 | +`python /opt/mcreceiver.py` |
| 102 | + |
| 103 | +In the BastionHost instance (sender) terminal session, execute the following to send one message to the receivers: |
| 104 | + |
| 105 | +`python /opt/mcsender.py` |
| 106 | + |
| 107 | +To send one message every one second continuously, you can use the following one liner: |
| 108 | + |
| 109 | +`while true; do python /opt/mcsender.py; sleep 1; done;` |
| 110 | + |
| 111 | +To stop the python scripts press CTRL+C. |
| 112 | + |
| 113 | +## Test multicast connectivity using `omping` |
64 | 114 |
|
65 |
| -## Test using iperf |
| 115 | +The `omping` tool needs the IP addresses of the instances you want to test connectivity, replace the 10.99.x.x addresses in the command below with your own and run the command on all terminal sessions starting with the BastionHost: |
66 | 116 |
|
67 |
| -TODO |
| 117 | +`omping -m 239.0.0.1 -p 1234 10.99.x.x 10.99.x.x 10.99.x.x 10.99.x.x` |
68 | 118 |
|
69 |
| -## Test using omping |
| 119 | +For example, in my environment the command is: `omping -m 239.0.0.1 -p 1234 10.99.169.17 10.99.147.76 10.99.195.70 10.99.248.153` |
70 | 120 |
|
71 |
| -TODO |
| 121 | +You should see unicast responses in all instances from the other instances, but multicast responses only in the receiver instances. |
72 | 122 |
|
73 |
| -## Test using Python sender and receiver scripts |
| 123 | +## Clean up |
74 | 124 |
|
75 |
| -TODO |
| 125 | +* Delete all the subnet associations from the [Multicast domain](https://console.aws.amazon.com/vpc/home?region=us-east-1#TransitGatewayMulticastDomains:sort=transitGatewayMulticastDomainId). |
| 126 | +* Delete the VPC attachment from the [Transit Gateway Attachments](https://console.aws.amazon.com/vpc/home?region=us-east-1#TransitGatewayAttachments:sort=transitGatewayAttachmentId) console. |
| 127 | +* Delete the Transit Gateway from the [Transit Gateways](https://console.aws.amazon.com/vpc/home?region=us-east-1#TransitGateways:sort=transitGatewayId) console. |
| 128 | +* Run `cdk destroy` from your terminal in the folder you cloned this repo. |
0 commit comments