

# MediaConnect Gateway bridges
Bridges



A *bridge* is a connection between your data center's instances and the AWS Cloud. Depending on the selected bridge type, a bridge can be used to send content from the AWS Cloud to your data center or from your data center to the AWS Cloud.

**Contents**
+ [Key points](#gateway-components-bridges-key-points)
  + [Bridge types](#gateway-components-bridges-types)
  + [Bridge sources](#gateway-components-bridges-sources)
  + [Bridge outputs](#gateway-components-bridges-outputs)
+ [Next steps](#gateway-components-bridges-next-steps)

## Key points


### Bridge types


AWS Elemental MediaConnect Gateway supports two types of bridges. Each bridge type serves a different purpose and determines if you will be contributing content to the AWS Cloud or distributing content to a physical location. The following are the two types of bridges and their different functions:
+ **Ingress bridge**: A ground-to-cloud bridge. On an ingress bridge, the content originates at your premises and is delivered to the AWS Cloud
+ **Egress bridge**: A cloud-to-ground bridge. On an egress bridge, the content comes from an existing MediaConnect flow and is delivered to your premises. 

### Bridge sources


Each bridge requires you to create a minimum of one source. The source is the content that will be ingested by the MediaConnect Gateway. The origin of the source content will be different depending on the bridge type you select. If you create multiple bridge sources, you can enhance the resiliency of your bridge by activating failover during the creation process. The following are the two types of sources:
+ **Ingress bridge source**: For an ingress bridge, the content originates at your premises and is delivered to the cloud. When creating an ingress bridge source, you will need to select the protocol (RTP, RTP-FEC, or UDP) and enter the multicast IP address and port of the content originating in your premises. You can also use source-specific multicast (SSM) for ingress bridges, which allows you to optionally provide a source IP address in addition to the multicast IP when creating or updating an ingress bridge. This gives you more precise control over the multicast traffic.
+ **Egress bridge source**: For an egress bridge, the content originates as an existing MediaConnect flow and is delivered to your premises. When creating an egress bridge source, you will need to select the MediaConnect flow that you would like to send to your premises. You don't need to select the protocol. The source will use the same protocol as the existing flow.

#### Bridge source failover


If you create multiple bridge sources, you can enhance the resiliency of your bridge by activating failover during the creation process. The failover configuration determines how AWS Elemental MediaConnect Gateway behaves in the event of source input loss. The bridge type will determine which of the two failover modes are available. The following are the two failover modes:
+ **Failover**: This mode allows switching between a primary and a backup source. You can specify a source as the primary source. The second source serves as the backup. The service switches to the backup source if the primary source fails, and switches back to the primary source as soon as it is reliable.
+ **Merge**: This mode combines the sources into a single stream, allowing a graceful recovery from any single-source loss. In merge mode, if a source is missing a packet the service pulls the missing packet from the other source.

### Bridge outputs


Each bridge requires you to create a minimum of one output. The following are the two types of outputs:
+ **Ingress bridge output**: For an ingress bridge, the content originates at your premises and is delivered to the cloud. You do not need to configure outputs for ingress bridge types. When you create a MediaConnect flow using the ingress bridge as a source, the output is automatically created when the flow is started.
+ **Egress bridge output**: For an egress bridge, the content originates as an existing MediaConnect flow and is delivered to your premises. When you create an egress bridge output, you will need to configure the IP and protocol information that will be delivered to your premises. Egress bridge outputs support RTP, RTP-FEC, and UDP protocols.

## Next steps

+ To create a bridge, see [Creating a MediaConnect Gateway bridge](gateway-components-bridges-create.md). 

# Creating a MediaConnect Gateway bridge
Creating a bridge

After you have registered at least one instance to your gateway, you can create a bridge. The process for creating a bridge will vary depending on the bridge type you select.

**Contents**
+ [

## Prerequisites
](#gateway-components-bridges-create-prerequisites)
+ [

## Procedure
](#gateway-components-bridges-create-procedure)
+ [

## Next steps
](#gateway-components-bridges-create-next-steps)
  + [

### Starting a bridge
](#gateway-components-bridges-create-next-steps-start-bridge)
  + [

### Updating a bridge
](#gateway-components-bridges-create-next-steps-update-bridge)

## Prerequisites

+ The following procedure assumes that you have previously created a gateway and registered an instance to it.
+ Before creating a bridge, you will need to collect the details of the bridge you want to create.
+ If you're creating an ingress bridge and you want to use source-specific multicast (SSM), verify your network capability and ensure that your network infrastructure (routers and switches) supports SSM. The multicast source IP that you use must be a valid IPv4 address. 

## Procedure


 After you have registered at least one instance to your gateway, you can create a bridge. The process for creating a bridge will vary depending on the bridge type you select. There are two bridge types: ingress (a ground-to-cloud bridge) or egress (a cloud-to-ground bridge). 

------
#### [ Console ]

**To create an ingress bridge**

1. Open the MediaConnect console at [https://console.aws.amazon.com/mediaconnect/](https://console.aws.amazon.com/mediaconnect/).

1. From the navigation pane, select **Gateways**. 

1. In the **Gateways** section, select the gateway you want to create the bridge on. 

1. On the gateway **Details** page, select the **Bridges** tab. 

1. Select **Create bridge**.

1.  On the **Create bridge** page, complete the following steps in the **Details** section:

   1. Enter a **Name** for the bridge. 

   1. For **Bridge type**, select **Ingress bridge**.

   1. Enter the **Maximum bitrate** for the content you will transport over the bridge.

   1. Enter the **Maximum outputs** for the bridge.

1. Next, complete the following steps in the **Sources** section. The source of an ingress bridge is multicast content that originates at your premises:

   1. Enter a **Name** for the bridge source.

   1. Select a **Network**. This is a network you created during the gateway setup process.

   1. Select the **Protocol** for this source.

   1. Enter the **Multicast IP** address.

   1. (Optional) If you want to use source-specific multicast (SSM), enter the **Multicast Source IP** address. The multicast source IP that you enter must be a valid IPv4 address. If you don't enter a value here, the bridge source will use Any-Source Multicast (ASM) mode.

   1. Enter the **Port** of the source.

1. If you add more than one source, you can set up failover using the **Failover configuration** section.

   1. Select the **Failover mode**: **Failover** or **Merge**.

   1. (Optional) If you select **Failover** as the mode, you can select one of the sources you previously configured to be the **Primary source**. If you don't select a **Primary source**, MediaConnect will select one at random.

1. Choose **Create bridge**.

1. After the bridge is created, you can start the bridge by selecting **Start** on the bridge's **Details** page.

**To create an egress bridge**

1. Open the MediaConnect console at [https://console.aws.amazon.com/mediaconnect/](https://console.aws.amazon.com/mediaconnect/).

1. From the navigation pane, select **Gateways**. 

1. In the **Gateways** section, select the gateway you want to create the bridge on. 

1. On the gateway's **Details** page, select the **Bridges** tab.

1. Choose **Create bridge**.

1. On the **Create bridge** page, complete the following steps in the **Details** section:

   1. Enter a **Name** for the bridge. 

   1. Select a **Bridge type** of **Egress bridge**.

   1. Enter the **Maximum bitrate** for the content you will transport over the bridge.

1. Complete the following steps in the **Sources** section:

   1. Enter a **Name** for the bridge source. For an Egress bridge, the source is the content coming from a MediaConnect flow and delivered to your premises.

   1. Select a **Network**. This is a network you created during the gateway setup process.

   1. Select the **Flow ARN**. This is the ARN of the MediaConnect flow that you will use as a source.

   1. If this flow uses a **VPC interface**, select it.

1. If you add more than one source, you can set up failover using the **Failover configuration** section.

   1. When you select an egress bridge, the only available **Failover mode** is **Failover**. **Merge** cannot be selected.

   1. (Optional) Select one of the sources that you previously created to be the **Primary source**. If you don't select a **Primary source**, MediaConnect will select one at random.

1. Under **Outputs**, complete the following steps.

   1. Enter a **Name** for the bridge output.

   1. Select a **Network**. This is a network that you created during the MediaConnect Gateway setup process.

   1. Select a transport **Protocol** for the output.

   1. Enter an **IP address** for the output. This must be an IP that is compatible with your local network.

   1. Enter the **Port** for the output. This must be a port that is compatible with your local network.

   1. Enter a **TTL** (time-to-live) for the output.

1. Select **Create bridge**.

1. After the bridge is created, you can start the bridge by selecting **Start** on the bridge details page.

------
#### [ AWS CLI ]

**To create a bridge using the AWS CLI**

1. Find the details of the bridge you want to create. These details will be stored in a JSON file on the computer running the AWS CLI. The JSON file should be named `bridge.json`. The following examples show the correct sections and formatting for the JSON file.  

   Here is an example for creating an egress bridge:

   ```
   {
       "Name": "bridge",
       "PlacementArn": "arn:aws:mediaconnect:us-west-2:111122223333:gateway:1-23aBC45dEF67hiJ8-12AbC34DE5fG:gateway",
       "EgressGatewayBridge": {
           "MaxBitrate": 100000000
       },
       "SourceFailoverConfig": {
           "FailoverMode": "FAILOVER",
           "State": "ACTIVE"
       },
       "Sources": [
           {
               "FlowSource": {
                   "Name": "Source0",
                   "FlowArn": "arn:aws:mediaconnect:us-west-2:111122223333:flow:1-UAECXlABCQJeVwMB-95ec11ac6059:gatewayFlow",
                   "NetworkName": "blue"
               }
           },
           {
               "FlowSource": {
                   "Name": "Source1",
                   "FlowArn": "arn:aws:mediaconnect:us-west-2:111122223333:flow:1-ECRZVGADYMGtPGTM-c1iPQ5FNL7Qn:gatewayFlow",
                   "NetworkName": "blue",
                   "FlowVpcInterfaceAttachment": {
                       "VpcInterfaceName": "VPCIF"
                   }
               }
           }
       ],
       "Outputs": [
           {
               "NetworkOutput": {
                   "Name": "Output0",
                   "NetworkName": "blue",
                   "IpAddress": "225.1.2.3",
                   "Port": 5010,
                   "Protocol": "rtp-fec",
                   "Ttl": 8
               }
           },
           {
               "NetworkOutput": {
                   "Name": "Output1",
                   "NetworkName": "blue",
                   "IpAddress": "225.1.2.4",
                   "Port": 6010,
                   "Protocol": "rtp",
                   "Ttl": 250
               }
           }
       ]
   }
   ```

   Here is an example for creating an ingress bridge that supports SSM (`MulticastSourceSettings` and `MulticastSourceIp` are defined in the source):

   ```
   {
         "Name": "bridge",
         "PlacementArn": "arn:aws:mediaconnect:us-west-2:111122223333:gateway:1-23aBC45dEF67hiJ8-12AbC34DE5fG:gateway",
         "IngressGatewayBridge": {
             "MaxBitrate": 80000000,
             "MaxOutputs": 1
         },
         "SourceFailoverConfig": {
             "FailoverMode": "FAILOVER",
             "SourcePriority": {
                 "PrimarySource": "network-source1"
             },
             "State": "ENABLED"
         },
         "Sources": [
             {
                 "NetworkSource": {
                     "MulticastIp": "224.0.0.1",
                     "MulticastSourceSettings": {
                       "MulticastSourceIp": "1.2.3.4"
                     },
                     "Name": "network-source1",
                     "NetworkName": "network-1",
                     "Port": 5001,
                     "Protocol": "rtp"
                 }
             },
             {
                 "NetworkSource": {
                     "MulticastIp": "224.0.0.2",
                     "MulticastSourceSettings": {
                       "MulticastSourceIp": "4.3.2.1"
                     },
                     "Name": "network-source2",
                     "NetworkName": "network-1",
                     "Port": 5001,
                     "Protocol": "rtp"
                 }
             }
         ]
     }
   ```

1. Enter the following command into the AWS CLI interface. Replace the *<yourprofile>* and *<region>* values with your desired profile and AWS Region.

   ```
   aws --profile <yourprofile> --region <region> mediaconnect create-bridge
         --cli-input-json file://bridge.json
   ```

1. The AWS CLI will return a response like the following example.

   ```
   {
       "Bridge": {
           "BridgeArn": "arn:aws:mediaconnect:us-west-2:111122223333:bridge:1-GLxlBRLrHzzvpwyb-1dd82066b207:bridge",
           "BridgeMessages": [],
           "BridgeState": "STANDBY",
           "EgressGatewayBridge": {
               "MaxBitrate": 100000000
           },
           "Name": "bridge",
           "Outputs": [
               {
                   "NetworkOutput": {
                       "IpAddress": "225.1.2.3",
                       "Name": "Output0",
                       "NetworkName": "blue",
                       "Port": 5010,
                       "Protocol": "rtp-fec",
                       "Ttl": 8
                   }
               },
               {
                   "NetworkOutput": {
                       "IpAddress": "225.1.2.4",
                       "Name": "Output1",
                       "NetworkName": "blue",
                       "Port": 6010,
                       "Protocol": "rtp",
                       "Ttl": 250
                   }
               }
           ],
           "PlacementArn": "arn:aws:mediaconnect:us-west-2:111122223333:gateway:1-23aBC45dEF67hiJ8-12AbC34DE5fG:gateway",
           "SourceFailoverConfig": {
               "FailoverMode": "FAILOVER",
               "State": "ENABLED"
           },
           "Sources": [
               {
                   "FlowSource": {
                       "FlowArn": "arn:aws:mediaconnect:us-west-2:111122223333:flow:1-UAECXlABCQJeVwMB-95ec11ac6059:gatewayFlow",
                       "Name": "Source0",
                       "NetworkName": "blue"
                   }
               },
               {
                   "FlowSource": {
                       "FlowArn": "arn:aws:mediaconnect:us-west-2:111122223333:flow:1-ECRZVGADYMGtPGTM-c1iPQ5FNL7Qn:gatewayFlow",
                       "Name": "Source1",
                       "NetworkName": "blue",
                       "FlowVpcInterfaceAttachment": {
                           "VpcInterfaceName": "VPCIF"
                       }
                   }
               }
           ]
       }
   }
   ```

------

## Next steps


### Starting a bridge


After the bridge is created, you can start the bridge by choosing `Start` on the bridge's details page.

### Updating a bridge


When updating an existing bridge source to use SSM, keep these key points in mind:

1. **Bridge state requirements**: The bridge must be in `STANDBY` state before you make any changes. 

1. **Enabling SSM**: To enable SSM, add a multicast source IP to the ingress bridge configuration. After you start the bridge, it will use the new SSM configuration and only accept multicast traffic from the specified source IP.

1. **Reverting to ASM**: To switch back to Any-Source Multicast (ASM) mode, remove the multicast source IP from the ingress bridge configuration. Remember, this can only be done when the bridge is in `STANDBY` state.

1. **Applying changes**: After you make your changes, you must start the bridge for the new configuration to take effect.

1. **Verifying bridge source information**: You can view the current state of your bridge sources (including the multicast source IP) by using the [DescribeBridge](https://docs.aws.amazon.com/mediaconnect/latest/api/v1-bridges-bridgearn.html) API or checking the bridge details in the console.

By following these guidelines, you can successfully manage your bridge's multicast settings, switching between SSM and ASM modes as needed.