In a multiplayer gaming setup, custom routing accelerators can be used to optimize player connections by routing traffic directly to specific game server instances based on application logic, such as matchmaking results. This approach improves latency, reduces jitter, and enhances the player experience by leveraging AWS Global Accelerator's private network and static IP addresses.
Example of Using Custom Routing Accelerators in Multiplayer Gaming
1. Setup of Game Servers and Subnets
Suppose you have a fleet of game servers running on Amazon EC2 instances within one or more VPC subnets. Each instance hosts multiple game sessions, each listening on different ports. For example, two EC2 instances might be running in the same subnet with private IPs 10.1.1.1 and 10.1.1.2, each serving game sessions on TCP ports 80, 81, and 82.
2. Create a Custom Routing Accelerator
You create a custom routing accelerator in AWS Global Accelerator and add the relevant VPC subnets as endpoints. You define a listener port range (e.g., 1001 to 1050) on the accelerator and map these to the destination port range (e.g., 80 to 82) on your EC2 instances. This mapping allows incoming traffic on ports 1001-1050 to be routed to specific IP:port combinations on the backend servers.
3. Port Mapping and Traffic Control
The accelerator generates a port mapping table that statically maps each accelerator port to a specific EC2 instance IP address and port. For example, port 1001 on the accelerator maps to 10.1.1.1:80, port 1002 to 10.1.1.1:81, and so on. You can allow or deny traffic to specific instances or ports, ensuring only active game servers receive traffic.
4. Matchmaking and Routing Logic
When a player connects, your matchmaking service determines which game session (and thus which EC2 instance and port) the player should join based on criteria like location, skill level, or session availability. The matchmaking logic queries the Global Accelerator API to retrieve the accelerator port that corresponds to the selected game server session.
5. Player Connection via Accelerator
The player is given the accelerator's static IP address and the mapped port (e.g., port 1003). When the player connects, Global Accelerator routes the traffic over the AWS global network to the exact EC2 instance and port hosting the game session (e.g., 10.1.1.1:82). This reduces latency by avoiding the public internet and using AWSâs optimized network paths.
6. Benefits
- Low Latency and Reduced Jitter: Traffic is routed over AWSâs high-speed, congestion-free network.
- Scalability: You can manage thousands of game sessions across multiple regions with a single accelerator.
- Fault Tolerance: If a game server or subnet endpoint becomes unhealthy, traffic can be rerouted without player disruption.
- Protocol Flexibility: Supports TCP, UDP, or both, accommodating different game networking requirements.
Summary
Using AWS Global Accelerator custom routing, a multiplayer game can direct players to specific game server instances by mapping accelerator ports to private IP addresses and ports of EC2 instances in VPC subnets. The matchmaking service controls which player connects where by assigning the appropriate accelerator port, enabling deterministic, low-latency routing without requiring client changes. This setup is ideal for large-scale, global multiplayer games needing fine-grained control over player-to-server assignments and performance optimization[2][6][7][9].
Citations:
[1] https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-how-it-works.html
[2] https://aws.amazon.com/blogs/gametech/deploy-game-servers-with-amazon-gamelift-fleetiq-and-integrate-with-custom-routing-aws-global-accelerator/
[3] https://www.youtube.com/watch?v=YxqJylY80Pc
[4] https://pages.awscloud.com/rs/112-TZM-766/images/2023_OTT-OD-0502-NGI_Slide-Deck.pdf
[5] https://coda.io/@kirtanc25/aws-r53-cf-ga/aws-global-accelerator-14
[6] https://pages.awscloud.com/rs/112-TZM-766/images/PTNR-AWS-AMD-GameLift-GameServers.pdf
[7] https://www.alibabacloud.com/help/en/ga/user-guide/how-custom-routing-listeners-work
[8] https://www.youtube.com/watch?v=qLAaUF_zq4I
[9] https://aws.amazon.com/blogs/networking-and-content-delivery/introducing-aws-global-accelerator-custom-routing-accelerators/
[10] https://mas-bandwidth.com/the-case-for-network-acceleration-for-multiplayer-games/
[11] https://aws.amazon.com/blogs/gametech/modernize-game-backend-services-with-aws-global-accelerator/