0
0
Azurecloud~10 mins

Azure Load Balancer (Layer 4) - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Azure Load Balancer (Layer 4)
Client sends request
Azure Load Balancer receives request
Check load balancing rules
Select backend VM based on health and distribution
Forward request to selected VM
VM processes request and sends response
Load Balancer forwards response back to client
The Azure Load Balancer receives client requests, selects a healthy backend VM using Layer 4 rules, forwards the request, and returns the response.
Execution Sample
Azure
1. Client sends TCP request to Load Balancer IP
2. Load Balancer checks rules and health probes
3. Load Balancer forwards request to healthy VM
4. VM processes and responds
5. Load Balancer sends response back to client
This sequence shows how Azure Load Balancer routes a TCP request to a backend VM and returns the response.
Process Table
StepActionLoad Balancer DecisionBackend VM SelectedResponse Sent
1Client sends TCP request to Load Balancer IPReceived requestNone yetNo
2Load Balancer checks load balancing rulesRule matched for TCP port 80None yetNo
3Load Balancer checks health probesBackend VM1 healthy, VM2 unhealthyVM1 selectedNo
4Load Balancer forwards request to VM1Request forwardedVM1No
5VM1 processes requestProcessingVM1No
6VM1 sends response to Load BalancerResponse receivedVM1No
7Load Balancer forwards response to clientResponse forwardedVM1Yes
8End of request cycleRequest completeVM1Yes
💡 Request cycle ends after response is forwarded back to client.
Status Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 7Final
Request StateNot receivedReceivedReceivedForwarded to VM1Response forwardedComplete
Selected Backend VMNoneNoneVM1VM1VM1VM1
Response StateNoneNoneNoneNoneReceived from VM1Sent to client
Key Moments - 3 Insights
Why does the Load Balancer select VM1 and not VM2?
Because the health probe check at step 3 shows VM1 is healthy and VM2 is unhealthy, so only VM1 is selected as backend.
Does the Load Balancer inspect the content of the request?
No, Azure Load Balancer works at Layer 4, so it only looks at IP and port, not the request content, as shown in step 2.
When is the client response sent back?
At step 7, after the backend VM processes the request and sends the response to the Load Balancer, which then forwards it to the client.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, which backend VM is selected at step 3?
AVM1
BVM2
CNone
DBoth VM1 and VM2
💡 Hint
Check the 'Backend VM Selected' column at step 3 in the execution table.
At which step does the Load Balancer forward the response back to the client?
AStep 4
BStep 6
CStep 7
DStep 8
💡 Hint
Look at the 'Response Sent' column in the execution table to find when it changes to 'Yes'.
If VM1 became unhealthy, what would change in the execution table at step 3?
ALoad Balancer would select VM2 if healthy
BLoad Balancer would select VM1 anyway
CLoad Balancer would not forward the request
DLoad Balancer would forward to both VMs
💡 Hint
Refer to the 'Load Balancer Decision' and 'Backend VM Selected' columns at step 3.
Concept Snapshot
Azure Load Balancer (Layer 4):
- Operates at transport layer (TCP/UDP)
- Routes traffic based on IP and port
- Uses health probes to select healthy backend VMs
- Forwards client requests to backend VMs
- Returns VM responses back to clients
- Does not inspect request content
Full Transcript
Azure Load Balancer at Layer 4 receives client TCP requests and uses load balancing rules and health probes to select a healthy backend VM. It forwards the request to the selected VM, which processes it and sends a response back. The Load Balancer then forwards this response to the client, completing the request cycle. It works by routing based on IP and port without inspecting the request content.