How does Application Load Balancer route traffic to each node?

0

I have been reading How Elastic Load Balancing works and it is not clear.

"Clients send requests, and Amazon Route 53 responds to each request with the IP address of one of the load balancer nodes. Based on the round robin routing algorithm, traffic is distributed such that each load balancer node receives 50% of the traffic from the clients. Each load balancer node distributes its share of the traffic across the registered targets in its scope."

But then under the Request routing section:

"Before a client sends a request to your load balancer, it resolves the load balancer's domain name using a Domain Name System (DNS) server. The DNS entry is controlled by Amazon... The Amazon DNS servers return one or more IP addresses to the client. These are the IP addresses of the load balancer nodes for your load balancer... The client determines which IP address to use to send requests to the load balancer."

So does Route 53 decide which node to send the request to? or does it return mutiple IPs and the client decides?

2 Answers
4
Accepted Answer

Route 53 normally returns all the IPs of the load balancer, unless health checks have removed some of the nodes temporarily from service. It's the client that decides which of those ALB IP addresses to connect to.

You can see the IPs in practice by querying the load balancer's DNS name with a command line tool, such as dig or nslookup. You'll also see that they are returned in random order to the application that made the query.

EXPERT
Leo K
answered a month ago
profile picture
EXPERT
reviewed a month ago
profile picture
EXPERT
reviewed a month ago
1

In addition to the above explanation, it’s important to note that AWS doesn’t fully disclose the exact method the Application Load Balancer (ALB) uses to route traffic to internal servers behind the ALB(The Application Load Balancer uses its internal logic to determine which target group and instance to route the traffic to from this link).

For example, if you’re using an ALB across two subnets, it typically starts with two internal hosts, which you can view through the associated ENIs (Elastic Network Interfaces). As traffic increases or decreases, the number of ENIs—and consequently the internal servers handling traffic—will adjust accordingly.

While the internal logic for routing is handled automatically by AWS, and we don’t have direct control over it, we can influence routing behavior through several configuration settings. These include load_balancing.algorithm.type, load_balancing.cross_zone.enabled, and stickiness.enabled, among others.

For more details on how to configure target groups and routing, you can refer to AWS's documentation here: Target Group Attributes.

profile picture
answered a month 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.

Guidelines for Answering Questions