The OSI model is considered the primary conceptual model for inter-computer communications.
The OSI model provides a consistent framework for network architecture. Functionality: The OSI model divides the problem of network communication between computers into seven smaller and more
manageable layers, each layer specifying a particular network function.
Understanding the Classic Load Balancer and Layer 4 of OSI
The Classic ELB has a number of features available to help provide high availability, monitoring, and better security for your application stack.
The AWS Classic Load Balancer (CLB) operates at Layer 4 of the OSI model.
What this means is that the load balancer routes traffic between clients and backend servers based on IP address and TCP port.
Example: An ELB at a given IP address receives a request from a client on TCP port 80 (HTTP).
It will then route that request based on the rules previously configured when setting up the load balancer to a specified
port on one of several backend servers.
The port on which the load balancer routes to the target server will often be port 80 (HTTP) or 443 (HTTPS).
The backend destination server will then fulfill the client request, and send the requested data back to the ELB,
which will then forward the backend server reply to the client.
From the client’s perspective, this request will appear to have been entirely fulfilled by the ELB.
The client will have no knowledge of the backend server or servers fulfilling client requests.
Understanding the Application Load Balancer and Layer 7 of the OSI model
AWS Application Load Balancer (ALB) operates at Layer 7 of the OSI model.
At Layer 7, the ELB has the ability to inspect application-level content, not just IP and port.
This lets it route based on more complex rules than with the Classic Load Balancer.
Example: An (ELB) Elastic Load Balancer at a given IP will receive a request from the client on port 443 (HTTPS).
The Application Load Balancer will process the request, not only by receiving port, but also by looking at the destination URL.
Multiple services can share a single load balancer using path-based routing.
In the example given here, the client could request any of the following URLs:
The Application Load Balancer will be aware of each of these URLs based on patterns set up when configuring the
load balancer and can route to different clusters of servers depending on application need. Rules can also be added at a later time as you add new functionality to your stack.
The Application Load Balancer also integrates with EC2 Container Service (ECS) using Service Load Balancing. This allows for dynamic mapping of services to ports as specified in the ECS task definition.
Multiple containers can be targeted on the same EC2 instance, each running different services on different ports.
The ECS task scheduler will automatically add these tasks to the ALB.