ADC

Use case 15: Configure layer 4 load balancing on the NetScaler appliance

The layer 4 load balancer (TCP and UDP ports) uses information provided in the networking transport layer for routing client requests across the server groups.

When a layer 4 connection is established between a client and a server, it has a packet view of traffic exchanged between them. The layer 4 load balancer makes its routing decisions based on the address information extracted from the first few packets in the TCP stream, and doesn’t inspect the packet content. Therefore, the layer 4 load balancing is also called as connection-based load balancing.

The layer 4 load balancer monitors the health of a server. Traffic is not routed to the server if it is DOWN.

The layer 4 load balancing is useful for various applications that uses TCP or UDP payloads. Such protocols exchange data as TCP payload and don’t have a specific structure to follow.

To configure layer 4 load balancing using the command line interface

At the command prompt, type:

add service <name> <serverName> <serviceType> <port>
add lb vserver <name> <serviceType> <ip> <port>
bind lb vserver <name> <serviceName>
<!--NeedCopy-->

Example:

add service TCPservice 192.0.2.3 TCP 1
add lb vserver TCPserver TCP 192.0.2.4 1
bind lb vserver TCPserver TCPservice
<!--NeedCopy-->

To configure layer 4 load balancing using the GUI

  1. Navigate to Traffic Management > Load Balancing > Services.
  2. Click Add to a create a service.
  3. Specify the required details in Service Name and IP Address.
  4. Select either TCP or UDP in Protocol.
  5. Click OK.

  6. Click Done.

    A service is created.

    When you create a service using UDP as the transport layer protocol, a ping monitor (built-in monitor) is automatically bound to the service. When you create a service using TCP as the transport layer protocol, a tcp_default monitor is automatically bound to the service.

    For the load balancing setup, you can bind your service to a different type of monitor or multiple monitors. For advance monitoring requirements you can use the tcp-ecv monitor and configure the request and response messages.

  7. Navigate to Traffic Management > Load Balancing > Virtual Servers.

  8. Click Add to create a new virtual server.

    When the load balancing is configured, you can connect to the load-balanced website, application, or server through the virtual server’s IP address or FQDN.

  9. Specify the required details in Name, IP Address Type, and IP Address.

  10. Select either TCP or UDP in Protocol.

  11. Type a port number (0–1023 based on the type of service) in Port.

  12. Click OK.

  13. Click No Load Balancing Virtual Server Service Binding in Services and Service Groups.

  14. In the Service Binding page, select Click to Select in Select Service.
  15. Select the service to be bound and click Select.
  16. Click Bind to bind the service to the virtual server.

  17. Click Continue.
  18. Click Done.

    The layer 4 load balancing virtual server configuration is completed.

Use case 15: Configure layer 4 load balancing on the NetScaler appliance