Azure Load Balancer Floating IP configuration | Microsoft Learn
Azure Load Balancer Floating IP configuration | Microsoft Learn
In Azure, floating IPs (also known as direct server return or floating IP enabled) are used to enable load balancing scenarios that require the frontend IP address to be directly mapped to the backend virtual machines without address translation. This feature is particularly useful in high availability scenarios, such as clustering, where a specific IP address must float between multiple VMs.
How Floating IP Works in Azure
-
Azure Load Balancer:
- Floating IP is a feature of the Azure Load Balancer. When you configure a load balancer rule, you can enable floating IP for that rule.
- This setting allows the load balancer to forward traffic directly to the backend VMs without modifying the destination IP address, which is essential for certain high availability and clustering configurations.
-
Direct Server Return:
- With floating IP enabled, the load balancer forwards the traffic to the backend VM using the same destination IP address as the frontend IP address.
- This setup allows the backend VM to respond directly to the client, bypassing the load balancer for the return path (hence the term "direct server return").
Here's a more detailed explanation of the differences between using and not using floating IP in Azure Load Balancer configurations:
Without Floating IP (Default Configuration)
Traffic Flow:
- Inbound Traffic: Client traffic reaches the load balancer's frontend IP.
- Load Balancing: The load balancer forwards the traffic to one of the backend VMs, modifying the destination IP to the backend VM's IP address.
- Return Traffic: The backend VM sends the response back to the load balancer, which then forwards it to the client.
Use Case:
- This configuration is suitable for general load balancing scenarios where address translation is acceptable.
- Typical use cases include web servers, application servers, and scenarios where the client does not need to interact directly with the backend VM.
Benefits:
- Simplified setup without special requirements.
- Suitable for applications where the load balancer handles both incoming and outgoing traffic.
Limitations:
- The load balancer remains in the data path for return traffic, potentially introducing additional latency.
- Not suitable for certain high-availability configurations like SQL Server Always On Availability Groups, which require direct server return.
With Floating IP (Direct Server Return)
Traffic Flow:
- Inbound Traffic: Client traffic reaches the load balancer's frontend IP.
- Load Balancing: The load balancer forwards the traffic to one of the backend VMs without modifying the destination IP (the frontend IP is used as the destination IP).
- Return Traffic: The backend VM sends the response directly to the client, bypassing the load balancer.
Use Case:
- Essential for scenarios requiring high availability and failover mechanisms, such as SQL Server Always On Availability Groups, clustering, and certain real-time applications.
- Situations where maintaining the original client-to-frontend IP mapping is necessary for application functionality.
Benefits:
- Reduced latency as the return path bypasses the load balancer.
- Suitable for high-availability configurations requiring direct server return.
Limitations:
- More complex setup and configuration.
- Direct server return might require additional configuration on the backend VMs to handle the direct response traffic properly.
Comparison Summary
Feature/Aspect | Without Floating IP | With Floating IP |
---|---|---|
Destination IP Handling | Load balancer modifies destination IP | Destination IP remains the frontend IP |
Return Traffic Path | Via load balancer | Directly from backend VM to client |
Latency | Potentially higher due to return path | Lower due to direct server return |
Use Cases | General load balancing | High availability, clustering, SQL Server AG |
Complexity | Simpler setup | More complex setup |
Practical Example
Scenario: You have a web application where frontend traffic needs to be load-balanced across multiple web servers (backend VMs).
Without Floating IP:
- Clients send requests to the load balancer's frontend IP.
- The load balancer forwards requests to backend VMs, modifying the destination IP.
- Backend VMs respond to the load balancer, which then forwards responses to clients.
- Suitable for general web applications without special requirements.
With Floating IP:
- Clients send requests to the load balancer's frontend IP.
- The load balancer forwards requests to backend VMs without modifying the destination IP.
- Backend VMs respond directly to clients, bypassing the load balancer.
- Essential for applications like SQL Server Always On Availability Groups, where the floating IP enables seamless failover and high availability.
By understanding these differences, you can choose the appropriate configuration for your specific application needs and ensure optimal performance and availability.
Azure Load Balancer Deep Dive (youtube.com)
31:11介绍floating ip