Skip to content

Gamelift Managed Containers same UDP and TCP port

0

Hello!

I am facing an issue connecting to gamelift managed containers after the game session is created on the fleet.

Both of my TCP and UDP port range for the container group definitions are set to the same port.

However, I am only able to connect to the protocol that is at the bottom of the setting list

I can only use TCP to connect when the configuration is in this setting

Enter image description here

I can only use UDP to connect when the configuration is in this setting

Enter image description here

Does anyone have any idea what's going on? Is it not possible to have the same port on TCP and UDP for managed containers?

Thanks!

asked a year ago144 views
1 Answer
0

When you create a Managed Container fleet, you also need to provide an InstanceConnectionPortRange. Here's how the port mapping works:

As a container starts up, it gets assigned:

    A container port (same as the Internal container port provided during ContainerGroupDefinition creation)
    A connection port (One of the ports from InstanceConnectionPortRange)

Each container port is assigned a corresponding connection port, which can be used to connect to the container from outside. For more details, check the Game Client/Server connections section in the AWS GameLift documentation.

Let's look at your example (Assuming the InstanceConnectionPortRange to be the value mentioned below):

Container port range: 33430-33440 (for both TCP and UDP protocols)
InstanceConnectionPortRange: 1000-1200

This would result in port mappings like:

TCP Ports: 33430-33440 → connection ports 1000-1010
UDP Ports: 33430-33440 → connection ports 1011-1021

Important Note: As you can see from the example listed above, TCP and UDP port ranges are mapped to distinct sets of connection ports.

This is why you can only connect to your udp port from by using the connection port mentioned in CreateGameSession response. (We also default to udp port in such cases where we can't determine if the game server is using tcp or udp port and the ContainerGroupDefinition mentions same port ranges for both protocols)

Currently, there isn't a straightforward API method to obtain these port mappings (AWS is aware of this limitation and looking into it). For now, To view these port mappings, you'll need to:

  1. Access the instance running the container using GetComputeAccess API
  2. Run the docker ps command to see all port mappings assigned to containers
AWS
answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.