netscaler 9.3 load balancing - · pdf fileassigning weights to services ..... 146 protecting...

454
Load Balancing 2015-04-26 05:16:07 UTC © 2015 Citrix Systems, Inc. All rights reserved. Terms of Use | Trademarks | Privacy Statement

Upload: habao

Post on 16-Mar-2018

255 views

Category:

Documents


15 download

TRANSCRIPT

Page 1: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Load Balancing

2015-04-26 05:16:07 UTC

© 2015 Citrix Systems, Inc. All rights reserved. Terms of Use | Trademarks | Privacy Statement

Page 2: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Contents

Load Balancing ................................................................................................ 8

Load Balancing.................................................................................... 9

How Load Balancing Works................................................................ 10

Load Balancing Basics ................................................................ 11

Understanding the Topology......................................................... 13

Use of Wildcards Instead of IP Addresses and Ports ............................. 15

Configuring Global HTTP Ports ...................................................... 19

Setting Up Basic Load Balancing.......................................................... 22

Enabling Load Balancing ............................................................. 23

Configuring Services .................................................................. 25

Adding a Server .................................................................. 26

Creating a Service ............................................................... 29

Creating a Virtual Server............................................................. 33

Binding Services to the Virtual Server ............................................. 35

Verifying the Configuration.......................................................... 37

Viewing the Properties of a Server Object................................... 38

Viewing the Properties of a Virtual Server................................... 39

Viewing the Properties of a Service........................................... 40

Viewing the Bindings of a Service ............................................. 41

Viewing the Statistics of a Virtual Server .................................... 42

Viewing the Statistics of a Service ............................................ 44

Customizing a Load Balancing Configuration ........................................... 45

Load Balancing Algorithms........................................................... 46

The Least Connection Method ................................................. 49

The Round Robin Method ....................................................... 54

The Least Response Time Method............................................. 56

About Hashing Methods ......................................................... 65

The URL Hash Method ..................................................... 68

The Domain Hash Method ................................................. 70

2

Page 3: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The Destination IP Hash Method ......................................... 71

The Source IP Hash Method ............................................... 72

The Source IP Destination IP Hash Method ............................. 73

The Source IP Source Port Hash Method ................................ 74

The Call ID Hash Method .................................................. 75

The Least Bandwidth Method .................................................. 76

The Least Packets Method...................................................... 80

The Custom Load Method....................................................... 84

Configuring the Token Method................................................. 89

Configuring a Load Balancing Method That Does Not Include a Policy 92

Persistence and Persistent Connections ........................................... 94

About Persistence................................................................ 95

Persistence Based on Source IP Address...................................... 98

Persistence Based on HTTP Cookies .......................................... 99

Persistence Based on SSL Session IDs ......................................... 102

Custom Server ID Persistence .................................................. 103

Persistence Based on Destination IP Addresses ............................. 106

Persistence Based on Source and Destination IP Addresses ............... 107

Persistence Based on SIP Call ID............................................... 108

Persistence Based on RTSP Session IDs ....................................... 109

Configuring URL Passive Persistence.......................................... 110

Configuring Persistence Based on User-Defined Rules ..................... 112

Configuring Persistence Types That Do Not Require a Rule............... 115

Configuring Backup Persistence ............................................... 117

Configuring Persistence Groups................................................ 119

Configuring RADIUS Load Balancing with Persistence ...................... 122

Enabling the Load Balancing or Content Switching Feature 123

Configuring Virtual Servers ............................................... 124

Configuring Services ....................................................... 127

Binding Virtual Servers to Services ...................................... 128

Configuring a Persistency Group for Radius ............................ 129

Viewing Persistence Sessions................................................... 130

Clearing Persistence Sessions .................................................. 131

Overriding Persistence Settings for Overloaded Services.................. 133

Customizing the Hash Algorithm for Persistence across Virtual Servers...... 136

Configuring the Redirection Mode .................................................. 141

Configuring per-VLAN Wildcarded Virtual Servers ............................... 143

3

Page 4: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Assigning Weights to Services ....................................................... 146

Protecting the Load Balancing Configuration against Failure........................ 148

Redirecting Client Requests to an Alternate URL ................................ 149

Configuring a Backup Load Balancing Virtual Server............................. 151

Diverting Excess Traffic to a Backup Virtual Server ............................. 153

Configuring Connection-Based Spillover ........................................... 156

Configuring Dynamic Spillover ...................................................... 157

Configuring Bandwidth-Based Spillover ............................................ 158

Connection Failover................................................................... 159

Configuring Connection Failover .............................................. 162

Disabling Connection Failover ................................................. 163

Flushing the Surge Queue ............................................................ 164

Managing a Load Balancing Setup ........................................................ 166

Managing Server Objects ............................................................. 167

Managing Services ..................................................................... 169

Managing a Load Balancing Virtual Server......................................... 171

The Load Balancing Visualizer....................................................... 174

Managing Client Traffic............................................................... 181

Configuring Sessionless Load Balancing Virtual Servers.................... 182

Redirecting HTTP Requests to a Cache....................................... 186

Directing Requests According to Priority..................................... 188

Directing Requests to a Custom Web Page................................... 190

Enabling Cleanup of Virtual Server Connections ............................ 192

Graceful Shut down of Services ............................................... 195

Rewriting Ports and Protocols for HTTP Redirection ....................... 198

Inserting the IP Address and Port of a Virtual Server in the RequestHeader............................................................................. 203

Using a Specified Source IP for Backend Communication ................. 205

Setting a Timeout Value for Idle Client Connections....................... 214

Managing RTSP Connections.................................................... 216

Managing Client Traffic on the Basis of Traffic Rate ....................... 218

Identifying a connection with Layer 2 Parameters ......................... 219

Configuring the Prefer Direct Route Option ................................. 221

Advanced Load Balancing Settings.................................................. 223

The No-Monitor Option for Services........................................... 224

Protecting Applications on Protected Servers Against Traffic Surges 228

Enabling Cleanup of Service Connections .................................... 230

Directing Requests to a Custom Web Page................................... 232

4

Page 5: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Enabling Access to Services When Down ..................................... 234

Enabling TCP Buffering of Responses ......................................... 236

Enabling Compression ........................................................... 238

Maintaining Client Connection for Multiple Client Requests .............. 240

Inserting the IP Address of the Client in the Request Header ............ 242

Using the Source IP Address of the Client When Connecting to theServer.............................................................................. 244

Configuring the Source Port for Server-Side Connections ................. 246

Setting a Limit on the Number of Client Connections...................... 248

Setting a Limit on Number of Requests Per Connection to the Server 250

Setting a Threshold Value for the Monitors Bound to a Service 252

Setting a Timeout Value for Idle Client Connections....................... 254

Setting a Timeout Value for Idle Server Connections ...................... 256

Setting a Limit on the Bandwidth Usage by Clients ........................ 258

Redirecting Client Requests to a Cache ...................................... 260

Monitors................................................................................. 262

The Built-in Monitors ............................................................ 263

Monitoring TCP-based Applications...................................... 264

Monitoring SSL Services.................................................... 266

Monitoring FTP Services ................................................... 267

Monitoring SIP Services .................................................... 268

Monitoring RADIUS Services ............................................... 274

Monitoring DNS and DNS-TCP Services .................................. 276

Monitoring LDAP Services ................................................. 277

Monitoring MySQL Services................................................ 278

Monitoring SNMP Services ................................................. 279

Monitoring NNTP Services ................................................. 280

Monitoring POP3 Services ................................................. 281

Monitoring SMTP Services ................................................. 282

Monitoring RTSP Servers................................................... 283

Monitoring the XML Broker Services ..................................... 288

Monitoring ARP Requests .................................................. 289

Monitoring the Access Gateway .......................................... 290

Monitoring the Advanced Access Control Login Page 291

Monitoring the Advanced Access Control Logon Agent ServicePage..................................................................... 292

Monitoring the XenDesktop Delivery Controller Services 293

Monitoring Web Interface Services ...................................... 297

5

Page 6: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Custom Monitors ................................................................. 300

Configuring Inline Monitors ............................................... 301

Understanding User Monitors ............................................. 302

How to Use a User Monitor to Check Web Sites ....................... 306

Understanding the Internal Dispatcher ................................. 307

Configuring a Custom User Monitor...................................... 309

Understanding Load Monitors............................................. 310

Configuring Load Monitors ................................................ 312

Unbinding Metrics from a Metrics Table ................................ 314

Removing a Load Monitoring Metric Table.............................. 315

Viewing Metrics Tables .................................................... 316

Configuring Monitors in a Load Balancing Setup ............................ 317

Creating Monitors........................................................... 318

Binding Monitors to Services.............................................. 320

Modifying Monitors ......................................................... 321

Enabling and Disabling Monitors ......................................... 325

Unbinding Monitors......................................................... 327

Removing Monitors ......................................................... 328

Viewing Monitors ........................................................... 329

Closing Monitor Connections.............................................. 331

Ignoring the Upper Limit on Client Connections for MonitorProbes ........................................................................ 333

Configuring Support for Third-Party Load Balancers by Using SASP ........... 335

Creating a Work Load Manager ................................................ 338

Binding a Virtual Server to the Work Load Manager........................ 340

Managing the Work Load Manager............................................. 341

Modifying the Work Load Manager....................................... 342

Removing a Work Load Manager ......................................... 343

Unbinding a Work Load Manager ......................................... 344

Viewing a Work Load Manager............................................ 345

Managing a Large Scale Deployment ............................................... 346

Ranges of Virtual Servers and Services ....................................... 347

Creating a Range of Virtual Servers........................................... 348

Creating a Range of Services................................................... 350

Configuring Service Groups..................................................... 352

Creating Service Groups................................................... 353

Binding a Service Group to a Virtual Server............................ 354

Binding a Member to a Service Group................................... 355

6

Page 7: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Binding a Monitor to a Service Group ................................... 357

Managing Service Groups ....................................................... 358

Modifying a Service Group ................................................ 359

Removing a Service Group ................................................ 362

Unbinding a Member from a Service Group ............................ 363

Unbinding a Service Group from a Virtual Server ..................... 364

Unbinding Monitors from Service Groups ............................... 365

Enabling or Disabling a Service Group................................... 366

Viewing the Properties of a Service Group ............................. 368

Viewing Service Group Statistics......................................... 369

Load Balancing Virtual Servers Bound to a Service Group 370

Translating the IP Address of a Domain-Based Server...................... 372

Masking a Virtual Server IP Address........................................... 374

Configuring Load Balancing for Commonly Used Protocols ..................... 377

Load Balancing for a Group of FTP Servers .................................. 378

Load Balancing DNS Servers .................................................... 381

Load Balancing Domain-Name Based Services............................... 384

Load Balancing a Group of SIP Servers ....................................... 388

Load Balancing RTSP Servers................................................... 402

Load Balancing of Remote Desktop Protocol (RDP) Servers ............... 405

Use Cases .................................................................................... 412

Configuring Rule Based Persistence Based on a Name-Value Pair in a TCPByte Stream ............................................................................ 413

Configuring Load Balancing in Direct Server Return Mode...................... 416

Configuring LINUX Servers in DSR Mode............................................ 420

Configuring DSR Mode When Using TOS ............................................ 421

Configuring Load Balancing in DSR Mode by Using IP Over IP .................. 424

Configuring a Load Balancing Virtual Server................................. 425

Configuring Services for IP over IP DSR....................................... 428

Configuring Load Balancing in One-arm Mode .................................... 432

Configuring Load Balancing in the Inline Mode ................................... 434

Load Balancing of Intrusion Detection System Servers .......................... 436

Isolating the Network Paths by Using Traffic Domains .......................... 440

Configuring XenDesktop for Load Balancing....................................... 448

Configuring XenApp for Load Balancing............................................ 451

Troubleshooting Common Problems ..................................................... 453

7

Page 8: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

8

Load Balancing

The load balancing feature distributes user requests for Web site pages and other protectedapplications across multiple servers that all host (or mirror) the same content. You use loadbalancing primarily to manage user requests to heavily used applications, preventing poorperformance and outages and ensuring that users can access your protected applications.Load balancing also provides fault tolerance; when one server that hosts a protectedapplication becomes unavailable, the feature distributes user requests to the other serversthat host the same application.

You can configure the load balancing feature to:

• Distribute all requests for a specific protected Web site, application, or resourcebetween two or more identically-configured servers.

• Use any of several different algorithms to determine which server should receive eachincoming user request, basing the decision on different factors, such as which serverhas the fewest current user connections or which server has the lightest load.

The load balancing feature is a core feature of the NetScaler appliance. Most users first setup a working basic configuration and then customize various settings, including persistencefor connections. In addition, you can configure features for protecting the configurationagainst failure, managing client traffic, managing and monitoring servers, and managing alarge scale deployment.

Page 9: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

9

How Load Balancing Works

In a basic load balancing setup, clients send their requests to the IP address of a virtualserver configured on the NetScaler appliance. The virtual server distributes them to theload-balanced application servers according to a preset pattern, called the load balancingalgorithm. In some cases, you might want to assign the load balancing virtual server awildcard address instead of a specific IP address. For instructions about specifying a globalHTTP port on the appliance, see Global HTTP Ports.

Page 10: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

10

How Load Balancing Works

In a basic load balancing setup, clients send their requests to the IP address of a virtualserver configured on the NetScaler appliance. The virtual server distributes them to theload-balanced application servers according to a preset pattern, called the load balancingalgorithm. In some cases, you might want to assign the load balancing virtual server awildcard address instead of a specific IP address. For instructions about specifying a globalHTTP port on the appliance, see Global HTTP Ports.

Page 11: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

11

Load Balancing Basics

A load balancing setup includes a load-balancing virtual server and multiple load-balancedapplication servers. The virtual server receives incoming client requests, uses the loadbalancing algorithm to select an application server, and forwards the requests to theselected application server. The following conceptual drawing illustrates a typical loadbalancing deployment. Another variation involves assigning a global HTTP port.

Figure 1. Load Balancing Architecture

The load balancing virtual server can use any of a number of algorithms (or methods) todetermine how to distribute load among the load-balanced servers that it manages. Thedefault load balancing method is the least connection method, in which the NetScalerappliance forwards each incoming client connection to whichever load-balanced applicationserver currently has the fewest active user connections.

The entities that you configure in a typical NetScaler load balancing setup are:

• Load balancing virtual server. The IP address, port, and protocol combination to whicha client sends connection requests for a particular load-balanced website orapplication. If the application is accessible from the Internet, the virtual server IP (VIP)address is a public IP address. If the application is accessible only from the local areanetwork (LAN) or wide area network (WAN), the VIP is usually a private (ICANNnon-routable) IP address.

Page 12: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Service. The IP address, port, and protocol combination used to route requests to aspecific load-balanced application server. A service can be a logical representation ofthe application server itself, or of an application running on a server that hosts multipleapplications. After creating a service, you bind it to a load balancing virtual server.

• Server object. A virtual entity that enables you to assign a name to a physical serverinstead of identifying the server by its IP address. If you create a server object, you canspecify its name instead of the server's IP address when you create a service.Otherwise, you must specify the server's IP address when you create a service, and theIP address becomes the name of the server.

• Monitor. An entity on the NetScaler appliance that tracks a service and ensures that itis operating correctly. The monitor periodically probes (or performs a health check on)each service to which you assign it. If the service does not respond within the timespecified by the time-out, and a specified number of health checks fail, that service ismarked DOWN. The NetScaler appliance then skips that service when performing loadbalancing, until the issues that caused the service to quit responding are fixed.

The virtual server, services, and load balanced application servers in a load balancing setupcan use either Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6) IPaddresses. You can mix IPv4 and IPv6 addresses in a single load balancing setup.

For variations in the load balancing setup, see the following use cases:

• Configuring Load Balancing in Direct Server Return Mode

• Configuring LINUX Servers in DSR Mode

• Configuring DSR Mode When Using TOS

• Configuring Load Balancing in DSR Mode by Using IP Over IP

• Configuring Load Balancing in One-arm Mode

• Configuring Load Balancing in the Inline Mode

• Load Balancing of Intrusion Detection System Servers

• Load Balancing RDP services

Load Balancing Basics

12

Page 13: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

13

Understanding the Topology

In a load balancing setup, the load balancing server is logically located between the clientand the server farm, and manages traffic flow to the servers in the server farm. On theNetScaler appliance, the application servers are represented by virtual entities calledservices. The following diagram shows the topology of a basic load balancing configuration.

Figure 1. Basic Load Balancing Topology

In the diagram, load balancing is used to manage traffic flow to the servers. The virtualserver selects the service and assigns it to serve client requests. Consider a scenario wherethe services Service-HTTP-1 and Service-HTTP-2 are created and bound to the virtual servernamed Vserver-LB-1. Vserver-LB-1 forwards the client request to either Service-HTTP-1 orService-HTTP-2. The NetScaler appliance uses the least connection load balancing methodto select the service for each request. The following table lists the names and values of thebasic entities that must be configured on the appliance.

Entity Mandatory Parameters and Sample Values

Name IP Address Port Protocol

Virtual server Vserver-LB-1 10.102.29.60 80 HTTP

Services Service-HTTP-1 10.102.29.5 8083 HTTP

Service-HTTP-2 10.102.29.6 80 HTTP

Monitors Default None None None

Page 14: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The following diagram shows the load balancing sample values and mandatory parametersthat are described in the preceding table.

Figure 2. Load Balancing Entity Model

Understanding the Topology

14

Page 15: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

15

Use of Wildcards Instead of IP Addressesand Ports

In some cases you might need to use a wildcard for the IP address or the port of a virtualserver or for the port of a service. The following cases may require using a wildcard:

• If the NetScaler appliance is configured as a transparent pass through, which mustaccept all traffic that is sent to it regardless of the IP or port to which it is sent.

• If one or more services listen on ports that are not well known.

• If one or more services, over time, change the ports that they listen on.

• If you reach the limit for the number of IP addresses and ports that you can configureon a single NetScaler appliance.

• If you want to create virtual servers that listen for all traffic on a specific virtual LAN.

When a wildcard-configured virtual server or service receives traffic, the NetScalerappliance determines the actual IP address or port and creates new records for the serviceand associated load balanced application server. These dynamically created records arecalled dynamically learned server and service records.

For example, a firewall load balancing configuration can use wildcards for both the IPaddress and port. If you bind a wildcard TCP service to this type of load balancing virtualserver, the virtual server receives and processes all TCP traffic that does not match anyother service or virtual server.

The following table describes some of the different types of wildcard configurations andwhen each should be used.

IP Port Protocol Description

* * TCP A general wildcardvirtual server thataccepts traffic sentto any IP addressand port on theNetScalerappliance. Whenusing a wildcardedvirtual server, theappliancedynamically learnsthe IP and port ofeach service andcreates thenecessary records asit processes traffic.

Page 16: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

* * TCP A firewall loadbalancing virtualserver. You can bindfirewall services tothis virtual server,and the NetScalerappliance passestraffic through thefirewall to thedestination.

IP Address * TCP,UDP, and ANY A virtual server thataccepts all trafficthat is sent to thespecified IPaddress, regardlessof the port. Youmust explicitly bindto this type ofvirtual server theservices to which itwill redirect traffic.It will notdynamically learnthem.

Note: You do notconfigure servicesor virtual serversfor a global HTTPport. In this case,you configure aspecific port as aglobal HTTP port(for example,set ns config-httpPort 80).The appliancethen accepts alltraffic thatmatches the portnumber, andprocesses it asHTTP traffic. Theappliancedynamicallylearns andcreates servicesfor this traffic.

Use of Wildcards Instead of IP Addresses and Ports

16

Page 17: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

* port SSL, SSL_TCP A virtual server thataccepts all trafficsent to any IPaddress on aspecific port. Usedfor globaltransparent SSLoffloading. All SSL,HTTP, and TCPprocessing thatusually is performedfor a service of thesame protocol typeis applied to trafficthat is directed tothis specific port.The appliance usesthe port todynamically learnthe IP of the serviceit should use. If–cleartext is notspecified, theNetScaler applianceuses end-to-endSSL.

* port Not applicable All other virtualservers that canaccept traffic to theport. You do notbind services tothese virtualservers; theNetScaler appliancelearns themdynamically.

Note: If you have configured your NetScaler appliance as a transparent pass through thatmakes use of global (wildcard) ports, you may want to turn on Edge mode. For moreinformation, see "Configuring Edge Mode."

The NetScaler appliance attempts to locate virtual servers and services by first attemptingan exact match. If none is found, it continues to search for a match based on wildcards, inthe following order:

1. Specific IP address and specific port number

2. Specific IP address and a * (wildcard) port

3. * (wildcard) IP address and a specific port

4. * (wildcard) IP address and a * (wildcard) port

If the appliance is unable to select a virtual server by IP address or port number, it searchesfor a virtual server on the basis of the protocol used in the request, in the following order:

Use of Wildcards Instead of IP Addresses and Ports

17

Page 18: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

1. HTTP

2. TCP

3. ANY

Use of Wildcards Instead of IP Addresses and Ports

18

Page 19: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

19

Configuring Global HTTP Ports

You do not configure services or virtual servers for a global HTTP port. Instead, youconfigure a specific port by using the set ns config command. After configuring thisport, the NetScaler appliance accepts all traffic that matches the port number, andprocesses it as HTTP traffic, dynamically learning and creating services for that traffic.

You can configure more than one port number as a global HTTP port. If you are specifyingmore than one port number in a single set ns config command, separate the portnumbers by a single white space. If one or more ports have already been specified as globalHTTP ports, and you want to add one or more ports without removing the ports that arecurrently configured, you must specify all the port numbers, current and new, in thecommand. Before you add port numbers, use the show ns config command to view theports that are currently configured.

To configure a global HTTP port by using thecommand line interface

At the command prompt, type the following commands to configure a global HTTP port andverify the configuration:

• set ns config –httpPort <port>

• show ns config

Example 1: Configuring a port as a global HTTP port

In this example, port 80 is configured as a global HTTP port.

> set ns config -httpPort 80 Done> show ns config NetScaler IP: 192.0.2.3 (mask: 255.255.255.0) Number of MappedIP(s): 6 Node: Standalone

Global configuration settings: HTTP port(s): 80 Max connections: 0 Max requests per connection: 0 Client IP insertion: DISABLED ... ...

Example 2: Adding ports when one or more global HTTP ports are already configured

Page 20: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

In this example, port 8888 is added to the global HTTP port list. Port 80 is alreadyconfigured as a global HTTP port.

> show ns config NetScaler IP: 192.0.2.3 (mask: 255.255.255.0) Number of MappedIP(s): 6 Node: Standalone

Global configuration settings: HTTP port(s): 80 Max connections: 0 ... ... Done> set ns config -httpPort 80 8888 Done> show ns config NetScaler IP: 192.0.2.3 (mask: 255.255.255.0) Number of MappedIP(s): 6 Node: Standalone

Global configuration settings: HTTP port(s): 80,8888 Max connections: 0 ... ... Done>

Parameters for configuring a global HTTP porthttpPort

The HTTP ports on the web server. This setting allows the system to perform connectionoff-load for any client request that has a destination port matching one of the configuredports. Minimum value: 1.

Configuring Global HTTP Ports

20

Page 21: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure a global HTTP port by using theconfiguration utility

1. In the navigation pane, expand System, and then click Settings.

2. In the details pane, under Settings, click Change HTTP parameters.

3. In the Configure HTTP Parameters dialog box, in the HTTP Port area, do the following:

• To add a port, enter the port number, and then click Add.

• To remove a port that has already been configured, click the port number, and thenclick Remove.

4. Click OK.

Configuring Global HTTP Ports

21

Page 22: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

22

Setting Up Basic Load Balancing

Before configuring your initial load balancing setup, enable the load balancing feature.Then begin by creating at least one service for each server in the load balancing group.With the services configured, you are ready to create a load balancing virtual server, andbind each service to the virtual server. That completes the initial setup. Before proceedingwith further configuration, verify your configuration to make sure that each element wasconfigured properly and is operating as expected.

Page 23: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

23

Enabling Load Balancing

You can configure load balancing entities such as services and virtual servers when the loadbalancing feature is disabled, but they will not function until you enable the feature.

To enable load balancing by using the command lineinterface

At the command prompt, type the following command to enable load balancing and verifythe configuration:

• enable ns feature LB

• show ns feature

Example

> enable ns feature LoadBalancing Done> show ns feature

Feature Acronym Status ------- ------- ------ 1) Web Logging WL OFF 2) Surge Protection SP ON 3) Load Balancing LB ON . . . 24) NetScaler Push push OFF Done

To enable load balancing by using the configurationutility

1. In the navigation pane, expand System, and then click Settings.

2. In the details pane, under Modes and Features, click Change basic features.

3. In the Configure Basic Features dialog box, select the Load Balancing check box, andthen click OK.

4. In the Enable/Disable Feature(s)? message box, click Yes.

Page 24: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Enabling Load Balancing

24

Page 25: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

25

Configuring Services

After you enable the load balancing feature, you must create at least one service for eachapplication server that is to be included in your load balancing setup. The services that youconfigure provide the connections between the NetScaler appliance and the load balancedservers. Each service has a name and specifies an IP address, a port, and the type of datathat is served.

If you create a service without first creating a server object, the IP address of the service isalso the name of the server that hosts the service. If you prefer to identify servers by namerather than IP address, you can create server objects and then specify a server's nameinstead of its IP address when you create a service.

When you create a service that uses UDP as the transport layer protocol, a ping monitor isautomatically bound to the service. A ping monitor is the most basic of the built-inmonitors. When you create a service that uses TCP as the transport layer protocol, aTCP_default monitor is automatically bound to the service. When you develop a strategy formanaging your load balancing setup, you might decide to bind a different type of monitor,or multiple monitors, to the service.

Page 26: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

26

Adding a Server

If you add a server to the list of servers before creating a service to represent that server,you can assign a name to the server. You can then specify the server's name instead of its IPaddress when you create a service. If you create a service from the configuration utility,you can select the server from the drop-down list. When adding the server to the list, youmight want to assign it a name that helps identify the kind of services that you will createwith it. You can also specify its state and add a comment.

When adding a server, you must identify it by specifying its IP address or domain name. Ifyou specify the domain name, you can later change the IP address of the physical serverwithout having to modify the server's entry in the list of servers on the appliance. Thedomain name is resolved to an IP address that is specified in an address record on the DNS.

During hardware maintenance or software upgrades, you may have to make the serverDOWN. If the server is domain based, to override the IP address resolved by the DNS, youcan configure an IP address mask and a translation IP address on the NetScaler appliance.For more information, see "Translating the IP Address of a Domain Based Server."

You can add a range of servers from a single CLI command or the same dialog box. Thenames in the range vary by a number used as a suffix or prefix. For example, server1,server2, and so on. From the configuration utility, you can specify a range only in the lastoctet of the IP address, which is the fourth in case of an IPv4 address and the eighth in caseof an IPv6 address. From the command line, you can specify the range in any octet of the IPaddress. For more information, see "Creating a Range of Virtual Servers."

To add a server by using the command line interfaceAt the command prompt, type:

add server <name> (<ipAddress> | (<domain> [-ipv6Address ( YES | NO )]) [-state ( ENABLED| DISABLED )] [-comment <string>]

Examples

add server myserver www.example.net -state DISABLED -comment "Web server for example.net"Done> show server myserver Name: myserver State:DISABLED Domain: www.example.net Resolve Retry: 0 Secs Translation IP: 0.0.0.0 Translation Mask: 0.0.0.0 Comment: "Web server for example.net" Done>

Page 27: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Parameters for configuring a servername

The name assigned to the server. This alphanumeric string is required. The name mustnot exceed 127 characters, and the leading character must be a number or letter. Thefollowing characters are also allowed: @ _ - . (period) : (colon) # and space ( ).

ipAddress

IP address of the server, in either IPv4 or IPv6 format.

If the server is not reachable from the appliance or is not active, the service is marked asDOWN.

domain

Domain name that resolves to the IP address that represents the server.

ipv6Address

Resolve the domain name to an IPv6 address. Possible values: YES, NO. Default: NO.

state

The initial state of the server. Possible values: ENABLED, DISABLED. Default: ENABLED.

comment

A comment to help identify the server. Maximum length: 255 characters. To includespaces in a comment that you type on the command line, enclose the entire commentinside quotation marks. The quotation marks become part of the comment. They are notrequired if you use the configuration utility.

Adding a Server

27

Page 28: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To add a server by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Servers.

2. In the details pane, click Add.

3. In the Create Server dialog box, specify values for the following parameters, whichcorrespond to parameters described in "Parameters for configuring a server" as shownabove:

• Server Name—name

• IP Address—ipAddress (Select IP Address and type the address. Before typing an IPv6address, select the IPv6 check box.)

• Domain Name—domain (For a domain-name based server, select Domain Name andtype the name of the server's domain.)

• Enable after Creating—state

• Comment—comment4. If you specify the domain name of the server and you want the domain name to be

resolved to an IPv6 address, select the IPv6 Domain check box.

5. Click Create, and then click Close. The server you named appears in the Servers pane.

Adding a Server

28

Page 29: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

29

Creating a Service

Before you create a service, you need to understand the different service types and howeach is used. The following list describes the types of services supported on the NetScalerappliance.

HTTP

Used for load-balanced servers that accept HTTP traffic, such as standard web sites andweb applications. The HTTP service type enables the NetScaler appliance to providecompression, content filtering, caching, and client keep-alive support for your Layer 7web servers. This service type also supports virtual server IP port insertion, redirect portrewriting, Web 2.0 Push, and URL redirection support.

Because HTTP is a TCP-based application protocol, you can also use the TCP service typefor web servers. If you do so, however, the NetScaler appliance is able to perform onlyLayer 4 load balancing. It cannot provide any of the Layer 7 support described earlier.

SSL

Used for servers that accept HTTPS traffic, such as ecommerce web sites and shoppingcart applications. The SSL service type enables the NetScaler appliance to encrypt anddecrypt SSL traffic (perform SSL offloading) for your secure web applications. It alsosupports HTTP persistence, content switching, rewrite, virtual server IP port insertion,Web 2.0 Push, and URL redirection.

You can also use the SSL_BRIDGE, SSL_TCP, or TCP service types. If you do so, however,the NetScaler performs only Layer 4 load balancing. It cannot provide SSL offloading orany of the Layer 7 support described above

FTP

Used for servers that accept FTP traffic. The FTP service type enables the NetScalerappliance to support specific details of the FTP protocol.

You can also use TCP or ANY service types for FTP servers.

TCP

Used for servers that accept many different types of TCP traffic, or that accept a type ofTCP traffic for which a more specific type of service is not available.

You can also use the ANY service type for these servers.

SSL_TCP

Used for servers that accept non-HTTP-based SSL traffic, to support SSL offloading.

You can also use the TCP service type for these services. If you do so, the NetScalerappliance performs both the Layer 4 load balancing and SSL offloading.

Page 30: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

UDP

Used for servers that accept UDP traffic. You can also use the ANY service type.

SSL_BRIDGE

Used for servers that accept SSL traffic when you do not want the NetScaler appliance toperform SSL offloading. Alternatively, you can use the SSL_TCP service type.

NNTP

Used for servers that accept Network News Transfer Protocol (NNTP) traffic, typicallyUsenet sites.

DNS

Used for servers that accept DNS traffic, typically nameservers. With the DNS servicetype, the NetScaler appliance validates the packet format of each DNS request andresponse. It can also cache DNS responses. You can apply DNS policies to DNS services.

You can also use the UDP service type for these services. If you do, however, theNetScaler appliance can only perform Layer 4 load balancing. It cannot provide supportfor DNS-specific features.

ANY

Used for servers that accept any type of TCP, UDP, or ICMP traffic. The ANY parameter isused primarily with firewall load balancing and link load balancing.

SIP-UDP

Used for servers that accept UDP-based Session Initiation Protocol (SIP) traffic. SIPinitiates, manages, and terminates multimedia communications sessions, and hasemerged as the standard for Internet telephony (VoIP).

You can also use the UDP service type for these services. If you do, however, theNetScaler appliance performs only Layer 4 load balancing. It cannot provide support forSIP-specific features.

DNS-TCP

Used for servers that accept DNS traffic, where the NetScaler appliance acts as a proxyfor TCP traffic sent to DNS servers. With services of the DNS-TCP service type, theNetScaler appliance validates the packet format of each DNS request and response andcan cache DNS responses, just as with the DNS service type.

You can also use the TCP service type for these services. If you do, however, theNetScaler appliance only performs Layer 4 load balancing of external DNS name servers.It cannot provide support for any DNS-specific features.

RTSP

Used for servers that accept Real Time Streaming Protocol (RTSP) traffic. RTSP providesdelivery of multimedia and other streaming data. Select this type to support audio,video, and other types of streamed media.

Creating a Service

30

Page 31: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

You can also use the TCP service type for these services. If you do, however, theNetScaler appliance performs only Layer 4 load balancing. It cannot parse the RTSPstream or provide support for RTSPID persistence or RTSP NATting.

DHCPRA

Used for servers that accept DHCP traffic. The DHCPRA service type can be used to relayDHCP requests and responses between VLANs.

Services are designated as DISABLED until the NetScaler appliance connects to theassociated load-balanced server and verifies that it is operational. At that point, the serviceis designated as ENABLED. Thereafter, the NetScaler appliance periodically monitors thestatus of the servers, and places any that fail to respond to monitoring probes (calledhealth checks) back in the DISABLED state until they respond.

Note: You can create a range of services from a single CLI command or the same dialogbox. The names in the range vary by a number used as a suffix/prefix. For example,service1, service2, and so on. From the configuration utility, you can specify a range onlyin the last octet of the IP address, which is the fourth in case of an IPv4 address and theeighth in case of an IPv6 address. From the command line, you can specify the range inany octet of the IP address.

To create a service by using the command lineinterface

At the command prompt, type:

add service <name> <serverName> <serviceType> <port>

Example

add service Service-HTTP-1 192.0.2.5 HTTP 80

Parameters for configuring a servicename

Name of the service. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( ).

serverName

Either the name of a previously created server object, or the IP address of theload-balanced server that hosts this service, in either IPv4 or IPv6 format. When youprovide the IP address of the service, a server object is created with this IP address as itsname. You can also create a server object manually, and then select the server nameinstead of an IP address from the drop-down menu that is associated with this field.

Creating a Service

31

Page 32: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

If the server is not reachable from the NetScaler or is not active, the service isdesignated as DOWN.

serviceType

The type of connections that the service will handle. Possible values: HTTP, FTP, TCP,UDP, SSL, SSL_BRIDGE, SSL_TCP, NNTP, RPCSVR, DNS, ADNS, SNMP, RTSP, DHCPRA, ANY,SIP_UDP, DNS_TCP, ADNS_TCP, RADIUS, MYSQL, MSSQL, and RDP. Default: HTTP.

port

Port on which the service listens. The port number must be a positive number notgreater than 65534.

Note: For more information about the SSL and SSL_TCP service types, see SSL Offload andAcceleration.

To create a service by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, click Add.

3. In the Create Service dialog box, specify values for the following parameters, whichcorrespond to parameters described in “Parameters for creating a service” as shown:

• Service Name—name

• Server—serverName

• Protocol—serviceType

• Port—port4. Click Create, and then click Close. The service you created appears in the Services

pane.

Creating a Service

32

Page 33: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

33

Creating a Virtual Server

After you create your services, you must create a virtual server to accept traffic for theload balanced Web sites, applications, or servers. Once load balancing is configured, usersconnect to the load-balanced Web site, application, or server through the virtual server’s IPaddress or FQDN.

Note: The virtual server is designated as DOWN until you bind the services that youcreated to it, and until the NetScaler appliance connects to those services and verifiesthat they are operational. Only then is the virtual server designated as UP.

To create a virtual server by using the command lineinterface

At the command prompt, type:

add lb vserver <name> <serviceType> <ip> <port>

Example

add lb vserver Vserver-LB-1 HTTP 10.102.29.60 80

Parameters for creating a virtual servername

Name of the virtual server. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( )

IPAddress

IP address of the virtual server. This IP address can be an IPv4 or IPv6 address, and isusually a public IP address. Clients send connection requests to this IP address.

serviceType

The type of services to which the virtual server distributes requests. Possible values:HTTP, FTP, TCP, UDP, SSL, SSL_BRIDGE, SSL_TCP, NNTP, DNS, DHCPRA, ANY, SIP_UDP,DNS_TCP, RTSP, PUSH, SSL_PUSH, RADIUS, RDP, MYSQL, and MSSQL. Default: HTTP

port

Port on which the virtual server listens for client connections. The port number must bebetween 0-65535.

Page 34: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To create a virtual server by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, click Add.

3. In the Create Virtual Server (Load Balancing) dialog box, specify values for the followingparameters, which correspond to parameters described in “Parameters for creating avirtual server” as shown:

• Name—name

• IP Address—IPAddress

Note: If the virtual server uses IPv6, select the IPv6 check box and enter theaddress in IPv6 format (for example,1000:0000:0000:0000:0005:0600:700a:888b).

• Protocol—serviceType

• Port—port4. Click Create, and then click Close. The virtual server you created appears in the Load

Balancing Virtual Servers pane.

Creating a Virtual Server

34

Page 35: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

35

Binding Services to the Virtual Server

After you have created services and a virtual server, you must bind the services to thevirtual server. In most cases, services are bound to virtual servers of the same type, but youcan bind certain types of services to certain different types of virtual servers, as shownbelow.

Virtual Server Type Service Type Comment

HTTP SSL You would normally bind anSSL service to an HTTPvirtual server to doencryption.

SSL HTTP You would normally bind anHTTP service to an SSLvirtual server to do SSLoffloading.

SSL_TCP TCP You would normally bind aTCP service to an SSL_TCPvirtual server to do SSLoffloading for other TCP(SSL decryption withoutcontent awareness).

The state of the services bound to a virtual server determines the state of the virtualserver: if all of the bound services are DOWN, the virtual server is marked DOWN, and if anyof the bound services is UP or OUT OF SERVICE, the state of the virtual server is UP.

To bind a service to a load balancing virtual server byusing the command line interface

At the command prompt, type:

bind lb vserver <name> <serviceName>

Example

bind lb vserver Vserver-LB-1 Service-HTTP-1

To bind a service to a load balancing virtual server byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

Page 36: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

2. In the details pane, select the virtual server for which you want to bind the service.

3. Click Open.

4. In the Configure Virtual Server (Load Balancing) dialog box, on the Services tab, selectthe Active check box next to the service that you want to bind to the virtual server.

5. Click OK.

Note: You can bind a service to multiple virtual servers.

Binding Services to the Virtual Server

36

Page 37: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

37

Verifying the Configuration

After finishing your basic configuration, you should view the properties of each service andload balancing virtual server in your load balancing setup to verify that each is configuredcorrectly. After the configuration is up and running, you should view the statistics for eachservice and load balancing virtual server to check for possible problems.

Page 38: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

38

Viewing the Properties of a Server Object

You can view properties such as the name, state, and IP address of any server object inyour NetScaler appliance configuration.

To view the properties of server objects by using thecommand line interface

At the command prompt, type:

show server <serverName>

Example

show server server-1

To view the properties of server objects by using theconfiguration utility

In the navigation pane, expand Load Balancing, and then click Servers. The parametervalues of the available servers appear in the details pane.

Page 39: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

39

Viewing the Properties of a Virtual Server

You can view properties such as the name, state, effective state, IP address, port, protocol,method, and number of bound services for your virtual servers. If you have configured morethan the basic load balancing settings, you can view the persistence settings for your virtualservers, any policies that are bound to them, and any cache redirection and contentswitching virtual servers that have been bound to the virtual servers.

To view the properties of a load balancing virtualserver by using the command line interface

At the command prompt, type:

show lb vserver <name>

Example

show lb vserver Vserver-LB-1

To view the properties of a load balancing virtualserver by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, click a virtual server to display its properties at the bottom of thedetails pane.

3. To view cache redirection and content switching virtual servers that are bound to thisvirtual server, click Show CS/CR Bindings.

Page 40: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

40

Viewing the Properties of a Service

You can view the name, state, IP address, port, protocol, maximum client connection,maximum requests per connection, and server type of the configured services, and use thisinformation to troubleshoot any mistake in the service configuration.

To view the properties of services by using thecommand line interface

At the command prompt, type:

show service <name>

Example

show service Service-HTTP-1

To view the properties of services by using theconfiguration utility

In the navigation pane, expand Load Balancing, and then click Services. The details of theavailable services appear on the Services pane.

Page 41: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

41

Viewing the Bindings of a Service

You can view the list of virtual servers to which the service is bound. The bindinginformation also provides the name, IP address, port and state of the virtual servers towhich the services are bound. You can use the binding information to troubleshoot anyproblem with binding the services to virtual servers.

To view the bindings of a service by using thecommand line

At the command prompt, type:

show service bindings <name>

Example

show service bindings Service-HTTP-1

To view the bindings of a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service whose binding information you want to view.

3. Click Show Bindings. The bindings of the service you selected appear in the Bindingdetails for Service: ServiceName dialog box.

Page 42: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

42

Viewing the Statistics of a Virtual Server

To evaluate the performance of virtual servers or to troubleshoot problems, you can displaydetails of the virtual servers configured on the NetScaler appliance. You can display asummary of statistics for all the virtual servers, or you can specify the name of a virtualserver to display the statistics only for that virtual server. You can display the followingdetails:

• Name

• IP address

• Port

• Protocol

• State of the virtual server

• Rate of requests received

• Rate of hits

To display virtual server statistics by using thecommand line interface

To display a summary of the statistics for all the virtual servers currently configured on theNetScaler, or for a single virtual server, at the command prompt, type:

stat lb vserver [-detail] [<name>]

Example

>stat lb vserver -detailVirtual Server(s) Summary vsvrIP port Protocol State Req/s Hits/sOne * 80 HTTP UP 5/s 0/sTwo * 0 TCP DOWN 0/s 0/sThree * 2598 TCP DOWN 0/s 0/sdnsVirtualNS 10.102.29.90 53 DNS DOWN 0/s 0/sBRVSERV 10.10.1.1 80 HTTP DOWN 0/s 0/sLBVIP 10.102.29.66 80 HTTP UP 0/s 0/s Done

Page 43: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Parameters for displaying statisticsdetail

Include the statistics for hits per second and the total number of hits.

name

Name of the virtual server whose statistics are displayed.

To display virtual server statistics by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. If you want to display the statistics for only one virtual server, in the details pane,select the virtual server whose statistics you want to display.

3. In the details pane, click Statistics.

Viewing the Statistics of a Virtual Server

43

Page 44: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

44

Viewing the Statistics of a Service

You can view the rate of requests, responses, request bytes, response bytes, current clientconnections, requests in surge queue, current server connections, and so forth using theservice statistics.

To view the statistics of a service by using thecommand line interface

At the command prompt, type:

stat service <name>

Example

stat service Service-HTTP-1

To view the statistics of a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service whose statistics you want to view (for example,Service-HTTP-1).

3. Click Statistics. The statistics appear in a new window.

Page 45: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

45

Customizing a Load BalancingConfiguration

After you configure a basic load balancing setup, you can make a number of modificationsto it so that it distributes load exactly as you need. The load balancing feature is complex.You can modify the basic elements by changing the load balancing algorithm, configuringload balancing groups and using them to create your load balancing configuration,configuring persistent client-server connections, configuring the redirection mode, andassigning different weights to different services that have different capacities.

The default load balancing algorithm on the NetScaler appliance is the least connectionmethod, which configures the appliance to send each incoming connection to the servicethat is currently handling the fewest connections. You can specify different load balancingalgorithms, each of which is suited to different conditions.

To accommodate applications such as shopping carts, which require that all requests fromthe same user be directed to the same server, you can configure the appliance to maintainpersistent connections between clients and servers. You can also specify persistence for agroup of virtual servers, causing the appliance to direct individual client requests to thesame service regardless of which virtual server in the group receives the client request.

You can enable and configure the redirection mode that the appliance uses whenredirecting user requests, choosing between IP-based and MAC-based forwarding. You canassign weights to different services, specifying what percentage of incoming load should bedirected to each service, so that you can include servers with different capacities in thesame load balancing setup without overloading the lower-capacity servers or allowing thehigher-capacity servers to sit idle.

Page 46: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

46

Load Balancing Algorithms

The load balancing algorithm defines the criteria that the NetScaler appliance uses toselect the service to which to redirect each client request. Different load balancingalgorithms use different criteria. For example, the least connection algorithm selects theservice with the fewest active connections, while the round robin algorithm maintains arunning queue of active services, distributes each connection to the next service in thequeue, and then sends that service to the end of the queue.

Some load balancing algorithms are best suited to handling traffic on websites, others tomanaging traffic to DNS servers, and others to handling complex web applications used ine-commerce or on company LANs or WANs. The following table lists each load balancingalgorithm that the NetScaler appliance supports, with a brief description of how eachoperates.

Name Server Selection Based On

LEASTCONNECTION Which service currently has the fewestclient connections. This is the default loadbalancing algorithm.

ROUNDROBIN Which service is at the top of a list ofservices. After that service is selected fora connection, it moves to the bottom ofthe list.

LEASTRESPONSETIME Which load balanced server currently hasthe quickest response time.

URLHASH A hash of the destination URL.

DOMAINHASH A hash of the destination domain.

DESTINATIONIPHASH A hash of the destination IP address.

SOURCEIPHASH A hash of the source IP address.

SRCIPDESTIPHASH A hash of the source and destination IPaddresses.

CALLIDHASH A hash of the call ID in the SIP header.

SRCIPSRCPORTHASH A hash of the client's IP address and port.

LEASTBANDWIDTH Which service currently has the fewestbandwidth constraints.

LEASTPACKETS Which service currently is receiving thefewest packets.

CUSTOMLOAD Data from a load monitor.

TOKEN The configured token.

LRTM Fewest active connections and the lowestaverage response time.

Depending on the protocol of the service that it is load balancing, the NetScaler appliancesets up each connection between client and server to last for a different time interval. This

Page 47: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

is called load balancing granularity, of which are three types: request-based,connection-based, and time-based granularity. The following table describes each type ofgranularity and when each is used.

Granularity Types of Load BalancedService

Specifies

Request -based HTTP or HTTPS A new service is chosen foreach HTTP request,independent of TCPconnections. As with allHTTP requests, after theWeb server fulfills therequest, the connection isclosed.

Connection-based TCP and TCP-basedprotocols other than HTTP

A service is chosen forevery new TCP connection.The connection persistsuntil terminated by eitherthe service or the client.

Time-based UDP and other IP protocols A new service is chosen foreach UDP packet. Uponselection of a service, asession is created betweenthe service and a client fora specified period of time.When the time expires, thesession is deleted and anew service is chosen forany additional packets,even if those packets comefrom the same client.

During startup of a virtual server, or whenever the state of a virtual server changes, thevirtual server can initially use the round robin method to distribute the client requestsamong the physical servers. This type of distribution, referred to as startup round robin,helps prevent unnecessary load on a single server as the initial requests are served. Afterusing the round robin method at the startup, the virtual server switches to the loadbalancing method specified on the virtual server.

The Startup RR Factor works in the following manner:

• If the Startup RR Factor is set to zero, the NetScaler switches to the specified loadbalancing method depending on the request rate.

• If the Startup RR Factor is any number other than zero, NetScaler uses the round robinmethod for the specified number of requests before switching to the specified loadbalancing method.

• By default, the Startup RR Factor is set to zero.

Note: You cannot set the startup RR Factor for an individual virtual server. The value youspecify applies to all the virtual servers on the NetScaler appliance.

To set the startup round-robin factor by using the command line interface

Load Balancing Algorithms

47

Page 48: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

At the command prompt, type:

set lb parameter -startupRRFactor <positive_integer>

Example

set lb parameter -startupRRFactor 25000

Parameter for setting the startup round-robin factor

startupRRFactor

The number of requests for which the virtual server is to apply the round robin loadbalancing method (slow start mode) before switching to the load balancing methodconfigured on the virtual server. Minimum value: 0, Maximum value: 4294967295.Default: 0.

To set the startup round-robin factor by using the configuration utility

1. In the navigation pane, click Load Balancing.

2. Under Settings, click Configure Load Balancing Parameters.

3. In the Configure Load Balancing Parameters dialog box, for Startup RR Factor type avalue.

4. Click OK.

Load Balancing Algorithms

48

Page 49: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

49

The Least Connection Method

When a virtual server is configured to use the least connection load balancing algorithm (ormethod), it selects the service with the fewest active connections. This is the defaultmethod, because, in most circumstances, it provides the best performance.

For TCP, HTTP, HTTPS, and SSL_TCP services, the NetScaler appliance includes thefollowing connection types in its list of existing connections:

• Active connections to a service. Connections representing requests that a client hassent to the virtual server and that the virtual server has forwarded to a service. ForHTTP and HTTPS services, active connections represent only those HTTP or HTTPSrequests that have not yet received a response.

• Waiting connections in the surge queue. Any connections to the virtual server that arewaiting in a surge queue and have not yet been forwarded to a service. Connections canbuild up in the surge queue at any time, for any of the following reasons:

• Your services have connection limits, and all services in your load balancingconfiguration are at that limit.

• The surge protection feature is configured and has been activated by a surge inrequests to the virtual server.

• The load-balanced server has reached an internal limit and therefore does not openany new connections. (For example, an Apache server’s connection limit isreached.)

When a virtual server uses the least connection method, it considers the waitingconnections as belonging to the specific service. Therefore, it does not open newconnections to those services.

For UDP services, the connections that the least connection algorithm considers include allsessions between the client and a service. These sessions are logical, time-based entities.When the first UDP packet in a session arrives, the NetScaler appliance creates a sessionbetween the source IP address and port and the destination IP address and port.

For Real-Time Streaming Protocol (RTSP) connections, the NetScaler appliance uses thenumber of active control connections to determine the lowest number of connections to anRTSP service.

The following example shows how a virtual server selects a service for load balancing byusing the least connection method. Consider the following three services:

• Service-HTTP-1 is handling 3 active transactions.

• Service-HTTP-2 is handling 15 active transactions.

• Service-HTTP-3 is not handling any active transactions.

The following diagram illustrates how the NetScaler appliance forwards incoming requestswhen using the least connection method.

Page 50: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 1. Mechanism of the Least Connections Load Balancing Method

In this diagram, the virtual server selects the service for each incoming connection bychoosing the server with the fewest active transactions.

Connections are forwarded as follows:

• Service-HTTP-3 receives the first request, because it is not handling any activetransactions.

Note: The service with no active transaction is selected first.

• Service-HTTP-3 receives the second and third requests because the service has the nextleast number of active transactions.

• Service-HTTP-1 receives the fourth request Because Service-HTTP-1 and Service-HTTP-3have same number of active transactions, the virtual server uses the round robinmethod to choose between them.

• Service-HTTP-3 receives the fifth request.

• Service-HTTP-1 receives the sixth request, and so on, until both Service-HTTP-1 andService-HTTP-3 are handling the same number of requests as Service-HTTP-2. At thattime, the NetScaler appliance starts forwarding requests to Service-HTTP-2 when it isthe least loaded service or its turn comes up in the round robin queue.

Note: If connections to Service-HTTP-2 close, it might get new connections beforeeach of the other two services has 15 active transactions.

The following table explains how connections are distributed in the three-service loadbalancing setup described above.

The Least Connection Method

50

Page 51: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

IncomingConnection

Service Selected Current Number ofActive Connections

Remarks

Request-1 Service-HTTP-3

(N = 0)

1 Service-HTTP-3 hasthe fewest activeconnections.

Request-2 Service-HTTP-3

(N = 1)

2

Request-3 Service-HTTP-3

(N = 2)

3  

Request-4 Service-HTTP-1

(N = 3)

4 Service-HTTP-1 andService-HTTP-3have the samenumber of activeconnections.Request-5 Service-HTTP-3

(N = 3)

4

Request-6 Service-HTTP-1

(N = 4)

5  

Request-7 Service-HTTP-3

(N = 4)

5  

Request-8 Service-HTTP-1

(N = 5)

6  

Service-HTTP-2 is selected for load balancing when it completes its active transactionsand the current connections to it close, or when the other services (Service-HTTP-1 andService-HTTP-3) have 15 or more connections each.

The NetScaler appliance can also use the least connection method when weights areassigned to services. It selects a service by using the value (Nw) of the following expression:

Nw = (Number of active transactions) * (10000 / weight)

The following example shows how the NetScaler appliance selects a service for loadbalancing by using the least connection method when weights are assigned to services. Inthe preceding example, suppose Service-HTTP-1 is assigned a weight of 2, Service-HTTP-2 isassigned a weight of 3, and Service-HTTP-3 is assigned a weight of 4. Connections areforwarded as follows:

• Service-HTTP-3 receives the first because the service is not handling any activetransactions.

Note: If services are not handling any active transactions, the NetScaler applianceuses the round robin method regardless of the weights assigned to each of theservices.

• Service-HTTP-3 receives the second, third, fourth, fifth, sixth, and seventh requestsbecause the service has lowest Nw value.

The Least Connection Method

51

Page 52: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Service-HTTP-1 receives the eighth request. Because Service-HTTP-1 andService-HTTP-3 now have same Nw value, the NetScaler performs load balancing in around robin manner. Therefore, Service-HTTP-3 receives the ninth request.

The following table explains how connections are distributed on the three-service loadbalancing setup that is described above.

Request Received Service Selected Current Nw(Number of activetransactions) *(10000 / weight)value

Remarks

Request-1 Service-HTTP-3

(Nw = 0)

Nw = 2500 Service-HTTP-3 hasthe lowest Nwvalue.

Request-2 Service-HTTP-3

(Nw = 2500)

Nw = 5000  

Request-3 Service-HTTP-3

(Nw = 5000)

Nw = 7500  

Request-4 Service-HTTP-3

(Nw = 7500)

Nw = 10000  

Request-5 Service-HTTP-3

(Nw = 10000)

Nw = 12500  

Request-6 Service-HTTP-3

(Nw = 12500)

Nw = 15000  

Request-7 Service-HTTP-1

(Nw = 15000)

Nw = 20000 Service-HTTP-1 andService-HTTP-3have the same NwvaluesRequest-8 Service-HTTP-3

(Nw = 15000)

Nw = 17500

Service-HTTP-2 is selected for load balancing when it completes its active transactions orwhen the Nw value of other services (Service-HTTP-1 and Service-HTTP-3) is equal to50000.

The following diagram illustrates how the NetScaler appliance uses the least connectionmethod when weights are assigned to the services.

The Least Connection Method

52

Page 53: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 2. Mechanism of the Least Connections Load Balancing Method when Weights areAssigned

To configure the least connection method, see Configuring a Load Balancing Method thatDoes Not Include a Policy.

The Least Connection Method

53

Page 54: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

54

The Round Robin Method

When a load balancing virtual server is configured to use the round robin method, itcontinuously rotates a list of the services that are bound to it. When the virtual serverreceives a request, it assigns the connection to the first service in the list, and then movesthat service to the bottom of the list.

The following diagram illustrates how the NetScaler appliance uses the round robin methodwith a load balancing setup that contains three load-balanced servers and their associatedservices.

Figure 1. How the Round Robin Load Balancing Method Works

If you assign a different weight to each service, the NetScaler appliance performs weightedround robin distribution of incoming connections. It does this by skipping thelower-weighted services at appropriate intervals.

For example, assume that you have a load balancing setup with three services. You setService-HTTP-1 to a weight of 2, Service-HTTP-2 to a weight of 3, and Service-HTTP-3 to aweight of 4. The services are bound to Vserver-LB-1, which is configured to use the roundrobin method. With this setup, incoming requests are delivered as follows:

• Service-HTTP-1 receives the first request.

• Service-HTTP-2 receives the second request.

Page 55: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Service-HTTP-3 receives the third request.

• Service-HTTP-1 receives the fourth request.

• Service-HTTP-2 receives the fifth request.

• Service-HTTP-3 receives the sixth request.

• Service-HTTP-2 receives the seventh request.

• Service-HTTP-3 receives both the eighth and the ninth requests.

Note: You can also configure weights on services to prevent multiple services from usingthe same server and overloading the server.

A new cycle then begins, using the same pattern.

The following diagram illustrates the weighted round robin method.

Figure 2. How the Round Robin Load Balancing Method Works with Weighted Services

To configure the round robin method, see Configuring a Load Balancing Method that DoesNot Include a Policy.

The Round Robin Method

55

Page 56: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

56

The Least Response Time Method

When the load balancing virtual server is configured to use the least response time method,it selects the service with the fewest active connections and the lowest average responsetime. You can configure this method for HTTP and Secure Sockets Layer (SSL) services only.The response time (also called Time to First Byte, or TTFB) is the time interval betweensending a request packet to a service and receiving the first response packet from theservice. The NetScaler appliance uses response code 200 to calculate TTFB.

The following example shows how a virtual server selects a service for load balancing byusing the least response time method. Consider the following three services:

• Service-HTTP-1 is handling three active transactions and TTFB is two seconds.

• Service-HTTP-2 is handling seven active transactions and TTFB is one second.

• Service-HTTP-3 is not handling any active transactions and TTFB is two seconds.

The following diagram illustrates how the NetScaler appliance uses the least response timemethod to forward the connections.

Figure 1. How the Least Response Time Load Balancing Method Works

The virtual server selects a service by multiplying the number of active transactions by theTTFB for each service and then selecting the service with the lowest result. For theexample shown above, the virtual server forwards requests as follows:

Page 57: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Service-HTTP-3 receives the first request, because the service is not handling any activetransactions.

• Service-HTTP-3 also receives the second and third requests, because the result is lowestof the three services.

• Service-HTTP-1 receives the fourth request. Since Service-HTTP-1 and Service-HTTP-3have the same result, the NetScaler appliance chooses between them by applying theRound Robin method.

• Service-HTTP-3 receives the fifth request.

• Service-HTTP-2 receives the sixth request, because at this point it has the lowestresult.

• Because Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 all have the same resultat this point, the NetScaler switches to the round robin method, and continues todistribute connections using that method.

The following table explains how connections are distributed in the three-service loadbalancing setup described above.

Request Received Service Selected Current N Value(Number of ActiveTransactions *TTFB)

Remarks

Request-1 Service-HTTP-3

(N = 0)

N = 2 Service-HTTP-3 hasthe lowest N value.

Request-2 Service-HTTP-3

(N = 2)

N = 4  

Request-3 Service-HTTP-3

(N = 3)

N = 6  

Request-4 Service-HTTP-1

(N = 6)

N = 8 Service-HTTP-1 andService-HTTP-3have the same Nvalues.Request-5 Service-HTTP-3

(N = 6)

N = 8

Request-6 Service-HTTP-2

(N = 7)

N = 8 Service-HTTP-2 hasthe lowest N value.

Request-7 Service-HTTP-1

(N = 8)

N = 15 Service-HTTP-1,Service-HTTP-2, andService-HTTP-3have the same Nvalues.Request-8 Service-HTTP-2

(N = 8)

N = 9

The virtual server selects a service by using the value (Nw) in the following expression:

The Least Response Time Method

57

Page 58: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Nw = (N) * (10000 / weight)

Suppose Service-HTTP-1 is assigned a weight of 2, Service-HTTP-2 is assigned weight of 3,and Service-HTTP-3 is assigned weight of 4.

The NetScaler appliance distributes requests as follows:

• Service-HTTP-3 receives the first request, because it is not handling any activetransactions.

If services are not handling any active transactions, the NetScaler selects themregardless of the weights assigned to them.

• Service-HTTP-3 receives the second, third, fourth, and fifth requests, because thisservice has the lowest Nw value.

• Service-HTTP-2 receives the sixth request, because this service has the lowest Nwvalue.

• Service-HTTP-3 receives the seventh request, because this service has the lowest Nwvalue.

• Service-HTTP-2 receives the eighth request, because this service has the lowest Nwvalue.

Service-HTTP-1 has the lowest weight and therefore the highest Nw value, so the virtualserver does not select it for load balancing.

The following table explains how connections are distributed in the three-service loadbalancing setup described above.

Request Received Service Selected Current Nw Value(Number of ActiveTransactions) *(10000 / Weight)

Remarks

Request-1 Service-HTTP-3

(Nw = 0)

Nw = 2500 Service-HTTP-3 hasthe lowest Nwvalue.

Request-2 Service-HTTP-3

(Nw = 2500

Nw = 5000  

Request-3 Service-HTTP-3

(Nw = 5000)

Nw = 15000  

Request-4 Service-HTTP-3

(Nw = 15000)

Nw = 20000  

Request-5 Service-HTTP-3

(Nw = 20000)

Nw = 25000  

The Least Response Time Method

58

Page 59: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Request-6 Service-HTTP-2

(Nw = 23333.34)

Nw = 26666.67 Service-HTTP-2 hasthe lowest Nwvalue.

Request-7 Service-HTTP-3

(Nw = 25000)

Nw= 30000 Service-HTTP-3 hasthe lowest Nwvalue.

Request-8 Service-HTTP-2

(Nw = 26666.67)

Nw = 33333.34 Service-HTTP-2 hasthe lowest Nwvalue.

Service-HTTP-1 is selected for load balancing when it completes its active transactions orwhen the Nw values of other services (Service-HTTP-2 and Service-HTTP-3) are equal to105000.

The following diagram illustrates how the NetScaler appliance uses the least response timemethod when weights are assigned.

Figure 2. How the Least Response Time Load Balancing Method Works When Weights AreAssigned

To configure the least response time method, see Configuring a Load Balancing Method thatDoes Not Include a Policy.

When a load balancing virtual server is configured to use the least response time method with monitors, it uses the existing monitoring infrastructure to select the service with the smallest number of active transactions and the fastest average response time. Before you use the least response time method with monitoring, you must bind application-specific monitors to each service and enable least response time method mode on these monitors. The NetScaler appliance then makes load balancing decisions based on the response times it calculates from monitoring probes. For more information about configuring monitors, see

The Least Response Time Method

59

Page 60: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Configuring Monitors in a Load Balancing Setup.

You can use the least response time method with monitors to select non-HTTP andnon-HTTPS services. You can also use this method when several monitors are bound to aservice. Each monitor determines the response time by using the protocol that it measuresfor the service that it is bound to. The virtual server then calculates an average responsetime for that service by averaging the results.

The following table summarizes how response times are calculated for various monitors.

Monitor Response Time Calculation

PING Time difference between the ICMP ECHOrequest and the ICMP ECHO response.

TCP Time difference between the SYN requestand the SYN+ACK response.

HTTP Time difference between the HTTP request(after the TCP connection is established)and the HTTP response.

TCP-ECV Time difference between the time thedata send string is sent and the datareceive string is returned.

A tcp-ecv monitor without the send andreceive strings is considered to have anincorrect configuration.

HTTP-ECV Time difference between the HTTP requestand the HTTP response.

UDP-ECV Time difference between the UDP sendstring and the UDP receive string.

A udp-ecv monitor without the receivestring is considered to have an incorrectconfiguration.

DNS Time difference between a DNS query andthe DNS response.

TCPS Time difference between a SYN requestand the SSL handshake completion.

FTP Time difference between the sending ofthe user name and the completion of userauthentication.

HTTPS (monitors HTTPS requests) Time difference is same as for the HTTPmonitor.

HTTPS-ECV (monitors HTTPS requests) Time difference is same as for theHTTP-ECV monitor

USER Time difference between the time when arequest is sent to the dispatcher and thetime when the dispatcher response isreceived.

The Least Response Time Method

60

Page 61: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The following example shows how the NetScaler appliance selects a service for loadbalancing by using the least response time method with monitors. Consider the followingthree services:

• Service-HTTP-1 is handling 3 active transactions and the response time is five seconds.

• Service-HTTP-2 is handling 7 active transactions and the response time is one second.

• Service-HTTP-3 is not handling any active transactions and the response time is twoseconds.

The following diagram illustrates the process that the NetScaler appliance follows when itforwards requests.

Figure 3. How the Least Response Time Load Balancing Method Works When Using Monitors

The virtual server selects a service by using the value (N) in the following expression:

N = Number of active transactions * Response time that is determined by the monitor

The virtual server delivers requests as follows:

• Service-HTTP-3 receives the first request, because this service is not handling anyactive transaction.

• Service-HTTP-3 receives the second, third, and fourth requests, because this servicehas the lowest N value.

• Service-HTTP-2 receives the fifth request, because this service has the lowest N value.

The Least Response Time Method

61

Page 62: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Since both Service-HTTP-2 and Service-HTTP-3 currently have the same N value, theNetScaler appliance switches to the round robin method Therefore, Service-HTTP-3receives the sixth request.

• Service-HTTP-2 receives the seventh and eighth requests, because this service has thelowest N value.

Service-HTTP-1 is not considered for load balancing, because it is more heavily loaded (hasthe highest N value) when compared to the other two services. However, if Service-HTTP-1completes its active transactions, the NetScaler appliance again considers that service forload balancing.

The following table summarizes how N is calculated for the services.

Request Received Service Selected Current N Value(Number of ActiveTransactions)

Remarks

Request-1 Service-HTTP-3

(N = 0)

N = 2 Service-HTTP-3 hasthe lowest N value.

Request-2 Service-HTTP-3

(N = 2)

N = 4  

Request-3 Service-HTTP-3

(N = 4)

N = 6  

Request-4 Service-HTTP-3

(N = 6)

N = 8  

Request-5 Service-HTTP-2

(N = 7)

N = 8 Service-HTTP-1 andService-HTTP-3have the same Nvalues.Request-6 Service-HTTP-3

(N = 8)

N = 10

Request-7 Service-HTTP-2

(N = 8)

N = 9 Service-HTTP-2 hasthe lowest N value.

Request-8 Service-HTTP-1

(N = 9)

N = 10  

Service-HTTP-1 is again selected for load balancing when it completes its activetransactions or when the N value of the other services (Service-HTTP-2 andService-HTTP-3) is equal to 15.

The NetScaler appliance also performs load balancing by using the number of activetransactions, response time, and weights if different weights are assigned to services. TheNetScaler appliance selects the service by using the value (Nw) in the following expression:

Nw = (N) * (10000 / weight)

The Least Response Time Method

62

Page 63: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

As in the preceding example, suppose Service-HTTP-1 is assigned a weight of 2,Service-HTTP-2 is assigned a weight of 3, and Service-HTTP-3 is assigned a weight of 4.

The NetScaler appliance delivers requests as follows:

• Service-HTTP-3 receives the first request, because it is not handling any activetransactions.

• Service-HTTP-3 receives the second, third, and fourth requests, because this servicehas the lowest Nw value.

• Service-HTTP-2 receives the fifth request, because this service has the lowest Nwvalue.

• Service-HTTP-3 receives the sixth request, because this service has the lowest Nwvalue.

• Service-HTTP-2 receives the seventh and the eighth requests, because this service hasthe lowest Nw value.

Service-HTTP-1 has the lowest weight and the highest Nw value, so the NetScaler appliancedoes not select it for load balancing.

The following table summarizes how Nw is calculated for various monitors.

Request Received Service Selected Current Nw Value(Number of ActiveTransactions) *(10000 / Weight)

Remarks

Request-1 Service-HTTP-3

(Nw = 0)

Nw = 5000 Service-HTTP-3 hasthe lowest Nwvalue.

Request-2 Service-HTTP-3

(Nw = 5000

Nw = 10000  

Request-3 Service-HTTP-3

(Nw = 15000)

Nw = 20000  

Request-4 Service-HTTP-3

(Nw = 20000)

Nw = 25000  

Request-5 Service-HTTP-2

(Nw = 23333.34)

Nw = 26666.67 Service-HTTP-2 hasthe lowest Nwvalue.

Request-6 Service-HTTP-3

(Nw = 25000)

Nw = 30000 Service-HTTP-3 hasthe lowest Nwvalue.

Request-7 Service-HTTP-2

(Nw = 23333.34)

Nw= 26666.67 Service-HTTP-2 hasthe lowest Nwvalue.

The Least Response Time Method

63

Page 64: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Request-8 Service-HTTP-2

(Nw =25000)

Nw = 30000 Service-HTTP-2 hasthe lowest Nwvalue.

Service-HTTP-1 is selected for load balancing when it completes its active transactions orwhen the Nw value of the other services (Service-HTTP-2 and Service-HTTP-3) is equal to75000.

The following diagram illustrates how the virtual server uses the least response timemethod when weights are assigned.

Figure 4. How the Least Response Time Load Balancing Method with Monitors Works WhenWeights Are Assigned

To configure the least response time method using monitors, see Configuring a LoadBalancing Method that Does Not Include a Policy.

The Least Response Time Method

64

Page 65: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

65

About Hashing Methods

Load balancing methods based on hashes of certain connection information or headerinformation constitute the majority of the NetScaler appliance’s load balancing methods.Hashes are shorter and easier to use than the information that they are based on, whileretaining enough information to ensure that no two different pieces of informationgenerate the same hash and are therefore confused with one another.

You can use the hashing load balancing methods in an environment where a cache serves awide range of content from the Internet or specified origin servers. Caching requestsreduces request and response latency, and ensures better resource (CPU) utilization,making caching popular on heavily used Web sites and application servers. Since these sitesalso benefit from load balancing, hashing load balancing methods are widely useful.

The NetScaler provides the following hashing methods:

• URL hash method

• Domain hash method

• Destination IP hash method

• Source IP hash method

• Source IP Destination IP hash method

• Source IP Source Port hash method

• Call ID hash method

• Token method

These hashing algorithms ensure minimal disruption when services are added to or deletedfrom your load balancing setup. Most of them calculate two hash values:

• A hash of the service’s IP address and port.

• A hash of the incoming URL, the domain name, the source IP address, the destination IPaddress, or the source and destination IP addresses, depending on the configured hashmethod.

The NetScaler appliance then generates a new hash value by using both of those hashvalues. Finally, it forwards the request to the service with highest hash value. As theappliance computes a hash value for each request and selects the service that will processthe request, it populates a cache. Subsequent requests with the same hash value are sentto the same service. The following flow chart illustrates this process.

Page 66: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 1. How theHashing MethodsDistributeRequests

Hashing methods can be applied to IPv4 and IPv6 addresses.

Consider a scenario where three services (Service-HTTP-1, Service-HTTP-2, andService-HTTP-3) are bound to a virtual server, any hash method is configured, and the hashvalue is Hash1. When the configured services are UP, the request is sent to Service-HTTP-1.If Service-HTTP-1 is down, the NetScaler appliance calculates the hash value for the last log

About Hashing Methods

66

Page 67: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

of the number of services. The NetScaler then selects the service with the highest hashvalue, such as Service-HTTP-2. The following diagram illustrates this process.

Figure 2. Entity Model for Hashing Methods

Note: If the NetScaler appliance fails to select a service by using a hashing method, itdefaults to the least connection method to select a service for the incoming request. Youshould adjust server pools by removing services during periods of low traffic to enable thecaches to repopulate without affecting performance on your load balancing setup.

About Hashing Methods

67

Page 68: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

68

The URL Hash Method

When you configure the NetScaler appliance to use the URL hash method for load balancingthe services, for selecting a service, the NetScaler generates a hash value of the HTTP URLpresent in the incoming request. If the service selected by the hash value is DOWN, thealgorithm has a method to select another service from the list of active services. TheNetScaler caches the hashed value of the URL, and when it receives subsequent requeststhat use the same URL, it forwards them to the same service. If the NetScaler cannot parsean incoming request, it uses the round robin method for load balancing instead of the URLhash method.

For generating the hash value, NetScaler uses a specific algorithm and considers a part ofthe URL. By default, the NetScaler considers the first 80 bytes of the URL. If the URL is ofless than 80 bytes, the complete URL is used. You can specify a different length. The hashlength can be from 1 to 4096 bytes. Generally, if long URLs are used where only a smallnumber of characters are different, it is a good idea to make the hash length as high aspossible to try to ensure a more even load distribution.

Consider a scenario where three services, Service-HTTP-1, Service-HTTP-2, andService-HTTP-3, are bound to a virtual server, and the load balancing method configured onthe virtual server is the URL hash method. The virtual server receives a request and thehash value of the URL is U1. NetScaler selects Service-HTTP-1. If Service-HTTP-1 is DOWN,the NetScaler selects Service-HTTP-2.

The following diagram illustrates this process.

Page 69: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 1. How URL Hashing Operates

If both Service-HTTP-1 and Service-HTTP-2 are DOWN, NetScaler sends requests with hashvalue U1 to Service-HTTP-3.

If Service-HTTP-1 and Service-HTTP-2 are down, requests that generate the hash URL1 aresent to Service-HTTP-3. If these services are UP, requests that generate the hash URL1 aredistributed in the following manner:

• If the Service-HTTP-2 is up, the request is sent to Service-HTTP-2.

• If the Service-HTTP-1 is up, the request is sent to Service-HTTP-1.

• If Service-HTTP-1 and Service-HTTP-2 are up at the same time, the request is sent toService-HTTP-1.

To configure the URL hash method, see Configuring a Load Balancing Method that Does NotInclude a Policy. Select the load balancing method as URL Hash, and set the hash length tothe number of bytes to be used for generating the hash value.

The URL Hash Method

69

Page 70: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

70

The Domain Hash Method

A load balancing virtual server configured to use the domain hash method uses the hashedvalue of the domain name in the HTTP request to select a service. The domain name istaken from either the incoming URL or the Host header of the HTTP request. If the domainname appears in both the URL and the Host header, the NetScaler gives preference to theURL.

If you configure domain name hashing, and an incoming HTTP request does not contain adomain name, the NetScaler appliance defaults to the round robin method for that request.

The hash-value calculation uses the name length or hash length value, whichever is smaller.By default, the NetScaler appliance calculates the hash value from the first 80 bytes of thedomain name. To specify a different number of bytes in the domain name when calculatingthe hash value, you can set the hashLength parameter (Hash Length in the configurationutility) to a value of from 1 to 4096 (bytes).

To configure the domain hash method, see Configuring a Load Balancing Method that DoesNot Include a Policy.

Page 71: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

71

The Destination IP Hash Method

A load balancing virtual server configured to use the destination IP hash method uses thehashed value of the destination IP address to select a server. You can mask the destinationIP address to specify which part of it to use in the hash value calculation, so that requeststhat are from different networks but destined for the same subnet are all directed to thesame server. This method supports IPv4 and IPv6-based destination servers.

This load balancing method is appropriate for use with the cache redirection feature.

To configure the destination IP hash method for an IPv4 destination server, you set thenetMask parameter. To configure this method for an IPv6 destination server, you use thev6NetMaskLen parameter. In the configuration utility, text boxes for setting theseparameters appear when you select the Destination IP Hash method.

To configure the destination IP hash method, see Configuring a Load Balancing Method thatDoes Not Include a Policy.

Page 72: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

72

The Source IP Hash Method

A load balancing virtual server configured to use the source IP hash method uses the hashedvalue of the client IPv4 or IPv6 address to select a service. To direct all requests fromsource IP addresses that belong to a particular network to a specific destination server, youmust mask the source IP address. For IPv4 addresses, use the netMask parameter. For IPv6addresses, use the v6NetMaskLength parameter.

To configure the source IP hash method, see Configuring a Load Balancing Method that DoesNot Include a Policy.

Page 73: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

73

The Source IP Destination IP HashMethod

A load balancing virtual server configured to use the source IP destination IP hash methoduses the hashed value of the source and destination IP addresses (either IPv4 or IPv6) toselect a service. Hashing is symmetric; the hash-value is the same regardless of the order ofthe source and destination IPs. This ensures that all packets flowing from a particular clientto the same destination are directed to the same server.

To direct all requests that belong to a particular network to a specific destination server,you must mask the source IP address. For IPv4 addresses, use the netMask parameter. ForIPv6 addresses, use the v6NetMaskLength parameter.

To configure the source IP destination IP hash method, see Configuring a Load BalancingMethod that Does Not Include a Policy.

Page 74: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

74

The Source IP Source Port Hash Method

A load balancing virtual server configured to use the source IP source port hash method usesthe hash value of the source IP (either IPv4 or IPv6) and source port to select a service. Thisensures that all packets on a particular connection are directed to the same service.

This method is used in connection mirroring and firewall load balancing. For moreinformation about connection mirroring, see Connection Failover.

To direct all requests that belong to a particular network to a specific destination server,you must mask the source IP address. For IPv4 addresses, use the netMask parameter. ForIPv6 addresses, use the v6NetMaskLength parameter.

To configure the source IP source port hash method, see Configuring a Load BalancingMethod that Does Not Include a Policy.

Page 75: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

75

The Call ID Hash Method

A load balancing virtual server configured to use the call ID hash method uses the hashvalue of the call ID in the SIP header to select a service. Packets for a particular SIP sessionare therefore always directed to the same proxy server.

This method is applicable to SIP load balancing. For more information about SIP loadbalancing, see Monitoring SIP Services.

To configure the call ID hash method, see Configuring a Load Balancing Method that DoesNot Include a Policy.

Page 76: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

76

The Least Bandwidth Method

A load balancing virtual server configured to use the least bandwidth method selects theservice that is currently serving the least amount of traffic, measured in megabits persecond (Mbps). The following example shows how the virtual server selects a service forload balancing by using the least bandwidth method.

Consider three services, Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3.

• Service-HTTP-1 has 3 Mbps bandwidth.

• Service-HTTP-2 has 5 Mbps bandwidth.

• Service-HTTP-3 has 2 Mbps bandwidth.

The following diagram illustrates how the virtual server uses the least bandwidth method toforward requests to the three services.

Figure 1. How the Least Bandwidth Load Balancing Method Works

The virtual server selects the service by using the bandwidth value (N), which is the sum ofthe number of bytes transmitted and received over the previous 14 seconds. If each requestrequires 1 Mbps bandwidth, the NetScaler appliance delivers requests as follows:

• Service-HTTP-3 receives the first request, because this service has the lowest N value.

Page 77: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Since Service-HTTP-1 and Service-HTTP-3 now have same N value, the virtual serverswitches to the round robin method for these servers, alternating between them.Service-HTTP-1 receives the second request, Service-HTTP-3 receives the third request,Service-HTTP-1 receives the fourth request, Service-HTTP-3 receives the fifth request,and Service-HTTP-1 receives the sixth request.

• Since Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 now all have same N value,the virtual server includes Service-HTTP-2 in the round robin list. Therefore,Service-HTTP-2 receives the seventh request, Service-HTTP-3 receives the eighthrequest, and so on.

The following table summarizes how N is calculated.

Request Received Service Selected Current N Value Remarks

Request-1 Service-HTTP-3

(N = 2)

N = 3 Service-HTTP-3 hasthe lowest N value.

Request-2 Service-HTTP-1

(N = 3)

N = 4 Service-HTTP-1 andService-HTTP-3have the same Nvalues.Request-3 Service-HTTP-3

(N = 3)

N = 4

Request-4 Service-HTTP-1

(N = 4)

N = 5  

Request-5 Service-HTTP-3

(N = 4)

N = 5  

Request-6 Service-HTTP-1

(N = 5)

N = 6 Service-HTTP-1,Service-HTTP-2, andService-HTTP-3have the same Nvalues.Request-7 Service-HTTP-2

(N = 5)

N = 6

Request-8 Service-HTTP-3

(N = 5)

N = 6  

Note: If you enable the RTSP NAT option on the virtual server, the NetScaler applianceuses the number of data and control bytes exchanged to determine the bandwidth usagefor RTSP services. For more information about RTSP NAT option, see Managing RTSPConnections.

The NetScaler appliance also performs load balancing by using the bandwidth and weights ifdifferent weights are assigned to the services. It selects a service by using the value (Nw) inthe following expression:

Nw = (N) * (10000 / weight)

As in the preceding example, suppose Service-HTTP-1 is assigned a weight of 2,Service-HTTP-2 is assigned a weight of 3, and Service-HTTP-3 is assigned a weight of 4. The

The Least Bandwidth Method

77

Page 78: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

NetScaler appliance delivers requests as follows:

• Service-HTTP-3 receives the first second, third, fourth, and fifth requests, because thisservice has the lowest Nw value.

• Service-HTTP-1 receives the sixth request, because this service has the lowest Nwvalue.

• Service-HTTP-3 receives the seventh request, because this service has the lowest Nwvalue.

• Service-HTTP-2 receives the eighth request, because this service has the lowest Nwvalue.

The following table summarizes how Nw is calculated.

Request Received Service Selected Current Nw Value(Number of ActiveTransactions) *(10000 / Weight)

Remarks

Request-1 Service-HTTP-3

(Nw = 5000)

Nw = 5000 Service-HTTP-3 hasthe lowest Nwvalue.

Request-2 Service-HTTP-3

(Nw = 5000)

Nw = 7500  

Request-3 Service-HTTP-3

(Nw = 7500)

Nw = 10000  

Request-4 Service-HTTP-3

(Nw = 10000)

Nw = 12500  

Request-5 Service-HTTP-3

(Nw = 12500)

Nw = 15000  

Request-6 Service-HTTP-1

(Nw = 15000)

Nw = 20000 Service-HTTP-1 andService-HTTP-3have the same Nwvalue.Request-7 Service-HTTP-3

(Nw = 15000)

Nw = 17500

Request-8 Service-HTTP-2

(Nw = 16666.67)

Nw = 20000 Service-HTTP-2 hasthe lowest Nwvalue.

The following diagram illustrates how the virtual server uses the least bandwidth methodwhen weights are assigned to the services.

The Least Bandwidth Method

78

Page 79: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 2. How the Least Bandwidth Load Balancing Method Works When Weights AreAssigned

To configure the least bandwidth method, see Configuring a Load Balancing Method thatDoes Not Include a Policy.

The Least Bandwidth Method

79

Page 80: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

80

The Least Packets Method

A load balancing virtual server configured to use the least packets method selects theservice that has received the fewest packets in the last 14 seconds.

For example, consider three services, Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3.

• Service-HTTP-1 has handled three packets in last 14 seconds.

• Service-HTTP-2 has handled five packets in last 14 seconds.

• Service-HTTP-3 has handled two packets in last 14 seconds.

The following diagram illustrates how the NetScaler appliance uses the least packetsmethod to choose a service for each request that it receives.

Figure 1. How the Least Packets Load Balancing Method Works

The NetScaler appliance selects a service by using the number of packets (N) transmittedand received by each service in the last 14 seconds. Using this method, it delivers requestsas follows:

• Service-HTTP-3 receives the first request, because this service has the lowest N value.

• Since Service-HTTP-1 and Service-HTTP-3 now have the same N value, the virtual serverswitches to the round robin method. Service-HTTP-1 therefore receives the second

Page 81: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

request, Service-HTTP-3 receives the third request, Service-HTTP-1 receives the fourthrequest, Service-HTTP-3 receives the fifth request, and Service-HTTP-1 receives thesixth request.

• Since Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 all now have same N value,the virtual server switches to the round robin method for Service-HTTP-2 as well,including it in the round robin list. Therefore, Service-HTTP-2 receives the seventhrequest, Service-HTTP-3 receives the eighth request, and so on.

The following table summarizes how N is calculated.

Request Received Service Selected Current N Value Remarks

Request-1 Service-HTTP-3

(N = 2)

N = 3 Service-HTTP-3 hasthe lowest N value.

Request-2 Service-HTTP-1

(N = 3)

N = 4 Service-HTTP-1 andService-HTTP-3have the same Nvalues.Request-3 Service-HTTP-3

(N = 3)

N = 4

Request-4 Service-HTTP-1

(N = 4)

N = 5  

Request-5 Service-HTTP-3

(N = 4)

N = 5  

Request-6 Service-HTTP-1

(N = 5)

N = 6 Service-HTTP-1,Service-HTTP-2, andService-HTTP-3have the same Nvalues.Request-7 Service-HTTP-2

(N = 5)

N = 6

Request-8 Service-HTTP-3

(N = 5)

N = 6  

Note: If you enable the RTSP NAT option on the virtual server, the NetScaler uses thenumber of data and control packets to calculate the number of packets for RTSP services.For more information about RTSP NAT option, see Managing RTSP Connections.

The NetScaler appliance also performs load balancing by using the number of packets andweights when a different weight is assigned to each service. It selects a service by using thevalue (Nw) in the following expression:

Nw = (N) * (10000 / weight)

As in the preceding example, suppose Service-HTTP-1 is assigned a weight of 2,Service-HTTP-2 is assigned a weight of 3, and Service-HTTP-3 is assigned a weight of 4. TheNetScaler appliance delivers requests as follows:

The Least Packets Method

81

Page 82: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Service-HTTP-3 receives the first second, third, fourth, and fifth requests, because thisservice has the lowest Nw value.

• Service-HTTP-1 receives the sixth request, because this service has the lowest Nwvalue.

• Service-HTTP-3 receives the seventh request, because this service has the lowest Nwvalue.

• Service-HTTP-2 receives the eighth request, because this service has the lowest Nwvalue.

The following table summarizes how Nw is calculated.

Request Received Service Selected Current Nw Value(Number of ActiveTransactions) *(10000 / weight)

Remarks

Request-1 Service-HTTP-3

(Nw = 5000)

Nw = 5000 Service-HTTP-3 hasthe lowest Nwvalue.

Request-2 Service-HTTP-3

(Nw = 5000)

Nw = 7500  

Request-3 Service-HTTP-3

(Nw = 7500)

Nw = 10000  

Request-4 Service-HTTP-3

(Nw = 10000)

Nw = 12500  

Request-5 Service-HTTP-3

(Nw = 12500)

Nw = 15000  

Request-6 Service-HTTP-1

(Nw = 15000)

Nw = 20000 Service-HTTP-1 andService-HTTP-3have the same Nwvalue.Request-7 Service-HTTP-3

(Nw = 15000)

Nw = 17500

Request-8 Service-HTTP-2

(Nw = 16666.67)

Nw = 20000 Service-HTTP-2 hasthe lowest Nwvalue.

The following diagram illustrates how the virtual server uses the least packets method whenweights are assigned.

The Least Packets Method

82

Page 83: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 2. How the Least Packets Method Works When Weights Are Assigned

To configure the least packets method, see Configuring a Load Balancing Method that DoesNot Include a Policy.

The Least Packets Method

83

Page 84: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

84

The Custom Load Method

Custom load balancing is performed on server parameters such as CPU usage, memory, andresponse time. When using the custom load method, the NetScaler appliance usually selectsa service that is not handling any active transactions. If all of the services in the loadbalancing setup are handling active transactions, the appliance selects the service with thesmallest load. A special type of monitor, known as a load monitor, calculates the load oneach service in the network. The load monitors do not mark the state of a service, but theydo take services out of the load balancing decision when those services are not UP.

For more information about load monitors, see Understanding Load Monitors. The followingdiagram illustrates how a load monitor operates.

Figure 1. How Load Monitors Operate

The load monitor uses Simple Network Management Protocol (SNMP) probes to calculateload on each service by sending an SNMP GET request to the service. This request containsone or more object IDs (OIDs). The service responds with an SNMP GET response, withmetrics corresponding to the SNMP OIDs. The load monitor uses the response metrics,described below, to calculate the load on the service.

The load monitor calculates the load on a service by using the following parameters:

• Metrics values retrieved through SNMP probes that exist as tables in the NetScaler.

• Threshold value set for each metric.

Page 85: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Weight assigned to each metric.

For example, consider three services, Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3.

• Service-HTTP-1 is using 20 megabytes (MB) of memory.

• Service-HTTP-2 is using 70 MB of memory.

• Service-HTTP-3 is using 80 MB of memory.

The load balanced servers can export metrics such as CPU and memory usage to theservices, which can in turn provide them to the load monitor. The load monitor sends anSNMP GET request containing the OIDs 1.3.6.1.4.1.5951.4.1.1.41.1.5,1.3.6.1.4.1.5951.4.1.1.41.1.4, and 1.3.6.1.4.1.5951.4.1.1.41.1.3 to the services. SNMP OIDsof type STRING are not supported, because you cannot calculate the load by using a STRINGOID. Loads can be calculated by using other data types, such as INT and gauge32. The threeservices respond to the request. The NetScaler appliance compares the exported metrics,and then selects Service-HTTP-1 because it has more available memory. The followingdiagram illustrates this process.

Figure 2. How the Custom Load Method Works

If each request uses 10 MB memory, the NetScaler appliance delivers requests as follows:

• Service-HTTP-1 receives the first, second, third, fourth, and fifth requests, because thisservice has the lowest N value.

• Service-HTTP-1 and Service-HTTP-2 now have the same load, so the virtual serverreverts to the round robin method for these servers. Therefore, Service-HTTP-2receives the sixth request, and Service-HTTP-1 receives the seventh request.

The Custom Load Method

85

Page 86: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Since Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 all now have same load, thevirtual server reverts to the round robin method for Service-HTTP-3 as well. Therefore,Service-HTTP-3 receives the eighth request.

The following table summarizes how N is calculated.

Request received Service selected Current N Value(Number of ActiveTransactions)

Remarks

Request-1 Service-HTTP-1

(N = 20)

N = 30 Service-HTTP-3 hasthe lowest N value.

Request-2 Service-HTTP-1

(N = 30)

N = 40  

Request-3 Service-HTTP-1

(N = 40)

N = 50  

Request-4 Service-HTTP-1

(N = 50)

N = 60  

Request-5 Service-HTTP-1

(N = 60)

N = 70  

Request-6 Service-HTTP-1

(N = 70)

N = 80 Service-HTTP-2 andService-HTTP-3have the same Nvalues.Request-7 Service-HTTP-2

(N = 70)

N = 80

Request-8 Service-HTTP-1

(N = 80)

N = 90 Service-HTTP-1,Service-HTTP-2, andService-HTTP-3have the same Nvalues.

If different weights are assigned to the services, the custom load algorithm considers boththe load on each service and the weight assigned to each service. It selects a service byusing the value (Nw) in the following expression:

Nw = (N) * (10000 / weight)

As in the preceding example, suppose Service-HTTP-1 is assigned a weight of 4,Service-HTTP-2 is assigned a weight of 3, and Service-HTTP-3 is assigned a weight of 2. Ifeach request uses 10 MB memory, the NetScaler appliance delivers requests as follows:

• Service-HTTP-1 receives the first, second, third, fourth, fifth, sixth, seventh, andeighth requests, because this service has the lowest Nw value.

• Service-HTTP-2 receives the ninth request, because this service has the lowest Nwvalue.

The Custom Load Method

86

Page 87: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Service-HTTP-3 has the highest Nw value, and is therefore not considered for loadbalancing.

The following table summarizes how Nw is calculated.

Request received Service selected Current Nw Value(Number of ActiveTransactions) *(10000 / Weight)

Remarks

Request-1 Service-HTTP-1

(Nw = 50000)

Nw = 75000 Service-HTTP-1 hasthe lowest Nwvalue.

Request-2 Service-HTTP-1

(Nw = 5000)

Nw = 100000  

Request-3 Service-HTTP-1

(Nw = 15000)

Nw = 125000  

Request-4 Service-HTTP-1

(Nw = 20000)

Nw = 150000  

Request-5 Service-HTTP-1

(Nw = 23333.34))

Nw = 175000  

Request-6 Service-HTTP-1

(Nw = 25000)

Nw = 200000  

Request-7 Service-HTTP-1

(Nw = 23333.34)

Nw = 225000  

Request-8 Service-HTTP-1

(Nw = 25000)

Nw = 250000  

Request-9 Service-HTTP-2

(Nw = 233333.34)

Nw = 266666.67 Service-HTTP-2 hasthe lowest Nwvalue.

Service-HTTP-1 is selected for load balancing when it completes its active transactions orwhen the Nw value of other services (Service-HTTP-2 and Service-HTTP-3) is equal to400,000.

The following diagram illustrates how the NetScaler appliance uses the custom load methodwhen weights are assigned.

The Custom Load Method

87

Page 88: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 3. How the Custom Load Method Works When Weights Are Assigned

To configure the custom load method, see Configuring a Load Balancing Method that DoesNot Include a Policy.

The Custom Load Method

88

Page 89: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

89

Configuring the Token Method

A load balancing virtual server configured to use the token method bases its selection of aservice on the value of a data segment extracted from the client request. The data segmentis called the token. You configure the location and size of the token. For subsequentrequests with the same token, the virtual server chooses the same service that handled theinitial request.

This method is content aware; it operates differently for TCP, HTTP, and HTTPSconnections. For HTTP or HTTPS services, the token is found in the HTTP headers, the URL,or the BODY. To locate the token, you specify or create a classic or advanced expression.For more information on classic or advanced expressions, see Policy Configuration andReference.

For HTTP services, the virtual server searches for the configured token in the first 24kilobytes (KB) of the TCP payload. For non-HTTP (TCP, SSL, and SSL_TCP) services, thevirtual server searches for the configured token in the first 16 packets if the total size ofthe 16 packets is less than 24 KB. But if the total size of the 16 packets is greater than 24KB, the NetScaler searches for the token in the first 24 KB of payload. You can use this loadbalancing method across virtual servers of different types to make sure that requestspresenting the same token are directed to appropriate services, regardless of the protocolused.

For example, consider a load balancing setup consisting of servers that contain Webcontent. You want to configure the NetScaler appliance to search for a specific string (thetoken) inside the URL query portion of the request. Server-1 has two services,Service-HTTP-1 and Service-TCP-1, and Server-2 has two services, Service-HTTP-2 andService-TCP-2. The TCP services are bound to Vserver-LB-2, and the HTTP services arebound to Vserver-LB-1.

If Vserver-LB-1 receives a request with the token AA, it selects the service Service-HTTP-1(bound to server-1) to process the request. If Vserver-LB-2 receives a different request withthe same token (AA), it directs this request to the service Service-TCP-1. The followingdiagram illustrates this process.

Page 90: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 1. How the Token Method Works

To configure the Token load balancing method byusing the command line interface

At the command prompt, type the following commands to configure the token loadbalancing method and verify the configuration:

• set lb vserver <name> -lbMethod TOKEN -rule <rule> -datalength <length> -dataoffset<offset>

• show lb vserver <name>

Example

set lb vserver LB-VServer-1 -lbMethod TOKEN -rule 'AA' -datalength 2 -dataoffset 25

show lb vserver LB-VServer-1

Parameters for Configuring the Token Load BalancingMethod

name

Configuring the Token Method

90

Page 91: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Name of the virtual server. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( ).

rule

A string. The string can be an existing rule name, or it can be an inline expression with amaximum of 256 characters.

datalength

Length of the token in bytes. This parameter is applicable to HTTP virtual servers andTCP virtual servers configured for Token load balancing. Valid values: 0-100. Default: Nodefault.

dataoffset

Offset of the data to be taken as a token. This parameter is applicable to TCP virtualservers configured for Token load balancing. The token must be within the first 24 KB ofthe client TCP data. Valid values: 0-25400. Default: No default

To configure the Token load balancing method byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure a rule, andthen click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Method andPersistence tab and under LB Method, select Token.

4. Click Configure next to the Rule text box.

5. In the Create Expression dialog box, select Classic Syntax or Advanced Syntax.

6. Under Expression, click Add.

7. In the Add Expression dialog box, enter an expression. For more information aboutexpressions, see Policy Configuration and Reference. For example, if you areconfiguring a classic expression, you can select an Expression Type of General, a FlowType of REQ, a Protocol of HTTP, a Qualifier of URLQUERY, an Operator of CONTAINS,and in the Value text box, type AA.

8. Click OK, and then click Close.

9. In the Create Expression dialog box, click Create. The expression you created appears inthe Rule text box.

10. Click OK.

Configuring the Token Method

91

Page 92: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

92

Configuring a Load Balancing MethodThat Does Not Include a Policy

After you select a load balancing algorithm for your load balancing setup, you mustconfigure the NetScaler appliance to use that algorithm. You can configure it by using theNetScaler command line or by using the configuration utility.

Note:

The token method is policy based and requires more configuration than is described here.To configure the token method, see Configuring the Token Method.

For some hash-based methods, you can mask an IP address to direct requests belonging tothe same subnet to the same server. For more information, see The Destination IP HashMethod, The Source IP Hash Method, The Source IP Destination IP Hash Method, and TheSource IP Source Port Hash Method.

To set the load balancing method by using thecommand line interface

At the command prompt, type:

set lb vserver <name> -lbMethod <method>

Example

set lb vserver Vserver-LB-1 -lbMethod LeastConnection

Parameters for specifying a load balancing methodname

Name of the virtual server. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( ).

lbMethod

Load balancing method used by the virtual server. Possible values: ROUNDROBIN,LEASTCONNECTION, LEASTRESPONSETIME, URLHASH, DOMAINHASH, DESTINATIONIPHASH,SOURCEIPHASH, SRCIPDESTIPHASH, LEASTBANDWIDTH, LEASTPACKETS, TOKEN,SRCIPSRCPORTHASH, LRTM, CALLIDHASH, CUSTOMLOAD. Default: LEASTCONNECTION.

Page 93: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set the load balancing method by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure an LBmethod, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Method andPersistence tab.

4. From the drop-down menu under LB Method, select a method, (for example, LeastResponse Time).

5. Click OK.

Configuring a Load Balancing Method That Does Not Include a Policy

93

Page 94: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

94

Persistence and Persistent Connections

Unless you configure persistence, a load balancing stateless protocol, such as HTTP,disrupts the maintenance of state information about client connections. Differenttransmissions from the same client might be directed to different servers even though all ofthe transmissions are part of the same session. You must configure persistence on a loadbalancing virtual server that handles certain types of Web applications, such as shoppingcart applications.

Before you can configure persistence, you need to understand the different types ofpersistence, how they are used, and what the implications of each type is. You then needto configure the NetScaler appliance to provide persistent connections for those Web sitesand Web applications that require them.

You can also configure backup persistence, which takes effect in the event that the primarytype of persistence configured for a load balancing virtual server fails. You can configurepersistence groups, so that a client transmission to any virtual server in a group can bedirected to a server that has received previous transmissions from the same client.

For information about persistence with RADIUS load balancing, see Configuring RADIUS LoadBalancing with Persistence.

Page 95: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

95

About Persistence

You can choose from among any of several types of persistence for a given load balancingvirtual server, which then routes to the same service all connections from the same user toyour shopping cart application, Web-based email, or other network application. Thepersistence session remains in effect for a period of time, which you specify.

If a server participating in a persistence session goes DOWN, the load balancing virtualserver uses the configured load balancing method to select a new service, and establishes anew persistence session with the server represented by that service. If the server goes OUTOF SERVICE, it continues to process existing persistence sessions, but the virtual server doesnot direct any new traffic to it. After the shutdown period elapses, the virtual server ceasesto direct connections from existing clients to the service, closes existing connections, andredirects those clients to new services if necessary.

Depending on the persistence type you configure, the NetScaler appliance might examinethe source IPs, destination IPs, SSL session IDs, Host or URL headers, or some combinationof these things to place each connection in the proper persistence session. It might alsobase persistence on a cookie issued by the Web server, on an arbitrarily assigned token, oron a logical rule. Almost anything that allows the appliance to match connections with theproper persistence session and be used as the basis for persistence.

The following table summarizes the persistence types available on the NetScaler appliance.

Table 1. Types of Persistence

Persistence Type Description

Source IP SOURCEIP. Connections from the sameclient IP address are parts of the samepersistence session.

HTTP Cookie COOKIEINSERT. Connections that have thesame HTTP Cookie header are parts of thesame persistence session.

SSL Session ID SSLSESSION. Connections that have thesame SSL Session ID are parts of the samepersistence session.

URL Passive URLPASSIVE. Connections to the same URLare treated as parts of the samepersistence session.

Custom Server ID CUSTOMSERVERID. Connections with thesame HTTP HOST header are treated asparts of the same persistence session.

Destination IP DESTIP. Connections to the samedestination IP are treated as parts of thesame persistence session.

Page 96: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Source and Destination IPs SRCIPDESTIP. Connections that are bothfrom the same source IP and to the samedestination IP are treated as parts of thesame persistence session.

SIP Call ID CALLID. Connections that have the samecall ID in the SIP header are treated asparts of the same persistence session.

RTSP Session ID RTSPSID. Connections that have the sameRTSP Session ID are treated as parts of thesame persistence session.

User-Defined Rule RULE. Connections that match auser-defined rule are treated as parts ofthe same persistence session.

Depending on the type of persistence that you have configured, the virtual server cansupport either 250,000 simultaneous persistent connections or any number of persistentconnections up to the limits imposed by the amount of RAM on your NetScaler appliance.The following table shows which types of persistence fall into each category.

Table 2. Persistence Types and Numbers of Simultaneous Connections Supported

Persistence Type Number of Simultaneous PersistentConnections Supported

Source IP, SSL Session ID, Rule, destinationIP, source IP/destination IP, SIP Call ID,RTSP Session ID

250 K

Cookie, URL Server ID, Custom Server ID Memory limit. In case of CookieInsert, iftimeout is not 0, the number ofconnections is limited by memory.

Some types of persistence are specific to particular types of virtual server. The followingtable lists each type of persistence and indicates which types of persistence are supportedon which types of virtual server.

Table 3. Relationship of Persistence Type to Virtual Server Type

PersistenceType

HTTP HTTPS TCP UDP/IP

SSL_Bridge

SSL_TCP RTSP SIP_UDP

SOURCEIP

YES YES YES YES YES YES NO NO

COOKIEINSERT

YES YES NO NO NO NO NO NO

SSLSESSION

NO YES NO NO YES YES NO NO

URLPASSIVE

YES YES NO NO NO NO NO NO

CUSTOMSERVERID

YES YES NO NO NO NO NO NO

About Persistence

96

Page 97: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

RULE YES YES YES

Note:Loadbalancingvirtual serversoftypeTCP supportrulebased persistenceonlyon NetScaler 9.3.e.

NO NO YES

Note:Loadbalancing virtual serversoftypeSSL_TCP support rulebasedpersistenceonlyon NetScaler9.3.e.

NO NO

SRCIPDESTIP

YES YES YES YES YES YES NO NO

DESTIP

YES YES YES YES YES YES NO NO

CALLID

NO NO NO NO NO NO NO YES

RTSPID

NO NO NO NO NO NO YES NO

About Persistence

97

Page 98: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

98

Persistence Based on Source IP Address

When source IP persistence is configured, the load balancing virtual server uses theconfigured load balancing method to select a service for the initial request, and then usesthe source IP address (client IP address) to identify subsequent requests from that clientand send them to the same service. You can set a time-out value, which specifies themaximum inactivity period for the session. When the time-out value expires, the session isdiscarded, and the configured load balancing algorithm is used to select a new server.

Caution: In some circumstances, using persistence based on source IP address canoverload your servers. All requests to a single Web site or application are routed throughthe single gateway to the NetScaler appliance, even though they are then redirected tomultiple locations. In multiple proxy environments, client requests frequently havedifferent source IP addresses even when they are sent from the same client, resulting inrapid multiplication of persistence sessions where a single session should be created. Thisissue is called the “Mega Proxy problem.” You can use HTTP cookie-based persistenceinstead of Source IP-based persistence to prevent this from happening.

To configure persistence based on Source IP Address, see Configuring Persistence TypesThat Do Not Require a Rule.

Note: If all incoming traffic comes from behind a Network Address Translation (NAT)device or proxy, the traffic appears to the NetScaler appliance to come from a singlesource IP address. This prevents Source IP persistence from functioning properly. Wherethis is the case, you must select a different persistence type.

Page 99: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

99

Persistence Based on HTTP Cookies

When HTTP cookie persistence is configured, the NetScaler appliance sets a cookie in theHTTP headers of the initial client request. The cookie contains the IP address and port ofthe service selected by the load balancing algorithm. As with any HTTP connection, theclient then includes that cookie with any subsequent requests.

When the NetScaler appliance detects the cookie, it forwards the request to the service IPand port in the cookie, maintaining persistence for the connection. You can use this type ofpersistence with virtual servers of type HTTP or HTTPS. This persistence type does notconsume any NetScaler resources and therefore can accommodate an unlimited number ofpersistent clients.

Note: If the client’s Web browser is configured to refuse cookies, HTTP cookie-basedpersistence will not work. It might be advisable to configure a cookie check on the Website, and warn clients that do not appear to be storing cookies properly that they willneed to enable cookies for the Web site if they want to use it.

The format of the cookie that the NetScaler appliance inserts is:

NSC_XXXX=<ServiceIP ><ServicePort>

where:

• NSC_XXXX is the virtual server ID that is derived from the virtual server name.

• ServiceIP and ServicePort are encoded representations of the service IP address andservice port, respectively. The IP address and port are encoded separately.

You can set a time-out value for this type of persistence to specify an inactivity period forthe session. When the connection has been inactive for the specified period of time, theNetScaler appliance discards the persistence session. Any subsequent connection from thesame client results in a new server being selected based on the configured load balancingmethod, and a new persistence session being established.

Note: If you set the time-out value to 0, the NetScaler appliance does not specify anexpiration time, but sets a session cookie that is not saved when the client’s browser isshut down.

By default, the NetScaler appliance sets HTTP version 0 cookies for maximum compatibilitywith client browsers. (Only certain HTTP proxies understand version 1 cookies; mostcommonly used browsers do not.) You can configure the appliance to set HTTP version 1cookies, for compliance with RFC2109. For HTTP version 0 cookies, the appliance insertsthe cookie expiration date and time as an absolute Coordinated Universal Time (GMT). Itcalculates this value as the sum of the current GMT time on the appliance and the time-outvalue. For HTTP version 1 cookies, the appliance inserts a relative expiration time bysetting the “Max-Age” attribute of the HTTP cookie. In this case, the client’s browsercalculates the actual expiration time.

To configure persistence based on a cookie inserted by the appliance, see ConfiguringPersistence Types That Do Not Require a Rule.

Page 100: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

In the HTTP cookie, the appliance by default sets the httponly flag to indicate that thecookie is nonscriptable and should not be revealed to the client application. Therefore, aclient-side script cannot access the cookie, and the client is not susceptible to cross-sitescripting.

Certain browsers, however, do not support the httponly flag and, therefore, might notreturn the cookie. As a result, persistence is broken. For browsers that do not support theflag, you can omit the httponly flag in the persistence cookie.

To change the httponly flag setting by using thecommand line interface

At the command prompt, type:

set lb parameter -httpOnlyCookieFlag (ENABLED|DISABLED)

Example

> set lb parameter -httpOnlyCookieFlag disabled Done> show lb parameter Global LB parameters: Persistence Cookie HttpOnly Flag: DISABLED Use port for hash LB: YES Done

Parameter for customizing the httponly flaghttpOnlyCookieFlag

Flag the persistence cookie as nonscriptable so that it is not revealed to the clientapplication. Possible values: ENABLED, DISABLED. Default: ENABLED.

Persistence Based on HTTP Cookies

100

Page 101: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To change the httponly flag setting by using theconfiguration utility

1. In the navigation pane, click Load Balancing.

2. In the Settings group, click Configure Load Balancing Parameters.

3. To not set the httponly flag in the persistence cookie, clear the Persistence CookieHTTPOnly Flag check box.

4. Click OK.

5. Open the Configure Load Balancing Parameters dialog box and verify the setting youjust configured.

Persistence Based on HTTP Cookies

101

Page 102: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

102

Persistence Based on SSL Session IDs

When SSL Session ID persistence is configured, the NetScaler appliance uses the SSL SessionID, which is part of the SSL handshake process, to create a persistence session before theinitial request is directed to a service. The load balancing virtual server directs subsequentrequests that have the same SSL session ID to the same service. This type of persistence isused for SSL bridge services.

Note:

There are two issues that users should consider before choosing this type of persistence.First, the NetScaler appliance does not encrypt or decrypt data when it forwards requeststo services in an SSL bridge configuration, because it must maintain the data structures tokeep track of the sessions. This type of persistence therefore consumes resources on theNetScaler appliance, which limits the number of concurrent persistence sessions that it cansupport. If you expect to support a very large number of concurrent persistence sessions,you might want to choose another type of persistence.

Second, if the client and the load-balanced server should renegotiate the session ID duringtheir transactions, persistence is not maintained, and a new persistence session is createdwhen the client’s next request is received. This may result in the client’s activity on theWeb site being interrupted and the client being required to reauthenticate or restart thesession. It may also result in large numbers abandoned sessions if the timeout is set to toolarge a value.

To configure persistence based on SSL session ID, see Configuring Persistence Types That DoNot Require a Rule.

Page 103: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

103

Custom Server ID Persistence

In the Custom Server ID persistence method, the Server ID specified in the client request isused to maintain persistence. For this type of persistence to work, you must first set aserver ID on the services. The NetScaler appliance checks the URL of the client request andconnects to the server associated with the specified server ID. The service provider shouldmake sure that the users are aware of the server IDs to be provided in their requests forspecific services.

For example, if your site provides different types of data, such as images, text, andmultimedia, from different servers, you can assign each server a server ID. On the NetScalerappliance, you specify those server IDs for the corresponding services, and you configurecustom server ID persistence on the corresponding load balancing virtual server. Whensending a request, the client inserts the server ID into the URL indicating the required typeof data.

To configure custom server ID persistence:

• In your load balancing setup, assign a server ID to each service for which you want touse the user-defined server ID to maintain persistence. Only numeric server IDs areallowed.

• Specify rules, in the default-syntax expression language, to examine the URL queries forthe server ID and forward traffic to the corresponding server.

• Configure custom server ID persistence.

Note: The persistence time-out value does not affect the Custom Server ID persistencetype. There is no limit on the maximum number of persistent clients because thispersistence type does not store any client information.

Example

In a load balancing setup with two services, assign server ID 2344 to Service-1, and server ID2345 to Service-2. Bind these services to a virtual server named Web11.

set service Service-1 10.102.29.5 -serverID 2344set service Service-2 10.102.29.6 -serverID 2345

On virtual server Web11, enable Custom Server ID persistence.

Example

set lb vserver Web11 -persistenceType customserverIDbind lb vserver Web11 Service-[1-2]

Create the following expression so that all URL queries containing the string "sid=" areexamined.

HTTP.REQ.URL.AFTER_STR(“sid=”)

Page 104: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

When a client sends a request with the following URL to the IP address of Web11, theNetScaler directs the request to Service-2 and honors persistence.

Example

http://www.example.com/index.asp?&sid=2345

For more information about default-syntax policy expressions, see the Policy Configurationand Reference.

Parameters for configuring custom server IDpersistence

ServiceName

The name of the service that you are configuring.

vServerName

The name of the virtual server

persistenceType

Method of persistence. Select CUSTOMSERVERID.

rule

Rule to examine the URL for server ID.

Custom Server ID Persistence

104

Page 105: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure custom server ID persistence by usingthe configuration utility

1. Assign a server ID to each of the services for which you want to configure custom serverID persistence.

a. In the navigation pane, expand Load Balancing, and then click Services.

b. In the details pane, select the service for which you want to specify a server ID, andthen click Open.

c. In the Configure Service dialog box, click the Advanced tab.

d. Scroll down, and under Others, in the Server ID box, type an ID for the server.

e. Click OK.2. Configure custom server ID persistence on the virtual server to which the services are

bound.

a. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

b. In the details pane, select the virtual server for which you want to specifypersistence, and then click Open.

c. On the Method and Persistence tab, in the Persistence group, selectCUSTOMSERVERID.

d. In the Rule box, type an expression, or click Configure, and use the optionsavailable in the Create Expression dialog box, to create the expression.

e. Click OK.

Custom Server ID Persistence

105

Page 106: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

106

Persistence Based on Destination IPAddresses

With destination IP address-based persistence, when the NetScaler appliance receives arequest from a new client, it creates a persistence session based on the IP address of theservice selected by the virtual server (the destination IP address). Subsequently, it directsrequests to the same destination IP to the same service. This type of persistence is usedwith link load balancing. For more information about link load balancing, see Link LoadBalancing.

The time-out value for destination IP persistence is the same as that for source IPpersistence, described in Persistence Based on Source IP Address.

To configure persistence based on the destination IP address, see Configuring PersistenceTypes That Do Not Require a Rule.

Page 107: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

107

Persistence Based on Source andDestination IP Addresses

With source and destination IP address-based persistence, when the NetScaler appliancereceives a request, it creates a persistence session based on both the IP address of theclient (the source IP address) and the IP address of the service selected by the virtualserver (the destination IP address). Subsequently, it directs requests from the same sourceIP and to the same destination IP to the same service.

The time-out value for destination IP persistence is the same as that for source IPpersistence, described in Persistence Based on Source IP Address.

To configure persistence based on both source and destination IP addresses, see ConfiguringPersistence Types That Do Not Require a Rule.

Page 108: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

108

Persistence Based on SIP Call ID

With SIP Call ID persistence, the NetScaler appliance chooses a service based on the call IDin the SIP header. This enables it to direct packets for a particular SIP session to the sameservice and, therefore, to the same load balanced server. This persistence type isapplicable specifically to SIP load balancing. For more information about SIP load balancing,see Monitoring SIP Services.

To configure persistence based on SIP Call ID, see Configuring Persistence Types That DoNot Require a Rule.

Page 109: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

109

Persistence Based on RTSP Session IDs

With RTSP Session ID persistence, when the NetScaler appliance receives a request from anew client, it creates a new persistence session based on the Real-Time Streaming Protocol(RTSP) session ID in the RTSP packet header, and then directs the request to the RTSPservice selected by the configured load balancing method. It directs subsequent requeststhat contain the same session ID to the same service. This persistence type is applicablespecifically to SIP load balancing. For more information about SIP load balancing, seeMonitoring SIP Services.

Note: RTSP Session ID persistence is configured by default on RTSP virtual servers, andyou cannot modify that setting.

Sometimes different RTSP servers issue the same session IDs. When this happens, uniquesessions cannot be created between the client and the RTSP server by using only the RTSPsession ID. If you have multiple RTSP servers that may issue the same session IDs, you canconfigure the appliance to append the server IP address and port to the session ID, creatinga unique token that can be used to establish persistence. This is called session ID mapping.

To configure persistence based on RTSP Session IDs, see Configuring Persistence Types ThatDo Not Require a Rule.

Important: If you need to use session ID mapping, you must set the following parameterwhen configuring each service within the load balancing setup. Also, make sure that nonon-persistent connections are routed through the RTSP virtual server.

Parameter to Set When Configuring Servicessession

Map the RTSP session ID by appending the IP address and port of the server to the sessionID, guaranteeing that all session IDs are unique within the load balancing setup.

Note: When Session ID Mapping is enabled, the NetScaler appliance rejects any packetthat does not contain a mapped ID. Possible values: ON and OFF. Default: OFF.

Note: If a client sends multiple SETUP requests on a single TCP connection, the NetScalerappliance sends those SETUP requests to the same service, because it makes a loadbalancing decision for every TCP connection. When this occurs, the appliance does notforward the SETUP requests to different servers based on the RTSP session ID.

Page 110: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

110

Configuring URL Passive Persistence

With URL Passive persistence, when the NetScaler appliance receives a request from aclient, it extracts the server IP address-port information (expressed as a single hexadecimalnumber) from the client request.

URL passive persistence requires configuring an advanced expression that specifies thequery element that contains the server IP address-port information. For more informationabout classic and advanced policy expressions, see Policy Configuration and Reference.

The following expression configures the appliance to examine requests for URL queries thatcontain the string "urlp=", extract the server IP address-port information, convert it from ahexadecimal string to an IP and port number, and forward the request to the serviceconfigured with this IP address and port number.

HTTP.REQ.URL.AFTER_STR(“urlp=”)

If URL passive persistence is enabled and the above expression is configured, a request withthe following URL and server IP address-port string is directed to 10.102.29.10:80.

http://www.example.com/index.asp?&urlp=0A661D0A0050

The persistence time-out value does not affect this persistence type; persistence ismaintained as long as the server IP address-port information can be extracted from clientrequests. This persistence type does not consume any NetScaler resources, so it canaccommodate an unlimited number of persistent clients.

To configure URL passive persistence, you first configure persistence as described inConfiguring Persistence Types That Do Not Require a Rule. You set the persistence type toURLPASSIVE. You then perform the procedures provided below.

To configure URL passive persistence by using thecommand line interface

At the command prompt, type:

set lb vserver <vserverName> [-rule <expression>]

Example

set lb vserver LB-VServer-1 –rule HTTP.REQ.URL.AFTER_STR(“urlp=”)

Page 111: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Parameters for Rule-Based Persistencerule

Value used to set the URLPASSIVE persistence type. The value can be an existing rulename, or it can be a classic or advanced expression. The default value is none. Themaximum length is 14999.

The rule evaluates either requests that are directed to the load balanced servers orresponses from the servers.

To configure URL passive persistence by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the Configure Virtual Server (Load Balancing) dialog box, on the Method andPersistence tab, in Persistence, select URLPASSIVE.

3. Click the Configure button next to the Rule field.

4. In the dialog box that appears, create the rule that you want to use. For moreinformation about creating rules, see Policy Configuration and Reference.

5. Click OK.

Configuring URL Passive Persistence

111

Page 112: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

112

Configuring Persistence Based onUser-Defined Rules

When rule based persistence is configured, the NetScaler appliance creates a persistencesession based on the contents of the matched rule before directing the request to theservice selected by the configured load balancing method. Subsequently, it directs allrequests that match the rule to the same service. You can configure rule based persistencefor services of type HTTP, SSL, RADIUS, and ANYHTTP, SSL, RADIUS, ANY, TCP, andSSL_TCP.

Note: Load balancing virtual servers of service type TCP and SSL_TCP support rule basedpersistence only on NetScaler 9.3.e.

Rule based persistence requires a classic or default syntax expression. You can use a classicexpression to evaluate request headers, or you can use a default syntax expression toevaluate request headers, Web form data in a request, response headers, or responsebodies. For example, you could use a classic expression to configure persistence based onthe contents of the HTTP Host header. You could also use a default syntax expression toconfigure persistence based on application session information in a response cookie orcustom header. For more information on creating and using classic and default syntaxexpressions, see Policy Configuration and Reference.

The expressions that you can configure depends on the type of service for which you areconfiguring rule based persistence. For example, certain RADIUS-specific expressions arenot allowed for protocols other than RADIUS, and TCP-option based expressions are notallowed for service types other than the ANY type. For TCP and SSL_TCP service types, youcan use expressions that evaluate TCP/IP protocol data, Layer 2 data, TCP options, and TCPpayloads.

Note: For a use case that involves configuring rule based persistence on the basis ofFinancial Information eXchange ("FIX") Protocol data transmitted over TCP, seeConfiguring Rule Based Persistence Based on a Name-Value Pair in a TCP Byte Stream.

Rule based persistence can be used for maintaining persistence with entities such as BranchRepeater appliances, Branch Repeater plug-ins, cache servers, and application servers.

Note: On an ANY virtual server, you cannot configure rule-based persistence for theresponses.

To configure persistence based on a user-defined rule, you first configure persistence asdescribed in Configuring Persistence Types That Do Not Require a Rule, and set thepersistence type to RULE. You then perform the procedures provided below. You canconfigure rule based persistence by using the configuration utility or the NetScalercommand line.

Page 113: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure persistence based on user-defined rulesby using the command line interface

At the command prompt, type:

set lb vserver <vserverName> [-rule <expression>][-resRule <expression>]

Example

set lb vserver vsvr_name –rule http.req.header("cookie").value(0).typecast_nvlist_t('=',';').value("server")

set lb vserver vsvr_name –resrule http.res.header("set-cookie").value(0).typecast_nvlist_t('=',';').value("server")

Parameters for Rule-Based Persistencerule

Value used to set the RULE persistence type. The value can be an existing rule name, orit can be a classic or default syntax expression. You can specify this parameter forservices of type HTTP, SSL, RADIUS, and ANYHTTP, SSL, RADIUS, ANY, TCP, and SSL_TCP.You can specify an expression that evaluates requests from clients.

Maximum length: 1499 characters. Default: NONE.

resRule

Value used to set the RULE persistence type. The response rule evaluates responses fromthe load balanced servers. You can configure this parameter for services of type . Theexpression must be a default syntax expression that evaluates responses from the loadbalanced servers.

Maximum length: 1499 characters. Default: NONE.

Configuring Persistence Based on User-Defined Rules

113

Page 114: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure persistence based on user-defined rulesby using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, click Add.

3. In the Configure Virtual Server (Load Balancing) dialog box, on the Method andPersistence tab, choose the type of rule you want to configure.

• If you want to base the rule on the request, click the Configure button next to theRule field.

• If you want to base the rule on the response, click the Configure button next to theResponse Rule field.

4. In the dialog box that appears, select Switch to Classic Syntax or Switch to AdvancedSyntax.

5. Select or create the rule that you want to use. Some examples of rules that you mightfind useful are provided below. For more information, see Policy Configuration andReference.

6. Click OK.

Example: Classic Expression for a Request Payload

The following classic expression creates a persistence session based on the presence of aUser-Agent HTTP header that contains the string, “MyBrowser”, and directs any subsequentclient requests that contain this header and string to the same server that was selected forthe initial request.

http header User-Agent contains MyBrowser

Example: Default syntax Expression for a Request Header

The following default syntax expression does exactly the same thing as the previous classicexpression.

HTTP.REQ.HEADER("User-Agent").CONTAINS ("MyBrowser")

Example: Default syntax Expression for a Response Cookie

The following expression examines responses for “server” cookies, and then directs anyrequests that contain that cookie to the same server that was selected for the initialrequest.

HTTP.RES.HEADER("SET-COOKIE").VALUE(0).TYPECAST_NVLIST_T('=',';').VALUE("server")

Configuring Persistence Based on User-Defined Rules

114

Page 115: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

115

Configuring Persistence Types That DoNot Require a Rule

To configure persistence, you must first set up a load balancing virtual server, as describedin Setting Up Basic Load Balancing. You then configure persistence on the virtual server.

To configure persistence on a virtual server by usingthe command line interface

At the command prompt, type the following commands to configure persistence and verifythe configuration:

• set lb vserver <name> -PersistenceType <type> [-timeout <integer>]

• show lb vserver

Example

set lb vserver Vserver-LB-1 -persistenceType SOURCEIP

show lb vserver

Note: For IP-based persistence, you can also set the persistMask parameter.

Parameters for configuring persistencePersistenceType

Persistence type supported on the virtual server. Valid Values: SOURCEIP, COOKIEINSERT,SSLSESSION, RULE, URLPASSIVE, CUSTOMSERVERID, DESTIP, SRCIPDESTIP, CALLID, RTSPID,and NONE. Default: NONE.

persistMask

Defines which IP range is used to determine whether a connection is part of an existingpersistence session or not. This parameter is used only if the persistence type isIP-based. The default value, 255.255.255.255, specifies that only connections from thesame IP are part of an existing session. Valid values include the full range of availablesubnet masks.

Note: Setting this parameter to 0 has the same effect as setting it to 255.255.255.255.

timeout

Page 116: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The period, in minutes, for which a persistence session remains in effect. Maximumvalue: 1440 minutes. Default: 2 minutes.

To configure persistence on a virtual server by usingthe configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configurepersistence, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, on the Method andPersistence tab, in the Persistence list, select the persistence type you want to use (forexample, SOURCEIP).

4. In the Time-out and Netmask text boxes type the time-out and subnet mask values (forexample, 2 and 255.255.255.255).

5. Click OK.

Configuring Persistence Types That Do Not Require a Rule

116

Page 117: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

117

Configuring Backup Persistence

The NetScaler appliance uses backup persistence to choose a new type of persistence whenthe primary persistence type fails. For example, if the primary persistence type is set toCookie Insert, and backup persistence is set to Source IP, the NetScaler appliance usesSource IP-based persistence when the cookie is missing from the HTTP header or when theclient browser does not support cookies.

You can set a time-out value for backup persistence only when the primary persistence typeis HTTP Cookie-based or RTSP session ID-based persistence, and the backup persistencetype is Source IP-based.

To set backup persistence for a virtual server byusing the command line interface

At the command prompt, type:

set lb vserver <name>@ -persistenceType <PersistenceType> -persistenceBackup<BackupPersistenceType>

Example

set lb vserver Vserver-LB-1 -persistenceType CookieInsert -persistenceBackup SourceIP

Parameter for configuring backup persistencepersistenceBackup

Backup persistence type for the group. Possible values: SOURCEIP, NONE. Default: NONE.

Page 118: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set backup persistence for a virtual server byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure backuppersistence (for example, Vserver-LB-1), and then click Open.

3. The Configure Virtual Server (Load Balancing) dialog box, click the Method andPersistence tab.

4. In the Persistence list, select the persistence type you want (for example,COOKIEINSERT).

5. In the Time-out text box, type the time-out value you want (for example, 20).

6. In the Backup Persistence list, select the backup persistence type that you want toconfigure (for example, SOURCEIP).

7. In the Backup Time-out and Netmask text boxes, type the backup time-out value andnetmask (for example, 20 and 255.255.255.255).

8. Click OK.

Configuring Backup Persistence

118

Page 119: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

119

Configuring Persistence Groups

When you have load-balanced servers that handle several different types of connections(such as Web servers that host multimedia), you can configure a virtual server group tohandle these connections. To create a virtual server group, you bind different types ofvirtual servers, one for each type of connection that your load balanced servers accept,into a single group. You then configure a persistence type for the entire group.

You can configure either source IP-based persistence or HTTP cookie-based persistence forpersistence groups. After you set persistence for the entire group, you cannot change it forindividual virtual servers in the group. If you configure persistence on a group and then adda new virtual server to the group, the persistence of the new virtual server is changed tomatch the persistence setting of the group.

When persistence is configured on a group of virtual servers, persistence sessions arecreated for initial requests, and subsequent requests are directed to the same service asinitial request, regardless of the virtual server in the group that receives each clientrequest.

If you configure HTTP cookie-based persistence, the domain attribute of the HTTP cookie isset. This setting causes the client software to add the HTTP cookie into client requests ifdifferent virtual servers have different public host names. For more information aboutCookieInsert persistence type, see Persistence Based on HTTP Cookies.

To create a virtual server persistency group by usingthe command line interface

At the command prompt, type:

bind lb group <vServerGroupName> <vServerName> -persistenceType <PersistenceType>

Example

bind lb group Vserver-Group-1 Vserver-LB-1 -persistenceType CookieInsert

Parameters for configuring virtual server persistencygroups

name

Name of the persistence group. The name must not exceed 127 characters, and theleading character must be a number or letter. The following characters are also allowed:@ _ - . (period) : (colon) # and space ( )

Page 120: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

persistenceType

Persistence type for the group. Possible values: SOURCEIP, COOKIEINSERT, NONE.

Note: If you specify NONE, the persistence configured for each of the individual virtualservers is applied, and the persistence group does not function.

persistMask

Netmask specified when the persistency type is SOURCEIP.

timeout

Time period for which the persistence is in effect for a specific client. The value rangesfrom 2 through 1440 minutes. The default value is 2 minutes. The maximum value is 1440minutes (1 day).

To create a virtual server persistency group by usingthe configuration utility

1. In the navigation pane, expand Load Balancing, and then click Persistency Groups.

2. On the Persistency Groups pane, click Add.

3. In the Create Persistency Group dialog box, in the Group Name text box type a namefor the group (for example, Vserver-Group-1).

4. In the Persistence list, select a persistence type (for example, SOURCEIP).

5. In the Persistence Mask and Time-out text boxes, type the persistence mask andtimeout values (for example, 255.255.255.255 and 2).

6. Under Virtual Server List, in the Available Virtual Server list box, select the virtualserver that you want to bind to the group (for example, Vserver-LB-1), and then clickAdd.

7. Click Create, and then click Close. The virtual server group you created appears in thePersistence Groups pane.

You can also change the backup persistence type, backup persistence time-out, and cookiedomain value on an existing persistence group.

To modify a virtual server group by using thecommand line interface

At the command prompt, type:

set lb group <vServerGroupName> -PersistenceBackup <BackupPersistenceType>-persistMask <SubnetMaskAddress>

Example

Configuring Persistence Groups

120

Page 121: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

set lb group vserver-Group-1 -PersistenceBackup SourceIP -persistMask 255.255.255.255

Parameters for modifying virtual server persistencygroups

PersistenceBackup

Backup persistence type for the group. The valid options for this parameter are:SOURCEIP and NONE

backupPersistenceTimeout

Maximum time, in minutes, for which the backup persistence is in effect for a specificclient. Maximum value: 1440. Default: 2.

cookieDomain

Domain attribute of the HTTP cookie.

To modify a virtual server group by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Persistency Groups.

2. In the Persistency Groups pane, select the virtual server group that you want to modify(for example, Vserver-Group-1), and click Open.

3. The Configure Virtual Server Group dialog box appears.

4. In the Backup Persistence list, select the type of backup persistence (for example,SOURCEIP).

5. In the Persistence Mask text box, type the subnet mask (for example, 255.255.255.255).

6. Click OK.

Configuring Persistence Groups

121

Page 122: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

122

Configuring RADIUS Load Balancing withPersistence

Today’s complex networking environment often requires coordinating a high-volume,high-capacity load balancing configuration with robust authentication and authorization.Application users may connect to a VPN through mobile access points such asconsumer-grade DSL or Cable connections, WiFi, or even dial-up nodes. Those connectionsusually use dynamic IPs, which can change during the connection.

If you configure RADIUS load balancing on the NetScaler appliance to support persistentclient connections to RADIUS authentication servers, the appliance uses the user logon orthe specified RADIUS attribute instead of the client IP as the session ID, directing allconnections and records associated with that user session to the same RADIUS server. Usersare therefore able to log on to your VPN from mobile access locations without experiencingdisconnections when the client IP or WiFi access point changes.

To configure RADIUS load balancing with persistence, you must first configure RADIUSauthentication for your VPN. For information and instructions, see the Authentication,Authorization, Auditing (AAA) chapter in AAA Application Traffic. You must also chooseeither the Load Balancing or Content Switching feature as the basis for your configuration,and make sure that the feature you chose is enabled. The configuration process with eitherfeature is almost the same.

Then, you configure either two load balancing, or two content switching, virtual servers,one to handle RADIUS authentication traffic and the other to handle RADIUS accountingtraffic. Next, you configure two services, one for each load balancing virtual server, andbind each load balancing virtual server to its service. Finally, you create a load balancingpersistency group and set the persistency type to RULE.

Page 123: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

123

Enabling the Load Balancing or ContentSwitching Feature

To use the Load Balancing or Content Switching feature, you must first ensure that thefeature is enabled. If you are configuring a new NetScaler appliance that has not previouslybeen configured, both of these features are already enabled, so you can skip to the nextsection. If you are configuring a NetScaler appliance with a previous configuration on it,and you are not certain that the feature you will use is enabled, you must do that now.

• For instructions on enabling the load balancing feature, see Enabling Load Balancing.

• For instructions on enabling the content switching feature, see Enabling ContentSwitching.

Page 124: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

124

Configuring Virtual Servers

After enabling the load balancing or content switching feature, you must next configuretwo virtual servers to support RADIUS authentication:

• RADIUS authentication virtual server. This virtual server and its associated service willhandle authentication traffic to your RADIUS server. Authentication traffic consists ofconnections associated with users logging onto your protected application or virtualprivate network (VPN).

• RADIUS accounting virtual server. This virtual server and its associated service willhandle accounting connections to your RADIUS server. Accounting traffic consists ofconnections that track an authenticated user’s activities on your protected applicationor VPN.

Important: You must create either a pair of load balancing virtual servers or a pair ofcontent switching virtual servers to use in your RADIUS persistence configuration. Youcannot mix virtual server types.

To configure a load balancing virtual server by usingthe command line interface

At the command prompt type the following commands to create a new load balancingvirtual server and verify the configuration:

• add lb vserver <name> RADIUS <IP address> <port> -lbmethod TOKEN -rule <rule>

• show lb vserver <name>

To configure an existing load balancing virtual server, replace the above add lb virtualserver command with the set lb vserver command, which takes the same arguments.

To configure a content switching virtual server byusing the command line interface

At the command prompt type the following commands to create a new content switchingvirtual server and verify the configuration:

• add cs vserver <name> RADIUS <IP address> <port> -lbmethod TOKEN -rule <rule>

• show cs vserver <name>

To configure an existing content switching virtual server, replace the above add cs vservercommand with the set cs vserver command, which takes the same arguments.

Example

Page 125: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

add lb vserver radius_auth_vs1 RADIUS 192.168.46.33 1812      -lbmethod TOKEN -rule CLIENT.UDP.RADIUS.USERNAMEadd lb vserver radius_acct_vs1 RADIUS 192.168.46.34 1813      -lbmethod TOKEN -rule CLIENT.UDP.RADIUS.USERNAMEset lb vserver radius_auth_vs1 RADIUS 192.168.46.33 1812      -lbmethod TOKEN -rule CLIENT.UDP.RADIUS.USERNAMEset lb vserver radius_auth_vs1 RADIUS 192.168.46.34 1813      -lbmethod TOKEN -rule CLIENT.UDP.RADIUS.USERNAME

Parameters for configuring virtual serversname

A name for your new virtual server, or the name of the existing virtual server you wantto modify. The name can begin with a letter, number, or the underscore symbol, and canconsist of from one to 127 letters, numbers, and the hyphen (-), period (.) pound (#),space ( ), at sign (@), equals (=), colon (:), and underscore (_) symbols.

protocol

RADIUS

IPAddress

The IP address assigned to your virtual server. This is normally an Internet-routable IP.

Note: If the virtual server uses IPv6, select the IPv6 check box and enter the address inIPv6 format. (For example, 1000:0000:0000:0000:0005:0600:700a:888b.)

port

The port on which your virtual server listens for connections.

lbmethod

TOKEN

rule

Which policy rule to use as the basis for persistence. The two supported rules are:

• CLIENT.UDP.RADIUS.USERNAME. Use the client login name.

• CLIENT.UDP.RADIUS.ATTR_TYPE(INT). Use the specified RADIUS attribute type. ForINT, substitute the integer assigned to that attribute type as specified in RFC4014.

Configuring Virtual Servers

125

Page 126: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure a load balancing or content switchingvirtual server by using the configuration utility

1. In the navigation pane, expand Load Balancing or Content Switching, and then clickVirtual Servers.

Note: Except for the GUI location where you create or configure the virtual server,the process is the same.

2. In the details pane, do one of the following:

• To create a new virtual server, click Add.

• To modify an existing virtual server, select the virtual server, and then click Open.3. In the Create Virtual Server (Load balancing ) or Configure Virtual Server (Content

Switching) dialog box, specify values for the following parameters, which correspond toparameters described in "Parameters for configuring virtual servers" as shown:

• Name*—name

• Protocol*—protocol

• IP address*—IPAddress

• Port*—port* A required parameter

4. In the Method and Persistence tab, specify values for the following parameters, whichcorrespond to parameters described in "Parameters for configuring virtual servers" asshown:

• Method*—method

• Rule*—rule* A required parameter

5. Click Close. The virtual server that you created now appears in the Virtual Serverspane.

Configuring Virtual Servers

126

Page 127: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

127

Configuring Services

After configuring your virtual servers, you must next configure two services, one for each ofthe virtual servers that you created. For instructions, see Configuring Services. You shouldset the service parameters as described in "Parameters for configuring services."

Note: Once configured, these services are in the DISABLED state until the NetScalerappliance can connect to your RADIUS server’s authentication and accounting IPs andmonitor their status.

Parameters for configuring servicesname

A name for your new service, or the name of the existing service you want to modify.The name can begin with a letter, number, or the underscore symbol, and can consist offrom one to 127 letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), atsign (@), equals (=), colon (:), and underscore (_) symbols.

IPAddress

The IP address used to connect to the RADIUS server for authentication or accounting, asappropriate, in either IPv4 or IPv6 format. When you provide the IP address of theservice, the NetScaler appliance automatically creates a server object with this IPaddress as its name.

serviceType

The service type, always RADIUS when configuring RADIUS load balancing withpersistence.

port

The port on which your service listens for connections.

Page 128: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

128

Binding Virtual Servers to Services

After configuring your services, you must next bind each of the virtual servers that youcreated to the appropriate service. For instructions, see Binding Services to the VirtualServer.

Page 129: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

129

Configuring a Persistency Group forRadius

After binding your load balancing virtual servers to the corresponding services, you must setup your RADIUS load balancing configuration to support persistence. To do so, you configurea load balancing persistency group that contains your RADIUS load balancing virtual serversand services, and configure that load balancing persistency group to use rule-basedpersistence. For instructions, see Configuring Persistence Groups. You should set theparameters as described in "Parameters for configuring RADIUS load balancing persistencygroups."

Parameters for configuring RADIUS load balancingpersistency groups

name

The name of the load balancing persistency group that you are setting or binding. Thename can begin with a letter, number, or the underscore symbol, and can consist of fromone to 127 letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign(@), equals (=), colon (:), and underscore (_) symbols.

vservername

The name of the load balancing virtual server that you are binding to the load balancingpersistency group. The name can have the same length and characteristics as the namedescribed above.

newname

The new name of the load balancing persistency group that you are renaming. The namecan have the same length and characteristics as the name described above.

rule

Which policy rule to use as the basis for persistence. The two supported rules are:

• CLIENT.UDP.RADIUS.USERNAME. Use the client login name.

• CLIENT.UDP.RADIUS.ATTR_TYPE(INT). Use the specified RADIUS attribute type. ForINT, substitute the integer assigned to that attribute type as specified in RFC4014

Your RADIUS load balancing configuration is now complete.

Page 130: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

130

Viewing Persistence Sessions

You can view the different persistence sessions that are in effect globally or for a particularvirtual server.

Note: A NetScaler nCore appliance uses multiple CPU cores for packet handling. Everysession on the appliance is owned by a CPU core. If the appliance receives a request forwhich a session does not already exist, a session is created, and one of the cores isdesignated as the owner of that session. Subsequent requests that belong to that sessionmight not always arrive at and be handled by the owner core. In that case, inter-coremessaging ensures that the session information on the owner core is always current.However, when a core receives a request that belongs to a persistence session owned byanother core, the inter-core messaging does not refresh the timeout value for thepersistence session. Consequently, in the output of successively executed show lbpersistentSessions commands, which display timeout values from owner cores only, thetimeout value for a persistence session might diminish to 0 (zero), even if the persistencesession continues to be active.

To view a persistence session by using the commandline interface

At the command prompt, to view all persistence sessions type:

show lb persistentSessions [<vServer>]

Example

show lb persistentSessions myVserver

Parameters for viewing a persistence sessionvServer

Name of the virtual server on which the persistence sessions are running.

To view persistence sessions by using theconfiguration utility

1. In the navigation pane, click Load Balancing.

2. In the details pane, under Monitor Sessions, click Virtual Server persistence sessions.

Page 131: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

131

Clearing Persistence Sessions

You might need to clear persistence sessions from the NetScaler if sessions fail to time out.You can do one of the following:

• Clear all sessions for all virtual servers at once.

• Clear all sessions for a given virtual server at once.

To clear a persistence session by using the commandline interface

At the command prompt, type the following commands to clear persistence sessions andverify the configuration:

• clear lb persistentSessions [<vServer> ]

• show persistentSessions <vServer>

Example

> clear persistentSessions lbvip1 Done> show persistentSessions Done>

Parameters for clearing persistence sessionsvServer (Virtual Server)

The name of the load balancing virtual server whose persistence sessions are to beflushed. If not specified, all persistence sessions will be flushed . Maximum Length: 127.

Page 132: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To clear persistence sessions by using theconfiguration utility

1. In the navigation pane, click Load Balancing.

2. In the details pane, under Monitor Sessions, click Clear persistence sessions.

3. In the Clear Persistence Sessions dialog box, do one of the following:

• If you want to clear all sessions for all virtual servers on the appliance, in VirtualServer, select All Virtual Servers.

• If you want to clear all sessions for a given virtual server, in Virtual Server, selectthe virtual server.

4. Click OK.

Clearing Persistence Sessions

132

Page 133: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

133

Overriding Persistence Settings forOverloaded Services

When a service is loaded or is otherwise unavailable, service to clients is degraded. To workaround this situation, you might have to configure the NetScaler appliance to temporarilyforward to other services the requests that would otherwise be included in the persistencesession that is associated with the overloaded service. In other words, you might have tooverride the persistence setting that is configured for the load balancing virtual server. Youcan achieve this functionality by setting the skippersistency parameter. With the parameterset, when the virtual server receives new connections for an overloaded service, the virtualserver disregards any existing persistence sessions that are associated with that service,until the service returns to a state at which it can accept requests. Persistence sessionsassociated with other services are not affected. The functionality is available for onlyvirtual servers whose type is ANY or UDP.

In Branch Repeater load balancing configurations, you must also configure a load monitorand bind it to the service. The monitor takes the service out of subsequent load balancingdecisions until the load on the service is brought below the configured threshold. Forinformation about configuring a load monitor for your virtual server, see UnderstandingLoad Monitors.

You can configure the virtual server to perform one of the following actions with therequests that would otherwise form a part of the persistence session:

• Send each request to one of the other services. The virtual server takes a loadbalancing decision and sends each request to one of the other services on the basis ofthe configured load balancing method. If all the services are overloaded, requests aredropped until a service becomes available.

Both wildcard and IP address–based virtual servers support this option. This action isappropriate for all deployments, including deployments in which the virtual server isload balancing Branch Repeater appliances or firewalls.

• Bypass the virtual server-service configuration. The virtual server does not take aload balancing decision. Instead, it simply bridges each request through to a physicalserver on the basis of the destination IP address in the request.

Only wildcard virtual servers of type ANY and UDP support the bypass option. Wildcardvirtual servers have a *:* IP and port combination. This action is appropriate fordeployments in which you are using the virtual server to load balance Branch Repeaterappliances or firewalls. In these deployments, the NetScaler appliance first forwards arequest to a Branch Repeater appliance or firewall, and then forwards the processedresponse to a physical server. If you configure the virtual server to bypass the virtualserver–service configuration for overloaded services, if a Branch Repeater appliance orfirewall gets overloaded, the virtual server bridges requests directly to their destinationIP addresses until the Branch Repeater appliance or firewall can accept requests.

Page 134: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To override persistence settings for overloadedservices by using the command line interface

At the command prompt, type the following commands to override persistence settings foroverloaded services and verify the configuration:

• set lb vserver <name> -skippersistency <skippersistency>

• show lb vserver <name>

Example

> set lb vserver mylbvserver -skippersistency ReLb Done> show lb vserver mylbvserver mylbvserver (*:*) - ANY Type: ADDRESS . . . . . . Skip Persistency: ReLb . . . Done>

Parameters for overriding persistence for overloadedservices

name

The name of the load balancing virtual server.

skippersistency

Disregard the persistence settings that are configured for the virtual server when thevirtual server receives new connections for a service that is overloaded or unavailable.Possible values: Bypass, ReLb, None. Default value: None.

If you set the parameter to ReLb, the virtual server sends requests to other services onthe basis of the configured load balancing method until the overloaded service returns toa state at which it can accept requests. This action is appropriate for all deployments,including deployments in which the virtual server is load balancing Branch Repeaterappliances. If all the services are overloaded, requests are dropped until a servicebecomes available.

If you set the parameter to Bypass, the virtual server bypasses the virtual server–serviceconfiguration and bridges the requests through to the servers.

Overriding Persistence Settings for Overloaded Services

134

Page 135: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To override persistence settings for overloadedservices by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, click the virtual server that you want to override persistencesettings when services are overloaded, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, on the Advanced tab, in theSkip Persistency list, select the option that you want.

4. Click OK.

Overriding Persistence Settings for Overloaded Services

135

Page 136: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

136

Customizing the Hash Algorithm forPersistence across Virtual Servers

The NetScaler appliance uses hash-based algorithms for maintaining persistence acrossvirtual servers. By default, the hash-based load balancing method uses a hash value of theIP address and port number of the service. If a service is made available at different portson the same server, the algorithm generates different hash values. Therefore, differentload balancing virtual servers might send requests for the same application to differentservices, breaking the pseudo-persistence.

As an alternative to using the port number to generate the hash value, you can specify aunique hash identifier for each service. For a service, the same hash identifier value mustbe specified on all the virtual servers. If a physical server serves more than one type ofapplication, each application type should have a unique hash identifier.

The algorithm for computing the hash value for a service works as follows:

• By default, a global setting specifies the use of port number in a hash calculation.

• If you configure a hash identifier for a service, it is used, and the port number is not,regardless of the global setting.

• If you do not configure a hash identifier, but change the default value of the globalsetting so that it does not specify use of the port number, the hash value is based onlyon the IP address of the service.

• If you do not configure a hash identifier or change the default value of the globalsetting to use the port number, the hash value is based on the IP address and the portnumber of the service.

You can also specify hash identifiers when using the NetScaler command line to bindservices to a service group. In the configuration utility, you can open a service group andadd hash identifiers on the Members tab.

To change the use-port-number global setting byusing the command line interface

At the command prompt, type:

set lb parameter -usePortForHashLb (YES | NO)

Example

> set lb parameter -usePortForHashLb NO Done>show lb parameterGlobal LB parameters:

Page 137: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Persistence Cookie HttpOnly Flag: DISABLED Use port for hash LB: NO Done

To change the use-port-number global setting byusing the configuration utility

1. In the navigation pane, click Load Balancing.

2. In the Settings group, click Configure Load Balancing Parameters.

3. To not use the port number to generate the hash value, clear the Use Port for HashBased LB Methods check box.

4. Click OK.

5. Open the Configure Load Balancing Parameters dialog box and verify the setting youjust configured.

To create a new service and specify a hash identifierfor a service by using the command line interface

At the command prompt, type the following commands to set the hash ID and verify thesetting:

add service < name > (< ip > |< serverName >) < serviceType > < port > -hashId <positive_integer >

show service <name>

Example

> add service flbkng 10.101.10.1 http 80 -hashId 12345 Done>show service flbkng flbkng (10.101.10.1:80) - HTTP State: DOWN Last state change was at Thu Nov 4 10:14:52 2010 Time since last state change: 0 days, 00:00:15.990 Server Name: 10.101.10.1 Server ID : 0 Monitor Threshold : 0

Down state flush: ENABLED Hash Id: 12345

1) Monitor Name: tcp-default State: DOWN Weight: 1

Customizing the Hash Algorithm for Persistence across Virtual Servers

137

Page 138: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Done

To specify a hash identifier for an existing service byusing the command line interface

Type the set service command, the name of the service, and -hashID followed by the IDvalue.

To specify a hash identifier while adding a servicegroup member

To specify a hash identifier for each member to be added to the group and verify thesetting, at the command prompt, type the following commands (Be sure to specify a uniquehashID for each member.):

bind servicegroup <serviceGroupName> <memberName> <port> -hashId <positive_integer>

show servicegroup <serviceGroupName>

Example

bind servicegroup http_svc_group 10.102.27.153 80 -hashId 2222222

>show servicegroup SRV SRV - HTTP State: ENABLED Monitor Threshold : 0 …

1) 1.1.1.1:80 State: DOWN Server Name: 1.1.1.1 Server ID: 123 Weight: 1 Hash Id: 32211

Monitor Name: tcp-default State: DOWN …

2) 2.2.2.2:80 State: DOWN Server Name: 2.2.2.2 Server ID: 123 Weight: 1 Hash Id: 12345

Monitor Name: tcp-default State: DOWN …Done

Customizing the Hash Algorithm for Persistence across Virtual Servers

138

Page 139: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Parameters for configuring a servicename

Name of the service. This alphanumeric string is required. The name must not exceed127 characters, and the leading character must be a number or a letter. The followingcharacters are also allowed: @ _ - . (period) : (colon) # and space ( ).

ip

IP address of the server that is associated with the service, in either IPv4 or IPv6 format.

serverName

Name of the server that is associated with the service. The name must not exceed 127characters, and the leading character must be a number or a letter. The followingcharacters are also allowed: @ _ - . (period) : (colon) # and space ( ).

serviceType

Protocol supported by the service. Possible values: HTTP, FTP, TCP, UDP, SSl,SSL_BRIDGE, SSL_TCP, NNTP, RPCSVR, DNS, ADNS, SNMP, RTSP, DHCPRA, ANY, SIP_UDP,DNS_TCP, ADNS_TCP, RDP, RADIUS.

port

The port number used for the service.

hashId

The hash identifier for the service. Must be unique for each service. Minimum value: 1,Maximum value: 4294967295.

Customizing the Hash Algorithm for Persistence across Virtual Servers

139

Page 140: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To specify a hash identifier for a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and click Services.

2. In the details pane, do one of the following:

• To create a new service, click Add.

• To modify an existing service, select the service and then click Open.3. In the Create Service or Configure Service dialog box, specify values for the following

parameters, which correspond to the parameters described in "Parameters for adding aservice," as shown:

• ServiceName*—name

• Server*—ip or serverName

• Protocol*—serviceType

• Port*—port4. Click the Advanced tab and then scroll down in the dialog box.

5. In the Hash ID box, type a unique hash ID value.

6. Click Create.

7. Open the service and verify the settings you just configured.

To specify a hash identifier for an already configuredservice group member by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. Select a service group, and then click Open.

3. On the Members tab, under Configured Members, in the row of the member for whichyou want to specify a hash ID value, double-click the space in the Hash ID column.

4. Type a unique hash ID value.

5. Click OK.

6. Open the service group and verify the hash IDs of the service group members you justconfigured.

Customizing the Hash Algorithm for Persistence across Virtual Servers

140

Page 141: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

141

Configuring the Redirection Mode

The redirection mode configures the method used by a virtual server to determine where toforward incoming traffic. The NetScaler appliance supports the following redirectionmodes:

• IP-Based forwarding (the default)

• MAC-Based forwarding

You can configure MAC-Based forwarding on networks that use direct server return (DSR)topology, link load balancing, or firewall load balancing. For more information onMAC-Based forwarding, see Advanced Networking.

To configure the redirection mode by using thecommand line interface

At the command prompt, type:

set lb vserver <name>@ -m <RedirectionMode>

Example

set lb vserver Vserver-LB-1 -m MAC

Parameter for configuring the redirection modem

The load balancing redirection mode. Possible Values: IP, MAC. Default: IP.

If set to IP, the destination IP address of the request is changed to the IP address of theserver to which you are redirecting traffic, and the traffic is then forwarded to thatserver.

If set to MAC, the destination MAC address is changed to the MAC address of the server towhich you are redirecting traffic, and the traffic is then forwarded to that server. Withthis setting, the destination IP address of the traffic is not changed.

Page 142: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure the redirection mode by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure theredirection mode, and then click Open.

3. On the Advanced tab, under Redirection Mode, click either IP-Based or MAC-Based.

4. Click OK.

Configuring the Redirection Mode

142

Page 143: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

143

Configuring per-VLAN Wildcarded VirtualServers

If you want to configure load balancing for traffic on a specific virtual local area network(VLAN), you can create a wildcarded virtual server with a listen policy that restricts it toprocessing traffic only on the specified VLAN.

To configure a wildcarded virtual server that listens toa specific VLAN by using the command line interface

At the command prompt, type the following commands to configure a wildcarded virtualserver that listens to a specific VLAN and verify the configuration:

• add lb vserver <name> <serviceType> IPAddress * Port * -listenpolicy <expression>[-listenpriority <positive_integer>]

• show vserver

Example

add lb vserver Vserver-LB-vlan1 ANY -listenpolicy "CLIENT.VLAN.ID.EQ(2)" -listenpriority 10

show vserver Vserver-LB-vlan1

Parameters for configuring per-VLAN wildcardedvirtual servers

name

Name of the virtual server. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( ).

IPAddress

IP address of the virtual server. For wildcarded virtual servers bound to VLANs, this isalways *

serviceType

Behavior of the service. Select one of the following service types: HTTP, FTP, TCP, UDP,SSL, SSL_BRIDGE, SSL_TCP, NNTP, RPCSVR, DNS, ADNS, SNMP, RTSP, DHCPRA, ANY,SIP_UDP, DNS_TCP, ADNS_TCP, RADIUS, MYSQL, MSSQL, and RDP.

Page 144: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

port

Port on which the virtual server listens for client connections. The port number must bein the range 0-65535. For wildcarded virtual servers bound to VLANs, the setting isnormally *.

listenpolicy

Use this parameter to specify the listen policy for LB Vserver. The string can be either anexisting expression name (configured using add policy expression command) or else it canbe an in-line expression with a maximum of 1500 characters.

listenpriority

The priority assigned to the listen policy. This can be any positive integer. Priority isevaluated in reverse order; the lower the number, the higher the priority assigned to thelisten policy.

rule

The policy rule to use to identify the VLAN that you want this virtual server to listen to.This rule is:

• CLIENT.VLAN.ID.EQ(<integer>)

• For <integer>, substitute the ID number assigned to the VLAN.

Configuring per-VLAN Wildcarded Virtual Servers

144

Page 145: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure a wildcarded virtual server that listens toa specific VLAN by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, do one of the following:

• To create a new virtual server, click Add.

• To modify an existing virtual server, select the virtual server, and then click Open.3. In the Create Virtual Server or Configure Virtual Server dialog box, on the Services tab,

specify values for the following parameters, which correspond to parameters describedin “Parameters for configuring per-VLAN wildcarded virtual servers” as shown:

• Name*—name

• Protocol*—serviceType

• IP address*—IPAddress

• Port—port*A required parameter

4. In the Advanced tab, expand Listen Policy, and then specify values for the followingparameters, which correspond to parameters described in “Parameters for configuringper-VLAN wildcarded virtual servers” as shown:

• Listen Priority*—listenpriority

• Listen Policy Rule*—rule*A required parameter

5. Click Create or OK, depending on whether you are creating a new virtual server ormodifying an existing virtual server.

6. Click Close. The virtual server that you created now appears in the Virtual Serverspage.

7. To remove a virtual server, in the Virtual Servers pane select the virtual server, andthen click Remove.

After you have created this virtual server, you bind it to one or more services as describedin Setting Up Basic Load Balancing.

Configuring per-VLAN Wildcarded Virtual Servers

145

Page 146: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

146

Assigning Weights to Services

In a load balancing configuration, you assign weights to services to indicate the percentageof traffic that should be sent to each service. Services with higher weights can handle morerequests; services with lower weights can handle fewer requests. Assigning weights toservices allows the NetScaler appliance to determine how much traffic each load balancedserver can handle, and therefore more effectively balance load.

Note: If you use a load balancing method that supports weighting of services (forexample, the round robin method), you can assign a weight to the service.

The following table describes the load balancing methods that support weighting, andbriefly describes the manner in which weighting affects how a service is selected for eachone.

Load Balancing Methods Service Selection with Weights

Round Robin The virtual server prioritizes the queue ofavailable services such that services withthe highest weights come to the front ofthe queue more frequently than those withthe lowest weights and receiveproportionately more traffic. For acomplete description, see The Round RobinMethod.

Least Connection The virtual server selects the service withthe best combination of fewest activetransactions and highest weight. For acomplete description, see The LeastConnection Method.

Least Response Time and Least ResponseTime Method using Monitors

The virtual server selects the service withthe best combination of fewest activetransactions and fastest average responsetime. For a complete description, see TheLeast Response Time Method.

Least Bandwidth The virtual server selects the service withthe best combination of least traffic andhighest bandwidth. For a completedescription, see The Least BandwidthMethod.

Least Packets The virtual server selects the service withthe best combination of fewest packetsand highest weight. For a completedescription, see The Least Packets Method.

Custom Load The virtual server selects the service withthe best combination of lowest load andhighest weight. For a completedescription, see The Custom Load Method.

Page 147: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Hashing methods and Token method Weighting is not supported by these loadbalancing methods.

To configure a virtual server to assign weights toservices by using the command line interface

At the command prompt, type:

set lb vserver <name>@ -weight <Value> <ServiceName>

Example

set lb vserver Vserver-LB-1 -weight 10 Service-HTTP-1

Parameter for setting weightsweight

Weight to be assigned to the specified service. The minimum value is 1 and the maximumvalue is 100.

To configure a virtual server to assign weights toservices by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server, and then click Open.

3. On the Services tab, in the Weights spin box, type or select the weight to assign to theservice (for example, 10).

4. Click OK.

Assigning Weights to Services

147

Page 148: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

148

Protecting the Load BalancingConfiguration against Failure

When a load balancing virtual server fails, or when the virtual server is unable to handleexcessive traffic, the load balancing setup can fail. You can protect your load balancingsetup against failure by configuring the NetScaler appliance to redirect excess traffic to analternate URL, configuring a backup load balancing virtual server, and configuring statefulconnection failover.

Page 149: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

149

Redirecting Client Requests to anAlternate URL

In the event that a load balancing virtual server of type HTTP or type HTTPS goes DOWN oris disabled, you can redirect requests to an alternate URL by using an HTTP 302 redirect.The alternate URL can provide information about the status of the server.

You can redirect to a page on the local server or a remote server. You can redirect to arelative URL or an absolute URL. If you configure a redirect to a relative URL consisting of adomain name with no path, the NetScaler appliance appends the path of the incoming URLto the domain. If you use an absolute URL, the HTTP redirect is sent to that URL with nomodification.

Note: If a load balancing virtual server is configured with both a backup virtual serverand a redirect URL, the backup virtual server takes precedence over the redirect URL. Aredirect is used only when both the primary and backup virtual servers are DOWN.

To configure a virtual server to redirect the clientrequest to a URL by using the command line interface

At the command prompt, type:

set lb vserver <vServerName> -redirectURL <URLValue>

Example

set lb vserver Vserver-LB-1 -redirectURL http://www.newdomain.com/mysite/maintenance

Parameters for Redirecting Client Requests to anAlternative URL

redirectURL

URL to which traffic is redirected when the load balancing virtual server is unavailable.This URL length must not exceed 127 characters.

Note: The domain specified in the URL must not match the domain specified in thedomain name argument of a content switching policy. If the same domain is specifiedin both arguments, the request is redirected continuously to the same unavailable loadbalancing virtual server.

Page 150: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure a virtual server to redirect the clientrequest to a URL by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure redirectURL, and then click Open.

3. On the Advanced tab, in the Redirect URL text box, type the URL (for example,http://www.newdomain.com/mysite/maintenance).

4. Click OK.

Redirecting Client Requests to an Alternate URL

150

Page 151: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

151

Configuring a Backup Load BalancingVirtual Server

You can configure the NetScaler appliance to direct requests to a backup virtual server inthe event that the primary load balancing virtual server is DOWN or unavailable. Thebackup virtual server is a proxy and is transparent to the client. The appliance can alsosend a notification message to the client regarding the site outage.

You can configure a backup load balancing virtual server when you create it, or you canchange the optional parameters of an existing virtual server. You can also configure abackup virtual server for an existing backup virtual server, thus creating cascading backupvirtual servers. The maximum depth of cascading backup virtual servers is 10.

If you have multiple virtual servers that connect to two servers, you have a choice for whathappens if the primary virtual server goes DOWN and then comes back up. The defaultbehavior is for the primary virtual server to resume its role as primary. However, you maywant to configure the backup virtual server to remain in control in the event that it takesover. For example, you may want to sync updates on the backup virtual server to theprimary virtual server and then manually force the original primary server to resume itsrole. In this case, you can designate the backup virtual server to remain in control in theevent that the primary virtual server goes DOWN and then comes back up.

You can configure a redirect URL on the primary load balancing virtual server as a fallbackfor when both the primary and the backup virtual servers are DOWN or have reached theirthreshold for handling requests. When services bound to virtual servers are OUT OFSERVICE, the appliance uses the redirect URL.

Note: If a load balancing virtual server is configured with both a backup virtual serverand a redirect URL, the backup virtual server takes precedence over the redirect URL. Aredirect is used only when the primary and backup virtual servers are down.

To set a backup virtual server by using the commandline interface

At the command prompt, type:

set lb vserver <vServerName> -backupVserver <BackupVServerName>[-disablePrimaryOnDown]

Example

set lb vserver Vserver-LB-1 -backupVserver Vserver-LB-2 -disablePrimaryOnDown

Page 152: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Parameters for configuring a backup load balancingvirtual server

backupVserver

Name of the backup virtual server. You can create a virtual server and specify the name,IP address, port, and type as described in “Creating a Virtual Server,” on page 38. Youcan use the name of the virtual server as a backup virtual server

disablePrimaryOnDown

Configures the backup virtual server to remain in control, after it takes over, until youmanually reenable the primary virtual server.

To set a backup virtual server by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure the backupvirtual server, and then click Open.

3. On the Advanced tab, in the Backup Virtual Server list, select the backup virtual server.

4. If you want the backup virtual server to remain in control until you manually re-enablethe primary virtual server even if the primary virtual server comes back up, select theDisable Primary When Down check box.

5. Click OK.

Configuring a Backup Load Balancing Virtual Server

152

Page 153: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

153

Diverting Excess Traffic to a BackupVirtual Server

In addition to taking over for a primary virtual server when it becomes unavailable, abackup load balancing virtual server can handle excess traffic when the primary virtualserver reaches its limit. To set this up, you configure the spillover option to divert newconnections to the backup virtual server when the number of connections to the primaryvirtual server exceeds the threshold. You can allow the NetScaler appliance to calculate thethreshold dynamically, or you can configure the value manually.

When spillover is configured, the appliance compares the number of established TCPconnections on the primary virtual server with the threshold value. When the number ofconnections reaches the threshold, it diverts new connections to the backup virtual server.

You can configure persistence with spillover. When persistence is configured, connectionsthat are diverted to the backup virtual server are not moved back to the primary virtualserver after the number of connections on it drops below the threshold. Instead, theprimary virtual server accepts new client connections.

If the backup virtual server reaches its own threshold and is unable to accept additionalconnections, the appliance diverts all requests to the redirect URL. If a redirect URL is notconfigured on the primary virtual server, any requests over the threshold are dropped.

Note: With RTSP virtual servers, the appliance uses only data connections for spillover. Ifthe backup RTSP virtual server is not available, the requests are redirected to an RTSPURL and an RTSP redirect message is sent to the client.

To configure a primary virtual server to divert newconnections to a backup virtual server by using thecommand line interface

At the command prompt, type:

set lb vserver <vServerName> -soMethod <spillOverType> -soThreshold <positiveInteger>-soPersistence ENABLED -soPersistenceTimeout <positiveInteger>

Example

set lb vserver Vserver-LB-1 -soMethod Connection -soThreshold 1000 -soPersistence enabled -soPersistenceTimeout 2

Page 154: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Parameters diverting excess traffic to a backup virtualserver

soMethod

The spillover method to use for diverting traffic to the backup virtual server when theprimary virtual server reaches the spillover threshold. Available settings function asfollows:

• CONNECTION. Spillover occurs when the number of client connections at the virtualserver exceeds the static threshold value (the value of the Threshold parameter).

• DYNAMICCONNECTION. Spillover occurs when the number of client connections at thevirtual server exceeds a dynamically calculated threshold. The dynamic threshold isthe sum of the maximum client (Max Clients) settings of the bound services that areup. Do not specify a spillover threshold for this setting, because the threshold isimplied by the Max Clients settings of bound services.

• BANDWIDTH. Spillover occurs when the bandwidth consumed by the virtual server'sincoming and outgoing traffic exceeds the static threshold value.

• HEALTH. Spillover occurs when the percentage of weights of the services that are UPdrops below the static threshold value. For example, if services svc1, svc2, and svc3are bound to a virtual server, with weights 1, 2, and 3, and the spillover threshold is50%, spillover occurs if svc1 and svc3 or svc2 and svc3 transition to DOWN.

• NONE. Spillover does not occur.soThreshold

Threshold at which spillover occurs. Specify an integer for the CONNECTION spillovermethod, a bandwidth value in kilobits per second for the BANDWIDTH method (do notenter the units), or a percentage for the HEALTH method (do not enter the percentagesymbol).

soPersistence

If spillover occurs, maintain source IP address based persistence for both primary andbackup virtual servers. Possible values: ENABLED, DISABLED. Default: DISABLED.

soPersistenceTimeout

Time-out for spillover persistence, in minutes. Minimum value: 2. Maximum value: 1440.Default: 2.

Diverting Excess Traffic to a Backup Virtual Server

154

Page 155: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set a primary virtual server to divert newconnections to a backup virtual server by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure thespillover, and then click Open.

3. On the Advanced tab, in the Method list, select the type of threshold, and in Thresholdtext box, type the threshold value.

4. Under Spillover, select the Persistence check box, and in Persistence Time-out (min)text box type the time-out.

5. Click OK.

Diverting Excess Traffic to a Backup Virtual Server

155

Page 156: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

156

Configuring Connection-Based Spillover

You can use connection-based spillover to configure a maximum threshold for the numberof active client connections on a virtual server. When the client connections exceed theconfigured threshold limit, new client connections are diverted to the backup virtualserver.

To configure connection-based spillover, see Diverting Excess Traffic to a Backup VirtualServer.

Note: Global Server Load Balancing (GSLB) virtual servers do not supportconnection-based spillover.

Page 157: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

157

Configuring Dynamic Spillover

When you configure dynamic spillover, if the number of client connections to the primaryload balancing virtual server exceeds the sum of the maximum client values, newconnections are diverted to the backup virtual server.

To configure dynamic spillover, you must first enable it on the primary virtual server. Next,you configure each service that is bound to that virtual server with appropriate maximumclient values for that service. Different services can have different maximum client values.If the value for maximum client is set to 0, the spillover limit is treated as infinity, andspillover never occurs.

Note: Content-based virtual servers do not support dynamic spillover.

To configure dynamic spillover, see Diverting Excess Traffic to a Backup Virtual Server.

Page 158: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

158

Configuring Bandwidth-Based Spillover

With bandwidth-based spillover, when the bandwidth used by the primary load balancingvirtual server exceeds the specified bandwidth threshold value, the NetScaler appliancediverts new connections to the backup virtual server. You can also configure the backupvirtual server with a threshold value. When the threshold for the backup virtual server isreached, the appliance diverts new client connections to the next backup virtual server.

To configure bandwidth-based spillover, see Diverting Excess Traffic to a Backup VirtualServer.

Page 159: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

159

Connection Failover

Connection failover helps prevent disruption of access to applications deployed in adistributed environment. In a NetScaler High Availability (HA) setup, connection failover (orconnection mirroring-CM) refers to keeping active an established TCP or UDP connectionwhen a failover occurs. The new primary NetScaler appliance has information about theconnections established before the failover and continues to serve those connections. Afterfailover, the client remains connected to the same physical server. The new primaryappliance synchronizes the information with the new secondary appliance by using the SSFframework.

You can set up connection failover in either stateless or stateful mode. In the statelessconnection failover mode, the HA nodes do not exchange any information about theconnections that are failed over. This method has no runtime overhead.

In the stateful connection failover mode, the primary appliance synchronizes the data ofthe failed-over connections with the new secondary appliance.

How Connection Failover Works on NetScalerAppliances

In stateless connection failover, the new primary appliance tries to re-create the packetflow according to the information contained in the packets it receives.

In stateful failover, to maintain current information about the mirrored connections, theprimary appliance sends messages to the secondary appliance. The secondary appliancemaintains the data related to the packets but uses it only in the event of a failover. If afailover occurs, the new primary (old secondary) appliance starts using the stored dataabout the mirrored connections and accepting traffic. During the transition period, theclient and server may experience a brief disruption and retransmissions.

Note:

Verify that the primary appliance is able to authorize itself on the secondary appliance. Toverify correct configuration of the passwords, use the show rpcnode command fromcommand line or use the RPC option of the Network menu from the configuration utility.

A basic HA configuration with connection failover contains the entities shown in thefollowing figure.

Page 160: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 1. Connection Failover Entity Diagram

Supported SetupConnection failover can be configured only on load balancing virtual servers. It cannot beconfigured on content-switching virtual servers.

The following table describes the setup supported for connection failover.

Table 1. Connection Failover - Supported Setup

Setting Stateless Stateful

Servicetype

ANY. ANY, UDP, TCP, FTP, SSL_BRIDGE.

Loadbalancingmethods

All methodssupported forthe service typeANY.

However, ifSource IPpersistence isnot set, the SRCIPSRCPORTHASHmethod must beused.

All methods applicable to the supported service types.

Connection Failover

160

Page 161: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Persistencetypes

SOURCEIPpersistence.

All types applicable to the supported service types aresupported.

USIP Must be ON. No restriction.

It can be ON or OFF.

Servicebindings

Service can bebound to onlyone virtualserver.

Service can be bound to one or more virtual servers.

InternetProtocol(IP) versions

IPv4 and IPv6 IPV4

Redundancysupport

Clustering andhigh availability

High availability

Features Affected by Connection FailoverThe following table lists the features affected if connection failover is configured.

Table 2. How Connection Failover Affects NetScaler Features

Feature Impact of Connection Failover

SYN protection For any connection, if a failover occurs after the NetScaler issuesSYN-ACK but before it receives the final ACK, the connection is notsupported by connection failover. The client must reissue the requestto establish the connection.

Surgeprotection

If the failover occurs before a connection with the server isestablished, the new primary NetScaler tries to establish theconnection with the server. It also retransmits all the packets held inthe course of surge protection.

Access down If enabled, the access-down functionality takes precedence overconnection failover.

ApplicationFirewall™

The Application Firewall feature is not supported.

INC Independent network configuration is not supported in the highavailability (HA) mode.

TCP buffering TCP buffering is not compatible with connection mirroring.

Close onresponse

After failover, the NATPCBs may not be closed on response.

IPv6 virtualservers

Not yet supported.

Connection Failover

161

Page 162: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

162

Configuring Connection Failover

You can configure connection failover on a load balancing virtual server.

To configure connection failover by using thecommand line interface

At the command prompt, type:

set lb vserver <vServerName> -connFailover <Value>

Example

set lb vserver Vserver-LB-1 -connFailover stateful

Parameters for configuring connection failoverconnFailover

State of connection failover on the virtual server. Valid values: STATELESS, STATEFUL,DISABLE. Default: DISABLE.

To configure connection failover by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the Load Balancing Virtual Servers pane, select the virtual server for which you wantto configure connection failover, and click Open.

3. On the Advanced tab, in the Connection Failover drop-down list, select Stateful.

4. Click OK.

Page 163: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

163

Disabling Connection Failover

When connection failover is disabled on a virtual server, the resources allocated to thevirtual server are freed.

To disable a connection failover by using thecommand line interface

At the command prompt, type:

set lb vserver <vServerName> -connFailover <Value>

Example

set lb vserver Vserver-LB-1 -connFailover disable

To disable a connection failover by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the Load Balancing Virtual Servers pane, select the virtual server for which you wantto configure a connection failover and click Open.

3. On the Advanced tab, in the Connection Failover drop-down list box, select Disable.

4. Click OK.

Page 164: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

164

Flushing the Surge Queue

When a physical server receives a surge of requests, it becomes slow to respond to theclients that are currently connected to it, which leaves users dissatisfied and disgruntled.Often, the overload also causes clients to receive error pages. To avoid such overloads, theNetScaler appliance provides features such as surge protection, which controls the rate atwhich new connections to a service can be established.

The appliance does connection multiplexing between clients and physical servers. When itreceives a client request to access a service on a server, the appliance looks for an alreadyestablished connection to the server that is free. If it finds a free connection, it uses thatconnection to establish a virtual link between the client and the server. If it does not findan existing free connection, the appliance establishes a new connection with the server,and establishes a virtual link between client and the server. However, if the appliancecannot establish a new connection with the server, it sends the client request to a surgequeue. If all the physical servers bound to the load balancing or content switching virtualserver reach the upper limit on client connections (max client value, surge protectionthreshold or maximum capacity of the service), the appliance cannot establish a connectionwith any server. The surge protection feature uses the surge queue to regulate the speed atwhich connections are opened with the physical servers. The appliance maintains adifferent surge queue for each service bound to the virtual server.

The length of a surge queue increases whenever a request comes for which the appliancecannot establish a connection, and the length decreases whenever a request in the queuegets sent to the server or a request gets timed out and is removed from the queue.

If the surge queue for a service or service group becomes too long, you may want to flushit. You can flush the surge queue of a specific service or service group, or of all the servicesand service groups bound to a load balancing virtual server. Flushing a surge queue does notaffect the existing connections. Only the requests present in the surge queue get deleted.For those requests, the client has to make a fresh request.

You can also flush the surge queue of a content switching virtual server. If a contentswitching virtual server forwards some requests to a particular load balancing virtualserver, and the load balancing virtual server also receives some other requests, when youflush the surge queue of the content switching virtual server, only the requests receivedfrom this content switching virtual server are flushed; the other requests in the surge queueof the load balancing virtual server are not flushed.

Note: You cannot flush the surge queues of cache redirection, authentication, VPN orGSLB virtual servers or GSLB services.

Note: Do not use the Surge Protection feature if Use Source IP (USIP) is enabled.

To flush a surge queue by using the command lineinterface

The flush ns surgeQ command works in the following manner:

Page 165: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• You can specify the name of a service, service group, or virtual server whose surgequeue has to be flushed.

• If you specify a name while executing the command, surge queue of the specified entitywill be flushed. If more than one entity has the same name, the appliance flushes surgequeues of all those entities.

• If you specify the name of a service group, and a server name and port while executingthe command, the appliance flushes the surge queue of only the specified service groupmember.

• You cannot directly specify a service group member (<serverName> and <port>) withoutspecifying the name of the service group (<name>) and you cannot specify <port>without a <serverName>. Specify the <serverName> and <port> if you want to flush thesurge queue for a specific service group member.

• If you execute the command without specifying any names, the appliance flushes thesurge queues of all the entities present on the appliance.

• If a service group member is identified with a server name, you must specify the servername in this command; you cannot specify its IP address.

At the command prompt, type:

flush ns surgeQ [-name <name>] [-serverName <serverName> <port>]

Examples

1.flush ns surgeQ –name SVC1ANZGB –serverName 10.10.10.1 80The above command flushes the surge queue of the service or virtual server that is named SVC1ANZGB and has IP address as 10.10.102.flush ns surgeQThe above command flushes all the surge queues on the appliance.

Parameters for flushing a surge queuename

Name of a virtual server, service or service group

serverName

Name of a service group member

Flushing the Surge Queue

165

Page 166: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

166

Managing a Load Balancing Setup

An existing Load Balancing setup does not require a great deal of work to maintain as longas it is unchanged, but most do not remain unchanged for long. Increasing load requiresnew load-balanced servers and eventually new NetScaler appliances, which must beconfigured and added to the existing setup. Old servers wear out and need to be replaced,requiring removal of some servers and addition of others. Upgrades to your networkingequipment or changes to topology may also require modifications to your load balancingsetup. Therefore, you will need to perform operations on server objects, services, andvirtual servers. The Visualizer can display your configuration graphically, and you canperform operations on the entities in the display. You can also take advantage of a numberof other features that facilitate management of the traffic through your load balancingsetup.

Page 167: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

167

Managing Server Objects

During basic load balancing setup, when you create a service, a server object with the IPaddress of the service is created, if one does not already exist. If you prefer for yourservice objects named with domain names rather than IP addresses, you might also havecreated one or more server objects manually. You can enable, disable, or remove anyserver object.

When you enable or disable a server object, you enable or disable all services associatedwith the server object. When you refresh the NetScaler appliance after disabling a serverobject, the state of its service appears as OUT OF SERVICE. If you specify a wait time whendisabling a server object, the server object continues to handle established connections forthe specified amount of time, but rejects new connections. If you remove a server object,the service to which it is bound is also deleted.

To enable a server by using the command lineinterface

At the command prompt, type:

enable server <name>@

Example

enable server 10.102.29.5

To enable a server object by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Servers.

2. In the details pane, select the server that you want to enable, and then click Enable.

3. In the Enable dialog box, click Yes.

To disable a server object by using the command lineinterface

At the command prompt, type:

disable server <name>@ <delay>

Page 168: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Example

disable server 10.102.29.5 30

Wait time parameterdelay

The time, in seconds, after which the server object is marked DOWN.

To disable a server object by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Servers.

2. In the details pane, select the server that you want to disable, and then click Disable.

3. In the Wait Time dialog box, type the wait time after which the server is to be disabled(for example 30).

4. Click Enter.

To remove a server object by using the command lineinterface

At the command prompt, type:

rm server <name>@

Example

rm server 10.102.29.5

To remove a server object by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Servers.

2. In the details pane, select the server that you want to remove, and then click Remove.

3. In the Remove dialog box, click Yes.

Managing Server Objects

168

Page 169: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

169

Managing Services

Services are enabled by default when you create them. You can disable or enable eachservice individually. When disabling a service, you normally specify a wait time duringwhich the service continues to handle established connections, but rejects new ones,before shutting down. If you do not specify a wait time, the service shuts downimmediately. During the wait time, the service’s state is OUT OF SERVICE.

You can remove a service when it is no longer used. When you remove a service, it isunbound from its virtual server and deleted from the NetScaler configuration.

To enable a service by using the command lineinterface

At the command prompt, type:

enable service <name>

Example

enable service Service-HTTP-1

To enable a service by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service that you want to enable (for example,Service-HTTP-1), and click Enable.

3. In the Enable dialog box, click Yes.

To disable a service by using the command lineinterface

At the command prompt, type:

disable service <name>@ <DelayInSeconds>

Example

disable service Service-HTTP-1 30

Page 170: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Wait Time Parameterdelay

The time, in seconds, after which the service is marked DOWN.

To disable a service by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service that you want to disable (for example,Service-HTTP-1), and then click Disable.

3. In the Wait Time dialog box, type the wait time after which the service is to bedisabled (for example, 30).

4. Click Enter.

To remove a service by using the command lineinterface

At the command prompt, type:

rm service <name>@

Example

rm service Service-HTTP-1

To remove a service by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service that you want to remove (for example,Service-HTTP-1), and then click Remove.

3. In the Remove dialog box, click Yes.

Managing Services

170

Page 171: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

171

Managing a Load Balancing VirtualServer

Virtual servers are enabled by default when you create them. You can disable and enablevirtual servers manually. If you disable a virtual server, the virtual server’s state appears asOUT OF SERVICE. When this happens, the virtual server terminates all connections, eitherimmediately or after allowing existing connections to complete, depending on the setting ofthe downStateFLush parameter. If downStateFLush is ENABLED (default), all theconnections are flushed. If DISABLED, the virtual server continues to serve requests onexisting connections.

You remove a virtual server only when you no longer require the virtual server. Before youremove it, you must unbind all services from it.

To enable a virtual server by using the command lineinterface

At the command prompt, type:

enable lb vserver <name>@

Example

enable lb vserver Vserver-LB-1

To enable a virtual server by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to enable, and click Enable.

3. In the Enable dialog box, click Yes.

To disable a virtual server by using the command lineinterface

At the command prompt, type:

Page 172: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

disable vserver

Example

disable lb vserver Vserver-LB-1

To disable a virtual server by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to disable, and then clickDisable.

3. In the Disable dialog box, click Yes.

Note: In the disabled state, a virtual server continues to exist on the network. TheNetScaler appliance continues to respond to address resolution protocol (ARP) andInternet control message protocol (ICMP) requests directed to the IP address of thevirtual server.

To unbind a service from a virtual server by using thecommand line interface

At the command prompt, type:

unbind lb vserver <name>@ <serviceName>

Example

unbind lb vserver Vserver-LB-1 Service-HTTP-1

Managing a Load Balancing Virtual Server

172

Page 173: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To unbind a service from a virtual server by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server from which you want to unbind a service,and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, in the Services tab, clearthe Active check box next to the service that you want to unbind from the virtualserver.

4. Click OK.

To remove a virtual server by using the command lineinterface

At the command prompt, type:

rm lb vserver <name>@

Example

rm lb vserver Vserver-LB-1

To remove a virtual server by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to remove, and then clickRemove.

3. In the Remove dialog box, click Yes.

Managing a Load Balancing Virtual Server

173

Page 174: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

174

The Load Balancing Visualizer

The Load Balancing Visualizer is a tool that you can use to view and modify the loadbalancing configuration in graphical format. Following is an example of the Visualizerdisplay

Figure 1. Load Balancing Visualizer Display

You can use the visualizer to view the following:

• The services and service groups that are bound to a virtual server.

• The monitors that are bound to each service.

• The policies that are bound to the virtual server.

• The policy labels, if configured.

• Configuration details of any displayed element.

• Load balancing virtual server statistics.

• Statistical information such as the number of requests received per second by thevirtual server and the number of hits per second for rewrite, responder, and cache

Page 175: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

policies.

• A comparative list of all the parameters whose values either differ or are not definedacross service containers.

You can also use the Visualizer to add and bind new objects, modify existing ones, andenable or disable objects. Most configuration elements displayed in the Visualizer appearunder the same names as in other parts of the configuration utility. However, unlike therest of the configuration utility, the Visualizer groups services that have the sameconfiguration details and monitor bindings into an entity called a service container.

A service container is set of similar services and service groups that are bound to a singleload balancing virtual server. Next to the service container is a number that shows thenumber of services in the group. The services in the container have the same properties,with the exception of the name, IP address, and port, and their monitor bindings shouldhave the same weight and binding state. When you bind a new service to a virtual server, itis placed into an existing container if its configuration and monitor bindings match those ofother services; otherwise, it is placed in its own container.

The service container display can help you troubleshoot your configuration if something isnot functioning as you expect. More than one container for a particular virtual server is anindication that something is wrong with the configuration of that virtual server and itsservices. To correct the problem, you must first identify the container that has the desiredconfiguration. You can do so by using the Service Attributes Diff feature, described below.After you identify the container, you right-click the container and click Apply Configuration.

The following procedures provide only basic steps for using the Visualizer. Because theVisualizer duplicates functionality in other areas of the Load Balancing feature, othermethods of viewing or configuring all of the settings that can be configured in the Visualizerare provided throughout the Load Balancing documentation.

Note: The Visualizer requires a graphic interface, so it is available only through theconfiguration utility.

The Load Balancing Visualizer

175

Page 176: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To view load balancing virtual server properties byusing the Visualizer

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to view, and then clickVisualizer.

3. In the Load Balancing Visualizer dialog box, you can adjust the viewable area asfollows:

• Click the Zoom In and Zoom Out icons to increase or decrease the size of theviewed objects. You can click and drag the viewable area if an item that you wantto see disappears from view after zooming in.

• Click the Best Fit icon to optimize the viewing area.

• Click the Save Image icon to save the graph as an image file.

• Click the image, hold down the mouse button, and drag the image to pan the view.

• In the Search in text field, begin typing the name of the item you are looking for.The item’s location is then highlighted. To restrict the search, click the drop-downmenu and select the type of element that you want to search for

The Load Balancing Visualizer

176

Page 177: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To view configuration details for services, servicegroups, and monitors by using the Visualizer

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to view, and then clickVisualizer.

3. In the Load Balancing Visualizer dialog box, to view configuration details for entitiesthat are bound to this virtual server, you can do the following:

• To view a summary of bound services, position the cursor over the virtual servericon.

• To view services in a service container, click the icon for a service group, click theRelated Tasks tab, click Show Member Services, and then click the service groupname. To view additional details about the services click Open.

• To view common properties of services in a service group, click the icon for theservice group, click the Related Tasks tab, and view the Details section of the tab.

• To view a comparative list of the parameters whose values either differ or are notdefined across service containers, click the icon for a container, click the RelatedTasks tab, and then click Service Attributes Diff. To view monitor binding details forthe services in a container, in the Service Attributes Diff dialog box, in the Groupcolumn for the container, click Details.

• To view the details for a monitor, position the cursor over the icon or click the iconfor the monitor. For additional details, click the icon, click the Related Tasks tab,and then click View Monitor.

• To view binding details of a monitor, click the connecting line between the monitorand its related service.

The Load Balancing Visualizer

177

Page 178: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To view configuration details for policies and policylabels by using the Visualizer in the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to view, and then clickVisualizer.

3. In the Load Balancing Visualizer dialog box, to view configuration details for entitiesthat are bound to this virtual server, you can do the following:

• To view policies that are bound to this virtual server, select one or more policyicons in the tool bar at the top of the dialog box. For example, you can selectCompression, Filter, Rewrite, and Responder. If policy labels are configured, theyappear in the main view area.

• For bound policies that appear in the view pane of the Visualizer, to view a policy’sexpression and actions, position the cursor over the policy icon. To view bindingdetails, position the cursor over the line that connects the policy to the virtualserver. To view these details, click the policy. The details of the policy appear inthe details pane.

To view statistical information by using the Visualizer1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to view, and then clickVisualizer.

3. In the Load Balancing Visualizer dialog box, to view statistical information, you can dothe following:

• To view detailed statistics for the load balancing virtual server, click the icon forthe virtual server, click the Related Tasks tab, and then click Statistics.

• To view the number of requests received per second at a given point in time by theload balancing virtual server and the number of hits per second at a given point intime for rewrite, responder, and cache policies, click Show Stats. The statisticalinformation is displayed on the respective nodes in the Visualizer. This informationis not updated in real time and has to be refreshed manually. To refresh thisinformation, click Refresh Stats.

Note: The Show Stats option is available only on NetScaler nCore builds.

The Load Balancing Visualizer

178

Page 179: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To save configuration properties for any entity byusing the Visualizer

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to view, and then clickVisualizer.

3. To copy configuration details for an element to a document or spreadsheet, click theicon for that element, click Related Tasks.

4. In the Related Tasks tab, click Copy Properties and then paste the information into adocument.

To bind a resource to a load balancing configurationby using the Visualizer

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure bindings,and then click Visualizer.

3. In the Load Balancing Visualizer dialog box, click the Available Resources tab, select aresource type in the drop-down menu, and do one or more of the following:

• To bind a new monitor to a service, select Monitors, click a particular monitor, andthen drag it to the service container icon. Use CONTROL + click to select multiplemonitors and drag them to the service.

• To bind a service or service group, select Services or Service Groups, respectively,click a particular service or service group, and then drag it to the virtual servericon. To bind multiple services or service groups at one time, press CONTROL + clickto select multiple services and drag them over the virtual server.

• To bind a policy, select one of the policy groups, click a particular policy, and thendrag it to a virtual server. To bind multiple policies (classic policies only) at onetime, press CONTROL + policies and drag them over the virtual server. For detailson classic and advanced policies, see Policy Configuration and Reference.

The Load Balancing Visualizer

179

Page 180: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To unbind a resource by using the Visualizer1. In the navigation pane, expand Load Balancing, and then click Virtual Server.

2. In the details pane, select the virtual server from which you want to unbind a service,policy, or monitor, and then click Visualizer.

3. In the Load Balancing Visualizer dialog box, on the Visualizer image, click theconnecting line between the resources that you want to unbind, and then click Unbind.For example, to unbind a monitor, you would click the link between the monitor and itsbound service and click Unbind.

4. In the Unbind dialog box, click Yes.

To modify a resource in a load balancingconfiguration by using the Visualizer

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to configure, and then clickVisualizer.

3. In the Load Balancing Visualizer dialog box, on the Visualizer image, double-click theresource that you want to modify.

Note: Alternatively, on the Available Resources tab, select the resource type fromthe drop-down menu, select the particular resource that you want to configure andthen click Open.

4. In the modify dialog box, enter new settings for the resource.

To add, remove, or disable a resource in a loadbalancing configuration by using the Visualizer

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to configure, and then clickVisualizer.

3. In the Load Balancing Visualizer dialog box, right-click the icon for the resource thatyou want to add, remove, or disable, and then select the corresponding option from themenu.

Note: Alternatively, on the Available Resources tab, click the resource type from thedrop-down menu, and then click Add to add an entity, or select the particularresource that you want to configure and then click Open.

Note: These options are not available for service groups or policies.

The Load Balancing Visualizer

180

Page 181: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

181

Managing Client Traffic

Managing client connections properly helps to ensure that your applications remainavailable to users even when your NetScaler appliance is experiencing high loads. A numberof load balancing features and other features available on the appliance can be integratedinto a load balancing setup to process load more efficiently, divert it when necessary, andprioritize the tasks that the appliance must perform:

• Sessionless load balancing. You can configure sessionless load balancing virtual serversand perform load balancing without creating sessions in configurations that use DSR orintrusion detection systems (IDS).

• Integrated caching. You can redirect HTTP requests to a cache.

• Priority queuing. You can direct requests based on priority, by integrating yourconfiguration with the Priority Queuing feature.

• SureConnect. You can use load balancing with the SureConnect feature to redirectimportant requests to a custom Web page, insulating them from delays due to networkcongestion.

• Delayed cleanup. You can configure delayed cleanup of virtual server connections toprevent the cleanup process from using CPU cycles during periods when the NetScalerappliance is experiencing high loads.

• Rewrite. You can use the Rewrite feature to modify port and protocol when performingHTTP redirection, or insert the virtual server IP address and port into a custom Requestheader.

• RTSP NAT.

• Rate-based monitoring. You can enable rate-based monitoring to divert excess traffic.

• Layer 2 Parameters. You can configure a virtual server to use the L2 parameters toidentify a connection.

• ICMP Response. You can configure the NetScaler to send ICMP responses to PINGrequests according to your settings. On the IP address corresponding to the virtualserver, set the ICMP RESPONSE to VSVR_CNTRLD, and on the virtual server, set the ICMPVSERVER RESPONSE.

The following settings can be made on a virtual server:

• When you set ICMP VSERVER RESPONSE to PASSIVE on all virtual servers, NetScaleralways responds.

• When you set ICMP VSERVER RESPONSE to ACTIVE on all virtual servers, NetScalerresponds even if one virtual server is UP.

• When you set ICMP VSERVER RESPONSE to ACTIVE on some and PASSIVE on others,NetScaler responds even if one virtual server set to ACTIVE is UP.

Page 182: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

182

Configuring Sessionless Load BalancingVirtual Servers

When the NetScaler appliance performs load balancing, it creates and maintains sessionsbetween clients and servers. The maintenance of session information places a significantload on the NetScaler resources, and sessions might not be needed in scenarios such as adirect server return (DSR) setup and the load balancing of intrusion detection systems (IDS).To avoid creating sessions when they are not necessary, you can configure a virtual serveron the appliance for sessionless load balancing. In sessionless load balancing, the appliancecarries out load balancing on a per-packet basis.

Sessionless load balancing can operate in MAC-based forwarding mode or IP-basedforwarding mode.

For MAC-based forwarding, the IP address of the sessionless virtual server must be specifiedon all the physical servers to which the traffic is forwarded.

For IP-based forwarding in sessionless load balancing, the IP address and port of the virtualserver need not be specified on the physical servers, because this information is included inthe forwarded packets. When forwarding a packet from the client to the physical server,the appliance leaves client details such as IP address and port unchanged and adds the IPaddress and port of the destination.

Supported SetupNetScaler sessionless load balancing supports the following service types and load balancingmethods:

Service Types

• ANY for MAC-based redirection

• ANY, DNS, and UDP for IP-based redirection

Load Balancing Methods

• Round Robin

• Least Bandwidth

• LRTM (Least response time method)

• Source IP Hash

• Destination IP Hash

• Source IP Destination IP Hash

Page 183: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Source IP Source Port Hash

• Custom Load

LimitationsSessionless load balancing has the following limitations:

• The NetScaler must be deployed in two-arm mode.

• A service must be bound to only one virtual server.

• Sessionless load balancing is not supported for service groups.

• Sessionless load balancing is not supported for domain based services (DBS services).

• Sessionless load balancing in the IP mode is not supported for a virtual server that isconfigured as a backup to a primary virtual server.

• You cannot enable spillover mode.

• For all the services bound to a sessionless load balancing virtual server, the Use SourceIP (USIP) option must be enabled.

• For a wildcard virtual server or service, the destination IP address will not be changed.

Note: While configuring a virtual server for sessionless load balancing, explicitly specify asupported load balancing method. The default method, Least Connection, cannot be usedfor sessionless load balancing.

Note: To configure sessionless load balancing in MAC-based redirection mode on a virtualserver, the MAC-based forwarding option must be enabled on the NetScaler.

To add a sessionless virtual server by using thecommand line interface

At the command prompt, type the following commands to add a sessionless virtual serverand verify the configuration:

• add lb vserver <name>@ <serviceType> <IPAddress>@ <port> -m <redirectionMode>-sessionless <(ENABLED|DISABLED)> -lbMethod <load_balancing_method>

• show lb vserver <name>

Example

add lb vserver sesslessv1 any 11.11.12.123 54 -sessionless ENABLED -lbMethod roundrobin -m ip Done show lb vserver sesslessv1 sesslessv1 (11.11.12.123:54) - ANY Type: ADDRESS State: DOWN

Configuring Sessionless Load Balancing Virtual Servers

183

Page 184: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

... Effective State: DOWN Client Idle Timeout: 120 sec Down state flush: ENABLED ... Persistence: NONE Sessionless LB: ENABLED Connection Failover: DISABLED L2Conn: OFF 1) Policy : cmp_text Priority:8680 Inherited 2) Policy : cmp_nocmp_ie60 Priority:8690 Inherited

To configure sessionless load balancing on an existing

virtual server

At the command prompt, type:

set lb vserver <name>@ -m <redirectionMode> -sessionless <(ENABLED|DISABLED)>-lbMethod <load_balancing_method>

Example

set lb vserver sesslessv1 -m mac -sessionless ENABLED -lbmethod lrtm Done

Parameters for configuring sessionless loadbalancing virtual servers

vServerName

The name of the virtual server that you are configuring.

m

The redirection mode that you want to use. MAC, IP.

sessionless

Perform load balancing on a per-packet basis, without establishing sessions. Possiblevalues: ENABLED and DISABLED. Default: DISABLED.

lbMethod

The load balancing method. See Supported Setup.

Configuring Sessionless Load Balancing Virtual Servers

184

Page 185: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure a sessionless virtual server by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, do one of the following:

• To add a sessionless virtual server, click Add.

• To specify sessionless load balancing for an existing virtual server, select it, andthen click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, specify values for thefollowing parameters, which correspond to parameters described in "Parameters forConfiguring Sessionless Load Balancing Virtual Servers" as shown:

• Service Name*-serviceName

• Protocol*-serviceType

• Server*-serverName

• Port*-port*A required parameter

4. In the Configure Virtual Server (Load Balancing) dialog box, on the Methods andPersistence tab, in the LB Method group, select a supported load balancing method.

5. In the Configure Virtual Server (Load Balancing) dialog box, on the Advanced tab, underRedirection Mode, select MAC Based or IP Based.

6. Select Sessionless.

7. Click Create or click OK.

8. In the details pane, click the arrow next to the name of the virtual server and verify theconfiguration.

Configuring Sessionless Load Balancing Virtual Servers

185

Page 186: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

186

Redirecting HTTP Requests to a Cache

The NetScaler cache redirection feature redirects HTTP requests to a cache. You cansignificantly reduce the impact of responding to HTTP requests and improve your Web siteperformance through proper implementation of the cache redirection feature.

A cache stores frequently requested HTTP content. When you configure cache redirectionon a virtual server, the NetScaler appliance sends cacheable HTTP requests to the cache,and non-cacheable HTTP requests to the origin Web server.

To configure cache redirection on a virtual server byusing the command line interface

At the command prompt, type:

set lb vserver <name>@ -cacheable <Value>

Example

set lb vserver Vserver-LB-1 -cacheable yes

Parameters for configuring cache redirectionvServerName

The name of the virtual server that you are configuring.

cacheable

Virtual server requests to be routed to the cache redirection virtual server beforesending them to the configured servers. Possible values: YES and NO. Default: NO.

To configure cache redirection on a virtual server byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure cacheredirection, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Advanced tab.

4. Select the Cache Redirection check box, and then click OK.

Page 187: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Redirecting HTTP Requests to a Cache

187

Page 188: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

188

Directing Requests According to Priority

The NetScaler appliance supports prioritization of client requests with its priority queuingfeature. This feature allows you to designate certain requests, such as those fromimportant clients, as priority requests and sends them to the “front of the line,” so that theappliance responds to them first. This allows you to provide uninterrupted service to thoseclients through demand surges or DDoS attacks on your Web site.

To configure priority queuing on a virtual server byusing the command line interface

At the command prompt, type:

set lb vserver <name>@ -pq <Value>

Example

set lb vserver Vserver-LB-1 -pq yes

Parameter for configuring priority queuingvServerName

The name of the virtual server that you are configuring.

pq

Prioritizes client requests on the specified virtual server. Possible values: ON and OFF.Default: OFF.

To configure priority queuing on a virtual server byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure priorityqueuing, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Advanced tab.

4. Select the PQ check box, and then click OK.

Note: You must configure priority queuing globally for it to function correctly.

Page 189: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Directing Requests According to Priority

189

Page 190: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

190

Directing Requests to a Custom WebPage

The NetScaler appliance provides the SureConnect option to ensure that web applicationsrespond despite delays caused by limited server capacity or processing speed. SureConnectdoes this by displaying an alternative web page of your choice when the server that hoststhe primary web page is either unavailable or responding slowly.

To configure SureConnect on a virtual server, you must first configure the alternativecontent. For information about configuring a SureConnect website, see SureConnect. Afteryou configure the website, enable SureConnect on the load balancing virtual server to putyour SureConnect custom web page in use.

Note: For SureConnect to function correctly, you must configure it globally.

To enable SureConnect on a virtual server by usingthe command line interface

At the command prompt, type:

set lb vserver <name>@ -sc <Value>

Example

set lb vserver Vserver-LB-1 -sc yes

Parameters for configuring SureConnectvServerName

The name of the virtual server that you are configuring.

sc

Assurance of a response from an application despite possible delays due to servercapacity or processing speed. Possible values: ON and OFF. Default: OFF.

Page 191: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To enable SureConnect on a virtual server by usingthe configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configureSureConnect, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Advanced tab.

4. Select the SC check box, and then click OK.

Directing Requests to a Custom Web Page

191

Page 192: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

192

Enabling Cleanup of Virtual ServerConnections

Under certain conditions, you can configure the downStateFlush setting to immediatelyterminate existing connections when a service or a virtual server is marked DOWN.Terminating existing connections frees resources, and in certain cases speeds recovery ofoverloaded load balancing setups.

The state of a virtual server depends on the states of the services bound to it. The state ofeach service depends on the responses of the load balanced servers to probes and healthchecks sent by the monitors that are bound to that service. Sometimes the load balancedservers do not respond. If a server is slow or busy, monitoring probes can time out. Ifrepeated monitoring probes are not answered within the configured timeout period, theservice is marked DOWN.

A virtual server is marked DOWN only when all services bound to it are marked DOWN.When a virtual server goes DOWN, it terminates all connections, either immediately or afterallowing existing connections to complete.

You must not enable the downStateFlush setting on those application servers that mustcomplete their transactions. You can enable this setting on Web servers whose connectionscan safely be terminated when they marked DOWN.

The following table summarizes the effect of this setting on an example configurationconsisting of a virtual server, Vserver-LB-1, with two services bound to it, Service-TCP-1and Service-TCP-2. The virtual server intercepts two connections, C1 and C2, and redirectsthem to Service-TCP-1 and Service-TCP-2, respectively. In the table, E and D denote thestate of the downStateFlush setting: E means Enabled, and D means Disabled.

Vserver-LB-1 Service-TCP-1 State of connections

E E Both client and serverconnections areterminated.

E D Both client and serverconnections areterminated. In case of HTTPservices, both client andserver connections areterminated only if thetransaction is active. If thetransaction is not active,only client connections areterminated.

Page 193: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

D E Both client and serverconnections areterminated. In case of HTTPservices, both client andserver connections areterminated only if thetransaction is active. If thetransaction is not active,only server connections areterminated.

D D Neither client nor serverconnections areterminated.

Note: In case of HTTP services, the downStateFlush setting is effective only when theclient is connected to the server.

If you want to disable a service only when all the established connections are closed by theserver or the client, you can use the graceful shutdown option. For information about thegraceful shutdown of a service, see Graceful Shutdown of Services.

To configure the down state flush setting on a virtualserver by using the command line interface

At the command prompt, type:

set lb vserver <name>@ -downStateFlush <Value>

Example

set lb vserver Vserver-LB-1 -downStateFlush enabled

Parameters for configuring down state flushvServerName

The name of the virtual server that you are configuring.

downStateFlush

Flush all active transactions associated with a virtual server whose state transitions fromUP to DOWN. Do not enable this option for applications that must complete theirtransactions. Possible values: ENABLED, DISABLED. Default: ENABLED

Enabling Cleanup of Virtual Server Connections

193

Page 194: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure the down state flush setting on a virtualserver by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure down stateflush, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Advanced tab.

4. Select the Down state flush check box, and then click OK.

Enabling Cleanup of Virtual Server Connections

194

Page 195: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

195

Graceful Shut down of Services

During scheduled network outages such as system upgrades or hardware maintenance, youmay have to close or disable some services. To avoid disrupting sessions that have alreadybeen established, you can specify a wait time, which places a service in the transition outof service (TROFS) state until the specified wait time expires. The service then enters theout of service (OFS) state.

Often, however, you cannot estimate the amount of time needed for all the connections toa service to complete the existing transactions. If a transaction is unfinished when the waittime expires, shutting down the service may result in data loss. In this case, you can specifygraceful shutdown for the service, so that the service is disabled only when all the currentactive client connections are closed by either the server or the client. See the followingtable for behavior if you specify a wait time in addition to graceful shutdown.

Persistence is maintained according to the specified method even if you enable gracefulshutdown. The system continues to serve all the persistent clients, including newconnections from the clients, unless the service is marked DOWN during the gracefulshutdown state as a result of the checks made by a monitor.

The following table describes graceful shut down options.

Table 1. Graceful Shut down Options

State Results

Graceful shutdown is enabled and a waittime is specified.

Service is shut down after the last of thecurrent active client connections is served,even if the wait time has not expired. Theappliance checks the status of theconnections once every second. If the waittime expires, any open sessions are closed.

Graceful shutdown is disabled and a waittime is specified.

Service is shut down only after the waittime expires, even if all establishedconnections are served before expiration.

Graceful shutdown is enabled and no waittime is specified.

Service is shut down only after the last ofthe previously established connections isserved, regardless of the time taken toserve the last connection.

Graceful shutdown is disabled and no waittime is specified.

No graceful shutdown. Service is shut downimmediately after the disable option ischosen or the disable command is issued.(The default wait time is zero seconds.)

To terminate existing connections when a service or a virtual server is marked DOWN, youcan use the Down State Flush option. For more information, see Enabling Cleanup of VirtualServer Connections.

Page 196: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure graceful shutdown for a service by usingthe command line interface

At the command prompt, type the following commands to shut down a service gracefullyand verify the configuration:

• disable service <name>@ [<delay>] [-graceFul (YES|NO)]

• show service <name>

Example

> disable service svc1 6000 -graceFul YESDone>show service svc1svc1 (10.102.80.41:80) - HTTPState: GOING OUT OF SERVICE (Graceful, Out Of Service in 5998 seconds)Last state change was at Mon Nov 15 22:44:15 2010 Time since last state change: 0 days, 00:00:01.160...Down state flush: ENABLED

1 bound monitor:1) Monitor Name: tcp-defaultState: UP Weight: 1Probes: 13898 Failed [Total: 0 Current: 0]Last response: Probe skipped - live traffic to service.Response Time: N/ADone

>show service svc1svc1 (10.102.80.41:80) - HTTPState: OUT OF SERVICELast state change was at Mon Nov 15 22:44:19 2010 Time since last state change: 0 days, 00:00:03.250Down state flush: ENABLED

1 bound monitor:1) Monitor Name: tcp-defaultState: UNKNOWN Weight: 1Probes: 13898 Failed [Total: 0 Current: 0]Last response: Probe skipped - service state OFS.Response Time: N/ADone

Graceful Shut down of Services

196

Page 197: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Parameters for configuring a graceful shutdown for aservice

serviceName

Name of the service. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( ).

delayInSeconds

The time in seconds after which the service is marked as OUT OF SERVICE.

graceFul

Wait for all previously established connections to this service to be closed beforedisabling the service. Possible values: YES, NO. Default: NO.

To configure graceful shutdown for a service by usingthe configuration utility

1. In the navigation pane, expand Load Balancing and then click Services.

2. In the details pane, select the service, and then click Disable.

3. To delay disabling the service, in the Wait Time dialog box, type the wait time afterwhich the service is to be disabled.

4. To disable the service only after all previously initiated transactions have beencompleted, check the Graceful Shutdown check box.

5. Click Enter.

6. In the Services pane, you can verify that the service is marked as UP until the wait timeexpires and after that, it is marked as OUT OF SERVICE.

Graceful Shut down of Services

197

Page 198: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

198

Rewriting Ports and Protocols for HTTPRedirection

Virtual servers and the services that are bound to them may use different ports. When aservice responds to an HTTP connection with a redirect, you might need to configure theNetScaler appliance to modify the port and the protocol to make sure that the redirectiongoes through successfully. You do this by enabling and configuring the redirectPortRewritesetting.

This setting affects only HTTP and HTTPS traffic. If this setting is enabled on a virtualserver, the virtual server rewrites the port on redirects, replacing the port used by theservice with the port used by the virtual server.

If the virtual server or service is of type SSL, you must enable SSL redirect on the virtualserver or service. If both the virtual server and service are of type SSL, enable SSL redirecton the virtual server.

The redirectPortRewrite setting can be used in the following scenarios:

• The virtual server is of type HTTP and the services are of type SSL.

• The virtual server is of type SSL and the services are of type HTTP.

• The virtual server is of type HTTP and the services are of type HTTP.

• The virtual server is of type SSL and the services are of type SSL.

Scenario 1: The virtual server is of type HTTP and services are of type SSL. SSL redirect, andoptionally port rewrite, is enabled on the service. If port rewrite is enabled, the port ofHTTPS URLs is rewritten. HTTP URLs from the server are sent as is to the client.

Redirect URL from the Server Redirect URL sent to the Client

Only SSL redirect is enabled. The virtual server can be configured on any port.

http://domain.com/ http://domain.com/

http://domain.com:8080/ http://domain.com:8080/

https://domain.com/ https://domain.com/

https://domain.com:444/ https://domain.com:444/

SSL redirect and port rewrite are enabled. The virtual server is configured on port 80.

http://domain.com/ http://domain.com/

http://domain.com:8080/ http://domain.com:8080/

https://domain.com/ https://domain.com/

https://domain.com:444/ https://domain.com/

SSL redirect and port rewrite are enabled. Virtual server is configured on port 8080.

Page 199: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

http://domain.com/ http://domain.com/

http://domain.com:8080/ http://domain.com:8080/

https://domain.com/ http://domain.com:8080/

https://domain.com:444/ http://domain.com:8080/Scenario 2: The virtual server is of type SSL and services are of type HTTP. If port rewrite isenabled, only the port of HTTP URLs is rewritten. HTTPS URLs from the server are sent as isto the client.

Redirect URL from the Server Redirect URL sent to the Client

SSL redirect is enabled on the virtual server. The virtual server can be configured on anyport.

http://domain.com/ https://domain.com/

http://domain.com:8080/ https://domain.com:8080/

https://domain.com/ https://domain.com/

https://domain.com:444/ https://domain.com:444/

SSL redirect and port rewrite are enabled on the virtual server. The virtual server isconfigured on port 443.

http://domain.com/ https://domain.com/

http://domain.com:8080/ https://domain.com/

https://domain.com/ https://domain.com/

https://domain.com:444/ https://domain.com:444/

SSL redirect and port rewrite are enabled. The virtual server is configured on port 444.

http://domain.com/ https://domain.com:444/

http://domain.com:8080/ https://domain.com:444/

https://domain.com/ https://domain.com/

https://domain.com:445/ https://domain.com:445/Scenario 3: The virtual server and service are of type HTTP. Port rewrite must be enabledon the virtual server. Only the port of HTTP URLs is rewritten. HTTPS URLs from the serverare sent as is to the client.

Redirect URL from the Server Redirect URL sent to the Client

The virtual server is configured on port 80.

http://domain.com/ http://domain.com/

http://domain.com:8080/ http://domain.com/

https://domain.com/ https://domain.com/

https://domain.com:444/ https://domain.com:444/

The virtual server is configured on port 8080.

http://domain.com/ http://domain.com:8080/

http://domain.com:8080/ http://domain.com:8080/

https://domain.com/ https://domain.com/

Rewriting Ports and Protocols for HTTP Redirection

199

Page 200: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

https://domain.com:445/ https://domain.com:445/Scenario 4: The virtual server and service are of type SSL. If port rewrite is enabled, onlythe port of HTTPS URLs is rewritten. HTTP URLs from the server are sent as is to the client.

Redirect URL from the Server Redirect URL sent to the Client

SSL redirect is enabled on the virtual server. The virtual server can be configured on anyport.

http://domain.com/ http://domain.com/

http://domain.com:8080/ http://domain.com:8080/

https://domain.com/ https://domain.com/

https://domain.com:444/ https://domain.com:444/

SSL redirect and port rewrite are enabled on the virtual server. The virtual server isconfigured on port 443.

http://domain.com/ http://domain.com/

http://domain.com:8080/ http://domain.com:8080/

https://domain.com/ https://domain.com/

https://domain.com:444/ https://domain.com/

SSL redirect and port rewrite are enabled on the virtual server. The virtual server isconfigured on port 444.

http://domain.com/ http://domain.com/

http://domain.com:8080/ http://domain.com:8080/

https://domain.com/ https://domain.com:444/

https://domain.com:445/ https://domain.com:444/

To configure HTTP redirection on a virtual server byusing the command line interface

At the command prompt, type:

set lb vserver <name>@ -redirectPortRewrite (ENABLED | DISABLED)

Example

set lb vserver Vserver-LB-1 -redirectPortRewrite enabled

Parameters for redirect port rewritevServerName

The name of the virtual server that you are configuring.

Rewriting Ports and Protocols for HTTP Redirection

200

Page 201: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

redirectPortRewrite

Rewrite the port and change the protocol to ensure successful HTTP redirects fromservices. Possible values: ENABLED and DISABLED. Default: DISABLED.

To configure HTTP redirection on a virtual server byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure HTTPredirection, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Advanced tab.

4. Select the Redirect Port Rewrite check box, and then click OK.

To configure SSL Redirect on an SSL virtual server orservice by using the command line interface

At the command prompt, type:

• set ssl vserver <vServerName> - sslRedirect (ENABLED | DISABLED)

• set ssl service <serviceName> - sslRedirect (ENABLED | DISABLED)

Example

set ssl vserver Vserver-SSL-1 -sslRedirect enabledset ssl service service-SSL-1 -sslRedirect enabled

Parameters for SSL RedirectvServerName

The name of the virtual server that you are configuring.

sslRedirect

State of HTTPS redirects for the SSL virtual server or service.

Rewriting Ports and Protocols for HTTP Redirection

201

Page 202: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure SSL redirection and SSL port rewrite onan SSL virtual server or service by using theconfiguration utility

1. In the navigation pane, expand SSL Offload, and then click Virtual Servers or Services.

2. In the details pane, select the virtual server or service for which you want to configureSSL redirection, and then click Open.

3. In the Configure Virtual Server (SSL Offload) dialog box, click the SSL Settings tab, andthen click SSL Parameter.

4. In the Configure SSL Params dialog box, select SSL Redirect. Optionally, select SSLRedirect Port Rewrite.

5. Click OK.

6. In the Configure Virtual Server (SSL Offload) dialog box, click OK.

Rewriting Ports and Protocols for HTTP Redirection

202

Page 203: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

203

Inserting the IP Address and Port of aVirtual Server in the Request Header

If you have multiple virtual servers that communicate with different applications on thesame service, you must configure the NetScaler appliance to add the IP address and portnumber of the appropriate virtual server to the HTTP requests that are sent to that service.This setting allows applications running on the service to identify the virtual server thatsent the request.

If the primary virtual server is down and the backup virtual server is up, the configurationsettings of the backup virtual server are added to the client requests. If you want the sameheader tag to be added, regardless of whether the requests are from the primary virtualserver or backup virtual server, then you must configure the required header tag on bothvirtual servers.

Note: This option is not supported for wild card virtual servers or dummy virtual servers.

To insert the IP address and port of the virtual serverin the client requests by using the command lineinterface

At the command prompt, type:

set lb vserver <name>@ -insertVserverIPPort <insertVserverIPPort> [<vipHeader>]

Example

set lb vserver Vserver-LB-1 -insertVserverIPPort VipAddr

Parameters for virtual server IP port insertionvServerName

The name of the virtual server that you are configuring.

insertVserverIPPort

Insert an HTTP header, whose value is the IP address and port number of the virtualserver, before forwarding a request to the server. The format of the header is<vipHeader>: <virtual server IP address>_<port number >, where vipHeader is the namethat you specify for the header. If the virtual server has an IPv6 address, the address inthe header is enclosed in brackets ([ and ]) to separate it from the port number. If youhave mapped an IPv4 address to a virtual server's IPv6 address, the value of this

Page 204: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

parameter determines which IP address is inserted in the header, as follows:

VIPADDR—Insert the IP address of the virtual server in the HTTP header regardless ofwhether the virtual server has an IPv4 address or an IPv6 address. A mapped IPv4address, if configured, is ignored.

V6TOV4MAPPING—Insert the IPv4 address that is mapped to the virtual server's IPv6address. If a mapped IPv4 address is not configured, insert the IPv6 address.

OFF—Disable header insertion.

vipHeader

Name for the inserted header. The default name is vip-header. Maximum Length: 79characters.

To insert the IP address and port of the virtual serverin the client requests by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to insert the IP addressand port, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Advanced tab.

4. In the Vserver IP Port Insertion list, select the VIPADDR or V6TOV4MAPPING, and thentype the port header in a text box next to Vserver IP Port Insertion box.

5. Click OK.

Inserting the IP Address and Port of a Virtual Server in the Request Header

204

Page 205: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

205

Using a Specified Source IP for BackendCommunication

For communication with the physical servers or other peer devices, the NetScaler applianceuses an IP address owned by it as the source IP address. NetScaler maintains a pool of its IPaddresses, and dynamically selects an IP address while connecting with a server. Dependingon the subnet in which the physical server is placed, NetScaler decides which IP address touse. This address pool is used for sending traffic as well as monitor probes.

In many situations, you may want the NetScaler to use a specific IP address or any IPaddress from a specific set of IP addresses for backend communications. The following are afew examples:

• A server can distinguish monitor probes from traffic if the source IP address used formonitor probes belongs to a specific set.

• To improve server security, a server may be configured to respond to requests from aspecific set of IP addresses or, sometimes, from a single specific IP address. In such acase, the NetScaler can use only the IP addresses accepted by the server as the sourceIP address.

• The NetScaler can manage its internal connections efficiently if it can distribute its IPaddresses into IP sets and use an address from a set only for connecting to a specificservice.

To configure the NetScaler to use a specified source IP address, create net profiles(network profiles) and configure the NetScaler entities to use the profile. A net profile canbe bound to load balancing or content switching virtual servers, services, service groups, ormonitors. A net profile has NetScaler owned IP addresses (SNIPs ) that can be used as thesource IP address. It can be a single IP address or a set of IP addresses, referred to as an IPset. If a net profile has an IP set, NetScaler dynamically selects an IP address from the IPset at the time of connection. If a profile has a single IP address, the same IP address isused as the source IP.

If a net profile is bound to a load balancing or content switching virtual server, the profilewill be used for sending traffic to all the services bound to it. If a net profile is bound to aservice group, NetScaler uses the profile for all the members of the service group. If a netprofile is bound to a monitor, NetScaler uses the profile for all the probes sent from themonitor.

Note: The user-specified source IP feature is supported only on NetScaler 9.3.e.

Usage of a net profile for sending traffic:

If the Use Source IP Address (USIP) option is enabled, NetScaler uses the IP address of theclient and ignores all the net profiles. If the USIP option is not enabled, NetScaler selectsthe source IP in the following manner:

• If there is no net profile on the virtual server or the service/service group, NetScaleruses the default method.

Page 206: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• If there is a net profile only on the service/service group, NetScaler uses that netprofile.

• If there is a net profile only on the virtual server, NetScaler uses the net profile.

• If there is a net profile both on the virtual server and service/service group, NetScaleruses the net profile bound to the service/service group.

Usage of a net profile for sending monitor probes:

For monitor probes, NetScaler selects the source IP in the following manner:

• If there is a net profile bound to the monitor, NetScaler uses the net profile of themonitor. It ignores the net profiles bound to the virtual server or service/service group.

• If there is no net profile bound to the monitor,

• If there is a net profile on the service/service group, NetScaler uses the net profileof the service/service group.

• If there is no net profile even on the service/service group, NetScaler uses thedefault method of selecting a source IP.

Note: If there is no net profile bound to a service, NetScaler looks for a net profile on theservice group if the service is bound to a service group.

To use a specified source IP address for communication, go through the following steps:

1. Create IP sets from the pool of SNIPs owned by the NetScaler. An IP set can consist ofboth SNIP addresses. For instructions, see Creating IP Sets.

2. Create net profiles. For instructions, see Creating a Net Profile.

3. Bind the net profiles to NetScaler entities. For instructions, see Binding a Net Profile toa NetScaler Entity.

Note: A net profile can have only the IP addresses specified as SNIP on the NetScaler.

Managing Net ProfilesA net profile (or network profile) contains an IP address or an IP set. During communicationwith physical servers or peers, the NetScaler appliance uses the addresses specified in theprofile as the source IP address. For more information on the use of net profiles, see Usinga User-specified Source IP Address for Backend Communication.

Note: The net profile feature is supported only on NetScaler 9.3.e.

• For instructions on creating a network profile, see Creating a Network Profile.

• For instructions on binding a network profile to a NetScaler entity, see Binding aNetwork Profile.

Using a Specified Source IP for Backend Communication

206

Page 207: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Creating an IP SetAn IP set is a set of IP addresses, which are configured on the NetScaler appliance as SubnetIP addresses (SNIPs) . An IP set is identified with a meaningful name that helps inidentifying the usage of the IP addresses contained in it. To create an IP set, add an IP setand bind NetScaler owned IP addresses to it. SNIP addresses can be present in the same IPset. For more information about the use of IP sets, see Using a User-specified Source IPAddress for Backend Communication.

Note: The IP Set feature is supported only on NetScaler 9.3.e.

To create an IP set by using the command line interfaceAt the command prompt, type the following commands:

• add ipset <name>

• bind ipset <name> <IPAddress>@or

• bind ipset <name> <IPAddress>@

• show ipset [<name>]The above command shows the names of all the IP sets on the NetScaler if you do notpass any name. It shows the IP addresses bound to the specified IP set if you pass aname.

Examples

1.> add ipset skpnwipset Done> bind ipset skpnwipset 21.21.20.1 Done

2. > add ipset testnwipset Done> bind ipset testnwipset 21.21.21.[21-25] IPAddress "21.21.21.21" bound IPAddress "21.21.21.22" bound IPAddress "21.21.21.23" bound IPAddress "21.21.21.24" bound IPAddress "21.21.21.25" bound Done

3. > bind ipset skpipset 11.11.11.101 ERROR: Invalid IP address[This IP address could not be added because this is not an IP address owned by the NetScaler] > add ns ip 11.11.11.101 255.255.255.0 -type SNIP ip "11.11.11.101" added Done

Using a Specified Source IP for Backend Communication

207

Page 208: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

> bind ipset skpipset 11.11.11.101 IPAddress "11.11.11.101" bound Done4.> sh ipset1) Name: ipset-12) Name: ipset-23) Name: ipset-34) Name: skpnewipset Done

5.> sh ipset skpnewipsetIP:21.21.21.21IP:21.21.21.22IP:21.21.21.23IP:21.21.21.24IP:21.21.21.25 Done

Parameters for configuring an IP setname (Name)

The name of the IP set. The name can have up to 127 characters. It must begin with analphanumeric character or underscore, and must contain only alphanumerics, '_', '#', '.', '', ':', '@', '=' or '-'.

ipAddress (IP Address)

A SNIP address on the NetScaler.

ipAddressRange

A contiguous range of SNIP or MIP address on the NetScaler.

Using a Specified Source IP for Backend Communication

208

Page 209: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To create an IP set by using the configuration utility1. In the navigation pane, expand Network, and then click IP Sets.

2. In the details pane, do one of the following:

• To create a new IP set, click Add.

• To modify an existing IP set, select the IP set, and then click Open.3. In the Create IP Set dialog box, set the following parameters:

• Name

• IP Address (The SNIPs specified on the NetScaler are displayed. Check the IPaddresses that you want to bind to the IP set. You can select more than one.)

If you want to add an IP address to the pool, do one of the following:

• To add an IPv4 address, click Add IPv4, and then in the Create IP dialog box, typethe necessary details.

• To add an IPv6 address, click Add IPv6, and then in the Create IPV6 dialog box, typethe necessary details.

4. Click Create.

Creating a Net ProfileA net profile (network profile) consists of one or more SNIP addresses of the NetScaler. Formore information about the usage of net profiles, see Using a User-specified Source IPAddress for Backend Communication.

To create a net profile by using the command line interfaceAt the command prompt, type:

add netprofile <name> [-srcIp <srcIpVal>] If the srcIpVal is not provided in this command, itcan be provided later by using the set netprofile command.

Examples

> add netprofile skpnetprofile1 -srcIp 21.21.20.1 Done

> add netprofile baksnp -srcIp bakipset Done

> set netprofile yahnp -srcIp 12.12.23.1 Done

> set netprofile citkbnp -srcIp citkbipset Done

Using a Specified Source IP for Backend Communication

209

Page 210: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Parameters for creating a net profilename (Name)

The name of the net profile. The name can have up to 127 characters. It must begin withan alphanumeric character or underscore, and must contain only alphanumerics, '_', '#','.', ' ', ':', '@', '=' or '-'.

srcIpVal (IP address or IP Set)

IP address or the name of an IP set.

To create a net profile by using the configuration utility1. In the navigation pane, expand Network, and then click Net Profiles.

2. In the Create Net Profile dialog box, type a name for the net profile.

3. To specify the source IP address, do one of the following:

• Check IP Address and select an IP address from the IP Address drop-down list.

• Check IP Set and select the name of an IP set from the IP Set drop-down list.If you want to add a new IP address or IP set, click New and type the necessary detailsin the dialog box that is displayed. If you want to modify an entry after selecting itfrom the drop-down list, click Modify and change the values. To unbind an IP address orIP set from a net profile, select the blank entry from the drop down list, and then clickOK.

4. Click Create.

Binding a Net Profile to a NetScaler EntityA net profile can be bound to a load balancing virtual server, service, service group, or amonitor. For more information about the effect of binding a net profile to a NetScalerentity, see Using a User-specified Source IP Address for Backend Communication.

Note: You can bind a net profile at the time of creating a NetScaler entity or bind it to analready existing entity.

To bind a net profile to a server by using the command line

interfaceYou can bind a net profile to load balancing virtual servers and content switching virtualservers. Specify the appropriate virtual server.

At the command prompt, type:

• set lb vserver <name>@ -netProfile <net_profile_name>or

Using a Specified Source IP for Backend Communication

210

Page 211: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• set cs vserver <name> -netProfile <net_profile_name>

Examples

set lb vserver skpnwvs1 -netProfile gntnp Doneset cs vserver mmdcsv -netProfile mmdnp Done

To bind a net profile to a virtual server by using the

configuration utility1. In the navigation pane, expand Load Balancing or Content Switching, and then click

Virtual Servers.

2. In the details pane, select the virtual server to which you want to bind a net profile,and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, or Configure Virtual Server(Content Switching) click the Profiles tab.

4. In the Net Profile drop-down list, select a net profile. In this dialog box, you can clickNew… to add a net profile or Modify… to modify the selected net profile.

5. Click OK.

To bind a net profile to a service by using the command line

interfaceAt the command prompt, type:

set service <name>@ -netProfile <net_profile_name>

Example

set service brnssvc1 -netProfile brnsnp Done

Using a Specified Source IP for Backend Communication

211

Page 212: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To bind a net profile to a service by using the configuration

utility1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service to which you want to bind a net profile, and thenclick Open.

3. In the Configure Service dialog box, click the Profiles tab.

4. In the Net Profile drop-down list, select a net profile. In this dialog box, you can clickNew… to add a net profile or Modify… to modify the selected net profile.

5. Click OK.

To bind a net profile to a service group by using the

command line interfaceAt the command prompt, type:

set servicegroup <serviceGroupName>@ -netProfile <net_profile_name>

Example

set servicegroup ndhsvcgrp -netProfile ndhnp Done

To bind a net profile to a service group by using the

configuration utility1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the details pane, select the service group to which you want to bind a net profile,and then click Open.

3. In the Configure Service Group dialog box, click the Profiles tab.

4. In the Net Profile drop-down list, select a net profile. In this dialog box, you can clickNew… to add a net profile or Modify… to modify the selected net profile.

5. Click OK.

To bind a net profile to a monitor by using the command line

interfaceAt the command prompt, type:

Using a Specified Source IP for Backend Communication

212

Page 213: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

set monitor <monitor_name> -netProfile <net_profile_name>

Example

set monitor brnsecvmon1 -netProfile brnsmonnp Done

To bind a net profile to a monitor by using the configuration

utility1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. In the details pane, select the monitor to which you want to bind a net profile, andthen click Open.

3. In the Configure Monitor dialog box, in the Net Profile drop-down list, select a netprofile.

4. Click OK.

Using a Specified Source IP for Backend Communication

213

Page 214: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

214

Setting a Timeout Value for Idle ClientConnections

You can configure a virtual server to terminate any idle client connections after aconfigured timeout period elapses. When you configure this setting, the NetScalerappliance waits for the time you specify and, if the client is idle after that time, it closesthe client connection.

To set a time-out value for idle client connections byusing the command line interface

At the command prompt, type:

set lb vserver <name>@ -cltTimeout <Value>

Example

set lb vserver Vserver-LB-1 -cltTimeout 100

Parameters for setting the client time-out valuevServerName

The name of the virtual server that you are configuring.

cltTimeout

Idle time (in seconds) after which the client connection is terminated. The default valueis 180sec for HTTP/SSL-based services and 9000sec for TCP-based services.

Page 215: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set a time-out value for idle client connections byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure a time-outvalue, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Advanced tab.

4. In the Client Time-out (secs) text box, type the timeout value (for example, 100).

5. Click OK.

Setting a Timeout Value for Idle Client Connections

215

Page 216: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

216

Managing RTSP Connections

The NetScaler appliance can use either of two topologies—NAT-on mode or NAT-offmode—to load balance RTSP servers. In NAT-on mode, Network Address Translation (NAT) isenabled and configured on the appliance. RTSP requests and responses both pass throughthe appliance. You must therefore configure the appliance to perform network addresstranslation (NAT) to identify the data connection.

For more information about enabling and configuring NAT, see "IP Addressing."

In NAT-off mode, NAT is not enabled and configured. The appliance receives RTSP requestsfrom the client and routes them to the service that it selects using the configured loadbalancing method. The load balanced RTSP servers send their responses directly to theclient, bypassing the appliance. You must therefore configure the appliance to use DirectServer Return (DSR) mode, and assign publicly accessible FQDNs in DNS to your loadbalanced RTSP servers.

For more information about enabling and configuring DSR mode, see "Configuring LoadBalancing in Direct Server Return Mode." For more information about configuring DNS, see"Domain Name System."

In either case, when you configure RTSP load balancing, you must also configure rtspNat tomatch the topology of your load balancing setup.

To configure RTSP NAT by using the command lineinterface

At the command prompt, type:

set lb vserver <name>@–RTSPNAT <ValueOfRTSPNAT>

Example

set lb vserver vserver-LB-1 –RTSPNAT ON

Parameters for configuring RTSPvServerName

The name of the virtual server that you are configuring.

rtspNat

Whether the appliance is configured to use NAT or not when load balancing RTSPservices. When the appliance is configured for the NAT-on mode, you must set rtspNat

Page 217: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

ON. When the NetScaler is configured for NAT-off mode, you must set rtspNat OFF.Possible values: ON and OFF. Default value: OFF.

To configure RTSP NAT by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure RTSP NAT,and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Advanced tab.

4. Select the RTSP Natting check box, and then click OK.

Managing RTSP Connections

217

Page 218: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

218

Managing Client Traffic on the Basis ofTraffic Rate

You can monitor the rate of traffic that flows through load balancing virtual servers andcontrol the behavior of the NetScaler appliance based on the traffic rate. You can throttlethe traffic flow if it is too high, cache information based on the traffic rate, and if thetraffic rate is too high redirect excess traffic to a different load balancing virtual server.You can apply rate-based monitoring to HTTP and Domain Name System (DNS) requests.

For more information on rate-based policies, see Rate Limiting.

Page 219: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

219

Identifying a connection with Layer 2Parameters

Generally, to identify a connection, the NetScaler uses the 4-tuple of client IP address,client port, destination IP address, and destination port. When you enable the L2Connection option, the Layer 2 parameters of the connection (channel number, MACaddress, and VLAN ID) are used in addition to the normal 4-tuple.

Enabling the L2Conn parameter for a load balancing virtual server allows multiple TCP andnon-TCP connections with the same 4-tuple (<source IP>:<source port>::<destinationIP>:<destination port>) to co-exist on the NetScaler appliance. The appliance uses both the4-tuple and the Layer 2 parameters to identify TCP and non-TCP connections.

You can enable the L2Conn option in the following scenarios:

• Multiple VLANs are configured on the NetScaler appliance, and a firewall is set up foreach VLAN.

• You want the traffic originating from the servers in one VLAN and bound for a virtualserver in another VLAN to pass through the firewalls configured for both VLANs.

Note: In NetScaler 9.3 Classic, the L2 Connection option is not supported for loadbalancing virtual servers. It is supported only for cache redirection virtual servers. InNetScaler 9.3 nCore, the L2 Connection option is supported for both load balancing andcache redirection virtual servers.

Therefore, when an nCore NetScaler appliance on which the l2Conn parameter is set forone or more load balancing virtual servers is downgraded to a Classic build or to an nCorebuild that does not support the l2Conn parameter, the load balancing configurations thatuse the l2Conn parameter become ineffective.

To configure the L2 connection option by using thecommand line interface

At the command prompt, type:

add lb vserver <name>@ <serviceType> <IPAddress>@ <port> -l2Conn ON

Example

add lb vserver LB-VIP1 HTTP 10.1.1.254 80 -l2Conn ON

Page 220: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Parameters for configuring a virtual servervServerName

Name of the virtual server that is associated with the service. The name must not exceed127 characters, and the leading character must be a number or a letter. The followingcharacters are also allowed: @ _ - . (period) : (colon) # and space ( ).

ipAddress

IP address of the virtual server, in either IPv4 or Ipv6 format.

serviceType

The type of services to which the virtual server distributes requests.

port

Port on which the virtual server listens for client connections.

l2Conn

The tuple used to identify a connection includes the layer 2 parameters.

To configure the L2 connection option by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers .

2. In the details pane, click Add.

3. In the CreateVirtual Server (Load Balancing) dialog box, specify values whichcorrespond to parameters described in "Parameters for configuring a virtual server" asshown:

• Name*—vServerName

• IP Address*—ipAddress

• Protocol*—serviceType

• Port*—port*A required parameter

4. On the Advanced tab, selectL2 Connection.

5. Click Create.

6. Open the virtual server you configured and verify the configuration.

Identifying a connection with Layer 2 Parameters

220

Page 221: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

221

Configuring the Prefer Direct RouteOption

On a wildcard load balancing virtual server if you explicitly configure a route to adestination, by default, the NetScaler appliance forwards traffic according to theconfigured route. If you want the NetScaler to not look up for the configured route, you canset the Prefer Direct Route option to NO.

If a device is directly connected to a NetScaler appliance, the NetScaler directly forwardstraffic to the device. For example, if the destination of a packet is a firewall, the packetneed not be routed through another firewall. However, in some cases, you may want thetraffic to go through the firewall even if the device is directly connected to it. In suchcases, you can set the Prefer Direct Route Option to NO.

Note: The preferDirectRoute setting is applicable to all the wildcard virtual servers onthe NetScaler appliance.

To set the prefer direct route option by using thecommand line interface

At the command prompt, type:

set lb parameter -preferDirectRoute (YES | NO)

Example

set lb parameter -preferDirectRoute YES

Parameter for configuring prefer direct route optionpreferDirectRoute

If enabled, the NetScaler looks up for the configured route. Possible values: YES, NO.Default: YES.

Page 222: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set the prefer direct route option by using theconfiguration utility

1. In the navigation pane, click Load Balancing.

2. Under Settings, click Configure Load Balancing Parameters.

3. In the Configure Load Balancing Parameters dialog box, select the Prefer Direct Routecheck box.

4. Click OK.

Configuring the Prefer Direct Route Option

222

Page 223: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

223

Advanced Load Balancing Settings

In addition to configuring virtual servers, you can configure advanced settings for services.

Page 224: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

224

The No-Monitor Option for Services

If you use an external system to perform health checks on the services and do not want theNetScaler appliance to monitor the health of a service, you can set the no-monitor optionfor the service. If you do so, the appliance does not send probes to check the health of theservice but shows the service as UP. Even if the service goes DOWN, the appliancecontinues to send traffic from the client to the service as specified by the load balancingmethod.

The monitor can be in the ENABLED or DISABLED state when you set the no-monitor option,and when you remove the no-monitor option, the earlier state of the monitor is resumed.

You can set the no-monitor option for a service when creating the service. You can also setthe no-monitor option on an existing service.

The following are the consequences of setting the no-monitor option:

• If a service for which you enabled the no-monitor option goes down, the NetScalercontinues to show the service as UP and continues to forward traffic to the service. Apersistent connection to the service can worsen the situation. In that case, or if manyservices shown as UP are actually DOWN, the system may fail. To avoid such a situation,when the external mechanism that monitors the services reports that a service that isDOWN, remove the service from the NetScaler configuration.

• If you configure the no-monitor option on a service, you cannot configure loadbalancing in the Direct Server Return (DSR) mode. For an existing service, if you set theno-monitor option, you cannot configure the DSR mode for the service.

To set the no-monitor option for a new service byusing the command line interface

At the command prompt, type the following commands to create a service with the healthmonitor option, and verify the configuration:

add service <serviceName> <IP | serverName> <serviceType> <port> -healthMonitor(YES|NO)

Example

>add service nomonsrvc 10.102.21.21 http 80 -healthMonitor no Done > show service nomonsrvcnomonsrvc (10.102.21.21:80) - HTTPState: UPLast state change was at Mon Nov 15 22:41:29 2010Time since last state change: 0 days, 00:00:00.970

Page 225: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Server Name: 10.102.21.21 Server ID : 0 Monitor Threshold : 0...Access Down Service: NO...Down state flush: ENABLEDHealth monitoring: OFF

1 bound monitor:1) Monitor Name: tcp-defaultState: UNKNOWN Weight: 1Probes: 3 Failed [Total: 3 Current: 3]Last response: Probe skipped - Health monitoring is turned off.Response Time: N/ADone

To set the no-monitor option for an existing service byusing the command line interface

At the command prompt, type the following command to set the health monitor option:

set service <name> -healthMonitor (YES|NO)

Example

By default, the state of a service and the state of the corresponding monitor are UP. >show service LB-SVC1LB-SVC1 (10.102.29.5:80) - HTTPState: UP

1) Monitor Name: http-ecv State: UP Weight: 1Probes: 99992 Failed [Total: 0 Current: 0]Last response: Success - Pattern found in response.Response Time: 3.76 millisecDone

When the no-monitor option is set on a service, the state of the monitor changes to UNKNOWN.> set service LB-SVC1 -healthMonitor NODone> show service LB-SVC1LB-SVC1 (10.102.29.5:80) - HTTPState: UPLast state change was at Fri Dec 10 10:17:37 2010.Time since last state change: 5 days, 18:55:48.710Health monitoring: OFF

1) Monitor Name: http-ecv State: UNKNOWN Weight: 1

The No-Monitor Option for Services

225

Page 226: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Probes: 100028 Failed [Total: 0 Current: 0] Last response: Probe skipped - Health monitoring is turned off. Response Time: 0.0 millisec DoneWhen the no-monitor option is removed, the earlier state of the monitor is resumed.> set service LB-SVC1 -healthMonitor YESDone>show service LB-SVC1LB-SVC1 (10.102.29.5:80) - HTTPState: UPLast state change was at Fri Dec 10 10:17:37 2010Time since last state change: 5 days, 18:57:47.8801) Monitor Name: http-ecv State: UP Weight: 1 Probes: 100029 Failed [Total: 0 Current: 0] Last response: Success - Pattern found in response. Response Time: 5.690 millisec Done

Parameters for configuring a serviceserviceName

Name of the service. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( ).

ipAddress

IP address of the server that is associated with the service, in either IPv4 or IPv6 format.

serverName

Name of the server that is associated with the service. The name must not exceed 127characters, and the leading character must be a number or a letter. The followingcharacters are also allowed: @ _ - . (period) : (colon) # and space ( ).

serviceType

Protocol supported by the service. Possible values: HTTP, FTP, TCP, UDP, SSL,SSL_BRIDGE, SSL_TCP, NNTP, RPCSVR, DNS, ADNS, SNMP, RTSP, DHCPRA, ANY, SIP_UDP,DNS_TCP, ADNS_TCP, RADIUS, MYSQL, MSSQL, and RDP.

port

The port number used for the service.

healthMonitor

The monitoring option for the service. Possible values: YES, NO. Default: YES.

The No-Monitor Option for Services

226

Page 227: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set the no-monitor option for a service by usingthe configuration utility

1. In the navigation pane, click Load Balancing and then click Services.

2. In the details pane, do one of the following:

• To create a new service, click Add.

• To modify an existing service, select the service and then click Open.3. In the Create Service or Configure Service dialog box, specify values for the following

parameters, which correspond to parameters described in “Parameters for configuring aservice” as shown:

• Service Name*–serviceName

• Protocol*–serviceType

• Server*–ipAddress

• Port*–port

• Health Monitor–healthMonitor* A required parameter

4. Click Create. The service you created appears in the Services pane.

5. From the Services pane, open the service that you added, and verify the health monitorsetting.

The No-Monitor Option for Services

227

Page 228: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

228

Protecting Applications on ProtectedServers Against Traffic Surges

The NetScaler provides the surge protection option to maintain the capacity of a server orcache. The NetScaler regulates the flow of client requests to servers and controls thenumber of clients that can simultaneously access the servers. The NetScaler blocks anysurges passed to the server, thereby preventing overloading of the server.

For surge protection to function correctly, you must enable it globally. For moreinformation about surge protection, see "Surge Protection."

To set surge protection on the service by using thecommand line interface

At the command prompt, type:

set service <name>@ -sp <Value>

Example

set service Service-HTTP-1 -sp ON

Parameters for configuring surge protection on theservice

ServiceName

The name of the service that you are configuring.

sp

State of surge protection for the service. Possible values: ON and OFF. Default: OFF.

Page 229: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set surge protection on the service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure surge protection,and then click Open.

3. In the Configure Service dialog box, click the Advanced tab, scroll down, and underOthers, select the Surge Protection check box.

4. Click OK.

Protecting Applications on Protected Servers Against Traffic Surges

229

Page 230: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

230

Enabling Cleanup of Service Connections

When cleanup of service connections is enabled, the NetScaler performs a cleanup of theconnections on a service that is down. This setting is described in Enabling Cleanup ofVirtual Server Connections.

To set down state flush on the service by using thecommand line interface

At the command prompt, type:

set service <name> -downStateFlush <Value>

Example

set service Service-HTTP-1 -downStateFlush enabled

Parameters for configuring down state flush on theservice

ServiceName

The name of the service that you are configuring.

downStateFlush

Flush all active transactions associated with a service whose state transitions from UP toDOWN. Do not enable this option for applications that must complete their transactions.Possible values: ENABLED and DISABLED. Default: ENABLED.

Page 231: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set down state flush on the service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure down state flush,and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Scroll down, and under Others, select the Down state flush check box.

5. Click OK.

Enabling Cleanup of Service Connections

231

Page 232: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

232

Directing Requests to a Custom WebPage

For SureConnect to function correctly, you must set it globally. The NetScaler provides theSureConnect option to ensure the response from an application. For more information aboutthe SureConnect option, see "Sure Connect."

To set SureConnect on the service by using thecommand line interface

At the command prompt, type:

set service <name>@ -sc <Value>

Example

set service Service-HTTP-1 -sc ON

Parameters for configuring SureConnect on theservice

ServiceName

The name of the service that you are configuring.

sc

State of SureConnect for the service. This parameter is supported for legacy purposesonly. It has no effect on the NetScaler, and its only valid value is OFF. Possible values:ON and OFF. Default: OFF.

Page 233: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set SureConnect on the service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure SureConnect,and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Scroll down, and under Others, select the Sure Connect check box.

5. Click OK.

Directing Requests to a Custom Web Page

233

Page 234: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

234

Enabling Access to Services When Down

You can enable access to a service when it is disabled or in a DOWN state by configuring theNetScaler appliance to use Layer 2 mode to bridge the packets sent to the service.Normally, when requests are forwarded to services that are DOWN, the request packets aredropped. When you enable the Access Down setting, however, these request packets aresent directly to the load balanced servers.

For more information about Layer 2 and Layer 3 modes, see IP Addressing.

For the appliance to bridge packets sent to the DOWN services, enable Layer 2 mode withthe accessDown parameter.

To enable access down on a service by using thecommand line interface

At the command prompt, type:

set service <name>@ -accessDown <Value>

Example

set service Service-HTTP-1 -accessDown YES

Parameters for configuring Access DownServiceName

The name of the service that you are configuring.

accessDown

Access to disabled or DOWN services. If this option is enabled, and the service goesDOWN, all packets to the service are bridged. If this option is disabled, and the servicegoes DOWN, the packets are dropped. Possible values: YES and NO. Default: NO.

Page 235: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To enable access down on a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure access down,click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Scroll down, and under Others, select the Access Down check box.

5. Click OK.

Enabling Access to Services When Down

235

Page 236: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

236

Enabling TCP Buffering of Responses

The NetScaler appliance provides a TCP buffering option that buffers only responses fromthe load balanced server. This enables the appliance to deliver server responses to theclient at the maximum speed that the client can accept them. The appliance allocates from0 through 4095 megabytes (MB) of memory for TCP buffering, and from 4 through 20480kilobytes (KB) of memory per connection.

Note: TCP buffering set at the service level takes precedence over the global setting. Formore information about configuring TCP buffering globally, see "TCP Buffering."

To enable TCP Buffering on a service by using thecommand line interface

At the command prompt, type:

set service <name>@ -TCPB <Value>

Example

set service Service-HTTP-1 -TCPB YES

Parameters for configuring TCP bufferingServiceName

The name of the service that you are configuring.

TCPB

State of the TCP buffering feature for the service. Possible values: YES and NO. Default:NO.

Page 237: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To enable TCP Buffering on a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure TCP buffering(for example, Service-HTTP-1), and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Scroll down, and under Settings, select the TCP Buffering check box.

5. Click OK.

Enabling TCP Buffering of Responses

237

Page 238: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

238

Enabling Compression

The NetScaler appliance provides a compression option to transparently compress HTML andtext files by using a set of built-in compression policies. Compression reduces bandwidthrequirements and can significantly improve server responsiveness in bandwidth-constrainedsetups. The compression policies are associated with services bound to the virtual server.The policies determine whether a response can be compressed and send compressiblecontent to the appliance, which compresses it and sends it to the client.

Note: For compression to function correctly, you must enable it globally. For moreinformation about configuring compression globally, see Compression.

To enable compression on a service by using thecommand line interface

At the command prompt, type:

set service <name> -CMP <YES | NO>

Example

set service Service-HTTP-1 -CMP YES

Parameters for configuring compressionServiceName

The name of the service that you are configuring.

CMP

State of the HTTP compression feature for the service. Possible values: YES, NO. Default:NO.

Page 239: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To enable compression on a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure compression (forexample, Service-HTTP-1), and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Under Settings, select the Compression check box.

5. Click OK.

Enabling Compression

239

Page 240: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

240

Maintaining Client Connection for MultipleClient Requests

You can set the client keep-alive parameter to configure an HTTP or SSL service to keep aclient connection to a Web site open across multiple client requests. If client keep-alive isenabled, even when the load balanced Web server closes a connection, the NetScalerappliance keeps the connection between the client and itself open. This setting allowsservices to serve multiple client requests on a single client connection.

If you do not enable this setting, the client will open a new connection for every requestthat it sends to the Web site. The client keep-alive setting saves the packet round trip timerequired to establish and close connections. This setting also reduces the time to completeeach transaction. Client keep-alive can be enabled only on HTTP or SSL service types.

Client keep-alive set at the service level takes precedence over the global client keep-alivesetting. For more information about client keep-alive, see Client Keep-Alive.

To enable client keep-alive on a service by using thecommand line interface

At the command prompt, type:

set service <name>@ -CKA <Value>

Example

set service Service-HTTP-1 -CKA YES

Parameters to configure client keep-aliveServiceName

The name of the service that you are configuring.

CKA

State of the Client Keep-Alive feature. Possible values: YES, NO. Default: NO.

Page 241: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To enable client keep-alive on a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure clientkeep-alive, and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Under Settings, select the Client Keep-Alive check box.

5. Click OK.

Maintaining Client Connection for Multiple Client Requests

241

Page 242: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

242

Inserting the IP Address of the Client inthe Request Header

A NetScaler uses the mapped IP address (MIP) to connect to the server. The server need notbe aware of the client.

However, in some situations, the server needs to be aware of the client it has to serve.When you enable the client IP setting, the NetScaler inserts the client's IPv4 or IPv6 addresswhile forwarding the requests to the server. The server inserts this client IP in the headerof the responses. The server is thus aware of the client.

To insert client IP address in the client request byusing the command line interface

At the command prompt, type:

set service <name>@ -CIP <Value> <cipHeader>

Example

set service Service-HTTP-1 -CIP enabled X-forwarded-for

Parameters for inserting client IP address in the clientrequest

ServiceName

The name of the service that you are configuring.

CIP

Client IP address header addition option for the service. Possible values: ENABLED andDISABLED. Default: DISABLED.

This option works with IPv4 and IPv6 addresses.

cipHeader

The name of the HTTP header that the NetScaler inserts and to which it adds the IPaddress of the client as the header value. If client IP insertion is enabled, and the clientIP header is not specified, then the NetScaler sets the client IP header. The default isblank (NetScaler uses a blank HTTP header).

Page 243: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To insert client IP address in the client request byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to add the client IP address inthe request, and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Under Settings, select the Client IP check box.

5. In the Header text box, type the header tag (for example, X-Forwarded-for).

6. Click OK.

Inserting the IP Address of the Client in the Request Header

243

Page 244: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

244

Using the Source IP Address of the ClientWhen Connecting to the Server

You can configure the NetScaler appliance to forward packets from the client to the serverwithout changing the source IP address. This is useful when you cannot insert the client IPaddress into a header, such as when working with non-HTTP services.

For more information about configuring USIP globally, see "Enabling Use Source IP Mode."

For information about using the port of the client when connecting to the server, see Usingthe Client Port When Connecting to the Server.

To enable USIP mode for a service by using thecommand line interface

At the command prompt, type:

set service <name>@ -usip (YES | NO)

Example

set service Service-HTTP-1 -usip YES

Parameters to configure USIP modeServiceName

The name of the service that you are configuring.

usip

Determines the source IP address used when the NetScaler appliance connects to theserver. If this option is set to YES, the NetScaler uses the client IP address. Possiblevalues: YES, NO. Default: NO.

Note: USIP does not work when you bind an IPv6 service with USIP enabled to an IPv4virtual server, or when you bind an IPv4 service with USIP enabled to an IPv6 virtualserver.

Page 245: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To enable USIP mode for a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to enable the USIP mode, andthen click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Under Settings, select the Use Source IP check box.

5. Click OK.

Using the Source IP Address of the Client When Connecting to the Server

245

Page 246: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

246

Configuring the Source Port forServer-Side Connections

When the NetScaler appliance connects to a physical server, it can use the source port fromclient's request, or it can use a proxy port as the source port for the connection. You canset the Use Proxy Port parameter to YES to handle situations such as the following scenario:

• The NetScaler appliance is configured with two load balancing virtual servers, LBVS1and LBVS2.

• Both the virtual servers are bound to the same service, S-ANY.

• Use (the client's) source IP address (USIP) is enabled on the service.

• Client C1 sends two requests, Req1 and Req2, for the same service.

• Req1 is received by LBVS1 and Req2 is received by LBVS2.

• LBVS1 and LBVS2 forward the request to S-ANY, and when S-ANY sends the response,they forward the response to the client.

• Consider two cases:

• Use the client port. When the NetScaler uses the client port, both the virtualservers use the client's IP address (because USIP is ON) and the client's port whenconnecting to the server. Therefore, when the service sends the response, theNetScaler cannot determine which virtual server should receive the response.

• Use proxy port. When the NetScaler uses a proxy port, the virtual servers use theclient's IP address (because USIP is ON), but different ports when connecting to theserver. Therefore, when the service sends the response, the port number identifiesthe virtual server that should receive the response.

The Use Proxy Port option becomes relevant if the use source IP (USIP) option is enabled.For TCP-based service types, such as TCP, HTTP, and SSL, the option is enabled by default.For UDP-based service types, such as UDP and DNS, including ANY, the option is disabled bydefault. For more information about the USIP option, see "Enabling Use Source IP Mode."

You can configure the Use Proxy Port setting either globally or on a given service.

To configure the Use Proxy Port setting on a serviceby using the command line interface

At the command prompt, type:

set service <ServiceName> -useProxyPort (YES | NO)

Example

Page 247: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

> set service svc1 -useproxyport YES Done > show service svc1 svc1 (10.102.29.30:80) - HTTP State: UP . . . Use Source IP: YES Use Proxy Port: YES . . . Done>

Parameters for configuring proxy port mode on aservice

ServiceName

The name of the service that you are configuring.

useProxyPort

If USIP is enabled, use a proxy port, instead of the source port in the client's request, asthe source port when connecting to a physical server. Possible values: YES, NO. Default:YES for TCP based service types, NO for UDP based service types.

To configure the Use Proxy Port setting on a serviceby using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to use the source IP address,and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Under Others, in the Use Proxy Port drop-down list, select YES.

5. Click OK.

Configuring the Source Port for Server-Side Connections

247

Page 248: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

248

Setting a Limit on the Number of ClientConnections

You can specify a maximum number of client connections that each load balanced servercan handle. The NetScaler appliance then opens client connections to a server only untilthis limit is reached. When the load balanced server reaches its limit, monitor probes areskipped, and the server is not used for load balancing until it has finished processingexisting connections and frees up capacity.

For more information on the Maximum Client setting, see "Load Balancing Domain-NameBased Services."

Note: Connections that are in the process of closing are not considered for this limit.

To set a limit to the number of client connections byusing the command line interface

At the command prompt, type:

set service <name> -maxclient <Value>

Example

set service Service-HTTP-1 -maxClient 1000

Parameters for configuring the maximum clientssetting

ServiceName

The name of the service that you are configuring.

maxClient

Maximum number of open connections to the service. The default value is 0. Themaximum value is 4294967294.

Page 249: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set a limit to the number of client connections byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure the maximumnumber of client connections (for example, Service-HTTP-1), and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Under Thresholds, in the Max Clients text box, type the maximum number of clientconnections (for example, 100).

5. Click OK.

Setting a Limit on the Number of Client Connections

249

Page 250: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

250

Setting a Limit on Number of RequestsPer Connection to the Server

The NetScaler appliance can be configured to reuse connections to improve performance. Insome scenarios, however, load balanced Web servers may have issues when connections arereused for too many requests. For HTTP or SSL services, use the max request option to limitthe number of requests sent through a single connection to a load balanced Web server.

Note: You can configure the max request option for HTTP or SSL services only.

To limit the number of client requests per connectionby using the command line interface

At the command prompt, type:

set service <ServiceName> -maxReq <Value>

Example

set service Service-HTTP-1 -maxReq 100

Parameters for configuring the maximum requestssetting

ServiceName

The name of the service that you are configuring.

maxReq

Maximum number of requests that can be sent on a persistent connection to the service.The default value is 0. The minimum value is 0 and maximum value is 65535. ‘0’ specifiesthat there is no limit on the maximum requests that are sent on a persistent connection.

Page 251: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To limit the number of client requests per connectionby using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure the maximumnumber of client requests, and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Under Thresholds, in the Max Requests text box, type the maximum number of clientrequests (for example, 100).

5. Click OK.

Setting a Limit on Number of Requests Per Connection to the Server

251

Page 252: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

252

Setting a Threshold Value for theMonitors Bound to a Service

The NetScaler appliance designates a service as UP only when the sum of the weights of allmonitors bound to it and that are UP is equal to or greater than the threshold valueconfigured on the service. The weight for a monitor specifies how much that monitorcontributes to designating the service to which it is bound as UP.

For example, assume that three monitors, named Monitor-HTTP-1, Monitor-HTTP-2, andMonitor-HTTP-3 respectively, are bound to Service-HTTP-1, and that the thresholdconfigured on the service is three. Suppose the following weights are assigned to eachmonitor:

• The weight of Monitor-HTTP-1 is 1.

• The weight of Monitor-HTTP-2 is 3.

• The weight of Monitor-HTTP-3 is 1.

The service is marked UP only when one of the following is true:

• Monitor-HTTP-2 is UP.

• Monitor-HTTP-2 and Monitor-HTTP-1 or Monitor-HTTP-3 are UP

• All three monitors are UP.

To set the monitor threshold value on a service byusing the command line interface

At the command prompt, type:

set service <name> -monThreshold <Value>

Example

set service Service-HTTP-1 -monThreshold 100

Parameters for configuring the monitor threshold on aservice

ServiceName

Page 253: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The name of the service that you are configuring.

monThreshold

Monitoring threshold. The default value is 0. The minimum value is 0 and maximum valueis 65535.

To set the monitor threshold value on a service byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure monitorthreshold (for example, Service-HTTP-1), and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. In the Monitor Threshold text box, type the monitor threshold.

5. Click OK.

Setting a Threshold Value for the Monitors Bound to a Service

253

Page 254: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

254

Setting a Timeout Value for Idle ClientConnections

You can configure the service with a time-out value to terminate any idle clientconnections when the configured time elapses. If the client is idle during the configuredtime, the NetScaler closes the client connection.

To set a timeout value for idle client connections byusing the command line interface

At the command prompt, type:

set service <name> -cltTimeout <Value>

Example

set service Service-HTTP-1 -cltTimeout 100

Parameters for setting a timeout value for idle clientconnections

ServiceName

The name of the service that you are configuring.

cltTimeout

Idle time (in seconds) after which the client connection is terminated. The default valueis 180sec for HTTP/SSL-based services and 9000sec for TCP-based services.

Page 255: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set a timeout value for idle client connections byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure the time-outvalue for client connections, and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Under Idle Time-out (secs), in the Client text box, type the timeout value.

5. Click OK.

Setting a Timeout Value for Idle Client Connections

255

Page 256: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

256

Setting a Timeout Value for Idle ServerConnections

You can configure a service with a timeout value to terminate any idle server connectionswhen the configured time elapses. If the server is idle for the configured amount of time,the NetScaler appliance closes the server connection.

To set a timeout value for idle server connections byusing the command line interface

At the command prompt, type:

set service <name>@ -svrTimeout <Value>

Example

set service Service-HTTP-1 -svrTimeout 100

Parameters for configuring idle server timeout onservices

ServiceName

The name of the service that you are configuring.

svrTimeout

Idle time (in seconds) after which the server connection is terminated. The default valueis 360. The maximum value is 31536000.

Page 257: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set a timeout value for idle server connections byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure the timeoutvalue for server connections (for example, Service-HTTP-1), and click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Under Idle Time-out (secs), in the Server text box, type a timeout value as a number ofseconds (for example, 100).

5. Click OK.

Setting a Timeout Value for Idle Server Connections

257

Page 258: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

258

Setting a Limit on the Bandwidth Usageby Clients

In some cases, servers may have limited bandwidth to handle client requests and maybecome overloaded. To prevent overloading a server, you can specify a maximum limit onthe bandwidth processed by the server. The NetScaler appliance forwards requests to aload balanced server only until this limit is reached.

To set a maximum bandwidth limit on a service byusing the command line interface

At the command prompt, type:

set service <name> -maxBandwidth <Value>

Example

set service Service-HTTP-1 -maxBandwidth 100

Parameters for configuring a maximum bandwidth ona service

ServiceName

The name of the service that you are configuring.

maxBandwidth

Maximum bandwidth, in Kbps, allowed for forwarding incoming requests to a service.Possible Values: 0-limit of memory. Default: limit of memory.

Page 259: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set a maximum bandwidth limit on a service byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details page, select the service for which you want to configure maximumbandwidth usage (for example, Service-HTTP-1), and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Under Thresholds, in the Max Bandwidth (kbits) text box, type the maximum bandwidth(for example, 100).

5. Click OK.

Setting a Limit on the Bandwidth Usage by Clients

259

Page 260: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

260

Redirecting Client Requests to a Cache

You can configure a service to redirect client requests to a cache, and forward only thoserequests that are cache misses to a service chosen by the configured load balancingmethod.

To set cache redirection on a service by using thecommand line interface

At the command prompt, type:

set service <name>@ -cacheable <Value>

Example

set service Service-HTTP-1 -cacheable YES

Parameters for configuring caching of client requestsServiceName

The name of the service that you are configuring.

cacheable

Use the transparent cache redirection virtual server to forward requests to the cacheserver.

Note: Do not specify this parameter if you set the Cache Type parameter.

Possible values: YES and NO. Default: NO.

Page 261: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set cache redirection on a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to configure cacheredirection, and then click Open.

3. In the Configure Service dialog box, click the Advanced tab.

4. Scroll down, and under Cache Redirection Options, in Cache Type list, select the typeof cache (for example, Regular Server).

5. Click OK.

Redirecting Client Requests to a Cache

261

Page 262: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

262

Monitors

To manage a high-traffic load balancing setup, the NetScaler appliance needs to track thestate of each load balanced server in near real time, so that it can divert traffic from anyload balanced server that is not responding and send that traffic to a load balanced serverthat is responding. Therefore, a monitor is bound to each service. The monitor is configuredto test the service by sending periodic probes to the service. (This is sometimes referred toas performing a health check.) If the monitor receives a timely response to its probes, itmarks the service as UP. If it does not receive a timely response to the designated numberof probes, it marks the service as DOWN.

The load balancing virtual server does not route requests to services that are DOWN. Thoseservices are removed from its list of available services until they become available againand respond to monitor probes.

You can bind a single monitor or multiple monitors to the same service. If you bind multiplemonitors to a service, they each evaluate responses to different types of traffic.

The NetScaler appliance supports built-in monitors to monitor common types of services. Italso supports user-created monitors based on the built-in monitors, and allows you tocreate and configure custom monitors.

Page 263: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

263

The Built-in Monitors

The NetScaler appliance contains a number of built-in monitors that you can use to monitoryour services. These built-in monitors handle most of the common protocols. You cannotmodify or remove the built-in monitors; you can only bind a built-in monitor to a serviceand unbind it from the service.

Note: You can create a custom monitor based on a built-in monitor. To learn how tocreate custom monitors, see Configuring Monitors in a Load Balancing Setup.

Page 264: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

264

Monitoring TCP-based Applications

The NetScaler appliance has two built-in monitors that monitor TCP-based applications:tcp-default and ping-default. When you create a service, the appropriate default monitor isbound to it automatically, so that the service can be used immediately if it is UP. Thetcp-default monitor is bound to all TCP services; the ping-default monitor is bound to allnon-TCP services.

You cannot delete or modify default monitors. When you bind any other monitor to a TCPservice, the default monitor is unbound from the service. The following table lists themonitor types, and the parameters and monitoring processes associated with each type.

Monitor type Specific parameters Process

tcp Not applicable The NetScaler applianceestablishes a 3-wayhandshake with the monitordestination, and then closesthe connection.

If the appliance observesTCP traffic to thedestination, it does notsend TCP monitoringrequests. This occurs ifLRTM is disabled. Bydefault, LRTM is disabledon this monitor.

http httprequest [“HEAD /”] -HTTP request that is sent tothe service.

respcode [200] - A set ofHTTP response codes areexpected from the service.

The NetScaler applianceestablishes a 3-wayhandshake with the monitordestination.

After the connection isestablished, the appliancesends HTTP requests, andthen compares the responsecode with the configuredset of response codes.

Page 265: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

tcp-ecv send [""] - is the data that issent to the service. Themaximum permissiblelength of the string is 512 Kbytes.

recv [""] - expectedresponse from the service.The maximum permissiblelength of the string is 128 Kbytes.

The NetScaler applianceestablishes a 3-wayhandshake with the monitordestination.

When the connection isestablished, the applianceuses the send parameter tosend specific data to theservice and expects aspecific response throughthe receive parameter.

http-ecv send [""] - HTTP data that issent to the service

recv [""] - the expectedHTTP response data fromthe service

The NetScaler applianceestablishes a 3-wayhandshake with the monitordestination.

When the connection isestablished, the applianceuses the send parameter tosend the HTTP data to theservice and expects theHTTP response that thereceive parameterspecifies. (HTTP body partwithout including HTTPheaders). Empty responsedata matches any response.Expected data may beanywhere in the first 24Kbytes of the HTTP body ofthe response.

ping Not Applicable The NetScaler appliancesends an ICMP echo requestto the destination of themonitor and expects anICMP echo response.

To configure built-in monitors for TCP-based applications, see Configuring Monitors in aLoad Balancing Setup.

Monitoring TCP-based Applications

265

Page 266: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

266

Monitoring SSL Services

The NetScaler appliance has built-in secure monitors, TCPS and HTTPS. You can use thesecure monitors to monitor HTTP as well as non-HTTP traffic. The secure monitors work asdescribed below:

• TCPS. The NetScaler appliance establishes a TCP connection. After the connection isestablished, the appliance performs an SSL handshake with the server. After thehandshake is over, the appliance closes the connection.

• HTTPS. The NetScaler appliance establishes a TCP connection. After the connection isestablished, the appliance performs an SSL handshake with the server. When the SSLconnection is established, the appliance sends HTTP requests over the encryptedchannel and checks the response codes.

The following table describes the available built-in monitors for monitoring SSL services.

Monitor type Probe Success criteria (Directcondition)

TCP TCP connection

SSL handshake

Successful TCP connectionestablished and successfulSSL handshake.

HTTP TCP connection

SSL handshake

Encrypted HTTP request

Successful TCP connectionis established, successfulSSL handshake isperformed, and expectedHTTP response code inserver HTTP response isencrypted.

TCP-ECV TCP connection

SSL handshake

(Data sent to a server isencrypted.)

Successful TCP connectionis established, successfulSSL handshake isperformed, and expectedTCP data is received fromthe server.

HTTP-ECV TCP connection

SSL handshake

(Encrypted HTTP request)

Successful TCP connectionis established, successfulSSL handshake isperformed, and expectedHTTP data is received fromthe server.

Page 267: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

267

Monitoring FTP Services

To monitor FTP services, the NetScaler appliance opens two connections to the FTP server.It first connects to the control port, which is used to transfer commands between a clientand an FTP server. After it receives the expected response, it connects to the data port,which is used to transfer files between a client and an FTP server. Only when the FTPserver responds as expected on both connections is it marked UP.

The NetScaler appliance has two built-in monitors for FTP services: the FTP monitor and theFTP-EXTENDED monitor. The FTP monitor checks basic functionality; the FTP-EXTENDEDmonitor also verifies that the FTP server is able to transmit a file correctly.

Parameter Specifies

userName User name used in the probe. Applies toboth the FTP and FTP-EXTENDED monitor.

password Password used in monitoring. Applies toboth the FTP and FTP-EXTENDED monitor

fileName File name to be used for FTP-EXTENDEDmonitor only.

To configure built-in monitors to check the state of FTP services, see Configuring Monitorsin a Load Balancing Setup.

Page 268: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

268

Monitoring SIP Services

A NetScaler ADC has two built-in monitors that you can use to monitor SIP services: theSIP-UDP and SIP-TCP monitors. A SIP monitor periodically checks the SIP service to whichthe SIP monitor is bound, by sending SIP request methods to the SIP service. If the SIPservice replies with a response code, the monitor marks the service as UP. If the SIP servicedoes not respond, or responds incorrectly, it is marked as DOWN.

Parameter Specifies

sipURI SIP addressing schema of the SIP server.

sipmethod Type of SIP request used to probe the SIP service. Specify one of thefollowing methods:

• INVITE

• OPTION (the default)

• REGISTER

respcode SIP response code with which the SIP service responds the proberequest.

Default: 200.The Session Initiation Protocol (SIP) is designed to initiate, manage, and terminatemultimedia communications sessions. It has emerged as the standard for Internet telephony(VoIP). SIP messages can be transmitted over TCP or UDP. SIP messages are of two types:request messages and response messages.

The following table summarizes the structure of SIP messages.

Messagetype

Components Components

Request Method Invite, Ack, Options, Bye, Cancel, Register

  Request URI Represents the subject, media type, or urgency ofsessions initiated. The common format is:sip:user:password@host:port;uri-parameters?headers

  SIP version The SIP version being used

Response SIP version The SIP version that is being used.

Page 269: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

  Status code A 3-digit integer result code. The possible values are:

1xx: Information Responses. For example: 180, Ringing

2xx: Successful Responses. For example: 200, OK

3xx: Redirection Responses. For example: 302, MovedTemporarily

4xx: Request Failures Responses. For example: 403,Forbidden

5xx: Server Failure Responses. For example: 504,Gateway Time-out

6xx: Global Failure Responses. For example: 600, BusyEverywhere

  Reason-phrase Textual description of the status code.The traffic in an SIP-based communication system is routed through dedicated devices andapplications (entities). In a multimedia communication session, these entities exchangemessages.

One of the most common uses for SIP is VoIP, where SIP is used to set up the session. Thefollowing diagram illustrates how the messages and entities in a SIP-based communicationsystem interoperate.

Figure 1. How SIP Works

Monitoring SIP Services

269

Page 270: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The entity that initiates the call is referred to as the user agent (UA). The UA can be an SIPsoftphone (a PC-based application) or a SIP phone.

To initiate a call, the user agent sends an INVITE request to the previously configured SIPproxy server. The INVITE request contains the details of the destination, such as thedestination uniform resource identifier (URI) and Call ID. In the diagram, the Caller A (useragent) sends an INVITE request to Proxy A.

When the proxy server receives the INVITE request, it sends a 100 (Trying) response to theuser agent, Caller A. It also performs a DNS lookup to locate the SIP proxy server of thedestination domain. After the SIP proxy server of the destination domain is located, the SIPproxy at the source domain sends the INVITE request to it. Here, Proxy A sends a 100(Trying) response to Caller A and an INVITE request to Proxy B.

When the SIP proxy server of the destination domain receives the INVITE request from theSIP proxy server of the source domain, it responds with a 100 (Trying) response. It thensends the INVITE request to the destination user agent. In this case, Proxy B sends a 100(Trying) response to Proxy A and an INVITE request to Caller B.

When the destination user agent receives the INVITE request, it alerts Caller B and respondswith a 180 (ringing) response. This response is routed back to the source user agent throughthe proxies.

When caller B accepts the call, the destination user agent responds with a 200 (OK)response. This signifies that caller B has answered the call. This response is routed back tothe source user agent through the proxies. After the call is set up, the user agentscommunicate directly without the proxies.

The following table describes the entities of a SIP-based communication system and theirroles.

Entity Role

User Agent (UA) SIP user agents generate requests andrespond to incoming requests. A user agentthat generates requests is known as a UserAgent Client (UAC). The user agent thatresponds to requests is known as the UserAgent Server (UAS). In the precedingexample, Caller A was the UAC and CallerB was the UAS.

Proxy Server Proxies receive and route SIP requestsbased on the URI. They can selectivelyrewrite parts of the request messagebefore forwarding it. They also handleregistrations and invitations to user agents,and apply call policies.

Redirect Server Redirect servers send routing informationto the SIP proxy servers.

Registrar Server Registrar servers provide locationinformation to user agents and proxyservers.

Back-to-Back User Agent (B2BUA) Back-to-Back User Agents (B2BUA) arecombination of UAS and UAC.

Monitoring SIP Services

270

Page 271: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

You can configure the NetScaler appliance to load balance SIP requests to a group of SIPproxy servers. To do so, you need to create a load balancing virtual server with the loadbalancing method set to Call-ID hash, and then bind to it the services that are bound to theSIP proxies.

For load balancing to work, you must also configure the SIP proxies so that they do not addprivate IP addresses or private domains to the SIP header/payload. SIP proxies must add tothe SIP header a domain name that resolves to the IP address of the SIP virtual server. Also,the SIP proxies must communicate with a common database to share registrationinformation.

The NetScaler appliance can load balance SIP proxies in either a one-arm DSR configurationor an inline direct server return (DSR) configuration. In a one-arm DSR configuration, theappliance receives SIP requests from user agents and routes the requests to the appropriateSIP proxy by using the configured load balancing method. The SIP proxies send theirresponses to the destination SIP proxies, bypassing the appliance, as illustrated in thefollowing diagram.

Figure 2. SIP in One-Arm Mode

The flow of requests and responses in this configuration is as follows:

• The user agent, Caller A, sends an INVITE request to the NetScaler. The NetScaler,using a load balancing method, routes the request to Proxy 2.

• Proxy 2 receives the INVITE request from the NetScaler and responds with a 100 (Trying)message.

• Proxy 2 performs a DNS lookup to obtain the IP address of the destination SIP proxy atdomainB.com. It then sends the INVITE request to the destination proxy.

Monitoring SIP Services

271

Page 272: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• The destination proxy responds with a 100 (Trying) message and sends the INVITErequest to the destination user agent, Caller B. The destination user agent, Caller B,begins to ring and responds with a 180 (Ringing) message. This message is sent to CallerA through the NetScaler and the Proxy 2. After the user accepts the call, Caller Bresponds with a 200 (OK) message that is propagated to Caller A through the NetScalerand the Proxy 2.

• After Caller B accepts the call, the user agents (Caller A and Caller B) communicateindependently.

In an inline DSR configuration, the appliance is placed between the router and the SIPproxy, as illustrated in the following diagram.

Figure 3. SIP in Inline Mode

The flow of requests and responses is as follows:

• The user agent, Caller A, sends an INVITE request to the appliance. The NetScaler,using a load balancing method, routes the request to Proxy 2.

• Proxy 2 receives the INVITE request from the appliance and responds with a 100(Trying) message.

• Proxy 2 performs a DNS lookup to obtain the IP address of the destination SIP proxy atdomainb.com. It then propagates the INVITE request to the destination proxy throughthe appliance.

• The appliance performs RNAT, and replaces the source IP address in the INVITE requestwith the NAT IP address, and then forwards the INVITE request to the destination SIPproxy.

Monitoring SIP Services

272

Page 273: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• The destination proxy responds with a 100 (Trying) message and sends the INVITErequest to the destination user agent, Caller B. Caller B begins to ring and respondswith a 180 (Ringing) message. This message is sent to Caller A through the NetScalerand the Proxy 2. After the user accepts the call, Caller B responds with a 200 (OK)message that is propagated to Caller A through the appliance and Proxy 2.

• After the user accepts the call, the user agents (Caller A and Caller B) communicateindependently.

Parameter Specifies

maxForwards SIP packet max-forwards. Possible Values:0-255. Default: 1.

sipMethod SIP method to be used for the query.Possible values: OPTIONS, INVITE,REGISTER Default value: OPTIONS.

sipURI SIP method string, sent to the server. Forexample “OPTIONS sip:sip.test.”

sipregURI SIP user to be registered.To configure built-in monitors to check the state of SIP server, see Configuring Monitors in aLoad Balancing Setup.

Monitoring SIP Services

273

Page 274: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

274

Monitoring RADIUS Services

The NetScaler appliance RADIUS monitor periodically checks the state of the RADIUS serviceto which it is bound by sending an authentication request to the service. The RADIUS serverauthenticates the RADIUS monitor and sends a response. By default, the monitor expects toreceive a response code of 2, the default Access-Accept response, from the RADIUS server.As long as the monitor receives the appropriate response, it marks the service UP.

Note: RADIUS monitor supports only PAP type authentication.

• If the client authenticated successfully, the RADIUS server sends an Access-Acceptresponse. The default access-accept response code is 2, and this is the code that theappliance uses.

• If the client fails to authenticate successfully (such as when there is a mismatch in theuser name, password, or secret key), the RADIUS server sends an Access-Rejectresponse. The default access-reject response code is 3, and this is the code that theappliance uses.

Parameter Specifies

userName User name on theRADIUS/NNTP/FTP/FTP-EXTENDED/MYSQL/POP3 server.This user name is used in the probe.

password Password used in monitoringRADIUS/NNTP/FTP/FTP-EXTENDED/MYSQL/POP3/LDAPservers.

radKey Shared secret key value that the RADIUS server usesduring client authentication.

radNASid NAS-ID that is encapsulated in the payload when anaccess request is made.

radNASip The IP address that is encapsulated in the payload whenan access-request is made. When radNASip is notconfigured, the NetScaler sends the mapped IP address(MIP) to the RADIUS server as the NAS IP address.

To monitor a RADIUS service, you must configure the RADIUS server to which it is bound asfollows:

1. Add the user name and password of the client that the monitor will use forauthentication to the RADIUS authentication database.

2. Add the IP address and secret key of the client to the appropriate RADIUS database.

3. Add the IP addresses that the appliance uses to send RADIUS packets to the RADIUSdatabase. If the NetScaler appliance has more than one mapped IP address, or if asubnet IP address (SNIP) is used, you must add the same secret key for all of the IPaddresses.

Caution: If the IP address used by the appliance are not added to the RADIUSdatabase, the RADIUS server will discard all packets.

Page 275: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure built-in monitors to check the state of RADIUS server, see Configuring Monitorsin a Load Balancing Setup.

Monitoring RADIUS Services

275

Page 276: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

276

Monitoring DNS and DNS-TCP Services

The NetScaler appliance has two built-in monitors that can be used to monitor DNS services:DNS and DNS-TCP. When bound to a service, either monitor periodically checks the state ofthat DNS service by sending a DNS query to it. The query resolves to an IPv4 or IPv6 address.That IP address is then checked against the list of test IP addresses that you configure. Thelist can contain up to five IP addresses. If the resolved IP address matches at least one IPaddress on the list, the DNS service is marked as up. If the resolved IP does not match anyIP addresses on the list, the DNS service is marked as down.

Parameter Parameter

query The DNS query (domain name) sent to theDNS service that is being monitored.Default value: “\007” If the DNS querysucceeds, the service is marked as UP;otherwise, it is marked as DOWN.

For a reverse monitor, if the DNS querysucceeds, the service is marked as DOWN;otherwise, it is marked as UP. If noresponse is received, the service is markedas DOWN.

queryType The type of DNS query that is sent.Possible values: Address, Zone.

IPAddress List of IP addresses that are checkedagainst the response to the DNS monitoringprobe.

IPv6 Select this check box if the IP address usesIPv6 format.

To configure the built-in DNS or DNS-TCP monitors, see Configuring Monitors in a LoadBalancing Setup.

Page 277: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

277

Monitoring LDAP Services

The NetScaler appliance has one built-in monitor that can be used to monitor LDAPservices: the LDAP monitor. It periodically checks the LDAP service to which it is bound byauthenticating and sending a search query to it. If the search is successful, the service ismarked UP. If the LDAP server does not locate the entry, a failure message is sent to theLDAP monitor, and the service is marked DOWN.

You configure the LDAP monitor to define the search that it should perform when sending aquery. You can use the Base DN parameter to specify a location in the directory hierarchywhere the LDAP server should start the test query. You can use the Attribute parameter tospecify an attribute of the target entity.

Parameter Specifies

baseDN Base name for the LDAP monitor fromwhere the LDAP search must start. If theLDAP server is running locally, the defaultvalue of base is dc=netscaler, dc=com.

bindDN BDN name for the LDAP monitor.

filter Filter for the LDAP monitor.

password Password used in monitoring LDAP servers.

attribute Attribute for the LDAP monitor.To configure the built-in LDAP monitor, see Configuring Monitors in a Load Balancing Setup.

Page 278: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

278

Monitoring MySQL Services

The NetScaler appliance has one built-in monitor that can be used to monitor MySQLservices: the MySQL monitor. It periodically checks the MySQL service to which it is boundby sending a search query to it. If the search is successful, the service is marked UP. If theMySQL server does not respond or the search fails, a failure message is sent to the MySQLmonitor, and the service is marked DOWN.

Parameter Specifies

database Database that is used for the MySQLmonitor.

sqlQuery SQL query that is used for the MySQLmonitor.

To configure built-in MySQL monitor, see Configuring Monitors in a Load Balancing Setup.

Page 279: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

279

Monitoring SNMP Services

The NetScaler appliance has one built-in monitor that can be used to monitor SMNPservices: the SNMP monitor. It periodically checks the SNMP agent on the service to which itis bound by sending a query for the enterprise identification ID (OID) that you configure formonitoring. If the query is successful, the service is marked UP. If the SNMP service findsthe OID that you specified, the query succeeds and the SNMP monitor marks the service UP.If it does not find the OID, the query fails and the SNMP monitor marks service DOWN.

Parameter Specifies

SNMPOID OID that is used for the SNMP monitor.

snmpCommunity Community that is used for the SNMPmonitor.

snmpThreshold Threshold that is used for the SNMPmonitor.

snmpVersion SNMP version that is used for loadmonitoring. Possible Values: V1, V2.

To configure the built-in SNMP monitor, see Configuring Monitors in a Load Balancing Setup.

Page 280: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

280

Monitoring NNTP Services

The NetScaler appliance has one built-in monitor that can be used to monitor NNTPservices: the NNTP monitor. It periodically checks the NNTP service to which it is bound byconnecting to the service and checking for the existence of the newsgroup that you specify.If the newsgroup exists, the search is successful and the service is marked UP. If the NNTPservice does not respond or the search fails, the service is marked DOWN.

The NNTP monitor can optionally be configured to post a test message to the newsgroup aswell.

Parameter Specifies

userName User name on theRADIUS/NNTP/FTP/FTP-EXTENDED/MYSQL/POP3 server.This user name is used in the probe.

password Password used in monitoringRADIUS/NNTP/FTP/FTP-EXTENDED/MYSQL/POP3/LDAPservers.

group Group name to be queried for NNTP monitor.To configure the built-in NNTP monitor, see Configuring Monitors in a Load Balancing Setup.

Page 281: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

281

Monitoring POP3 Services

The NetScaler appliance has one built-in monitor that can be used to monitor POP3services: the POP3 monitor. It periodically checks the POP3 service to which it is bound byopening a connection with a POP3 server. If the POP3 server responds with the correctresponse codes within the configured time period, it marks the service UP. If the POP3service does not respond, or responds incorrectly, it marks the service DOWN.

Parameter Specifies

userName User name POP3 server. This user name isused in the probe.

password Password used in monitoring POP3 servers.

scriptName The path and name of the script toexecute.

dispatcherIP The IP address of the dispatcher to whichthe probe is sent.

dispatcherPort The port of the dispatcher to which theprobe is sent.

To configure the built-in POP3 monitor, see Configuring Monitors in a Load Balancing Setup.

Page 282: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

282

Monitoring SMTP Services

The NetScaler appliance has one built-in monitor that can be used to monitor SMTPservices: the SMTP monitor. It periodically checks the SMTP service to which it is bound byopening a connection with it and conducting a series of handshakes to ensure that theserver is operating correctly. If the SMTP service completes the handshakes properly, themonitor marks the service UP. If the SMTP service does not respond, or respondsincorrectly, it marks the service DOWN.

Parameter Specifies

userName User name SMTP server. This user name isused in the probe.

password Password used in monitoring SMTP servers.

scriptName The path and name of the script toexecute.

dispatcherIP The IP Address of the dispatcher to whichthe probe is sent.

dispatcherPort The port of the dispatcher to which theprobe is sent.

To configure the built-in SMTP monitor, see Configuring Monitors in a Load Balancing Setup.

Page 283: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

283

Monitoring RTSP Servers

The NetScaler appliance has one built-in monitor that can be used to monitor RTSPservices: the RTSP monitor. It periodically checks the RTSP service to which it is bound byopening a connection with the load balanced RTSP server. The type of connection that itopens, and the response that it expects, differs depending upon the network configuration.If the RTSP service responds as expected within the configured time period, it marks theservice UP. If the service does not respond, or responds incorrectly, it marks the serviceDOWN.

The NetScaler appliance can be configured to load balance RTSP servers using twotopologies: NAT-off and NAT-on. RTSP servers send their responses directly to the client,bypassing the appliance. The appliance must be configured to monitor RTSP servicesdifferently depending upon which topology your network uses. The appliance can bedeployed either in inline or non-inline mode in both NAT-off and NAT-on mode.

In NAT-off mode, the appliance operates as a router: it receives RTSP requests from theclient and routes them to the service that it selects using the configured load balancingmethod. If your load balanced RTSP servers are assigned publicly accessible FQDNs in DNS,the load balanced servers send their responses directly to the client, bypassing theappliance. The following figure demonstrates this configuration.

Page 284: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure1. RTSPin

NAT-off

Mode

The flow of requests and responses in this scenario is as follows:

1. The client sends a DESCRIBE request to the appliance. The appliance uses theconfigured load balancing method to choose a service, and routes the request to MediaServer-1.

Monitoring RTSP Servers

284

Page 285: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

2. The client sends a SETUP request to the appliance. If the RTSP session ID is exchangedin the DESCRIBE request, the appliance, using RTSPSID persistence, routes the requestto Media Server-1. If the RTSP session ID is exchanged in the SETUP request, theappliance does one of the following:

• If the RTSP request comes on the same TCP connection, it routes the request toMedia Server-1, maintaining persistence.

• If the request arrives on a different TCP connection, it uses the configured loadbalancing method to choose a service, and sends the request to that service, notmaintaining persistence. This means that the request may be sent to a differentservice.

3. Media Server-1 receives the SETUP request from the appliance, allocates resources toprocess the RTSP request, and sends the appropriate session ID to the client.

Note: The appliance does not perform NAT to identify the RTSP connection, becausethe RTSP connections bypass it.

4. For subsequent requests, the client then uses the session ID to identify the session andsend control messages to the media server. Media Server-1 performs the requestedactions, such as play, forward, or rewind.

In NAT-on mode, the appliance receives RTSP requests from the client and routes thoserequests to the appropriate media server using the configured load balancing method. Themedia server then sends its responses to the client through the appliance, as illustrated inthe following diagram.

Monitoring RTSP Servers

285

Page 286: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure2. RTSPin

NAT-on Mode

The flow of requests and responses in this scenario is as follows:

1. The client sends a DESCRIBE request to the appliance. The appliance uses theconfigured load balancing method to choose a service, and routes the request to MediaServer-1.

Monitoring RTSP Servers

286

Page 287: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

2. The client sends a SETUP request to the appliance. If the RTSP session ID is exchangedin the DESCRIBE request, the appliance, using the RTSPSID persistence, routes therequest to Media Server-1. If the RTSP session ID is exchanged in the SETUP request, theappliance does one of the following:

• If the RTSP request comes on the same TCP connection, it routes the request toMedia Server-1, maintaining persistence.

• If the request arrives on a different TCP connection, it uses the configured loadbalancing method to choose a service, and sends the request to that service, notmaintaining persistence. This means that the request may be sent to a differentservice.

3. Media Server-1 receives the SETUP request from the appliance, allocates resources toprocess the RTSP request, and sends the appropriate session ID to the client.

4. The appliance performs NAT to identify the client for RTSP data connections, and theRTSP connections pass through the appliance and are routed to the correct client.

5. For subsequent requests, the client then uses the session ID to identify the session andsend control messages to the appliance. The appliance uses RTSPSID persistence toidentify the appropriate service, and routes the request to Media Server-1. MediaServer-1 performs the requested action, such as play, forward, or rewind.

The RTSP monitor uses the RTSP protocol to evaluate the state of the RTSP services. TheRTSP monitor connects to the RTSP server and conducts a sequence of handshakes to ensurethat the server is operating correctly.

Parameter Specifies

rtspRequest The RTSP request string that is sent to theRTSP server (for example, OPTIONS *). Thedefault value is 07. The length of therequest must not exceed 163 characters.

respCode Set of response codes that are expectedfrom the service.

For instructions on configuring an RTSP monitor, see Configuring Monitors in a LoadBalancing Setup.

Monitoring RTSP Servers

287

Page 288: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

288

Monitoring the XML Broker Services

The NetScaler appliance has a built-in monitor type, CITRIX-XML-SERVICE, with which youcan create monitors to monitor the XML Broker services. The XML Broker services are usedby Citrix XenApp. The monitor opens a connection to the service and periodically probesthe XML services to which it is bound. If the server responds as expected within theconfigured time period, the monitor marks the service UP. If the service does not respond,or responds incorrectly, the monitor marks the service DOWN.

To configure a CITRIX-XML-SERVICE monitor, you need to specify the application name inaddition to setting the standard parameters. The application name is the name of theapplication that has to be run to monitor the state of the XML Broker service. The defaultapplication is Notepad.

To configure monitors for XML Broker services, see "Configuring Monitors in a Load BalancingSetup."

Page 289: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

289

Monitoring ARP Requests

The NetScaler appliance has one built-in monitor that can be used to monitor ARP requests:the ARP monitor. This monitor periodically sends an ARP request to the service to which itis bound, and listens for the expected response. If it receives the expected response, itmarks the service UP. If it receives no response or the wrong response, it marks the serviceDOWN.

ARP locates a hardware address for a load balanced server when only the network layeraddress is known. ARP works with IPv4 to translate IP addresses to Ethernet MAC addresses.ARP monitoring is not relevant to IPv6 networks, and is therefore not supported on thosenetworks.

There are no special parameters for the ARP monitor.

For instructions on configuring an ARP monitor, see Configuring Monitors in a Load BalancingSetup.

Page 290: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

290

Monitoring the Access Gateway

The NetScaler appliance has one built-in monitor that can be used to monitor aload-balanced Access Gateway: the CITRIX-AG monitor. This is in addition to two monitorsfor the Advanced Access Control login page and agent service page, which are describedseparately. The CITRIX-AG monitor periodically logs on to the Access Gateway service towhich it is bound, and awaits the expected responses to its requests. If it receives theexpected responses, it marks the service UP. If it receives no response or the wrongresponses, it marks the service DOWN.

To configure monitoring of an Access Gateway, you must first create a local user andpassword for the monitor on the load balanced Access Gateway server that the service isbound to. After you configure the Access Gateway, you then configure the monitor. Themonitor logs on to the Access Gateway using the realm and user name. For example, if youconfigured a realm of LDAP and a user name of user1, the Access Gateway logs on asLDAP/user1.

Note: RSA SecurID authentication is not supported for this monitor. RSA SecurID requiresan RSA-generated token as a password, which is not supported on the NetScalerappliance.

Parameter Specifies

userName A user name.

password A password for the username.

secondaryPassword A secondary password for the username.For instructions on configuring the CITRIX-AG monitor, see Configuring Monitors in a LoadBalancing Setup.

Page 291: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

291

Monitoring the Advanced Access ControlLogin Page

The NetScaler appliance has one built-in monitor that can be used to monitor the AdvancedAccess Control (AAC) login page on a load-balanced Access Gateway: theCITRIX-AAC-LOGINPAGE monitor. This monitor periodically logs on to the AAC login page viathe Access Gateway service to which it is bound, and awaits the expected response. If itreceives the expected response, it marks the service UP. If it receives no response or thewrong response, it marks the service DOWN.

Parameter Specifies

logonpointName The URL from which users access corporateresources using the Access GatewayAdvanced Edition. This setting controlsaccess to server farms, the AccessInterface configuration, and othersession-specific settings. It can also beused as a filter within Access Gatewaypolicies.

For instructions on configuring the CITRIX-AAC-LOGINPAGE monitor, see ConfiguringMonitors in a Load Balancing Setup.

Page 292: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

292

Monitoring the Advanced Access ControlLogon Agent Service Page

The NetScaler appliance has one built-in monitor that can be used to monitor the AdvancedAccess Control (AAC) agent service page on a load-balanced Access Gateway: theCITRIX-AAC-LAS monitor. The Logon Agent Service (LAS) is a service component of AdvancedAccess Control that requests authentication to the Authentication Service. This monitorperiodically logs on to the AAC agent service page via the Access Gateway service to whichit is bound, and awaits the expected response. If it receives the expected response, itmarks the service UP. If it receives no response or the wrong response, it marks the serviceDOWN.

Parameter Specifies

logonpointName The URL from which users access corporateresources using the Access Gatewayadvanced edition. This setting controlsaccess to server farms, the AccessInterface configuration, and othersession-specific settings. It can also beused as a filter within Access Gatewaypolicies.

lasVersion The version number of the agent.For instructions on configuring the CITRIX-AAC-LAS monitor, see Configuring Monitors in aLoad Balancing Setup.

Page 293: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

293

Monitoring the XenDesktop DeliveryController Services

In desktop virtualization, the NetScaler appliance can be used to load balance the WebInterface (WI) servers and the XenDesktop Delivery Controller servers deployed by CitrixXenDesktop environment. The NetScaler provides a built-in monitor, CITRIX-XD-DDCmonitor, which monitors the XenDesktop Delivery Controller servers. In addition to thehealth check, you can also verify whether the probe is sent by a valid user of theXenDesktop Delivery Controller server.

The monitor sends a probe to the XenDesktop Delivery Controller server in the form of anXML message. If the server responds to the probe with the identity of the server farm, theprobe is considered to be successful and the server's status is marked as UP. If the HTTPresponse does not have a success code or the identity of the server farm is not present inthe response, the probe is considered to be a failure and the server's status is marked asDOWN.

The Validate Credentials option determines the probe to be sent by the monitor to theXenDesktop Delivery Controller server, that is, whether to request only the server name orto also validate the login credentials.

Note: Regardless of whether or not the user credentials (user name, password anddomain) are specified on the CITRIX-XD-DDC monitor, the XenDesktop Delivery Controllerserver validates the user credentials only if the option to validate credentials is enabledon the monitor.

If you use the wizard for configuring the load balancing of the XenDesktop servers, theCITRIX-XD-DDC monitor is automatically created and bound to the XenDesktop DeliveryController services. If you do not use the wizard, add a monitor of the type CITRIX-XD-DDC.

• For instructions on using the wizard, see Configuring the load balancing of XenDesktop.

• For instructions on adding a monitor, see Creating Monitors.

• For instructions on binding a monitor to a service, see Binding Monitors to Services.

To add an XD-DDC monitor with the validatecredentials option by using the command lineinterface

At the command prompt, type the following commands to add an XD-DDC monitor andverify the configuration:

• add lb monitor <monitorName> <monitorType> -userName <userName> -password<password> -ddcDomain <ddc_domain_name> -validateCred YES

• show lb monitor <monitorName>

Page 294: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Example

> add lb monitor xdddcmon Citrix-xd-ddc -userName Administrator -password E12Dc35450a1 -ddcDomain dhop -validateCred YES Done> show lb monitor xdddcmon 1) Name......:xdddcmon Type......:CITRIX-XD-DDC State......: ENABLED

Standard parameters:Interval......:..5 sec...Retries......:..3Response timeout......:..2 sec...Down time......:..30 secReverse......:..NO...Transparent......:..NOSecure......:..NO...LRTM......:..ENABLEDAction......:..Not applicable...Deviation......:..0 secDestination IP......:..Bound serviceDestination port......:..Bound serviceIptunnel......:..NOTOS......:..NO...TOS ID......:..0SNMP Alert Retries......:..0...Success Retries......:..1Failure Retries......:..0

Special parameters:User Name..........:"Administrator"Password...........:*****DDC Domain.........: "dhop"Done

To specify the validate credentials option on anXD-DDC monitor by using the command line interface

At the command prompt, type:

set lb monitor <monitorName> <monitorType> -userName -password -ddcDomain<ddc_domain_name> -validateCred YES

Example

> set lb monitor XD_DDC_21.21.21.22_443_mn CITRIX-xd-ddc -userName Administrator -password D123S1R2A123 -ddcDomain dhop -validateCred YES Done

Parameters for configuring a monitormonitorName

Name to identify the monitor.

monitorType

Monitoring the XenDesktop Delivery Controller Services

294

Page 295: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Type of the monitor. For monitoring XenDesktop Delivery Controller servers, specifyCITRIX-XD-DDC.

userName

User name of the user account authorized to log into the XenDesktop Delivery Controllerserver.

password

Password for the user account.

ddcDomain

Domain in which the XenDesktop Delivery Controller server is present.

validateCred

Verify the validity of the user credentials. Possible values: YES, NO. Default: NO

To configure an XD-DDC monitor with the validatecredentials option by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. In the details pane, do one of the following:

• To add an XD-DDC monitor, click Add.

• To modify an XD-DDC monitor, select the monitor, and click Open.3. Type a name for the monitor.

4. Select the monitor type as CITRIX-XD-DDC.

5. On the Special Parameters tab, specify values for the following parameters, whichcorrespond to parameters described in "Parameters for configuring a monitor" as shown:

• Validate Credentials—validateCred (To specify YES, select the check box.)

• Name*—monitorName

• Type*—monitorType

• User Name*—userName

• Password*—password

• Domain Name*—ddcDomain*A required parameter

6. Click Create.

7. Select the new monitor, click Open, and verify the settings.

Monitoring the XenDesktop Delivery Controller Services

295

Page 296: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Monitoring the XenDesktop Delivery Controller Services

296

Page 297: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

297

Monitoring Web Interface Services

In desktop virtualization, the NetScaler appliance can be used to load balance the WebInterface (WI) servers and Dynamic Desktop Controller (DDC) servers deployed in the CitrixXenApp and Citrix XenDesktop and environments. The NetScaler appliance has two built-inmonitor types for monitoring the WI servers used in these environments.

A CITRIX-WEB-INTERFACE monitor can monitor the Web Interface services efficientlybecause it monitors a dynamic page at the location specified by the site path. The monitorchecks for critical failures in resource availability.

When you configure a CITRIX-WEB-INTERFACE monitor, specify the site path to the locationof the http page that displays the data collected by the monitor. To monitor the status ofthe service, in the specified site path, you can view the data updated dynamically by themonitoring script auth/nocookies.aspx.

Note: End the site path with a slash (/) to indicate that the monitored resource isdynamic.

Note: When you configure the WI-EXTENDED monitor, when specifying the site path, donot enter a slash (/) at the end of the path as the software internally adds a slash at theend of the path. For example, note the following command:

add monitor wi CITRIX-WI-EXTENDED -sitepath "/Citrix/DesktopWeb" -username aaa -password bbb -domain ccc

A CITRIX-WI-EXTENDED monitor verifies the logging process with the Web Interface service.This monitor accesses the login page and passes the user name, password, domain, and sitepath that were specified while configuring the monitor. It verifies the validity of the logincredentials, correct configuration of the monitor (for example, the site path), and theconnection with the IIS server.

Note: The CITRIX-WI-EXTENDED monitor is supported only for the .NET version of the WIservers. This monitor will not work for the JSP version of the WI servers.

If you use the wizard for configuring load balancing of the XenDesktop servers, aCITRIX-WEB-INTERFACE monitor is automatically created and bound to the WI services. Thewizard adds and binds a CITRIX-WEB-INTERFACE monitor by default. If you want to add andbind a CITRIX-WI-EXTENDED monitor, select the Validate Credentials check box and type thenecessary data. If you do not use the wizard, add a monitor corresponding to the WIservices and bind it to each WI service that you create.

• For instructions on using the wizard, see Configuring XenDesktop for Load Balancing orConfiguring XenApp for Load Balancing.

• For instructions on adding a CITRIX-WEB-INTERFACE monitor, see Creating Monitors.

• For instructions on binding a monitor to a service, see Binding Monitors to Services.

Page 298: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To add a WI monitor by using the command lineinterface

At the command prompt, type:

add lb monitor <monitorName> <monitorType> -sitePath <site_path> -dispatcherIP127.0.0.1 -dispatcherPort 3013 -userName <username> -password <password> -domain<domain_name>

Examples

add lb monitor mwie CITRIX-WEB-INTERFACE -sitePath "/Citrix/XDWI/"

add lb monitor mwie CITRIX-WI-EXTENDED -sitePath "/Citrix/XDWI/" -dispatcherIP 127.0.0.1 -dispatcherPort 3013 -userName administrator -password d83d154575d426 -encrypted -domain wi

Parameters for configuring WI monitorsmonitorName

Name of the monitor.

monitorType

Type of the monitor. Type of monitor. For monitoring WI servers, specifyCITRIX-WEB-INTERFACE or CITRIX_WI_EXTENDED.

sitePath

URL of the logon page.

password

Password for the user account. To view the dynamic page, this site path must end with aslash (/).

userName

User name of the user account authorized to log on to the WI server.

password

Password for the user account.

domain

Domain in which the WI server is present.

Monitoring Web Interface Services

298

Page 299: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To add a WI monitor by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. In the details pane, do one of the following:

• To add a WI monitor, click Add.

• To modify a WI monitor, select the monitor, and click Open.3. Type a name for the monitor.

4. Select the monitor type as CITRIX-WEB-INTERFACE or CITRIX-WI-EXTENDED.

5. On the Special Parameters tab, type the site path. To configure theCITRIX-WI-EXTENDED monitor, specify values for the following parameters, whichcorrespond to parameters described in "Parameters for configuring a monitor" as shown:

• User Name*—userName

• Password*—password

• Domain Name*—domain6. Click Create.

7. Select the new monitor, click Open, and verify the settings.

Monitoring Web Interface Services

299

Page 300: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

300

Custom Monitors

In addition to built-in monitors, you can use custom monitors to check the state of yourservices. The NetScaler appliance provides several types of custom monitors based onscripts that are included with NetScaler operating system that can be used to determine thestate of services based on the load on the service or network traffic sent to the service.These are the inline monitors, user monitors, and load monitors.

With any of these types of monitors, you can use the supplied functionality, or you cancreate your own scripts and use those scripts to determine the state of the service to whichthe monitor is bound.

Page 301: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

301

Configuring Inline Monitors

Inline monitors analyze and probe the responses from the services to which they are boundonly when those services receive client requests. The inline monitor is of type HTTP-INLINEand can only be configured to work with HTTP and HTTPS services. An inline monitordetermines that the service to which it is bound is UP by checking its responses to therequests that are sent to it. When no client requests are sent to the service, the inlinemonitor probes the service by using the configured URL.

Note: Inline monitors cannot be bound to HTTP or HTTPS Global Server Load Balancing(GSLB) remote or local services because these services represent virtual servers ratherthan actual load balanced Web servers.

Inline monitors have a time-out value and a retry count when probes fail. You can selectany of the following action types for the NetScaler appliance to take when a failure occurs:

• NONE. No explicit action is taken. You can view the service and monitor, and themonitor indicates the number of current contiguous error responses and cumulativeresponses checked.

• LOG. Logs the event in ns/syslog and displays the counters.

• DOWN. Marks the service down and does not direct any traffic to the service. Thissetting breaks any persistent connections to the service. This action also logs the eventand displays counters.

After the service is down, the service remains DOWN for the configured down time. Afterthe DOWN time elapses, the inline monitor uses the configured URL to probe the service tosee if it is available again. If the probe succeeds, the state of the service is changed to UP.Traffic is directed to the service, and monitoring resumes as before.

To configure inline monitors, see Configuring Monitors in a Load Balancing Setup.

Page 302: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

302

Understanding User Monitors

User monitors extend the scope of custom monitors. You can create user monitors to trackthe health of customized applications and protocols that the NetScaler appliance does notsupport. The following diagram illustrates how the user monitor works.

Figure 1. User Monitors

A user monitor requires the following components.

• Dispatcher. A process on the appliance that listens to monitoring requests. A dispatchercan be on the loopback IP address (127.0.0.1) and port 3013. Dispatchers are alsoknown as internal dispatchers. A dispatcher can also be a Web server that supportsCommon Gateway Interface (CGI). Such dispatchers are also known as externaldispatchers. They are used for custom scripts that do not run on the FreeBSDenvironment, such as .NET scripts.

Note: You can configure the monitor and the dispatcher to use HTTPS instead ofHTTP if you enable the “secure” option on the monitor and configure it as anexternal dispatcher. However, an internal dispatcher understands only HTTP, andcannot use HTTPS.

In a HA setup, the dispatcher runs on both the primary and secondary NetScalerappliances. The dispatcher remains inactive on the secondary appliance.

Page 303: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Script. The script is a program that sends custom probes to the load balanced serverand returns the response code to the dispatcher. The script may return any value to thedispatcher, but if a probe succeeds, the script must return a value of zero (0). Thedispatcher considers any other value as probe failure.

The NetScaler appliance is bundled with sample scripts for commonly used protocols.The scripts exist in the /nsconfig/monitors directory. If you want to add a new script,you add the script there. If you want to customize an existing script, you copy thescript with a new name and modify the script.

For the scripts to function correctly, the name of the script file must not exceed 63characters, and the maximum number of script arguments is 512. To debug the script,you must run it using the nsumon-debug.pl script from the NetScaler command line. Youuse the script name (with its arguments), IP address, and the port as the arguments ofthe nsumon-debug.pl script. Users must use the script name, IP address, port, time-out,and the script arguments for the nsumon-debug.pl script.

To track the status of the server, the monitor sends an HTTP POST request to theconfigured dispatcher. This POST request contains the IP address and port of the server,and the script that must be executed. The dispatcher executes the script as a child process,with user-defined parameters (if any). Then, the script sends a probe to the server. Thescript sends the status of the probe (response code) to the dispatcher. The dispatcherconverts the response code to an HTTP response and sends it to the monitor. Based on theHTTP response, the monitor marks the service as up or down.

The appliance logs the error messages to the /var/nslog/nsumond.log file when usermonitor probes fail. The following table lists the user monitors and the possible reasons forfailure.

User monitor type Probe failure reasons

SMTP Monitor fails to establish a connection tothe server.

NNTP Monitor fails to establish a connection tothe server.

  Missing or invalid script arguments, whichmay include an invalid number ofarguments or argument format.

  Monitor fails to find NNTP group.

LDAP Monitor fails to establish a connection tothe server.

  Missing or invalid script arguments, whichmay include an invalid number ofarguments or argument format.

  Monitor fails to bind to the LDAP server.

  Monitor fails to locate an entry for thetarget entity in the LDAP server.

FTP The connection to the server times out.

  Missing or invalid script arguments, whichmay include an invalid number ofarguments or argument format.

Understanding User Monitors

303

Page 304: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

  Login fails.

  Monitor fails to find the file on the server.

POP3 Monitor fails to establish a connection tothe database.

  Missing or invalid script arguments, whichmay include an invalid number ofarguments or argument format.

  Login fails.

POP3 Monitor fails to establish a connection tothe database.

  Missing or invalid script arguments, whichmay include an invalid number ofarguments or argument format.

  Login fails.

  Preparation of SQL query fails.

  Execution of SQL query fails.

SNMP Monitor fails to establish a connection tothe database.

  Missing or invalid script arguments, whichmay include an invalid number ofarguments or argument format.

  Login fails.

  Monitor fails to create SNMP session.

  Monitor fails to find the object identifier.

  The monitor threshold value setting isgreater than or equal to the actualthreshold of the monitor.

RDP (Windows Terminal Server) Missing or invalid script arguments, whichmay include an invalid number ofarguments or argument format.

  Monitor fails to create a socket.

  Mismatch in version.

  Monitor fails to confirm connection.You can view the log file from the NetScaler command line by using the followingcommands, which open a BSD shell, display the log file on the screen, and then close theBSD shell and return you to the NetScaler command prompt:

> shellroot@ns# cat /var/nslog/nsumond.logroot@ns# exit>

User monitors also have a time-out value and a retry count on failure of probes. You canuse user monitors with non-user monitors. During high CPU utilization, a non-user monitorenables faster detection of a server failure.

Understanding User Monitors

304

Page 305: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Note: If the user monitor probe times out during high CPU usage, the state of the serviceremains unchanged.

Understanding User Monitors

305

Page 306: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

306

How to Use a User Monitor to Check WebSites

You can configure a user monitor to check for specific Web site problems that are reportedby HTTP servers using specific HTTP codes. The following table lists the HTTP responsecodes that this user monitor expects.

HTTP response code Meaning

200 - success Probe success.

503 - service unavailable Probe failure.

404 - not found Script not found or cannot execute.

500 - Internal server error Internal error/resource constraints indispatcher (out of memory, too manyconnections, unexpected system error, ortoo many processes). The service is notmarked DOWN.

400 - bad request Error parsing HTTP request.

502 - bad gateway Error decoding script's response.You configure the user monitor for HTTP by using the following parameters.

Parameter Specifies

scriptName The path and name of the script toexecute.

scriptArgs The strings that are added in the POSTdata. They are copied to the requestverbatim.

dispatcherIP The IP address of the dispatcher to whichthe probe is sent.

dispatcherPort The port of the dispatcher to which theprobe is sent.

localfileName The name of a monitor script file on thelocal system.

destPath A particular location on the NetScalerappliance where the uploaded local file isstored.

To create a user monitor to monitor HTTP, see Configuring Monitors in a Load BalancingSetup.

Page 307: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

307

Understanding the Internal Dispatcher

You can use a custom user monitor with the internal dispatcher. Consider a case where youneed to track the health of a server based on the presence of a file on the server. Thefollowing diagram illustrates this scenario.

Figure 1. Using a User Monitor with the Internal Dispatcher

A possible solution is to use a Perl script that initiates an FTP session with the server andchecks for the presence of the file. You can then create a user monitor that uses the Perlscript. The NetScaler includes such a Perl script (nsftp.pl), in the /nsconfig/monitors/directory.

You can use a user monitor with an external dispatcher. Consider a case where you musttrack the health of a server based on the state of an SMTP service on another server. Thisscenario is illustrated in the following diagram.

Figure 2. Using a User Monitor with an External Dispatcher

Page 308: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

A possible solution would be to create a Perl script that checks the state of the SMTPservice on the server. You can then create a user monitor that uses the Perl script.

Understanding the Internal Dispatcher

308

Page 309: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

309

Configuring a Custom User Monitor

To configure a custom user monitor, you must first write the script that performs the actionthat the monitor will use to check the service that is bound to it, and upload the script tothe /home/user directory on the NetScaler appliance. Then you create the monitor on theappliance, as described below.

To configure a user monitor by using the commandline interface

At the command prompt, type:

add lb monitor <monitorName> USER -scriptname <NameOfScript> –scriptargs <Arguments>

Example

add monitor Monitor-User-1 USER -scriptname nsftp.pl –scriptargs "file=/home/user/sample.txt;user=root;password=passwd"

Page 310: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

310

Understanding Load Monitors

Load monitors use SNMP polled OIDs to calculate load. The load monitor uses the IP addressof the service to which it is bound (the destination IP address) for polling. It sends an SNMPquery to the service, specifying the OID for a metric. The metrics can be CPU, memory, ornumber of server connections. The server responds to the query with a metric value. Themetric value in the response is compared with the threshold value. The NetScaler applianceconsiders the service for load balancing only if the metric is less than the threshold value.The service with the lowest load value is considered first.

The following diagram illustrates a load monitor configured for the services described in thebasic load balancing setup discussed in Setting Up Basic Load Balancing.

Figure 1. Operation of Load Monitors

Note: The load monitor does not determine the state of the service. It only enables theappliance to consider the service for load balancing.

After you configure the load monitor, you must then configure the metrics that the monitorwill use. For load assessment, the load monitor considers server parameters known asmetrics, which are defined within the metric tables in the appliance configuration. Metrictables can be of two types:

• Local. By default, this table exists in the appliance. It consists of four metrics: connections, packets, response time, and bandwidth. The appliance specifies these metrics for a service, and SNMP queries are not originated for these services. These

Page 311: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

metrics cannot be changed.

• Custom. A user-defined table. Each metric is associated with an OID.

By default, the appliance generates the following tables:

• NetScaler

• RADWARE

• CISCO-CSS

• LOCAL

• FOUNDRY

• ALTEON

You can either add the appliance-generated metric tables, or you can add tables of yourown choosing, as shown in the following table. The values in the metric table are providedonly as examples. In an actual scenario, consider the real values for the metrics.

Metric name OIDs Weight Threshold

CPU 1.2.3.4 2 70

Memory 4.5.6.7 3 80

Connections 5.6.7.8 4 90To calculate the load for one or more metrics, you assign a weight to each metric. Thedefault weight is 1. The weight represents the priority given to each metric. If the weight ishigh, the priority is high. The appliance chooses a service based on the SOURCEIPDESTIPhash algorithm.

You can also set the threshold value for each metric. The threshold value enables theappliance to select a service for load balancing if the metric value for the service is lessthan the threshold value. The threshold value also determines the load on each service.

Understanding Load Monitors

311

Page 312: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

312

Configuring Load Monitors

To configure a load monitor, first create the load monitor. For instructions on creating amonitor, see Creating Monitors. Next, select or create the metric table to define a set ofmetrics that determine the state of the server, and (if you create a metric table) bind eachmetric to the metric table.

To create a metric table by using the command lineinterface

At the command prompt, type the following commands:

• add lb metricTable <metricTableName>

• bind lb metricTable <metricTableName> <metric> <SNMPOID>

Example

add metricTable Table-Custom-1

bind metricTable Table-Custom-1 1.3.6.1.4.1.5951.4.1.1.41.1.5 11

Parameters for configuring load balancing metrictables

metricTableName

Name of the metric table. This alphanumeric string is required and cannot be changedafter the metric table is created. The name must not exceed 31 characters, and theleading character must be a number or letter. The following characters are also allowed:@ _ - . (period) : (colon) # and space ( ).

metric

The name of the metric that you are binding to the metric table.

SNMPOID

The SNMP OID for the metric that you are binding to the metric table.

Page 313: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To create a metric table and bind metrics to it byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Metric Tables.

2. In the details pane, click Add.

3. In the Create Metric Table dialog box, in the Metric Table Name text box, type thename of the metric table (for example, Table-Custom-1).

4. Click Create.

5. In the details pane, select the metric table that you just created (for example,Table-Custom-1), and then click Open.

6. In the Configure Metric Table dialog box, in the Metric and SNMP OID text boxes, typethe metric and SNMP OID for the metric table (for example,1.3.6.1.4.1.5951.4.1.1.41.1.5 and 11).

7. Click Add.

8. Click Close. The metric table you created appears in the Metric Tables pane.

Configuring Load Monitors

313

Page 314: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

314

Unbinding Metrics from a Metrics Table

You can unbind metrics from a metrics table if the metrics need to be changed, or if youwant to remove the metrics table entirely.

To unbind metrics from a metric table by using thecommand line interface

At the command prompt, type:

unbind lb metricTable <metricTable> <metric>

Example

unbind metricTable Table-Custom-1 1.3.6.1.4.1.5951.4.1.1.41.1.5

To unbind metrics from a metric table by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Metric Tables.

2. In the details pane, select the metric table from which you want to unbind the metrics(for example, Table-Custom-1), click Open.

3. In the Configure Metric Table dialog box, in the Bound Metrics list box, select themetric that you want to unbind from the table (for example,1.3.6.1.4.1.5951.4.1.1.41.1.5).

4. Click Remove, and then click OK.

You can view the detail of all configured metric tables, such as name and type, todetermine whether the metric table is internal or created and configured.

Page 315: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

315

Removing a Load Monitoring Metric Table

You can remove a metric table from the NetScaler configuration.

Note: Before you can remove a metric table, you must unbind all metrics from it.

To remove a metric table by using the command lineinterface

At the command prompt, type:

rm lb metricTable <metricTable>

Example

rm metricTable <Table-Custom-1>

To remove a metric table by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Metric Tables.

2. In the details pane, select the metric table that you want to remove (for example,Table-Custom-1), and click Remove.

3. In the Remove dialog box, and then click Yes.

You can unbind a metric from a metric table to remove that metric from consideration.

Page 316: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

316

Viewing Metrics Tables

You can view a metrics table and the metrics bound to it.

To view the metric tables by using the command lineinterface

At the command prompt, type:

show lb metricTable <metricTable>

Example

show metricTable Table-Custom-1

To view the metric tables by using the configurationutility

1. In the navigation pane, expand Load Balancing.

2. Click Metric Tables. The details of the available metric table appear on the MetricTables pane.

Page 317: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

317

Configuring Monitors in a Load BalancingSetup

To configure monitors on a Web site, you first decide whether to use a built-in monitor orcreate your own monitor. If you create a monitor, you can choose between creating amonitor based on a built-in monitor, or creating a custom monitor that uses a script thatyou write to monitor the service. (For more information about creating custom monitors,see Custom Monitors.) Once you have chosen or created a monitor, you then bind it to theappropriate service. The following conceptual diagram illustrates a basic load balancingsetup with monitors.

Figure 1. How Monitors Operate

As shown above, each service has a monitor bound to it. The monitor probes the loadbalanced server via its service. As long as the load balanced server responds to the probes,the monitor marks it UP. If the load balanced server should fail to respond to thedesignated number of probes within the designated time period, the monitor marks itDOWN.

Page 318: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

318

Creating Monitors

The NetScaler appliance provides a set of built-in monitors. It also allows you to createcustom monitors, either based on the built-in monitors or from scratch.

To create a monitor by using the command lineinterface

At the command prompt, type:

add lb monitor <monitorName> <monitorType> [<interval>]

Example

add lb mon monitor-HTTP-1 HTTP

add lb mon monitor-HTTP-2 TCP 2

Parameters for configuring monitorsmonitorName

Name of the monitor. This alphanumeric string is required and cannot be changed afterthe monitor is created. The name must not exceed 31 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( ).

Type

Type of monitor. The valid options for this parameter are: PING, TCP, HTTP, TCP-ECV,HTTP-ECV, UDP-ECV, DNS, FTP, LDNS-PING, LDNS-TCP, LDNS-DNS, RADIUS, USER,HTTP-INLINE, SIP-UDP, LOAD, FTP-EXTENDED, SMTP, SNMP, NNTP, MYSQL, LDAP, POP3,CITRIX-XML-SERVICE, CITRIX-WEB-INTERFACE, DNS-TCP, RTSP, ARP, CITRIX-AG,CITRIX-AAC-LOGINPAGE, CITRIX-AAC-LAS, CITRIX-XD-DDC, ND6, MYSQL-ECV | MSSQL-ECV.

interval

Frequency at which the probe is sent to a service. The interval must be greater than theresponse time-out. Possible values: 1 millisecond-160 seconds. Default: 5 seconds.

Page 319: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To create a monitor by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. On the Monitors pane, click Add.

3. In the Create Monitor dialog box, in the Name and Interval text boxes type the nameand interval value of the monitor.

4. In the Type list, select the type of the monitor.

5. In the list next to the Interval text box, select Seconds.

6. Click Create, and then click Close. The monitor that you created appears in theMonitors pane.

Creating Monitors

319

Page 320: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

320

Binding Monitors to Services

After creating a monitor, you bind it to a service. You can bind one or multiple monitors toa service. If you bind one monitor to a service, that monitor determines whether theservice is marked UP or DOWN. If you bind multiple monitors to a service, the NetScalerappliance checks all monitors bound to that service using a calculation that you control,and marks the service UP or DOWN depending on the results.

Note: The destination IP address of a monitor probe can be different than the server IPaddress and port.

To bind a monitor to a service by using the commandline interface

At the command prompt, type:

bind lb monitor <monitorName> <ServiceName>

Example

bind mon monitor-HTTP-1 Service-HTTP-1

To bind a monitor to a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service for which you want to bind the monitor (forexample, Service-HTTP-1), and then click Open.

3. On the Monitors tab, in the Available list box, select the monitor you want to bind theservice (for example, monitor-HTTP-1), and then click Add.

4. In the Configured box, click OK.

Page 321: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

321

Modifying Monitors

You can modify the settings for any monitor that you created.

Note: Two sets of parameters apply to monitors: those that apply to all monitors,regardless of type, and those that are specific to a monitor type. For information onparameters for a specific monitor type, see the description for that type of monitor.

To modify an existing monitor by using the commandline interface

At the command prompt, type:

set lb monitor <monitorName> <type> -interval <interval> -resptimeout <resptimeout>

Example

set mon monitor-HTTP-1 HTTP -interval 50 milli-resptimeout 20 milli

Parameters for modifying monitor settingsLRTM

State of the response time calculation of probes. Possible values: ENABLED andDISABLED. Default: DISABLED.

deviation

Deviation from the learned response time for dynamic response time monitoring. Themaximum value is 348 minutes.

interval

Duration of the interval for which the NetScaler appliance waits before it marks theprobe as failed. The response time-out must be less than the value specified in theinterval parameter.

The UDP-ECV monitor type does not decide the probe failure using the responsetime-out. The appliance considers the probe as successful for the UDP-ECV monitor typewhen the server response matches the criteria that the send and receive options set, orif the response is not received from the server.

The send option specifies the data that must be sent to the server in the probe, and thereceive option specifies the server response criteria for the probe to succeed. The

Page 322: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

unreachable error from the service causes probe failure. The minimum value is 10milliseconds. The maximum value is 159 seconds. The default value is 2 seconds.

resptimeout

Monitor response time-out threshold. If the response time for the monitoring probesexceeds the threshold, a trap is sent. The response time-out is given as a percentage.The minimum value is 1 and the maximum value is 100.

retries

Number of consecutive probe failures after which the NetScaler appliance determinesthe service as DOWN. Possible Values: 3 -127. Default: 3.

successRetries

Number of consecutive successful retries that are required to mark the state of theservice as UP. For example, if you set the success retries to 3, when 3 probes succeedconsecutively, the service is marked as UP. Possible Values: 1-32. Default: 1.

failureRetries

Number of failed probes that are required to mark the state of the service as DOWN. Bydefault, the NetScaler appliance requires a specific number of consecutive retry failuresto mark the state of the service as DOWN. The minimum value for this parameter is 0 andmaximum value is 32. The default value is 0. For example, if you set the retries to 10and the failure retries to 3, when 3 retry probes fail, the service is marked as DOWN.

alertRetries

The number of probe failures after which the NetScaler appliance generates an SNMPtrap named MonProbeFailed. This parameter is closely linked to the Retries parameter.For example, if you set Retries to ten and SNMP Alert Retries to three, the appliancegenerates a MonProbeFailed trap when it detects a third probe failure. You can then takecorrective action. However, if the problem is not corrected, the appliance marks theservice as DOWN after the tenth probe failure.

You need to set the SNMP Alert Retries parameter to a value lower than the Retriesparameter.

Note: The monitor probe failures need not be consecutive.

Possible Values: 0-32. Default: 0.

downTime

Wait duration until the next probe after the service is marked down. Possible Values:10-160 seconds. Default: 30 seconds.

destIP

IP address to which the probe is sent. If the destination IP address is set to 0, thedestination IP address is set to the bound service. Default: 0.0.0.0.

destPort

Modifying Monitors

322

Page 323: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

TCP/UDP port to which the probe is sent. If the destination port is set to 0, thedestination port is the port of the service to which the monitor is bound. For a USERmonitor, this port is the port sent in the HTTP request to the dispatcher. This option isignored if the monitor is of the PING type. For information about user monitors, seeUnderstanding User Monitors.

state

State of the monitor. If the monitor is disabled, this monitor type probe is not sent forthe services. If the monitor is bound, the state of this monitor is not considered whenthe state of the service is determined. Possible values: ENABLED and DISABLED. Default:ENABLED.

reverse

Mark a service as DOWN, instead of UP, when probe criteria are satisfied, and as UPinstead of DOWN when probe criteria are not satisfied. Possible values: YES, NO. Default:NO.

transparent

The monitor is bound to a transparent device such as a firewall or router. The state of atransparent device depends on the responsiveness of the services behind it. If atransparent device is being monitored, a destination IP address must be specified. Theprobe is sent to the specified IP address by using the MAC address of the transparentdevice. Possible values: YES, NO. Default: NO.

secure

State of the secure monitoring of services. SSL handshake is performed on theestablished TCP connection. Applicable for TCP-based monitors only. Possible values: YESand NO. Default: NO.

application

Name of the application that must be executed to check the state of the service.

sitePath

URL of the logon page.

Modifying Monitors

323

Page 324: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To modify an existing monitor by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. In the details pane, select the monitor that you want to modify (for example,monitor-HTTP-1), and then click Open.

3. On the Standard Parameters tab, in the Interval and Response Time-out text boxes,type the interval and response timeout values (for example, 50 and 20).

4. In the list next to Interval text box, select the interval (for example, Milli Seconds).

5. In the list next to Response Time-out text box, select the interval (for example, MilliSeconds).

6. Click OK.

Modifying Monitors

324

Page 325: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

325

Enabling and Disabling Monitors

By default, monitors bound to services and service groups are enabled. When you enable amonitor, the monitor begins probing the services to which it is bound. If you disable amonitor bound to a service, the state the service is determined using the other monitorsbound to the service. If the service is bound to only one monitor, and if you disable themonitor, the state of the service is determined using the default monitor.

To enable a monitor by using the command lineinterface

At the command prompt, type:

enable lb monitor <monitorName>

Example

enable lb mon monitor-HTTP-1

To enable a monitor by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. On the Monitors pane, select the monitor that you want to enable (for example,monitor-HTTP-1), and then click Enable.

3. In the Enable dialog box, click Yes.

To disable a monitor by using the command lineinterface

At the command prompt, type:

disable lb monitor <monitorName>

Example

disable lb mon monitor-HTTP-1

Page 326: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To disable a monitor by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. On the Monitors pane, select the monitor that you want to disable (for example,monitor-HTTP-1), and then click Disable.

3. In the Disable dialog box, click Yes.

Enabling and Disabling Monitors

326

Page 327: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

327

Unbinding Monitors

You can unbind monitors from a service and service group. When you unbind a monitor fromthe service group, the monitors are unbound from the individual services that constitutethe service group. When you unbind a monitor from a service or a service group, themonitor does not probe the service or the service group.

Note: When you unbind all user-configured monitors from a service or a service group,the default monitor is bound to the service and the service group. The default monitorsthen probes the service or the service groups.

To unbind a monitor from a service by using thecommand line interface

At the command prompt, type:

unbind lb monitor <monitorName>

Example

unbind mon monitor-HTTP-1 Service-HTTP-1

To unbind a monitor from a service by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, select the service from that you want to unbind the monitor (forexample, Service-HTTP-1), click Open.

3. In the Configure Service dialog box, under Configured, select the monitor that you wantto unbind from the service (for example, monitor-HTTP-1), and then click Remove.

4. Click OK.

Page 328: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

328

Removing Monitors

After you unbind a monitor that you created from its service, you can remove that monitorfrom the NetScaler configuration. (If a monitor is bound to a service, it cannot beremoved.)

Note: When you remove monitors bound to a service, the default monitor is bound to theservice. You cannot remove default monitors.

To remove a monitor by using the command lineinterface

At the command prompt, type:

rm lb monitor <monitorName> <type>

Example

rm lb monitor monitor-HTTP-1 HTTP

To remove a monitor by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. On the Monitors pane, select the monitor that you want to remove (for example,monitor-HTTP-1), and then click Remove.

3. In the Remove dialog box, click Yes.

Page 329: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

329

Viewing Monitors

You can view the services and service groups that are bound to a monitor. You can verifythe settings of a monitor to troubleshoot your NetScaler configuration. The followingprocedure describes the steps to view the bindings of a monitor to the services and servicegroups.

To view monitor bindings by using the command lineinterface

At the command prompt, type:

show lb monbindings <MonitorName>

Example

show lb monbindings monitor-HTTP-1

To view monitor bindings by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. On the Monitors pane, select the monitor for which you want to view the bindinginformation (for example, monitor-HTTP-1), and then click Show Bindings. The bindinginformation for the monitor that you selected appears in the Binding Info for Monitor:monitor-HTTP-1 dialog box.

To view monitors by using the command line interfaceAt the command prompt, type:

show lb monitor <monitorName>

Example

show lb mon monitor-HTTP-1

Page 330: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To view monitors by using the configuration utility1. In the navigation pane, expand Load Balancing, and then click Monitors. The details of

the available monitors appear on the Monitors pane.

Viewing Monitors

330

Page 331: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

331

Closing Monitor Connections

The NetScaler appliance sends probes to the services through the monitors bound to theservices. By default, the monitor on the NetScaler and the physical server follow thecomplete handshake procedure even for monitor probes. However, this procedure addsoverhead to the monitoring process and may not be always necessary.

For the TCP monitors, you can configure the NetScaler to close a monitor-probe connectionafter receiving SYN-ACK from the service. To do so, set the value of themonitorConnectionClose parameter to RESET. If you want the monitor-probe connection togo through the complete procedure, set the value to FIN.

Note: The monitorConnectionClose setting is applicable to all the monitors bound to allthe services configured on the NetScaler appliance.

To configure monitor-connection closure by using thecommand line interface

At the command prompt, type:

set lb parameter -monitorConnectionClose <monitor_conn_close_option>

Example

set lb parameter -monitorConnectionClose RESET

Parameter for configuring monitor-connection closuremonitorConnectionClose

Close (reset) a monitor-probe connection after receiving SYN-ACK from the service, orcomplete (finish) the handshake before closing the connection. Possible values: RESET,and FIN. Default: FIN.

Page 332: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure monitor-connection closure by using theconfiguration utility

1. In the navigation pane, click Load Balancing.

2. Under Settings, click Configure Load Balancing Parameters.

3. In the Configure Load Balancing Parameters dialog box, for Connection Close forMonitor, select FIN or RESET.

4. Click OK.

Closing Monitor Connections

332

Page 333: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

333

Ignoring the Upper Limit on ClientConnections for Monitor Probes

Depending on considerations such as the capacity of a physical server, you can specify alimit on the maximum number of client connections made to any service. If you have setsuch a limit on a service, the NetScaler appliance stops sending requests to the servicewhen the threshold is reached and resumes sending connections to the service after thenumber of existing connections falls to within the limits. You can configure the NetScaler toskip this check when it sends monitor-probe connections to a service.

Note: You cannot skip the maximum-client-connections check for an individual service. Ifyou specify this option, it applies to all the monitors bound to all the services configuredon the NetScaler appliance.

To set the Skip MaxClients for Monitor Connectionsoption by using the command line interface

At the command prompt, type:

set lb parameter -monitorSkipMaxClient (ENABLED|DISABLED)

Example

set lb parameter -monitorSkipMaxClient enabled

Parameter for skipping themaximum-client-connections check

monitorSkipMaxClient

For monitor-probe connections, ignore any maximum-client-connections limits that havebeen specified for the services being monitored. Possible values: ENABLED and DISABLED.Default: DISABLED.

Page 334: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To set the Skip MaxClients for Monitor Connectionsoption by using the configuration utility

1. In the navigation pane, click Load Balancing.

2. Under Settings, click Configure Load Balancing Parameters.

3. To ignore the upper limit on client connections for monitor probes, in the ConfigureLoad Balancing Parameters dialog box, select the Skip MaxClients for MonitorConnections checkbox.

4. Click OK.

Ignoring the Upper Limit on Client Connections for Monitor Probes

334

Page 335: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

335

Configuring Support for Third-Party LoadBalancers by Using SASP

A NetScaler appliance configured for Server/Application State Protocol (SASP) can work inconjunction with other load-balancing products. SASP accommodates load balancing basedon the weights of the services. When SASP is implemented, a work load manager (WLM)agent runs on each server and relays performance data to the enterprise work load manager(EWLM). The EWLM uses this data to dynamically calculate the weight of each server, andthen pushes the dynamically calculated weights to the appliance.

Note: SASP is not supported on NetScaler nCore builds.

The prerequisites for dynamic weight calculation are:

• The EWLM is configured as an entity within the appliance.

• A connection is established between the EWLM and the virtual server.

• The services bound to the virtual server are registered in the EWLM.

The following diagram shows how SASP facilitates load balancing decisions by using theWLM.

Figure 1. How SASP Load Balancing Works

Page 336: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The appliance and the EWLM communicate through a set of SASP messages. When theappliance is connected to the EWLM, a setlbstate message is sent to the EWLM to indicatethat the connection is established. After the connection is established, the appliance sendsa registration message to the EWLM to indicate that all services are registered with theEWLM. The EWLM responds with a registration success or failure message.

A connection is established only when a virtual server is bound to the WLM in the appliance.After all services are registered, the EWLM starts sending weight data to the applianceusing the sendweight message. The WLM that is connected to each of the services sends theweight messages to the EWLM, as shown in the diagram above. The weight is calculated forthe registered services only.

The appliance waits for the designated wait time (by default, two minutes) to receive theweight message from the EWLM. If the appliance receives the weight message within twominutes, the weight is dynamically calculated from the incoming weight message. If not,the appliance instead uses the user configured weights for making load balancing decisions.

If a service is disabled in the appliance, a setmemberstate message is sent to the EWLMconveying that the disabled service should not be considered for load balancing. Theappliance sends a deregistration message to the EWLM to deregister or remove the disabledservice. The EWLM responds with a deregistration success or failure message.

The following example shows the steps required to bind the services Service-HTTP-1 andService-HTTP-2 to the virtual server Vserver-LB-1. Vserver-LB-1 forwards the client requestto either of the two services Service-HTTP-1 or Service-HTTP-2. The appliance selects theservice for each request using the least connection load balancing method. A workloadmanager Wlm-1 is created and bound to Vserver-LB-1.

The following diagram shows the load balancing entities and the values of the parameters.

Configuring Support for Third-Party Load Balancers by Using SASP

336

Page 337: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 2. WLM Entity Model

Configuring Support for Third-Party Load Balancers by Using SASP

337

Page 338: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

338

Creating a Work Load Manager

You can create a work load manager to dynamically calculate the load on each service. TheNetScaler uses the load data to select services for load balancing.

To create a work load manager by using the NetScalercommand line

At the NetScaler command prompt, type:

add lb wlm <WLMName> <IPAddress> -LBUID <LBUniqueIdentifier>

Example

add lb wlm wlm-1 10.102.29.30 -LBUID 11

Parameters for configuring a work load managerWLMName

Name of the work load manager. This alphanumeric string is required and cannot bechanged after the work load manager is created. The name must not exceed 31characters, and the leading character must be a number or letter. The followingcharacters are also allowed: @ _ - . (period) : (colon) # and space ( ).

IPAddress

IP address of the work load manager.

LBUID

Unique identifier for the NetScaler to communicate to the work load manager.

port

Port of the work load manager. The port number must be a positive number and must notexceed 65535.

Page 339: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To create a work load manager by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Work Load Managers.

2. On the Work Load Managers pane, click Add.

3. In the Create Work Load Manager dialog box, in the Name, IP Address, LB UniqueIdentifier, Port, and Keep Alive Time-out (minutes) text boxes, type the correspondingvalues (for example, Wlm-1, 10.102.29.30, 11, 80, and 2).

4. Click Create, and then click Close. The work load manager you created appears in theWork Load Managers pane.

Creating a Work Load Manager

339

Page 340: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

340

Binding a Virtual Server to the Work LoadManager

The work load manager assigns a weight to the service on which it runs. The appliancerequires a connection to balance the load on the services. When you bind a virtual server toa work load manager (WLM), the connection is established and the appliance uses thevirtual server to balance the services.

To bind a virtual server to a work load manager byusing the NetScaler command line

At the NetScaler command prompt, type:

bind lb wlm <WLMName> <vServerName>

Example

bind lb wlm wlm-1 Vserver-LB-1

To bind a virtual server to a work load manager byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Work Load Managers.

2. In the details pane, select the work load manager for which you want to bind thevirtual server (for example, Wlm-1), and then click Open.

3. In the Configure Work Load Manager dialog box, under Virtual Servers, in the Availablelist box, select the virtual server that you want to bind to the work load manager (forexample, Vserver-LB-1).

4. Click Add, and then click OK.

Page 341: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

341

Managing the Work Load Manager

Managing the work load manager allows the NetScaler appliance to use the manuallyconfigured weights on the services. You can perform tasks such as removing or unbindingthe work load manager from the virtual server.

Page 342: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

342

Modifying the Work Load Manager

The NetScaler appliance periodically probes the work load manger. You can modify the timeinterval that the appliance uses to probe the WLM.

To modify a work load manager by using theNetScaler command line

At the NetScaler command prompt, type:

set lb wlm <WLMName> -KATimeout <TimeoutValue>

Example

set lb wlm wlm-1 -KATimeout 20

Parameter for modifying a work load managerKATimeout

The idle time period after which the NetScaler probes the work load manager. The valueranges from 2 to 1440 minutes. The default value is 2 minutes and the maximum value is1440 minutes.

To modify a work load manager by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Work Load Managers.

2. In the details pane, select the workload manager that you want to modify (for example,Wlm-1), and then click Open.

3. In the Configure Work Load Manager dialog box, in the Keep Alive Time-out (minutes)text box, type the timeout value (for example, 20).

4. Click OK.

Page 343: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

343

Removing a Work Load Manager

You can remove a work load manager when you no longer need for the NetScaler applianceto dynamically calculate load on the service. When the work load manager is removed, theappliance uses the manually configured weights of the service to balance the load.

To remove a work load manager by using theNetScaler command line

At the NetScaler command prompt, type:

rm lb wlm <WLMName>

Example

rm lb wlm wlm-1

To remove a work load manager by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Work Load Managers.

2. In the details pane, select the workload manager that you want to remove (forexample, Wlm-1), and then click Remove.

3. In the Remove dialog box, click Yes.

Page 344: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

344

Unbinding a Work Load Manager

When you unbind a work load manager from a virtual server, the virtual server reverts tousing the manually configured weights on its services to select the service for each request.

To unbind a virtual server from a work load managerby using the NetScaler command line

At the NetScaler command prompt, type:

unbind lb wlm <WLMName> <vServerName>

Example

unbind lb wlm wlm-1 vserver-LB-1

To unbind a virtual server from a work load managerby using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Work Load Managers.

2. In the details pane, select the workload manager for which you want to unbind a virtualserver (for example, Wlm-1), and then click Open.

3. In the Configure Work Load Manager dialog box, under Virtual Servers, in the Configuredbox, select the virtual server that you want to unbind from the work load manager (forexample, Vserver-LB-1).

4. Click Remove, and then click OK.

Page 345: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

345

Viewing a Work Load Manager

You can view the name, IP address, state, port, load balancing unique identifier, andkeep-alive timeout for the configured work load managers. Viewing the details of theconfiguration is useful to check your setup.

To view work load managers by using the NetScalercommand line

At the NetScaler command prompt, type:

show lb wlm <WLMName>

Example

show lb wlm wlm-1

To view work load managers by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Work Load Managers.

2. In the details pane, view the details of the available work load managers.

Page 346: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

346

Managing a Large Scale Deployment

The NetScaler appliance contains several features that are helpful when you are configuringa large load balancing deployment. Instead of configuring virtual servers and servicesindividually, you can create groups of virtual servers and services. You can also create arange of virtual servers and services, and you can translate or mask virtual server andservice IP addresses.

You can set persistence for a group of virtual servers. You can bind monitors to a group ofservices. Creating a range of virtual servers and services of identical type allows you to setup and configure those servers in a single procedure, which significantly shortens the timerequired to configure those virtual servers and services.

By translating or masking IP addresses, you can take down virtual servers and services, andmake changes to your infrastructure, without extensive reconfiguration of your service andvirtual server definitions.

Page 347: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

347

Ranges of Virtual Servers and Services

When you configure load balancing, you can create ranges of virtual servers and services,eliminating the need to configure virtual servers and services individually. For example, youcan use a single procedure to create three virtual servers with three corresponding IPaddresses. When more than one argument uses a range, all of the ranges must be of thesame size.

The following are the types of ranges you can specify when adding services and virtualservers to your configuration:

• Numeric ranges. Instead of typing a single number, you can specify a range ofconsecutive numbers.

For example, you can create a range of virtual servers by specifying a starting IPaddress, such as 10.102.29.30, and then typing a value for the last byte that indicatesthe range, such as 34. In this example, five virtual servers will be created with IPaddresses that range between 10.102.29.30 and 10.102.29.34.

Note: The IP addresses of the virtual servers and services must be consecutive.

• Alphabetic ranges. Instead of typing a literal letter, you can substitute a range for anysingle letter, for example, [C-G]. This results in all letters in the range being included,in this case C, D, E, F, and G.

For example, if you have three virtual servers named Vserver-x, Vserver-y, andVserver-z, instead of configuring them separately, you can type vserver [x-z] toconfigure them all.

Page 348: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

348

Creating a Range of Virtual Servers

You create a range of virtual servers as described below.

To create range of virtual servers by using thecommand line interface

At the command prompt, type one of the following commands:

• add lb vserver <name>@ <protocol> -range <rangeValue> <IPAddress> [<port>]

• add lb vserver <name>@[<rangeValue>]> <protocol> <IPAddress[<rangeValue>]> [<port>]

Example

add lb vserver Vserver-LB-2 http -range 6 10.102.29.30 80

OR

> add lb vserver vserver[P-R] http 10.102.29.[26-28] 80vserver "vserverP" addedvserver "vserverQ" addedvserver "vserverR" added Done

Parameters for configuring virtual server rangesvServerName

Name of the first virtual server in the range. If you use the second form of thiscommand, you bracket the portion of the vServerName that contains the range.

Note: This command returns an error if the vServerName and IPAddress ranges thatyou define differ in number of entities.

protocol

The protocol of the virtual server.

rangeValue

The number of entities in the range that you are creating.

Note: Do not use -range and the [ ] range operator in the same command.

IPAddress

Page 349: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The IP address at the beginning of the range that you are defining. If you use the secondform of this command, you bracket the portion of the IP address that contains the range.

port

The port of the virtual servers.

To create range of virtual servers by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, click Add Range.

3. In the Create Virtual Server (Load Balancing) - Range dialog box, in the Name Prefix, IPAddress Range, and Port text boxes, type the virtual server name, IP address with whichto begin the range, and port.

4. Select the Network VServer check box, and in Range, type the last value of the virtualserver range.

5. In the Protocol drop-down list box, select the protocol type.

6. Click Create, and then click Close. The range of virtual servers you created appears inthe Load Balancing Virtual Servers pane.

Creating a Range of Virtual Servers

349

Page 350: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

350

Creating a Range of Services

You create a range of services as described below. If you specify a range for the servicename, specify a range for the IP address too.

To create range of services by using the commandline interface

At the command prompt, type the command:

add service <name>@ <IP>@ <protocol> <port>

Example

> add service serv[1-3] 10.102.29.[102-104] http 80service "serv1" addedservice "serv2" addedservice "serv3" added Done

Parameters for configuring service rangesserviceName

Name of the first service in the range. If you use the second form of this command, youbracket the portion of the serviceName that contains the range.

Note: This command returns an error if the serviceName and IPAddress ranges that youdefine differ in number of entities.

protocol

The protocol of the service.

rangeValue

The number of entities in the range that you are creating.

Note: Do not use -range and the [ ] range operator in the same command.

IPAddress

The IP address at the beginning of the range that you are defining. If you use the secondform of this command, you bracket the portion of the IP address that contains the range.

Page 351: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

port

The port of the services.

To create range of services by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, click Add Range.

3. In the Create Service (Range) dialog box, in the IP Address Range and Port text boxes,type the start value of the IP address range and the port.

4. In the text box next to the IP Address Range text box, type the last value of the lastservice (for example, 104).

5. In the Protocol drop-down list box, select the protocol type.

6. Click Create, and then click Close. The range of services you created appears in theServices pane.

Creating a Range of Services

351

Page 352: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

352

Configuring Service Groups

Configuring a service group enables you to manage a group of services as easily as a singleservice. For example, if you enable or disable any option, such as compression, healthmonitoring or graceful shutdown, for a service group, the option gets enabled for all themembers of the service group.

After creating a service group, you can bind it to a virtual server, and you can add servicesto the group. You can also bind monitors to service groups.

The members of a service group can be identified by IP address or server name.

Using domain-name based service (DBS) group members is advantageous because you neednot reconfigure the member on the NetScaler appliance if the IP address of the memberchanges. The appliance automatically senses such changes through the configured nameserver. This feature is particularly useful in cloud scenarios, where the service provider canchange a physical server or change the IP address for a service. If you specify a DBS groupmember, the NetScaler learns the IP address dynamically.

You can bind both IP-based and DBS members to the same service group.

Note: If you use DBS service group members, make sure that either a name server isspecified or a DNS server is configured on the NetScaler. A domain name will be resolvedinto an IP address only if the corresponding address record is present on the NetScaler orthe name server.

Page 353: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

353

Creating Service Groups

You can configure up to 4096 service groups on the NetScaler appliance.

To create a service group by using the command lineAt the command prompt, type:

add servicegroup <ServiceGroupName> <Protocol>

Example

add servicegroup Service-Group-1 HTTP

Parameters for creating service groupsserviceGroupName

Name of the service group. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( ).

Protocol

Type of service in this group. The valid options are: HTTP, FTP, TCP, UDP, SSL,SSL_BRIDGE, SSL_TCP, NNTP, RPCSVR, DNS, ADNS, SNMP, RTSP, DHCPRA, ANY, SIP_UDP,DNS_TCP, ADNS_TCP, RADIUS, MYSQL, MSSQL, RDP.

To create a service group by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the details pane, click Add.

3. In the Create Service Group dialog box, in the Service Group Name text box, type nameof the service group.

4. In the Protocol list, select the protocol type.

5. Click Create, and then click Close. The service group you created appears in the ServiceGroups pane.

Page 354: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

354

Binding a Service Group to a VirtualServer

When you bind a service group to a virtual server, the member services are bound to thevirtual server.

To bind a service group to a virtual server by usingthe command line interface

At the command prompt, type:

bind lb vserver <name>@ <serviceGroupName>

Example

bind lb vserver Vserver-LB-1 Service-Group-1

To bind a service group to a virtual server by usingthe configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server to which you want to bind the servicegroup, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Services Groupstab.

4. In the Active column, select check box next to the service group that you want to bindto the virtual server (for example, Service-Group-1), and then click OK.

Page 355: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

355

Binding a Member to a Service Group

Adding services to a service group enables the service group to manage the servers. You canadd the servers to a service group by specifying the IP addresses or the names of theservers.

To add members to a service group by using thecommand line interface

To configure a service group, at the command prompt, type:

bind servicegroup <serviceGroupName> (<IP>@ | <serverName>) <port>

Examples

bind servicegroup Service-Group-1 10.102.29.30 80

bind servicegroup Service-Group-2 1000:0000:0000:0000:0005:0600:700a:888b 80

bind servicegroup CitrixEdu s1.citrite.net

Page 356: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To add members to a service group by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the details pane, select the service group to which you want to bind members, andthen click Open.

3. In the Configure Service Group dialog box, under Specify Member(s), do one of thefollowing:

• To add a new IP based service group member, select IP Based.

• To add a server-name based service group member, select Server Based.If you want to add a domain-name based service group member, select Server Based.With this option, you can add any server that has been assigned a name, regardless ofwhether the name is an IP address or a user-assigned name.

4. If adding a new IP based member, in the IP Address text box, type the IP address. If theIP address uses IPv6 format, select the IPv6 check box and then enter the address in theIP Address text box.

Note: You can add a range of IP addresses. The IP addresses in the range must beconsecutive. Specify the range by entering the starting IP address in the IP Addresstext box (for example, 10.102.29.30). Specify the end byte of the IP address range inthe text box under Range (for example, 35). In the Port text box type the port (forexample, 80), and then click Add.

5. Click OK.

Binding a Member to a Service Group

356

Page 357: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

357

Binding a Monitor to a Service Group

When you create a service group, the default monitor of the type appropriate for the groupis automatically bound to it. Monitors periodically probe the servers in the service group towhich they are bound and update the state of the service groups.

You can bind a different monitor of your own choice to the service group.

To bind a monitor to a service group by using thecommand line interface

At the command prompt, type:

bind lb monitor <monitorName> <ServiceGroupName>

Example

bind lb monitor monitor-HTTP-1 Service-Group-1

To a bind monitor to a service group by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the details pane, select the service group for which you want to bind monitors, andthen click Open.

3. On the Monitors tab, under Available, select a monitor name.

4. Click Add, and then click OK.

Page 358: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

358

Managing Service Groups

You can change the settings of the services in a service group, and you can perform taskssuch as enabling, disabling, and removing service groups. You can also unbind membersfrom a service group.

Page 359: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

359

Modifying a Service Group

You can modify attributes of service group members. You can set several attributes of theservice group, such as maximum client, SureConnect, and compression. The attributes areset on the individual servers in the service group. You cannot set parameters on the servicegroup such as transport information (IP address and port), weight, and server ID.

Note: A parameter you set for a service group is applied to the member servers in thegroup, not to individual services.

To modify a service group by using the command lineinterface

At the command prompt, type the following command with one or more of the optionalparameters:

set servicegroup <serviceGroupName> [-type <type>] [-maxClient <maxClient>] [-maxReq<maxReq>] [-cacheable (YES|NO)] [-cip (ENABLED|DISABLED)] [-cipHeader <cipHeader>][-usip (YES|NO)] [-sc (ON|OFF)] [-sp (ON|OFF)] [-cltTimeout <cltTimeout>] [-svrTimeout<svrTimeout>] [-cka (YES|NO)] [-TCPB (YES|NO)] [-CMP (YES|NO)] [-maxBandwidth<maxBandwidth>] [-maxThreshold <maxThreshold>] [-state (ENABLED|DISABLED)][-downStateFlush (ENABLED|DISABLED)

Example

set servicegroup Service-Group-1 -type TRANSPARENT

set servicegroup Service-Group-1 -maxClient 4096

set servicegroup Service-Group-1 -maxReq 16384

set servicegroup Service-Group-1 -cacheable YES

Parameters for modifying service groupstype

Cache server supports the cache type option. Possible values: TRANSPARENT, REVERSE,and FORWARD.

maxClient

Maximum number of open connections to each service in the service group. The defaultvalue is 0. The maximum value is 4294967294.

Page 360: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

maxReq

Maximum number of requests that can be sent over a persistent connection to a servicein the service group. The default value is 0. The minimum value is 0. The maximum valueis 65535.

cacheable

Whether a virtual server used for load balancing or content switching feature routes arequest to the virtual server (used in transparent cache redirection) on the sameappliance before sending it to the configured servers. The virtual server used fortransparent cache redirection determines if the request is directed to the cache serversor the configured servers. Do not specify this argument if a cache type is specified. Bydefault, this argument is disabled. Possible values: YES and NO. Default: NO.

cip

Enables or disables insertion of the Client IP header for services in the service group.Possible values: ENABLED and DISABLED. Default: DISABLED.

cipHeader

Client IP header. If client IP insertion is enabled and the client IP header is not specified,then the NetScaler sets the value of the Client IP header.

usip

Use of the client IP address as the source IP address while connecting to the server. Bydefault, the appliance uses a mapped IP address for its server connection. However, withthis option, you can tell the appliance to use the client's IP address when itcommunicates with the server. Possible values: yes and no. Default: no.

sc

The state of SureConnect on this service group. This parameter is supported for legacypurposes only; it has no effect, and the only valid value is OFF. Possible values: ON andOFF. Default: OFF.

sp

Whether surge protection needs to be enabled on this service group. Possible values: ONand OFF. Default: OFF

cltTimeout

Idle time in seconds after which the client connection is terminated. Default: 180.Maximum value: 31536000.

svrTimeout

Idle time in seconds after which the server connection is terminated. The default value is360. The maximum value is 31536000.

CKA

Modifying a Service Group

360

Page 361: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

State of the client keep-alive feature for the services in the service group. Possiblevalues: YES and NO. Default: NO.

TCPB

State of the TCP Buffering feature for the services in the service group. Possible values:YES and NO. Default: NO.

CMP

State of the HTTP Compression feature for the services in the service group. Possiblevalues: YES and NO. Default: NO.

maxBandwidth

Positive integer that identifies the maximum bandwidth in kilobits allowed for theservices in the service group.

maxThreshold

Monitoring threshold. The default value is 0. The minimum value is 0 and maximum valueis 65535.

state

State of the service group after it is added. Possible values: ENABLED and DISABLED.Default: ENABLED.

DownStateFlush

Delayed cleanup of connections on this service group. Possible values: ENABLED andDISABLED. Default: ENABLED.

Note: Any parameter you set on the service group is applied to the member servers in thegroup, not to individual services.

To modify a service group by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the details pane, select the service group that you want to modify (for example,Service-Group-1), and then click Open.

3. Change any of the parameters described in "Parameters for modifying service groups,"and then click OK.

Modifying a Service Group

361

Page 362: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

362

Removing a Service Group

When you remove a service group, the servers bound to the group retain their individualsettings and continue to exist on the NetScaler.

To remove a service group by using the command lineinterface

At the command prompt, type:

rm servicegroup <ServiceGroupName>

Example

rm servicegroup Service-Group-1

To remove a service group by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the details pane, select the service group that you want to remove (for example,Service-Group-1), and then click Remove.

3. In the Remove dialog box, click Yes.

Page 363: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

363

Unbinding a Member from a ServiceGroup

When you unbind a member from the service group, the attributes set on the service groupwill no longer apply to the member that you unbound. The member services retains itsindividual settings, however, and continues to exist on the NetScaler.

To unbind members from a service group by using thecommand line interface

At the command prompt, type:

unbind servicegroup <serviceGroupName> <IP>@ [<port>]

Example

unbind servicegroup Service-Group-1 10.102.29.30 80

To unbind members from a service group by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the details pane, select the service group from which you want to unbind members,and then click Open.

3. In the Configure Service Group dialog box, in the Configured Members list box, select aservice.

4. Click Remove, and then click OK.

Page 364: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

364

Unbinding a Service Group from a VirtualServer

When you unbind a service group from a virtual server, the member services are unboundfrom the virtual server and continue to exist on the NetScaler appliance.

To unbind a service group from a virtual server byusing the command line interface

At the command prompt, type:

unbind lb vserver <name>@ <ServiceGroupName>

Example

unbind lb vserver Vserver-LB-1 Service-Group-1

To unbind a service group from a virtual server byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server from which you want to unbind the servicegroup, and then click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, click the Services Grouptab.

4. Clear the Active check box next to the service group that you want to unbind from thevirtual server (for example, Service-Group-1).

5. Click OK.

Page 365: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

365

Unbinding Monitors from Service Groups

When you unbind a monitor from a service group, the monitor that you unbound no longermonitors the individual services that constitute the group.

To unbind a monitor from a service group using thecommand line interface

At the command prompt, type:

unbind lb monitor <monitorName> <ServiceGroupName>

Example

unbind lb monitor monitor-HTTP-1 Service-Group-1

To unbind a monitor from a service group by usingthe configuration utility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the details pane, select the service group from which you want to unbind themonitor, click Open.

3. In the Configure Service Group dialog box, click the Monitors tab.

4. Under Configured, select the monitor that you want to unbind from the service group,and then click Remove.

5. Click OK.

Page 366: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

366

Enabling or Disabling a Service Group

When you enable a service group and the servers, the services belonging to the servicegroup are enabled. Similarly, when a service belonging to a service group is enabled, theservice group and the service are enabled. By default, service groups are enabled.

After disabling an enabled service, you can view the service using the configuration utilityor the command line to see the amount of time that remains before the service goes DOWN.

To disable a service group by using the command lineinterface

At the command prompt, type:

disable servicegroup <ServiceGroupName>

Example

disable servicegroup Service-Group-1

To disable a service group by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the Service Groups pane, select the service group that you want to disable, and thenclick Disable.

3. In the Wait Time dialog box type the wait time value.

4. Click Enter.

To enable a service group by using the command lineinterface

At the command prompt, type:

enable servicegroup <ServiceGroupName>

Example

Page 367: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

enable servicegroup Service-Group-1

To enable a service group by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the Service Groups pane, select the service group that you want to enable (forexample, Service-Group-1), and then click Enable.

3. In the Enable dialog box, click Yes.

Enabling or Disabling a Service Group

367

Page 368: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

368

Viewing the Properties of a Service Group

You can view the following settings of the configured service groups: name, IP address,state, protocol, maximum client connections, maximum requests per connection, maximumbandwidth, and monitor threshold. Viewing the details of the configuration can be helpfulfor troubleshooting your configuration.

To view the properties of a service group by using thecommand line interface

At the command prompt, type one of the following commands to display the groupproperties or the properties and the group members:

• show servicegroup <ServiceGroupName>

• show servicegroup <ServiceGroupName> -includemembers

Example

show servicegroup Service-Group-1

To view the properties of a service group by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the details pane, click the name of the service group whose properties you want toview, and then click Open.

Page 369: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

369

Viewing Service Group Statistics

You can view service-group statistical data, such as rate of requests, responses, requestbytes, and response bytes. The NetScaler appliance uses the statistics of a service group,such as these, to balance the load on the services.

To view the statistics of a service group by using thecommand line interface

At the command prompt, type:

stat servicegroup <ServiceGroupName>

Example

stat servicegroup Service-Group-1

To view the statistics of a service group by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. In the details pane, select the service group for which statistics you want to view (forexample, Service-Group-1), and then click Statistics. The statistics of the service groupyou selected appear in a new window.

Page 370: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

370

Load Balancing Virtual Servers Bound toa Service Group

In large-scale deployments, the same service group can be bound to multiple load balancingvirtual servers. In such a case, instead of viewing each virtual server to see the servicegroup it is bound to, you can view a list of all the load balancing virtual servers bound to aservice group. You can view the following details of each virtual server:

• Name

• State

• IP address

• Port

To display the virtual servers bound to a servicegroup by using the command line interface

At the command prompt, type the following command to display the virtual servers boundto a service group:

show servicegroupbindings <serviceGroupName>

Example

> show servicegroupbindings SVCGRPDTLSSVCGRPDTLS - State :ENABLED1) Test-pers (10.10.10.3:80) - State : DOWN2) BRVSERV (10.10.1.1:80) - State : DOWN3) OneMore (10.102.29.136:80) - State : DOWN4) LBVIP1 (10.102.29.66:80) - State : UPDone>

ParametersserviceGroupName

Indicates the name of the service group whose bindings you want to view.

Page 371: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To display the virtual servers bound to a servicegroup by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Service Groups.

2. Select a service group, and then click Show Bindings. The Binding details for ServiceGroup box then displays all the load balancing virtual servers bound to the selectedservice group.

Load Balancing Virtual Servers Bound to a Service Group

371

Page 372: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

372

Translating the IP Address of aDomain-Based Server

To simplify maintenance on the NetScaler appliance and on the domain-based servers thatare connected to it, you can configure IP address masks and translation IP addresses. Thesefunctions work together to parse incoming DNS packets and substitute a new IP address fora DNS-resolved IP address.

When configured for a domain-based server, IP address translation enables the appliance tolocate an alternate server IP address in the event that you take the server down formaintenance or if you make any other infrastructure changes that affect the server.

When configuring the mask, you must use standard IP mask values (a power of two, minusone) and zeros, for example, 255.255.0.0. Non-zero values are only permitted in thestarting octets.

When you configure a translation IP for a server, you create a 1:1 correspondence betweena server IP address and an alternate server that shares leading or trailing octets in its IPaddress. The mask blocks particular octets in the original server's IP address. TheDNS-resolved IP address is transformed to a new IP address by applying the translation IPaddress and the translation mask.

For example, you can configure a translation IP address of 10.20.0.0 and a translation maskof 255.255.0.0. If a DNS-resolved IP address for a server is 40.50.27.3, this address istransformed to 10.20.27.3. In this case, the translation IP address supplies the first twooctets of the new address, and the mask passes through the last two octets from theoriginal IP address. The reference to the original IP address, as resolved by DNS, is lost.Monitors for all services to which the server is bound also report on the transformed IPaddress.

When configuring a translation IP address for a domain-based server, you specify a maskand an IP address to which the DNS-resolved IP address is to be translated.

Note: Translation of the IP address is only possible for domain-based servers. You cannotuse this feature for IP-based servers. The address pattern can be based on IPv4 addressesonly.

To configure a translation IP address for a server byusing the command line interface

At the command prompt, type:

add server <name>@ <serverDomainName> -translationIp <translationIPAddress>-translationMask <netMask> -state <ENABLED|DISABLED>

Example

Page 373: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

add server myMaskedServer www.example.com -translationIp 10.10.10.10 -translationMask 255.255.0.0 -state ENABLED

Parameters for configuring translation IP addressesserverName

Name of the domain-based server.

serverDomainName

Server's domain name (for example, www.example.com).

Note that for IP address translation, the domain name is required.

translationIP

IP address (relevant octets only) to which the resolved ip for the server needs to betranslated (for example, 11.12.0.0).

translationMask

Mask determines the number of bits in the translation IP address that are to beconsidered when applying the transformation.

For example, if you want an original server IP of 10.20.30.40 to be translated to11.12.30.40, you could specify the mask 255.255.0.0.

To configure a translation IP address for a server byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Servers.

2. In the details pane, click Add.

3. In the Create Server dialog box, in the Server Name field, enter a name.

4. In the IP Address / Domain Name field, enter the server's domain name.

Note: Do not enter an IP address if you are entering a mask.

5. In the Translation IP Address field, enter the IP address of a server on the same subnet.

6. In the Translation Mask field, enter a valid mask (for example, 255.255.0.0).

7. Click Create.

Translating the IP Address of a Domain-Based Server

373

Page 374: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

374

Masking a Virtual Server IP Address

You can configure a mask and a pattern instead of a fixed IP address for a virtual server.This enables traffic that is directed to any of the IP addresses that match the mask andpattern to be rerouted to a particular virtual server. For example, you can configure a maskthat allows the first three octets of an IP address to be variable, so that traffic to111.11.11.198, 22.22.22.198, and 33.33.33.198 is all sent to the same virtual server.

By configuring a mask for a virtual server IP address, you can avoid reconfiguration of yourvirtual servers due to a change in routing or another infrastructure change. The mask allowsthe traffic to continue to flow without extensive reconfiguration of your virtual servers.

The mask for a virtual server IP address works somewhat differently from the IP patterndefinition for a server described in Translating the IP Address of a Domain-Based Server. Fora virtual server IP address mask, a non-zero mask is interpreted as an octet that isconsidered. For a service, the non-zero value is blocked.

Additionally, for a virtual server IP address mask, either leading or trailing values can beconsidered. If the virtual server IP address mask considers values from the left of the IPaddress, this is known as a forward mask. If the mask considers the values to the right sideof the address, this is known as a reverse mask.

Note: The NetScaler appliance evaluates all forward mask virtual servers beforeevaluating reverse mask virtual servers.

When masking a virtual server IP address, you also need to create an IP address pattern formatching incoming traffic with the correct virtual server. When the appliance receives anincoming IP packet, it matches the destination IP address in the packet with the bits thatare considered in the IP address pattern, and after it finds a match, it applies the IPaddress mask to construct the final destination IP address.

Consider the following example:

• Destination IP address in the incoming packet: 10.102.27.189

• IP address pattern: 10.102.0.0

• IP mask: 255.255.0.0

• Constructed (final) destination IP address: 10.102.27.189.

In this case, the first 16 bits in the original destination IP address match the IP addresspattern for this virtual server, so this incoming packet is routed to this virtual server.

If a destination IP address matches the IP patterns for more than one virtual server, thelongest match takes precedence. Consider the following example:

• Virtual Server 1: IP pattern 10.10.0.0, IP mask 255.255.0.0

• Virtual Server 2: IP pattern 10.10.10.0, IP mask 255.255.255.0

• Destination IP address in the packet: 10.10.10.45.

Page 375: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Selected virtual server: Virtual Server 2.

The pattern associated with Virtual Server 2 matches more bits than that associated withVirtual Server 1, so IPs that match it will be sent to Virtual Server 2.

Note: Ports are also considered if a tie-breaker is required.

To configure a virtual server IP address mask byusing the command line interface

At the command prompt, type:

add lb vserver <name>@ http -ipPattern <ipAddressPattern> -ipMask <ipMask> <listenPort>

Example

Pattern matching based on prefix octets:

add lb vserver myLBVserver http -ippattern 10.102.0.0 -ipmask 255.255.0.0 80

Pattern matching based on trailing octets:

add lb vserver myLBVserver1 http -ippattern 0.0.22.74 -ipmask 0.0.255.255 80

Modify a pattern-based virtual server:

set lb vserver myLBVserver1 -ippattern 0.0.22.74 -ipmask 0.0.255.255

Parameters for masking virtual server IP addressesname

Name of the load balancing virtual server.

http

Value of HTTP

port

Listen port for the virtual server.

Pattern Based

(Configuration utility only.) Option to select if the virtual server is to be pattern-based.

ippattern

Masking a Virtual Server IP Address

375

Page 376: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

IP address pattern for the virtual server. You must supply either the initial or the trailingoctets (for example, 11.11.00.00).

ipmask

Network mask for the IP address. Non-zero values indicate the IP address octets that areto be passed through. (For example, for an IP address pattern of 11.11.00.00, you mightspecify a mask of 255.255.0.0).

Note: You cannot convert a virtual server with a fixed IP address to a pattern-basedvirtual server, and you cannot convert a pattern-based virtual server to one with a fixedIP address.

To configure a virtual server IP address mask byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, click Add.

3. In the Create Virtual Server dialog box, in the Name field, enter a name.

4. In the Protocol field, select the protocol.

5. In the Port field, enter the listen port.

6. In the IP Pattern field, enter a pattern for an IP address. The fixed part of the patternmust be entered in contiguous octets. Enter zeros for the pattern values that can varyin the IP address.

7. In the IP Mask field, enter a standard network mask. Use non-zero mask values for theportion of the IP address that constitutes the fixed part of the pattern.

Masking a Virtual Server IP Address

376

Page 377: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

377

Configuring Load Balancing forCommonly Used Protocols

In addition to Web sites and Web-based applications, other types of network-deployedapplications that use other common protocols often receive large amounts of traffic andtherefore benefit from load balancing. Several of these protocols require specificconfigurations for load balancing to work properly. Among them are FTP, DNS, SIP, andRTSP.

If you configure your NetScaler appliance to use domain names for your servers rather thanIPs, you may also need to set up IP translation and masking for those servers.

Page 378: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

378

Load Balancing for a Group of FTPServers

The NetScaler appliance can be used to load balance FTP servers. FTP requires that theuser initiate two connections on two different ports to the same server: the controlconnection, through which the client sends commands to the server, and the dataconnection, through which the server sends data to the client. When the client initiates anFTP session by opening a control connection to the FTP server, the appliance uses theconfigured load balancing method to select an FTP service, and forwards the controlconnection to it. The load balanced FTP server then opens a data connection to the clientfor information exchange.

The following diagram describes the topology of a load balancing configuration for a groupof FTP servers.

Figure 1. Basic Load Balancing Topology for FTP Servers

In the diagram, the services Service-FTP-1, Service-FTP-2, and Service-FTP-3 are bound tothe virtual server Vserver-LB-1. Vserver-LB-1 forwards the client’s connection request toone of the services using the least connection load balancing method. Subsequent requestsare forwarded to the service that the appliance initially selected for load balancing.

The following table lists the names and values of the basic entities configured on theappliance.

Page 379: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Entity type Name IP address Port Protocol

Vserver Vserver-LB-1 10.102.29.25 21 FTP

Services Service-FTP-1 10.102.29.21 21 FTP

  Service-FTP-2 10.102.29.22 21 FTP

  Service-FTP-3 10.102.29.23 21 FTP

Monitors FTP None None NoneThe following diagram shows the load balancing entities, and the values of the parametersthat need to be configured on the appliance.

Figure 2. Load Balancing FTP Servers Entity Model

The appliance can also provide a passive FTP option to access FTP servers from outside of afirewall. When a client uses the passive FTP option and initiates a control connection to theFTP server, the FTP server also initiates a control connection to the client. It then initiatesa data connection to transfer a file through the firewall.

To create services and virtual servers of type FTP, see Setting Up Basic Load Balancing.Name the entities and set the parameters to the values described in the columns of theprevious table. When you configure a basic load balancing setup, a default monitor is boundto the services.

Next, bind the FTP monitor to the services by following the procedure described in thesection Binding Monitors to Services.

To create FTP monitors by using the command lineinterface

At the command prompt, type:

Load Balancing for a Group of FTP Servers

379

Page 380: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

add lb monitor <MonitorName> FTP -interval <Interval> -userName <UserName> -password<Password>

Example

add lb monitor monitor-FTP-1 FTP -interval 360 -userName User -password User

To create FTP monitors by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. In the details pane, click Add.

3. On the Standards Parameters tab, in the Name and Interval text boxes, type themonitor name and interval.

4. In the Type list, select FTP.

5. On the Special Parameters tab, in the User Name and Password text boxes, type User.

6. Click Create, and then click Close. The monitor that you created appears in theMonitors pane.

Load Balancing for a Group of FTP Servers

380

Page 381: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

381

Load Balancing DNS Servers

When you request DNS resolution of a domain name, the NetScaler appliance uses theconfigured load balancing method to select a DNS service. The DNS server to which theservice is bound then resolves the domain name and returns the IP address as the response.The appliance can also cache DNS responses and use the cached information to respond tofuture requests for resolution of the same domain name. Load balancing DNS serversimproves DNS response times.

The following diagram describes the topology of a load balancing configuration that loadbalances a group of DNS services.

Figure 1. Basic Load Balancing Topology for DNS Servers

In the diagram, the services Service-DNS-1, Service-DNS-2, and Service-DNS-3 are bound tothe virtual server Vserver-LB-1. The virtual server Vserver-LB-1 forwards client requests toa service using the least connection load balancing method. The following table lists thenames and values of the basic entities configured on the appliance.

Entity type Name IP address Port Protocol

Virtual Server Vserver-LB-1 10.102.29.13 53 DNS

Services Service-DNS-1 10.102.29.14 53 DNS

  Service-DNS-2 10.102.29.15 53 DNS

  Service-DNS-3 10.102.29.16 53 DNS

Page 382: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Monitors monitor-DNS-1 None None NoneThe following diagram shows the load balancing entities and the values of the parametersthat need to be configured on the appliance.

Figure 2. Load Balancing DNS Servers Entity Model

To configure a basic DNS load balancing setup, see Setting Up Basic Load Balancing. Followthe procedures to create services and virtual servers of type DNS, naming the entities andsetting the parameters using the values described in the previous table. When you configurea basic load balancing setup, the default ping monitor is bound to the services. Forinstructions on binding a DNS monitor to DNS services, you can also see Binding Monitors toServices.

The following procedure describes the steps to create a monitor that maps a domain nameto the IP address based on a query.

To configure DNS monitors by using the commandline interface

At the command prompt, type:

add lb monitor <monitorName> DNS -query <domainName> -queryType <Address|ZONE>-IPAddress <ipAddress>

Example

Load Balancing DNS Servers

382

Page 383: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

add lb monitor monitor-DNS-1 DNS -query www.citrix.com -queryType Address -IPAddress 10.102.29.66

add lb monitor monitor-DNS-2 DNS -query www.citrix2.com -queryType Address -IPAddress 1000:0000:0000:0000:0005:0600:700a::888b-888d

To configure DNS monitors by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. In the details pane, click Add.

3. In the Create Monitor dialog box, in the Name and Interval text boxes, type a monitorname and a monitoring interval.

4. Select the unit of time for the interval in the drop-down menu.

5. In the Type list, select DNS.

6. Click the Special Parameters tab, in the Query text box type the domain name query tosend to the DNS service (for example, www.mycompany.com), and in the Query Typelist box, select ADDRESS or ZONE.

7. In the text box below the Query Type list box, type an IP address that is to be checkedagainst the response to the DNS monitoring query (for example, 10.102.29.66), andclick Add.

Note: If you want to enter an IPv6 address, select the IPv6 check box before enteringthe address.

8. Click Create, and then click Close. The monitor that you created appears in theMonitors pane.

Load Balancing DNS Servers

383

Page 384: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

384

Load Balancing Domain-Name BasedServices

When you create a service for load balancing, you can provide an IP address. Alternatively,you can create a server using a domain name. The server name (domain name) can beresolved using an IPv4 or IPv6 name server, or by adding an authoritative DNS record (Arecord for IPv4 or AAAA record for IPv6) to the NetScaler configuration.

When you configure services with domain names instead of IPs, if you change the IP addressof a server in your load balancing setup, the name server resolves the domain name to thenew IP address. The monitor runs a health check on the new IP address, and updates theservice IP address only when the IP address is found to be healthy.

Note: When you change the IP address of a server, the corresponding service is markeddown for the first client request. The name server resolves the service IP address to thechanged IP address for the next request, and the service is marked UP.

Domain-name based services have the following restrictions:

• The maximum domain name length is 255 characters.

• The Maximum Client parameter is used to configure a service that represents thedomain name-based server. For example, a maxClient of 1000 is set for the servicesbound to a virtual server. When the connection count at the virtual server reaches2000, the DNS resolver changes the IP address of the services. However, because theconnection counter on the service is not reset, the virtual server cannot take any newconnections until all the old connections are closed.

• When the IP address of the service changes, persistence is difficult to maintain.

• If the domain name resolution fails due to a timeout, the appliance uses the oldinformation (IP address).

• When monitoring detects that a service is down, the appliance performs a DNSresolution on the service (representing the domain name-based server) to obtain a newIP address.

• Statistics are collected on a service and are not reset when the IP address changes.

• If a DNS resolution returns a code of “name error” (3), the appliance marks the servicedown and changes the IP address to zero.

When the appliance receives a request for a service, it selects the target service. This way,the appliance balances load on your services. The following diagram describes the topologyof a load balancing configuration that load balances a group of domain-name based servers(DBS).

Page 385: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 1. Basic Load Balancing Topology for DBS Servers

The services Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 are bound to the virtualserver Vserver-LB-1. The vserver Vserver-LB-1 uses the least connection load balancingmethod to choose the service. The IP address of the service is resolved using the nameserver Vserver-LB-2.

The following table lists the names and values of the basic entities configured on theappliance.

Entity type Name IP address Port Protocol

Virtual Server Vserver-LB-1 10.102.29.17 80 HTTP

  Vserver-LB-2 10.102.29.20 53 DNS

Servers server-1 10.102.29.18 80 HTTP

  server-2 www.citrix.com 80 HTTP

Services Service-HTTP-1 server-1 80 HTTP

  Service-HTTP-2 server-2 80 HTTP

  Service-HTTP-2 10.102.29.19 80 HTTP

Monitors Default None None None

Name Server None 10.102.29.19 None NoneThe following diagram shows the load balancing entities and the values of the parametersthat need to be configured on the appliance.

Load Balancing Domain-Name Based Services

385

Page 386: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 2. Load Balancing DBS Servers Entity Model

To configure a basic load balancing setup, see Setting Up Basic Load Balancing. Create theservices and virtual servers of type HTTP, and name the entities and set the parametersusing the values described in the previous table.

You can add, remove, enable, and disable external name servers. You can create a nameserver by specifying its IP address, or you can configure an existing virtual server as thename server.

To add a name server by using the command lineinterface

At the command prompt, type:

add dns nameServer <dnsVserverName>

Example

add dns nameServer Vserver-LB-2

Load Balancing Domain-Name Based Services

386

Page 387: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To add a name server by using the configurationutility

1. In the navigation pane, expand DNS, and then click Name Servers.

2. In the details pane, click Add.

3. In the Create Name Server dialog box, select DNS Virtual Server.

4. In the DNS Virtual Server drop-down list, select the server name.

Note: Click New if you want to create a new load balancing vserver. The CreateVirtual Server (Load Balancing) dialog box appears.

5. Click Create, and then click Close.

You can also add an authoritative name server that resolves the domain name to an IPaddress.

Load Balancing Domain-Name Based Services

387

Page 388: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

388

Load Balancing a Group of SIP Servers

The Session Initiation Protocol (SIP) is designed to initiate, manage, and terminatemultimedia communications sessions. It has emerged as the standard for Internet telephony(VoIP). SIP messages can be transmitted over TCP or UDP. SIP messages are of two types:request messages and response messages.

The traffic in a SIP based communication system is routed through dedicated devices andapplications (entities). In a multimedia communication session, these entities exchangemessages. The following figure shows a basic SIP based communication system:

Figure 1. SIP Based Communication System

A NetScaler ADC enables you to load balance SIP messages over UDP or over TCP (includingTLS). You can configure the NetScaler ADC to load balance SIP requests to a group of SIPproxy servers. To do so, you create a load balancing virtual server with the load balancingmethod and the type of persistence set to one of the following combinations:

• Call-ID hash load balancing method with no persistence setting

• Call-ID based persistence with least connection or round robin load balancing method

• Rule based persistence with least connection or round robin load balancing method

Also, by default, the NetScaler ADC appends RPORT to the via header of the SIP request, sothat the server sends the response back to the source IP address and port from which therequest originated.

Page 389: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Note: For load balancing to work, you must configure the SIP proxies so that they do notadd private IP addresses or private domains to the SIP header/payload. SIP proxies mustadd to the SIP header a domain name that resolves to the IP address of the SIP virtualserver. Also, the SIP proxies must communicate with a common database to shareregistration information.

Server Initiated Traffic

For SIP-server initiated outbound traffic, configure RNAT on the NetScaler ADC so thatthe private IP addresses used by the clients are translated into public IP addresses.

If you have configured SIP parameters that include the RNAT source or destination port,the appliance compares the values of the source and destination ports of the requestpackets with the RNAT source port and RNAT destination port. If one of the valuesmatches, the appliance updates the VIA header with RPORT. The SIP response from theclient then traverses the same path as the request.

For server-initiated SSL traffic, the NetScaler ADC uses a built-in certificate-key pair. Ifyou want to use a custom certificate-key pair, bind the custom certificate-key pair to theNetScaler internal service named nsrnatsip-127.0.0.1-5061.

Support for Policies and Expressions

The NetScaler default expressions language contains a number of expressions thatoperate on Session Initiation Protocol (SIP) connections. These expressions can be boundonly to SIP based (sip_udp, sip_tcp or sip_ssl) virtual servers, and to global bindpoints. You can use these expressions in content switching, rate limiting, responder, andrewrite policies.

For more information, see SIP Expressions.

Load Balancing a Group of SIP Servers

389

Page 390: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 2. SIP Load Balancing Topology

In the example, the services Service-SIP-1 and Service-SIP-2 are bound to the virtual serverVserver-LB-1. The following table lists the names and values of the entities that you need toconfigure on the appliance in inline mode (also called two-arm mode).

Entity type Name IP address Port Protocol

Virtual Server Vserver-LB-1 10.102.29.65 80 SIP-UDP

Services Service-SIP-1 192.168.1.6 80 SIP-UDP

  Service-SIP-2 192.168.1.5 80 SIP-UDP

Monitors Default None 80 SIP-UDPThe following diagram shows the load balancing entities and the values of the parametersto be configured on the appliance.

Figure 3. Load Balancing SIP Servers Entity Model

To configure a basic load balancing setup for SIP, see Setting Up Basic Load Balancing. Youcreate services and virtual servers of type SIP-UDP, naming the entities and setting theparameters as described in the previous table. You must then configure RNAT.

Configuring Load Balancing for SIP Signaling Trafficover TCP or UDP

The NetScaler ADC can load balance SIP servers that send requests over UDP or TCP,including TCP traffic secured by TLS. The ADC provides the following service types to loadbalance the SIP servers:

• SIP_UDP – Used when SIP servers send SIP messages over UDP.

• SIP_TCP – Used when SIP servers send SIP messages over TCP.

Load Balancing a Group of SIP Servers

390

Page 391: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• SIP_SSL – Used to secure SIP signaling traffic over TCP by using SSL or TLS. TheNetScaler ADC supports the following modes:

• End-to-end TLS connection between the client, the ADC, and the SIP server.

• TLS connection between the client and the ADC, and TCP connection between theADC and the SIP server.

• TCP connection between the client and the ADC, and TLS connection between theADC and the SIP server.

The following figure shows the topology of a setup configured to load balance a group of SIPservers sending SIP messages over TCP or UDP.

Figure 4. SIP Load Balancing Topology

Entity type Name IP address Port Service type /Protocol

Virtual Server Vserver-LB-1 10.102.29.65 80 SIP_UDP /SIP_TCP /SIP_SSL

Services Service-SIP-1 192.168.1.6 80 SIP_UDP /SIP_TCP /SIP_SSL

  Service-SIP-2 192.168.1.5 80 SIP_UDP /SIP_TCP /SIP_SSL

Load Balancing a Group of SIP Servers

391

Page 392: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Monitors Default None 80 SIP_UDP /SIP_TCP /SIP_SSL

Following is an overview of configuring basic load balancing for SIP traffic:

1. Configure services, and configure a virtual server for each type of SIP traffic that youwant to load balance:

• SIP_UDP – If you are load balancing the SIP traffic over UDP.

• SIP_TCP – If you are load balancing the SIP traffic over TCP.

• SIP_SSL – If you are load balancing and securing the SIP traffic over TCP.Note: If you use SIP_SSL, be sure to create an SSL certificate-key pair. For moreinformation, see Adding a Certificate Key Pair.

2. Bind the services to the virtual servers.

3. If you want to monitor the states of the services with a monitor other than the default(tcp-default), create a custom monitor and bind it to the services. The NetScaler ADCprovides two custom monitor types, SIP-UDP and SIP-TCP, for monitoring SIP services.

4. If using a SIP_SSL virtual server, bind an SSL certificate-key pair to the virtual server.

5. If you are using the NetSCaler ADC as the gateway for the SIP servers in yourdeployment, configure RNAT.

6. If you want to append RPORT to the SIP messages that are initiated from the SIP server,configure the SIP parameters.

Load Balancing a Group of SIP Servers

392

Page 393: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure a basic load balancing setup for SIPtraffic by using the command line interface

1. Create one or more services. At the command prompt, type:

add service <name> <serverName> (SIP_UDP | SIP_TCP | SIP_SSL) <port>

Example

add service Service-SIP-UDP-1 192.0.2.5 SIP_UDP 80

2. Create as many virtual servers as necessary to handle the services that you created.The virtual server type must match the type of services that you will bind to it. At thecommand prompt, type:

add lb vserver <name> <serverName> (SIP_UDP | SIP_TCP | SIP_SSL) <port>

Example

add lb vserver Vserver-LB-1 SIP_UDP 10.102.29.60 80

3. Bind each service to a virtual server. At the command prompt, type:

bind lb vserver <name> <serverName>

Example

bind lb vserver Vserver-LB-1 Service-SIP-UDP-1

4. (Optional) Create a custom monitor of type SIP-UDP or SIP-TCP, and bind the monitor tothe service. At the command prompt, type:

add lb monitor <monitorName> <monitorType> [<interval>]

bind lb monitor <monitorName> <ServiceName>

Example

add lb monitor mon1 sip-UDP -sipMethod REGISTER -sipuRIsip:[email protected] -sipregURI sip:[email protected] -respcode 200

bind monitor mon1 Service-SIP-UDP-1

5. If you created a SIP_SSL virtual server, bind an SSL certificate key pair to the virtualserver. At the command prompt, type: At the command prompt, type:

bind ssl vserver <vServerName> -certkeyName <certificate-KeyPairName> -CA–skipCAName

Example

bind ssl vserver Vserver-LB-1 -certkeyName CertKey-SSL-1

Load Balancing a Group of SIP Servers

393

Page 394: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

6. Configure RNAT as required by your network topology. At the command prompt, typeone of the following commands to create, respectively, an RNAT entry that uses anetwork address as the condition and a MIP or SNIP as the NAT IP address, an RNATentry that uses a network address as the condition and a unique IP address as the NATIP address, an RNAT entry that uses an ACL as the condition and a MIP or SNIP as theNAT IP address, or an RNAT entry that uses an ACL as a condition and a unique IPaddress as the NAT IP address:

set rnat <IPAddress> <netmask>

set rnat <IPAddress> <netmask> -natip <NATIPAddress>

set rnat <aclname> [-redirectPort <port>]

set rnat <aclname> [-redirectPort <port>] -natIP <NATIPAddress>

Example

set rnat 192.168.1.0 255.255.255.0 -natip 10.102.29.50

If you want to use a custom certificate-key pair, bind the custom certificate-key pair tothe NetScaler internal service named nsrnatsip-127.0.0.1-5061.

add ssl certKey <certkeyName> -cert <string> [-key <string>]

bind ssl service <serviceName> -certkeyName <string>

Example

add ssl certKey c1 -cert cert.epm -key key.ky

bind ssl service nsrnatsip-127.0.0.1-5061 -certkeyName c1

7. If you want to append RPORT to the SIP messages that the SIP server initiates, type thefollowing command at the command prompt:

set lb sipParameters -rnatSrcPort <rnatSrcPort> -rnatDstPort<rnatDstPort> -retryDur<integer> -addRportVip <addRportVip> - sip503RateThreshold<sip503_rate_threshold_value>

Sample Configuration for load balancing the SIPtraffic over UDP

> add service service-UDP-1 10.102.29.5 SIP_UDP 80

Done

> add lb vserver vserver-LB-1 SIP_UDP 10.102.29.60 80

Done

> bind lb vserver vserver-LB-1 service-UDP-1

Load Balancing a Group of SIP Servers

394

Page 395: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Done

> add lb mon mon1 sip-udp -sipMethod REGISTER -sipuRIsip:[email protected] -sipregURI sip:[email protected] -respcode 200

Done

> bind mon mon1 service-UDP-1

Done

> set rnat 192.168.1.0 255.255.255.0

Done

> set lb sipParameters -rnatSrcPort 5060 -rnatDstPort 5060 -retryDur1000 -addRportVip ENABLED -sip503RateThreshold 1000

Done

Sample Configuration for load balancing the SIPtraffic over TCP

> add service service-TCP-1 10.102.29.5 SIP_TCP 80

Done

> add lb vserver vserver-LB-1 SIP_TCP 10.102.29.60 80

Done

> bind lb vserver vserver-LB-1 service-TCP-1

Done

> add lb mon mon1 sip-tcp -sipMethod REGISTER -sipuRIsip:[email protected] -sipregURI sip:[email protected] -respcode 200

Done

> bind mon mon1 service-TCP-1

Done

> set rnat 192.168.1.0 255.255.255.0

Done

> set lb sipParameters -rnatSrcPort 5060 -rnatDstPort 5060 -retryDur1000 -addRportVip ENABLED -sip503RateThreshold 1000

Done

Load Balancing a Group of SIP Servers

395

Page 396: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Sample Configuration for load balancing and securingSIP traffic over TCP

> add service service-SIP-SSL-1 10.102.29.5 SIP_SSL 80

Done

> add lb vserver vserver-LB-1 SIP_SSL 10.102.29.60 80

Done

> bind lb vserver vserver-LB-1 service-SIP-SSL

Done

> add lb mon mon1 sip-tCP -sipMethod REGISTER -sipuRIsip:[email protected] -sipregURI sip:[email protected] -respcode 200

Done

> bind mon mon1 service-SIP-SSL

Done

> bind ssl vserver Vserver-LB-1 -certkeyName CertKey-SSL-1

Done

> set rnat 192.168.1.0 255.255.255.0

Done

> set lb sipParameters -rnatSrcPort 5060 -rnatDstPort 5060 -retryDur1000 -addRportVip ENABLED -sip503RateThreshold 1000

Done

Load Balancing a Group of SIP Servers

396

Page 397: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure a basic load balancing setup for SIPtraffic by using the configuration utility

1. Navigate to Traffic Management > Load Balancing > Virtual Servers, and add a virtualserver of type SIP_UDP, SIP_TCP, or SIP_SSL.

2. Click the Service section, and add a service of type SIP_UDP, SIP_TCP, or SIP_SSL.

3. (Optional) Click the Monitor section, and add a monitor of type: SIP-UDP or SIP-TCP.

4. Bind the monitor to the service, and bind the service to the virtual server.

5. If you created a SIP_SSL virtual server, bind an SSL certificate key pair to the virtualserver. Click the Certificates section, and bind a certificate key pair to the virtualserver.

6. Configure RNAT as required by your network topology. To configure RNAT:

a. Navigate to System > Network > Routes.

b. On the Routes page, click the RNAT tab.

c. In the details pane, click Configure RNAT.

d. In the Configure RNAT dialog box, do one of the following:

• If you want to use the network address as a condition for creating an RNATentry, click Network and set the following parameters:

• Network

• Netmask• If you want to use an extended ACL as a condition for creating an RNAT entry,

click ACL and set the following parameters:

• ACL Name

• Redirect Porte. To set a MIP or SNIP address as a NAT IP address, skip to step 7.

f. To set a unique IP address as a NAT IP, in the Available NAT IP (s) list, select the IPaddress that you want to set as the NAT IP, and then click Add. The NAT IP youselected appears in the Configured NAT IP(s) list.

g. Click Create, and then click Close.If you want to use a custom certificate-key pair, bind the custom certificate-key pair tothe NetScaler internal service named nsrnatsip-127.0.0.1-5061. To bind the pair:

a. Navigate to Traffic Management > Load Balancing > Services and click the InternalServices tab.

b. Select nsrnatsip-127.0.0.1-5061 and click Edit.

c. Click the Certificates section and bind a certificate key pair to the internal service.

Load Balancing a Group of SIP Servers

397

Page 398: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

7. If you want to append RPORT to the SIP messages that the SIP server initiates, configurethe SIP parameters. Navigate to Traffic Management > Load Balancing and click ChangeSIP settings, set the various SIP parameters.

SIP Expression and Policy Example: CompressionEnabled in Client Requests

A NetScaler ADC cannot process compressed client SIP requests, so the client SIP requestfails.

You can configure a responder policy that intercepts the SIP NEGOTIATE message from theclient and looks for the compression header. If the message includes a compression header,the policy responds with "400 Bad Request," so that the client resends the request withoutcompressing it.

At the command prompt, type the following commands to create the responder policy:

> add responder action sipaction1 respondwith q{"SIP/2.0 400 BadRequest\r\n\r\n"}

Done.

> add responder policy sippol1

> add responder policy sippol1 "SIP.REQ.METHOD.EQ(\"NEGOTIATE\")&&SIP.REQ.HEADER(\"Compression\").EXISTS" sipaction1

To configure RNAT by using the command lineinterface

At the command prompt, type:

set rnat<network> <netmask>

Example

set rnat 192.168.1.0 255.255.255.0

Parameters for configuring RNATnetwork

IPv6 address of the network on whose traffic you want the NetScaler appliance to doRNAT processing.

netmask

Load Balancing a Group of SIP Servers

398

Page 399: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Subnet mask associated with the network address.

To configure RNAT by using the configuration utility1. In the navigation pane expand Network, expand Routing, and then click Routes.

2. On the Routes page, click the RNAT tab.

3. In the details pane, click Configure RNAT.

4. In the Configure RNAT dialog box, do one of the following:

• If you want to use the network address as a condition for creating an RNAT entry,click Network and set the following parameters:

• Network

• Netmask• If you want to use an extended ACL as a condition for creating an RNAT entry, click

ACL and set the following parameters:

• ACL Name

• Redirect Port5. To set a MIP or SNIP address as a NAT IP address, skip to step 7.

6. To set a unique IP address as a NAT IP, in the Available NAT IP (s) list, select the IPaddress that you want to set as the NAT IP, and then click Add. The NAT IP you selectedappears in the Configured NAT IP(s) list.

7. Click Create, and then click Close.

After you configure RNAT, the appliance sends SIP responses to the IP address and port thatthe client uses to send the request. The appliance also adds the RPORT tag in the VIAheader of the message. The appliance compares the values of the source and destinationports of the request packets with the RNAT source port and RNAT destination port. If one ofthe values matches, the appliance updates the VIA header with the RPORT setting.

You must enable this setting when RPORT is not configured on either client.

To configure SIP parameters by using the commandline interface

At the command prompt, type:

set lb sipParameters -rnatSrcPort <rnatSrcPort> -rnatDstPort<rnatDstPort> -retryDur<integer> -addRportVip <addRportVip> - sip503RateThreshold<sip503_rate_threshold_value>

Example

Load Balancing a Group of SIP Servers

399

Page 400: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

set lb sipParameters -rnatSrcPort 5060 -rnatDstPort 5060 -retryDur 1000 -addRportVip ENABLED -sip503RateThreshold 1000

Parameters for configuring the SIP parametersrnatSrcPort

Port number with which to match the source port in server-initiated SIP traffic. The rportparameter is added, without a value, to SIP packets that have a matching source portnumber, and CALL-ID based persistence is implemented for the responses received by thevirtual server.

rnatDstPort

Port number with which to match the destination port in server- initiated SIP traffic. Therport parameter is added, without a value, to SIP packets that have a matching sourceport number, and CALL-ID based persistence is implemented for the responses receivedby the virtual server.

retryDur

Time, in seconds, for which a client must wait before initiating a connection afterreceiving a 503 Service Unavailable response from the SIP server. The time value is sentin the "Retry-After" header in the 503 response. Minimum value: 1. Maximum Value:32767. Default: 120.

addRportVip

Add the rport parameter to the VIA headers of SIP requests that virtual servers receivefrom clients or servers. Possible values: ENABLED, DISABLED. Default: ENABLED.

sip503RateThreshold

Maximum number of 503 Service Unavailable responses to generate, once every 10milliseconds, when a SIP virtual server becomes unavailable. Maximum Value: 65535.Default: 100.

To configure SIP parameters by using theconfiguration utility

1. Navigate to Traffic Management > DNS > Name Servers.

2. Create a DNS name server of type DNS Virtual Server, and select a server from the DNSVirtual Server list.

1. In the navigation pane, click Load Balancing.

2. On the Load Balancing landing page, under Settings, click Change SIP settings.

3. In the Set SIP Parameters dialog box, set values for the following parameters:

Load Balancing a Group of SIP Servers

400

Page 401: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• RNAT Source Port

• RNAT Destination Port

• Retry Duration (secs)

• SIP503 Rate Threshold

4. Select Enable Add Rport VIP.

5. Click OK.

Load Balancing a Group of SIP Servers

401

Page 402: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

402

Load Balancing RTSP Servers

The NetScaler appliance can balance load on RTSP servers to improve the performance ofaudio and video streams over networks. The following diagram describes the topology of anload balancing setup configured to load balance a group of RTSP servers.

Figure 1. Load Balancing Topology for RTSP

In the example, the services Service-RTSP-1, Service-RTSP-2, and Service-RTSP-3 are boundto the virtual server Vserver-LB-1. The following table lists the names and values of theexample entities.

Entity type Name IP address Port Protocol

Virtual Server Vserver-LB-1 10.102.29.100 554 RTSP

Services Service-RTSP-1 10.102.29.101 554 RTSP

  Service-RTSP-2 10.102.29.102 554 RTSP

  Service-RTSP-3 10.102.29.103 554 RTSP

Monitors Monitor-RTSP-1 None 554 RTSPThe following diagram shows the load balancing entities used in RTSP configuration.

Page 403: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 2. Load Balancing RTSP Servers Entity Model

To configure a basic load balancing setup for RTSP servers, see Setting Up Basic LoadBalancing. Create services and virtual servers of type RTSP. When you configure a basicload balancing setup, the default TCP-default monitor is bound to the services. To bind anRTSP monitor to these services, see Binding Monitors to Services. The following proceduredescribes how create a monitor that checks RTSP servers.

To configure RTSP monitors by using the commandline interface

At the command prompt, type:

add lb monitor <monitorName> <type>

Example

add lb monitor Monitor-RTSP-1 RTSP

Load Balancing RTSP Servers

403

Page 404: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure RTSP monitors by using theconfiguration utility

1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. In the details pane, click Add.

3. In the Create Monitor dialog box, in the Name and Interval text boxes, type the nameand probing interval of a monitor.

4. In the Type list, select the type of the monitor.

5. Click Create, and then click Close.

Load Balancing RTSP Servers

404

Page 405: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

405

Load Balancing of Remote DesktopProtocol (RDP) Servers

Note: This feature is supported only on NetScaler nCore builds.

Remote Desktop Protocol (RDP) is a multichannel-capable protocol that allows for separatevirtual channels for carrying presentation data, serial device communication, licensinginformation, highly encrypted data (keyboard and mouse activity), and so on.

RDP is used for providing a graphical user interface to another computer on the network.RDP is used with Windows terminal servers for providing fast access with almost real-timetransmission of mouse movements and key presses even over low-bandwidth connections.

When multiple terminal servers are deployed to provide remote desktop services, theNetScaler appliance provides load balancing of the terminal servers (Windows 2003 and2008 Server Enterprise Editions). In some cases, a user who is accessing an applicationremotely may want to leave the application running on the remote machine but shut downthe local machine. The user therefore closes the local application without logging out ofthe remote application. After reconnecting to the remote machine, the user should be ableto continue with the remote application. To provide this functionality, the NetScaler RDPimplementation honors the routing token (cookie) set by the Terminal Services SessionDirectory or Broker so that the client can reconnect to the same terminal server to which itwas connected previously. The Session Directory, implemented on Windows 2003 TerminalServer, is referred to as Broker on Windows 2008 Terminal Server.

When a TCP connection is established between the client and the load balancing virtualserver, the NetScaler applies the specified load balancing method and forwards the requestto one of the terminal servers. The terminal server checks the session directory todetermine whether the client has a session running on any other terminal server in thedomain.

If there is no active session on any other terminal server, the terminal server responds byserving the client request, and the NetScaler forwards the response to the client.

If there is an active session on any other terminal server, the terminal server that receivesthe request inserts a cookie (referred to as routing token) with the details of the activesession and returns the packets to the NetScaler, which returns the packet to the client.The server closes the connection with the client. When the client retries to connect, theNetScaler reads the cookie information and forwards the packet to the terminal server onwhich the client has an active session.

The user on the client machine experiences a continuation of the service and does not haveto take any specific action.

Note: The Windows Session Directory feature requires the Remote Desktop client thatwas first released with Windows XP. If a session with a Windows 2000 or Windows NT 4.0Terminal Server client is disconnected and the client reconnects, the server with whichthe connection is established is selected by the load balancing algorithm.

The following diagram describes RDP load balancing.

Page 406: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 1. Load Balancing Topology for RDP

Note: When an RDP service is configured, persistence is automatically maintained byusing a routing token. You need not enable persistence explicitly.

Ensure that the disconnected RDP sessions are cleared on the terminal servers at thebackend to avoid flapping between two terminal servers when an RDP session isdisconnected without logging out. For more information, seehttp://technet.microsoft.com/en-us/library/cc758177(WS.10).aspx#BKMK_2

When you add an RDP service, by default, NetScaler adds a monitor of the type TCP andbinds it to the service. The default monitor is a simple TCP monitor that checks whether ornot a listening process exists at the 3389 port on the server specified for the RDP service. Ifthere is a listening process at 3389, NetScaler marks this service as UP and if there is nolistening process, it marks the service as DOWN.

For more efficient monitoring of an RDP service, in addition to the default monitor, you canconfigure a script monitor that is meant for the RDP protocol. When you configure thescripting monitor, the NetScaler opens a TCP connection to the specified server and sendsan RDP packet. The monitor marks the service as UP only if it receives a confirmation of theconnection from the physical server. Therefore, from the scripting monitor, the NetScalercan know whether the RDP service is ready to service a request.

The monitor is a user-type monitor and the script is located on the NetScaler at/nsconfig/monitors/nsrdp.pl. When you configure the user monitor, the NetScaler runs thescript automatically. To configure the scripting monitor, add the monitor and bind it to theRDP service.

Load Balancing of Remote Desktop Protocol (RDP) Servers

406

Page 407: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure RDP load balancing, create services of type RDP and bind them to an RDPvirtual server.

To configure RDP load balancing services by usingthe command line interface

At the command prompt, type the following commands to configure an RDP load balancingsetup and verify the configuration:

add service <name>@ <serverName> <serviceType> <port>

Note: Repeat the above command to add more services.

Example

> add service ser1 10.102.27.182 RDP 3389Done> add service ser2 10.102.27.183 RDP 3389Done>show service ser1ser1 (10.102. 27.182:3389) - RDP State: UP… Server Name: 10.102.27.182 Server ID : 0 Monitor Threshold : 0 Down state flush: ENABLED…1) Monitor Name: tcp-default State: UP Weight: 1… Response Time: 4.152 millisec Done

Parameters for configuring a serviceserviceName

Name of the service. The name must not exceed 127 characters, and the leadingcharacter must be a number or a letter. The following characters are also allowed: @ _ -. (period) : (colon) # and space ( ).

serverName

Name or IP address of the server in IPv4 format.

serviceType

Load Balancing of Remote Desktop Protocol (RDP) Servers

407

Page 408: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The service type must be RDP.

port

The default port, 3389, must be used.

To configure RDP load balancing services by usingthe configuration utility

1. In the navigation pane, expand Load Balancing and then click Services.

2. In the details pane, click Add.

3. In the Create Service dialog box, specify values for the following parameters, whichcorrespond to parameters described in "Parameters for configuring a service" as shown:

• Service Name*—serviceName

• Protocol*—serviceType

• Server*—serverName

• Port*—port*A required parameter

4. Click Create.

5. Create all the RDP services to be load balanced.

6. From the services pane, open the service you added, and verify the addition.

To configure an RDP load balancing virtual server byusing the command line interface

At the command prompt, type the following commands to configure an RDP load balancingvirtual server and verify the configuration:

• add lb vserver <name>@ <serviceType> <ipAddress> <port>

• bind lb vserver <name>@ <serviceName>

Bind all the RDP services to be load balanced to the virtual server.

Example

This example has two RDP services bound to the RDP virtual server.

> add lb vs v1 rdP 10.102.27.186 3389Done

Load Balancing of Remote Desktop Protocol (RDP) Servers

408

Page 409: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

> bind lb vs v1 ser1service "ser1" bound> bind lb vs v1 ser2service "ser2" boundDone

>sh lb vs v1v1 (10.102.27.186:3389) - RDP Type: ADDRESSState: UP…No. of Bound Services : 2 (Total) 2 (Active)Configured Method: LEASTCONNECTION Current Method: Round Robin, Reason: A new service is boundMode: IPPersistence: NONE L2Conn: OFF

1) ser1 (10.102.27.182: 3389) - RDPState: UP Weight: 12) ser2 (10.102.27.183: 3389) - RDPState: UP Weight: 1Done

Parameters for configuring a virtual servervServerName

Name of the virtual server that is associated with the service. The name must not exceed127 characters, and the leading character must be a number or a letter. The followingcharacters are also allowed: @ _ - . (period) : (colon) # and space ( ).

ipAddress

IP address of the virtual server in the IPv4 format.

serviceType

The service type must be RDP.

port

The default port, 3389, must be used.

Load Balancing of Remote Desktop Protocol (RDP) Servers

409

Page 410: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure an RDP load balancing virtual server byusing the configuration utility

1. In the navigation pane, expand Load Balancing and then click Virtual Servers.

2. In the details pane, click Add.

3. In the Create Virtual Server (Load Balancing) dialog box, specify values for the followingparameters, which correspond to parameters described in “Parameters for configuring avirtual server” as shown:

• Name*—vServerName

• IP Address*—ipAddress

• Protocol*—serviceType

• Port*—port*A required parameter

4. In the Services tab, select the services to be bound to the virtual server by checking theservice names.

5. Click Create.

6. In the Load Balancing Virtual Servers pane, select the RDP virtual server you configured,and then click Open to verify the configuration.

To configure a scripting monitor for RDP services byusing the command line interface

At the command prompt, type the following commands:

• add lb monitor <monitorName> USER -scriptName nsrdp.pl

• bind lb monitor <monitorName> <rdpServiceName>

Example

add service ser1 10.102.27.182 RDP 3389add lb monitor RDP_MON USER -scriptName nsrdp.plbind lb monitor RDP_MON ser1

Load Balancing of Remote Desktop Protocol (RDP) Servers

410

Page 411: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Parameter for configuring RDP scripting monitorscriptName

Name of the script to be run.

To configure a scripting monitor for RDP services byusing the configuration utility

1. In the navigation pane, expand Load Balancing and then click Monitors.

2. In the details pane, click Add.

3. In the Create Monitor dialog box, specify a name for the RDP monitor.

4. In the Type drop-down list, select USER.

5. On the Special Parameters tab, for the Script Name, click Browse and select nsrdp.plfrom the default location.

6. Click Create.

7. From the Monitors pane, open the monitor you added, and verify the addition.

8. In the navigation pane, expand Load Balancing, and then click Services.

9. In the details pane, select the RDP service, and then click Open.

10. In the Configure Service dialog box, select the RDP scripting monitor that you addedand click Add.

11. Click OK.

Load Balancing of Remote Desktop Protocol (RDP) Servers

411

Page 412: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

412

Use Cases

Certain deployment scenarios are useful to perform load balancing in a wide variety ofcircumstances. Several protocols benefit from a configuration that allows the server torespond directly to the client rather than through the NetScaler appliance. This is calleddirect server return (DSR) mode. Many deployments are faster when you connect theappliance to the network through a single interface, rather than placing it directly in theflow of traffic. This is called one-arm mode. Other deployments require that the appliancebe installed in the flow of traffic, so that it transparently intercepts traffic that is sent toand from the servers that it manages. This is called inline mode or (occasionally) two-armmode. These use cases are described in detail below.

Page 413: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

413

Configuring Rule Based PersistenceBased on a Name-Value Pair in a TCPByte Stream

Note: Load balancing virtual servers of type TCP and SSL_TCP support rule basedpersistence only on NetScaler 9.3.e.

Some protocols transmit name-value pairs in a TCP byte stream. The protocol in the TCPbyte stream in this example is the Financial Information eXchange (FIX) protocol. In itstraditional, non-XML implementation, the FIX protocol enables two hosts communicatingover a network to exchange business or trade-related information as a list of name-valuepairs (called “FIX fields”). The field format is <tag>=<value><delimiter>. Thistraditional tag-value format makes the FIX protocol ideal for the use case.

The tag in a FIX field is a numeric identifier that indicates the meaning of the field. Forexample, the tag 35 indicates the message type. The value after the equal sign holds aspecific meaning for the given tag and is associated with a data type. For example, a valueof A for the tag 35 indicates that the message is a logon message. The delimiter is thenonprinting “Start of Header” (SOH) ASCII character (0x01), which is the caret symbol (^).Each field is also assigned a name. For example, the field with tag 35 is the msgTypefield. Following is an example of a logon message.

8=FIX.4.1 9=61 35=A 49=INVMGR 56=BRKR 34=1 52=20000426-12:05:06 98=0108=30 10=157

Your choice of persistence type for a tag-value list such as the one shown above isdetermined by the options that are available to you for extracting a particular string fromthe list. Token-based persistence methods require you to specify the offset and length ofthe token that you want to extract from the payload. The FIX protocol does not allow youto do that, because the offset of a given field and the length of its value can vary from onemessage to another (depending on the message type, the preceding fields, and the lengthsof the preceding values) and from one implementation to another (depending on whethercustom fields have been defined). Such variations make it impossible to predict the exactoffset of a given field or to specify the length of the value that is to be extracted as thetoken. In this case, therefore, rule based persistence is the preferred persistence type.

Assume that a virtual server fixlb1 is load balancing TCP connections to a farm of servershosting instances of a FIX-enabled application, and that you want to configure persistencefor connections on the basis of the value of the SenderCompID field, which identifies thefirm sending the message. The tag for this FIX field is 49 (shown in the earlier logonmessage example).

To configure rule based persistence for the load balancing virtual server, set thepersistence type for the load balancing virtual server to RULE and configure the ruleparameter with an expression. The expression must be one that extracts the portion of theTCP payload in which you expect to find the SenderCompID field, typecasts the resultingstring to a name-value list based on the delimiters, and then extracts the value of theSenderCompID field (tag 49), as follows:

Page 414: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

set lb vserver fixlb1 -persistenceType RULE -rule"CLIENT.TCP.PAYLOAD(300).TYPECAST_NVLIST_T('=','^').VALUE(\"49\")"

Note: Backslash characters have been used in the expression because this is a CLIcommand. If you are using the configuration utility, do not enter the backslashcharacters.

If the client sends a FIX message that contains the name-value list in the earlier logonmessage example, the expression extracts the value INVMGR, and the NetScaler appliancecreates a persistence session based on this value.

The argument to the PAYLOAD() function can be as large as you deem is necessary toinclude the SenderCompID field in the string extracted by the function. Optionally, youcan use the SET_TEXT_MODE(IGNORECASE) function if you want the appliance to ignorecase when extracting the value of the field, and the HASH function to create a persistencesession based on a hash of the extracted value. The following expression uses theSET_TEXT_MODE(IGNORECASE) and HASH functions:

CLIENT.TCP.PAYLOAD(500).TYPECAST_NVLIST_T('=','^').SET_TEXT_MODE(IGNORECASE).VALUE("49").HASH

Following are more examples of rules that you can use to configure persistence for FIXconnections (replace <tag> with the tag of the field whose value you want to extract):

• To extract the value of any FIX field in the first 300 bytes of the TCP payload, you canuse the expressionCLIENT.TCP.PAYLOAD(300).BEFORE_STR("^").AFTER_STR("<tag>=").

• To extract a string that is 20 bytes long at offset 80, cast the string to a name-valuelist, and then extract the value of the field that you want, use the expression CLIENT.TCP.PAYLOAD(100).SUBSTR(80,20).TYPECAST_NVLIST_T('=','^').VALUE("<tag>").

• To extract the first 100 bytes of the TCP payload, cast the string to a name-value list,and extract the value of the third occurrence of the field that you want, use theexpression CLIENT.TCP.PAYLOAD(100).TYPECAST_NVLIST_T('=','^').VALUE("<tag>",2).

Note: If the second argument that is passed to the VALUE() function is n, theappliance extracts the value of the (n+1)th instance of the field because the countstarts from zero (0).

Following are more examples of rules that you can use to configure persistence. Only thepayload-based expressions can evaluate data being transmitted through the FIX protocol.The other expressions are more general expressions for configuring persistence based onlower networking protocols.

• CLIENT.TCP.PAYLOAD(100)

• CLIENT.TCP.PAYLOAD(100).HASH

• CLIENT.TCP.PAYLOAD(100).SUBSTR(5,10)

• CLIENT.TCP.SRCPORT

• CLIENT.TCP.DSTPORT

Configuring Rule Based Persistence Based on a Name-Value Pair in a TCP Byte Stream

414

Page 415: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• CLIENT.IP.SRC

• CLIENT.IP.DST

• CLIENT.IP.SRC.GET4

• CLIENT.IP.DST.GET4

• CLIENT.ETHER.SRCMAC.GET6

• CLIENT.ETHER.DSTMAC.GET5

• CLIENT.VLAN.ID

Configuring Rule Based Persistence Based on a Name-Value Pair in a TCP Byte Stream

415

Page 416: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

416

Configuring Load Balancing in DirectServer Return Mode

Load balancing in direct server return (DSR) mode allows the server to respond to clientsdirectly by using a return path that does not flow through the NetScaler appliance. In DSRmode, however, the appliance can continue to perform health checks on services. In ahigh-data volume environment, sending server traffic directly to the client in DSR modeincreases the overall packet handling capacity of the appliance because the packets do notflow through the appliance.

DSR mode has the following features and limitations:

• It supports one-arm mode and inline mode.

• The appliance ages out sessions based on idle timeout.

• Because the appliance does not proxy TCP connections (that is it does not send SYN-ACKto the client), it does not completely shut out SYN attacks. By using the SYN packetrate filter, you can control the rate of SYNs to the server. To control the rate of SYNs,set a threshold for the rate of SYNs. To get protection from SYN attacks, you mustconfigure the appliance to proxy TCP connections. However, that requires the reversetraffic to flow through the appliance.

• In a DSR configuration, the NetScaler appliance does not replace the load balancingvirtual server's IP address with the destination server's IP address. Instead, it forwardspackets to a service by using the server's MAC address, which it obtains from themonitor bound to the service. However, custom user monitors (monitors of type USER),which use scripts stored on the NetScaler appliance, do not learn a server's MACaddress. If you use only custom monitors in a DSR configuration, for each request thevirtual server receives, the appliance attempts to resolve the destination IP address toa MAC address (by sending ARP requests). Because the destination IP address is a virtualIP address owned by the NetScaler appliance, the ARP requests always resolve to theMAC address of the NetScaler interface. Consequently, all traffic received by the virtualserver is looped back to the appliance. If you use user monitors in a DSR configuration,you must also configure another monitor of a different type (for example, a PINGmonitor) for the services, ideally with a longer interval between probes, so that theMAC address of the servers can be learned.

In the example scenario, the services Service-ANY-1, Service-ANY-2, and Service-ANY-3 arecreated and bound to the virtual server Vserver-LB-1. The virtual server load balances theclient request to a service, and the service responds to clients directly, bypassing theNetScaler. The following table lists the names and values of the entities configured on theNetScaler in DSR mode.

Entity type Name IP address Protocol

Virtual server Vserver-LB-1 10.102.29.94 ANY

Services Service-ANY-1 10.102.29.91 ANY

  Service-ANY-2 10.102.29.92 ANY

Page 417: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

  Service-ANY-3 10.102.29.93 ANY

Monitors TCP None NoneThe following diagram shows the load balancing entities and values of the parameters to beconfigured on the appliance.

Figure 1. Entity Model for Load Balancing in DSR Model

For the appliance to function correctly in DSR mode, the destination IP in the client requestmust be unchanged. Instead, the appliance changes the destination MAC to that of theselected server. This setting enables the server to determine the client MAC address forforwarding requests to the client while bypassing the server. To enable the appliance to dothis, you must enable MAC-based forwarding.

To enable MAC-based forwarding by using the command line interface

At the command prompt, type:

enable ns mode MACbasedforwarding

To enable MAC-based forwarding by using the configuration utility

1. In the navigation pane, expand System, and then click Settings.

2. On the Settings pane, under Modes and Features, click Configure modes.

3. In the Configure Modes dialog box, select the MAC Based Forwarding check box, andthen click OK.

4. In the Enable/Disable Mode(s)? dialog box, click Yes.

Configuring Load Balancing in Direct Server Return Mode

417

Page 418: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Next, you configure a basic load balancing setup as described in Setting Up Basic LoadBalancing, naming the entities and setting the parameters using the values described in theprevious table.

After you configure the basic load balancing setup, you must customize it for DSR mode. Todo this, you configure a supported load balancing method, such as the Source IP Hashmethod with a sessionless virtual server. You also need to set the redirection mode to allowthe server to determine the client MAC address for forwarding responses and bypass theappliance.

After you configure the load balancing method and redirection mode, you need to enablethe USIP mode on each service. The service then uses the source IP address whenforwarding responses.

To configure the load balancing method and redirection mode for a sessionless virtualserver by using the command line interface

At the command prompt, type:

set lb vserver <vServerName> -lbMethod <LBMethodOption> -m <RedirectionMode>-sessionless <Value>

Example

set lb vserver Vserver-LB-1 -lbMethod SourceIPHash -m MAC -sessionless enabled

To configure the load balancing method and redirection mode for a sessionless virtualserver by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the virtual server (for example, Vserver-LB-1), and then clickOpen.

3. On the Method and Persistence tab, under LB Method, select SOURCE IP Hash.

4. On the Advanced tab, under Redirection Mode, select MAC Based.

5. Select the Sessionless check box and click OK.

To configure a service to use source IP address by using the command line interface

At the command prompt, type:

set service <ServiceName> -usip <Value>

Example

set service Service-ANY-1 -usip yes

To configure a service to use source IP address by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

Configuring Load Balancing in Direct Server Return Mode

418

Page 419: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

2. On the Services pane, click Service-ANY-1, and then click Open.

3. On the Advanced tab, under Settings, select the Use Source IP check box, and then clickOK.

4. Repeat steps 1-5 for the services Service-ANY-2 and Service-ANY-3.

Some additional steps are required in certain situations, which are described in thesucceeding sections.

Configuring Load Balancing in Direct Server Return Mode

419

Page 420: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

420

Configuring LINUX Servers in DSR Mode

The LINUX operating system requires that you set up a loopback interface with theNetScaler appliance virtual IP address (VIP) on each load balanced server in the DSR cluster.

To configure LINUX server in DSR modeTo create a loop back interface with the NetScaler appliance’s VIP on each load balancedserver, at the Linux OS prompt type the following commands:

ifconfig dummy0 up

ifconfig dummy0:0 inet <netscaler vip> netmask 255.255.255.255 up

echo 1 > /proc/sys/net/ipv4/conf/dummy0/arp_ignore

echo 2 > /proc/sys/net/ipv4/conf/dummy0/arp_announce

Then, run the software that re-maps the TOS id to VIP.

Note: Add the correct mappings to the software before running it. In the precedingcommands, the LINUX server uses dummy0 to connect to the network. When you use thiscommand, type the name of the interface that your LINUX server uses to connect to thenetwork.

Page 421: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

421

Configuring DSR Mode When Using TOS

Differentiated services (DS), also known as TOS (Type of Service), is a field that is part ofthe TCP packet header. TOS is used by upper layer protocols for optimizing the path for apacket. The TOS information encodes the NetScaler appliance virtual IP address (VIP), andthe load balanced servers extract the VIP from it.

In the following scenario, the appliance adds the VIP to the TOS field in the packet andthen forwards the packet to the load balanced server. The load balanced server thenresponds directly to the client, bypassing the appliance, as illustrated in the followingdiagram.

Figure 1. The NetScaler Appliance in DSR mode with TOS

The TOS feature is specifically customized for a controlled environment, as describedbelow:

• The environment must not have any stateful devices, such as stateful firewall and TCPgateways, in the path between the appliance and the load balanced servers.

• Routers at all the entry points to the network must remove the TOS field from allincoming packets to make sure that the load balanced server does not confuse anotherTOS field with that added by the appliance.

• Each server can have only 63 VIPs.

Page 422: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• The intermediate router must not send out ICMP error messages regardingfragmentation. The client will not understand the message, as the source IP addresswill be the IP address of the load balanced server and not the NetScaler VIP.

• TOS is valid only for IP-based services. You cannot use domain name based services withTOS.

In the example, Service-ANY-1 is created and bound to the virtual server Vserver-LB-1. Thevirtual server load balances the client request to the service, and the service responds toclients directly, bypassing the appliance. The following table lists the names and values ofthe entities configured on the appliance in DSR mode.

Entity Type Name IP Address Protocol

Virtual server Vserver-LB-1 10.102.33.91 ANY

Services Service-ANY-1 10.102.100.44 ANY

Monitors PING None NoneDSR with TOS requires that load balancing be set up on layer 3. To configure a basic loadbalancing setup for Layer 3, see Setting Up Basic Load Balancing. Name the entities and setthe parameters using the values described in the previous table.

After you configure the load balancing setup, you must customize the load balancing setupfor DSR mode by configuring the redirection mode to allow the server to decapsulate thedata packet and then respond directly to the client and bypass the appliance.

After specifying the redirection mode, you can optionally enable the appliance totransparently monitor the server. This enables the appliance to transparently monitor theload balanced servers.

To configure the redirection mode for the virtualserver by using the command line interface

At the command prompt, type:

set lb vserver <vServerName> -m <Value> -tosId <Value>

Example

set lb vserver Vserver-LB-1 -m TOS -tosId 3

Configuring DSR Mode When Using TOS

422

Page 423: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure the redirection mode for the virtualserver by using the configuration utility

1. In the left navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the Load Balancing Virtual Servers pane, select the virtual server and click Open.

3. In the Configure Virtual Server (Load Balancing) dialog box, on the Advanced tab, inRedirection Mode, click TOS Based.

4. In the TOS Id box, enter a value for the TOS ID.

5. Click OK.

To configure the transparent monitor for TOS byusing the command line interface

At the command prompt, type:

add monitor <MonitorName> <Type> -destip <DestinationIP> -tos <Value> -tosId <Value>

Example

add monitor mon1 PING -destip 10.102.33.91 -tos Yes -tosId 3

To create the transparent monitor for TOS by usingthe configuration utility

1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. On the Monitors pane, select the monitor (for example, tcp), and click Add.

3. In the Create Monitor dialog box, in the Name and Destination IP boxes, enter themonitor name and the destination IP address (for example, PING and 10.102.33.91).

4. In the Type list, select the type of monitor (for example, PING).

5. To configure the monitor for TOS, select the TOS check box.

6. In the TOS Id box, enter the same TOS ID that you had entered for the virtual server(for example, 3.)

7. Click OK.

Configuring DSR Mode When Using TOS

423

Page 424: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

424

Configuring Load Balancing in DSR Modeby Using IP Over IP

You can configure your NetScaler appliance to use direct server return (DSR) mode acrossLayer 3 networks by using IP tunneling, also called IP over IP configuration. As withstandard load balancing configurations for DSR mode, this allows servers to respond toclients directly instead of using a return path through the NetScaler appliance, improvingresponse times and throughput. As with standard DSR mode, the NetScaler appliancemonitors the servers and performs health checks on the application ports.

With IP over IP configuration, the NetScaler appliance and the servers do not need to be onthe same Layer 2 subnet. Instead, the NetScaler appliance encapsulates the packets beforesending them to the destination server. After the destination server receives the packets, itdecapsulates the packets, and then sends its responses directly to the client.

To configure IP over IP DSR mode on your NetScaler appliance, you must do the following:

• Create a load balancing virtual server. Set the protocol to ANY and set the mode toIPTUNNEL.

• Create services. Create a service for each of your back-end applications. Bind theservices that you created to the virtual server.

Page 425: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

425

Configuring a Load Balancing VirtualServer

Configure a virtual server to handle requests to your applications. Assign a service type ofANY and set the forwarding method to IPTUNNEL. Optionally, configure the virtual server tooperate in sessionless mode. You can configure any load balancing method that you want touse.

To create and configure a load balancing virtualserver for IP over IP DSR by using the command lineinterface

At the command prompt type the following command to configure a load balancing virtualserver for IP over IP DSR and verify the configuration:

• add lb vserver <name> serviceType <serviceType> IPAddress <ip> Port <port> -lbMethod<method> -m <ipTunnelTag> -sessionless <sessionless>

• show lb vserver <name>

Example

In the following example, we have selected the load balancing method as sourceIPhash andconfigured sessionless load balancing.

add lb vserver Vserver-LB-1 ANY 10.102.29.60 * -lbMethod SourceIPHash -m IPTUNNEL -sessionless enabled

Parameters for configuring virtual serversname

A name for your new virtual server. The name can begin with a letter, number, or theunderscore symbol, and can consist of from one to 127 letters, numbers, and the hyphen(-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_)symbols.

serviceType

The protocol that your virtual server processes. For an IP over IP DSR virtual server, setthe protocol to ANY.

IP

Page 426: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The IP address assigned to your virtual server. This is normally an Internet-routable IPaddress.

Note: If the virtual server uses IPv6, select the IPv6 check box and enter the address inIPv6 format. (An IPv6 format address appears as follows:1000:0000:0000:0000:0005:0600:700a:888b.)

Port

The port that your virtual server listens on for traffic. For an IP over IP DSR virtualserver, set the port to *.

Method

The load balancing method to use for this load balancing configuration. For informationabout the various load balancing methods, see "Load Balancing Algorithms."

Mode

Redirection mode for load balancing. For an IP over IP DSR virtual server, set toIPTUNNEL to perform IP-in-IP encapsulation for client IP packets.

sessionless

Perform load balancing on a per-packet basis, without establishing sessions.Recommended for load balancing in scenarios involving direct server return (DSR), wheresession information is unnecessary.

To create and configure a load balancing virtualserver for IP over IP DSR by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, click Add.

3. In the Create Virtual Server dialog box, specify values for the following parameters,which correspond to parameters described in "Parameters for configuring virtualservers" as shown:

• Name*—name

• Protocol*—protocol

• IP address*—IPAddress

• Port*—port* A required parameter

4. On the Advanced tab, under Redirection Mode, select IP Tunnel Based.

5. Click Create, and then click Close. The virtual server that you created now appears inthe Virtual Servers pane.

Configuring a Load Balancing Virtual Server

426

Page 427: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Configuring a Load Balancing Virtual Server

427

Page 428: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

428

Configuring Services for IP over IP DSR

After creating your load-balanced server, You must configure one service for each of yourapplications. The service handles traffic from the NetScaler appliance to those applications,and allows the NetScaler appliance to monitor the health of each application.

You assign a service type of ANY and configure it for USIP mode. Optionally, you can alsobind a monitor of type IPTUNNEL to the service for tunnel-based monitoring.

To create and configure a service for IP over IP DSRby using the command line interface

At the command prompt, type the following commands to create a service and optionally,create a monitor and bind it to the service:

• add service <serviceName> <serverName> <serviceType> <port> -usip <usip>

• add monitor <monitorName> <monitorType> -destip <ip> -iptunnel <iptunnel>

• bind service <serviceName> -monitorName <monitorName>

Example

In the following example, we are creating a monitor of type IPTUNNEL:

add monitor mon-1 PING -destip 10.102.29.60 -iptunnel yesadd service Service-DSR-1 10.102.30.5 ANY * -usip yesbind service Service-DSR-1 -monitorName mon-1

Service Configuration ParametersserviceName

Name for the service. Must begin with an ASCII alphabetic or underscore (_) character,and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon(:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the servicehas been created. Maximum Length: 127

serverName

Name of the server that hosts the service. Maximum Length: 127

serviceType

Protocol in which data is exchanged with the service.

Page 429: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

port

Port number of the service.

usip

Use the client's IP address as the source IP address when initiating a connection to theserver. Possible values: YES, NO. Set to YES for IP over IP DSR, to configure the service touse source IP mode.

monitorName

The name of the monitor that you are binding to the service.

monitorType

The type of monitor that you are binding to the service.

destip

IP address of the virtual server to which to send probes. If the parameter is set to 0, theIP address of the server to which the monitor is bound is considered the destination IPaddress.

iptunnel

Send the monitoring probe to the service through an IP tunnel. A destination IP addressmust be specified. Possible values: YES, NO. Default value: NO. Set to YES for IP over IPDSR.

To configure a monitor by using the configurationutility

1. In the navigation pane, expand Load Balancing, and then click Monitors.

2. In the details pane, click Add.

3. In the Create Monitor dialog box, specify values for the following parameters, whichcorrespond to parameters described in "Service Configuration Parameters" as shown:

• Monitor Name*—name

• Type*—type

• Destination IP—destip. Specify the IP address of the virtual server that you createdearlier.

* A required parameter

4. Select IP Tunnel.

5. Click Create, and then click Close.

Configuring Services for IP over IP DSR

429

Page 430: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To create and configure a service for IP over IP DSRby using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. In the details pane, click Add.

3. In the Create Service dialog box, specify values for the following parameters, whichcorrespond to parameters described in "Service Configuration Parameters" as shown:

• Service Name*—name

• Protocol*—type

• Server*—IP

• Port*—port* A required parameter

4. On the Monitors tab, from the Available list, select the monitor that you created earlierand add it to the Configured list.

5. On the Advanced tab, select Use Source IP.

6. Click Create, and then click Close.

To bind a service to a load balancing virtual server byusing the command line interface

At the command prompt type the following command:

bind lb vserver <name> <serviceName>

Example

bind lb vserver Vserver-LB-1 Service-DSR-1

Configuring Services for IP over IP DSR

430

Page 431: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To bind a service to a load balancing virtual server byusing the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the details pane, select the load balancing virtual server that you created earlier,and then select Open.

3. In the Services tab, select the check box beside the name of the service(s) that youcreated earlier.

4. Click OK.

Configuring Services for IP over IP DSR

431

Page 432: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

432

Configuring Load Balancing in One-armMode

In a one-arm setup, you connect the NetScaler appliance to the network through a singleinterface. This is one of the simplest deployment scenarios, where the router, the serversand the appliance are all connected to the same switch. The client can access the serverdirectly, bypassing the appliance, if the client knows the IP address of the server. Clientrequests at the switch are forwarded to the appliance, and the appliance uses theconfigured load balancing method to select the service, as is shown in the followingdiagram.

Figure 1. Entity Model for Load Balancing in One-Arm Mode

In the example scenario, the services Service-ANY-1, Service-ANY-2, and Service-ANY-3 arecreated and bound to the virtual server Vserver-LB-1. The virtual server load balances theclient request to a service. The following table lists the names and values of the entitiesconfigured on the appliance in one-arm mode.

Entity type Name IP address Protocol

Virtual server Vserver-LB-1 10.102.29.94 ANY

Services Service-ANY-1 10.102.29.91 ANY

  Service-ANY-2 10.102.29.92 ANY

Page 433: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

  Service-ANY-3 10.102.29.93 ANY

Monitors TCP None NoneTo configure a load balancing setup in one-arm mode, see "Setting Up Basic LoadBalancing."

Configuring Load Balancing in One-arm Mode

433

Page 434: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

434

Configuring Load Balancing in the InlineMode

In an inline mode (also called two-arm mode) setup, you deploy the NetScaler appliance tothe network through more than one interface. In the two-arm setup, the appliance isconnected between the servers and the client. Traffic from clients passes through theappliance to access the load balanced server. Client requests at the switch are forwardedto the appliance, and the appliance uses the configured load balancing method to selectthe service. This is shown in the following diagram.

Page 435: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 1. Load Balancing in Inline Mode

The configuration and the entity diagram for inline mode are the same as described in"Configuring Load Balancing in One-arm Mode."

Configuring Load Balancing in the Inline Mode

435

Page 436: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

436

Load Balancing of Intrusion DetectionSystem Servers

To enable the NetScaler appliance to support load balancing of intrusion detection system(IDS) servers, the IDS servers and clients must be connected through a switch that has portmirroring enabled. The client sends a request to the server. Because port mirroring isenabled on the switch, the request packets are copied or sent to the NetScaler appliancevirtual server port. The appliance then uses the configured load balancing method to selectan IDS server, as shown in the following diagram.

Figure 1. Topology of Load Balanced IDS Servers

Note: Currently, the appliance supports load balancing of passive IDS devices only.

As illustrated in the preceding diagram, the IDS load balancing setup functions as follows:

1. The client request is sent to the IDS server, and a switch with a mirroring port enabledforwards these packets to the IDS server. The source IP address is the IP address of theclient, and the destination IP address is the IP address of the server. The source MACaddress is the MAC address of the router, and the destination MAC address is the MACaddress of the server.

2. The traffic that flows through the switch is mirrored to the appliance. The applianceuses the layer 3 information (source IP address and destination IP address) to forwardthe packet to the selected IDS server without changing the source IP address or

Page 437: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

destination IP address. It modifies the source MAC address and the destination MACaddress to the MAC address of the selected IDS server.

Note: When load balancing IDS servers, you can configure the SRCIPHASH, DESTIPHASH, orSRCIPDESTIPHASH load balancing methods. The SRCIPDESTIPHASH method isrecommended because packets flowing from the client to a service on the appliance mustbe sent to a single IDS server.

Suppose Service-ANY-1, Service-ANY-2, and Service-ANY-3 are created and bound toVserver-LB-1. The virtual server balances the load on the services. The following table liststhe names and values of the entities configured on the appliance.

Entity type Name IP address Port Protocol

Virtual server Vserver-LB-1 * * ANY

Services Service-ANY-1 10.102.29.101 * ANY

  Service-ANY-2 10.102.29.102 * ANY

  Service-ANY-3 10.102.29.103 * ANY

Monitors Ping None None None

Note: You can use inline mode or one-arm mode for an IDS load balancing setup.

The following diagram shows the load balancing entities and values of the parameters to beconfigured on the appliance.

Figure 2. Entity Model for Load Balancing IDS Servers

To configure an IDS load balancing setup, you must first enable MAC-based forwarding. Youmust also disable layer 2 and layer 3 modes on the appliance.

Load Balancing of Intrusion Detection System Servers

437

Page 438: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To enable MAC-based forwarding by using the command line interface

At the command prompt, type:

enable ns mode <ConfigureMode>

Example

enable ns mode MAC

To enable MAC-based forwarding by using the configuration utility

1. In the navigation pane, expand System, and then click Settings.

2. On the Settings landing page, under Modes and Features, click modes.

3. In the Configure Modes dialog box, select the MAC Based Forwarding check box, andthen click OK.

4. In the Enable/Disable Feature(s)? dialog box, and then click Yes.

Next, see "Setting Up Basic Load Balancing", to configure a basic load balancing setup.

After you configure the basic load balancing setup, you must customize it for IDS byconfiguring a supported load balancing method (such as the SRCIPDESTIP Hash method on asessionless virtual server) and enabling MAC mode. The appliance does not maintain thestate of the connection and only forwards the packets to the IDS servers without processingthem. The destination IP address and port remains unchanged because the virtual server isin the MAC mode.

To configure LB method and redirection mode for a sessionless virtual server by usingthe command line interface

At the command prompt, type:

set lb vserver <vServerName> -lbMethod <LBMethodOption> -m <RedirectionMode>-sessionless <Value>

Example

set lb vserver Vserver-LB-1 -lbMethod SourceIPDestIPHash -m MAC -sessionless enabled

To configure LB method and redirection mode for a sessionless virtual server by usingthe configuration utility

1. In the left navigation pane, expand Load Balancing, and then click Virtual Servers.

2. In the Load Balancing Virtual Servers pane, click the virtual server Vserver-LB-1, andthen click Open.

3. On the Method and Persistence tab, under LB Method, select Source IP Destination IPHash.

4. On the Advanced tab, under Redirection Mode, click MAC Based.

Load Balancing of Intrusion Detection System Servers

438

Page 439: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

5. Select the Sessionless check box, and then click OK.

To set a service to use source IP address by using the command line interface

At the command prompt, type:

set service <ServiceName> -usip <Value>

Example

set service Service-ANY-1 -usip yes

To set a service to use source IP address by using the configuration utility

1. In the navigation pane, expand Load Balancing, and then click Services.

2. On the Services pane, select the service, Service-ANY-1, and then click Open.

3. On the Advanced tab, under Settings, select the Use Source IP check box.

4. Click OK.

5. Repeat steps 1-5 for the services Service-ANY-2 and Service-ANY-3.

For USIP to function correctly, you must set it globally. For more information aboutconfiguring USIP globally, see "IP Addressing."

Load Balancing of Intrusion Detection System Servers

439

Page 440: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

440

Isolating the Network Paths by UsingTraffic Domains

A very common security requirement in a data center is to maintain network path isolationbetween the traffic of various applications or tenants. One application or tenant's trafficmust be isolated from the traffic of other applications or tenants. For example, a financialservices company would want to keep the traffic of its insurance department's applicationsseparate from that of its financial services applications. In the past, this was easilyachieved through physical separation of network service devices such as firewalls, loadbalancers, and IDP, and network monitoring and logical separation in the switching fabric.

As data center architectures evolve toward multi-tenant virtualized data centers,networking services in the aggregation layer of a data center are getting consolidated. Thisdevelopment has made network path isolation a critical component for network servicedevices and is driving the requirement for ADCs to be able to isolate traffic at the L4 to L7levels. Furthermore, all the traffic of a particular tenant must go through a firewall beforereaching the service layer.

To address the requirement of isolating the network paths, a NetScaler appliance identifiesnetwork domains and controls the traffic across the domains. The NetScaler solution hastwo main components: listen policies and shadow virtual servers.

Each network path to be isolated is assigned a virtual server on which a listen policy isdefined so that the virtual server listens to traffic only from a specified traffic domain.

To isolate the traffic, listen policies can be based on a number of client parameters or theircombinations, and the policies can be assigned priorities. The following table lists theparameters that can be used in listen policies for identifying the traffic.

Table 1. Client Parameters Used to Define Listen Policies

Category Parameters

Ethernet protocol Source MAC address, destination MACaddress

Network interface Network ID, receiving throughput, sendingthroughput, transmission throughput

IP protocol Source IP address, destination IP address

IPv6 protocol Source IPv6 address, destination IPv6address

TCP protocol Source port, destination port, maximumsegment size, payload, and other options

UDP protocol Source port, destination port

VLAN IDOn the NetScaler appliance, a virtual server is configured for each domain, with a listenpolicy specifying that the virtual server is to listen only to traffic for that domain. Alsoconfigured for each domain is a shadow load balancing virtual server, which listens to

Page 441: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

traffic destined for any domain. Each of the shadow load balancing virtual servers has awildcard (*) IP address and port, and its service type is set to ANY.

In each domain, a firewall for the domain is bound as a service to the shadow loadbalancing virtual server, which forwards all traffic through the firewall. Local traffic isforwarded to its destination, and traffic destined for another domain is forwarded to thefirewall for that domain. The shadow load balancing virtual servers are configured for MACmode redirection.

How Network Paths Are Isolated by Using NetScalerTraffic Domains

The following figure shows a typical traffic flow across domains. Consider the traffic flowwithin Network Domain 1, and between Network Domain 1 and Network Domain 2.

Figure 1. Network Path Isolation Using Traffic Domains

Isolating the Network Paths by Using Traffic Domains

441

Page 442: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Traffic within Network Domain 1Network Domain 1 has three VLANs: VLAN 11, VLAN110, and VLAN120. The following stepsdescribe the traffic flow.

• A client from VLAN 11 sends a request for a service available from the service pool inVLAN 120.

• The load balancing virtual server LB-VIP1, which is configured to listen to traffic fromVLAN 11, receives the request and forwards the request to VLAN 110. The virtual serverin VLAN 110 forwards the request to shadow load balancing virtual server FW-VIP-1.

• FW-VIP-1, which is configured to listen to traffic from VLAN 110, receives the requestand forwards it to VLAN 120.

• The load balancing virtual server in VLAN 120 load balances the request to one of thephysical servers, App11, App12, or App13.

• The response sent by the physical server returns by the same path to the client in VLAN11.

This configuration ensures that traffic is always segregated inside the NetScaler for all thetraffic that originates from a client.

Traffic between Network Domain 1 and Network Domain 2Network Domain 1 has three VLANs: VLAN 11, VLAN 110, and VLAN 120. Network Domain 2also has three VLANS: VLAN 22, VLAN 210, and VLAN 220. The following steps describe thetraffic flow from VALN 11 to VLAN 22.

• A client from VLAN 11, which belongs to Network Domain 1, sends a request for aservice available from the service pool in VLAN 220, which belongs to the NetworkDomain 2.

• In Network Domain 1, the load balancing virtual server LB-VIP1, which is configured tolisten to traffic from VLAN 11, receives the request and forwards the request to VLAN110.

• Shadow load balancing virtual server FW-VIP-1, which is configured to listen to VLAN110 traffic destined to any other domain, receives the request and forwards it tofirewall virtual server FW-VIP-2 because the request is destined to a physical server inNetwork Domain 2.

• In Network Domain 2, FW-VIP-2 forwards the request to VLAN 220.

• The load balancing virtual server in VLAN 220 load balances the request to one of thephysical servers, App21, App22, or App23.

• The response sent by the physical server returns by the same path through the firewallin Network Domain 2 and then to Network Domain 1 to reach the client in VLAN 11.

Isolating the Network Paths by Using Traffic Domains

442

Page 443: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Configuring Traffic DomainsTo configure network path isolation by using listen policies, do the following:

• Add listen policy expressions. Each expression specifies a domain to which traffic isdestined. You can use the VLAN ID or other parameters to identify the traffic. For moredetails, see "Client Parameters Used to Define Listen Policies."

• For each network domain, configure two virtual servers as follows:

• Create a load balancing virtual server for which you specify a listen policy thatidentifies the traffic destined for this domain. You can specify the name of anexpression created earlier, or you can create a new expression while creating thevirtual server.

• Create another load balancing virtual server, referred to as shadow virtual server,for which you specify a listen policy expression that applies to traffic destined forany domain. On this virtual server, set the service type to ANY and the IP addressand port to an asterisk (*). Enable MAC-based forwarding on this virtual server.

• Enable the L2 Connection option on both the virtual servers.

Generally, to identify a connection, the NetScaler uses the 4-tuple of client IPaddress, client port, destination IP address, and destination port. When you enablethe L2 Connection option, the Layer 2 parameters of the connection (channelnumber, MAC address, and VLAN ID) are used in addition to the normal 4-tuple.

• Add services representing the server pools in the domain, and bind them to the virtualserver.

• Configure the firewall for each domain as a service, and bind all of the firewall servicesto the shadow virtual server.

To configure traffic domains by using the command line

interfaceAt the command prompt, type the following commands:

• add policy expression <expressionName> <listenPolicyExpression>

• add lb vserver <name> <serviceType> <ip> <port> -l2conn ON -listenPolicy<expressionName>

Add a load balancing virtual server for each domain. This virtual server is for traffic ofthe same domain.

• add lb vserver <name> ANY * * -l2conn ON -m MAC -listenPolicy <expressionName>

Add a shadow load balancing virtual server for each domain. This virtual server is fortraffic of other domains.

Example

Isolating the Network Paths by Using Traffic Domains

443

Page 444: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

add policy expression e110 client.vlan.id==110add policy expression e210 client.vlan.id==210add policy expression e310 client.vlan.id==310add policy expression e11 client.vlan.id==11add policy expression e22 client.vlan.id==22add policy expression e33 client.vlan.id==33

add lb vserver LB-VIP1 HTTP 10.1.1.254 80 -persistenceType NONE -listenPolicy e11 -cltTimeout 180 -l2Conn ON

add lb vserver LB-VIP2 HTTP 10.2.2.254 80 -persistenceType NONE - listenPolicy e22 -cltTimeout 180 -l2Conn ON

add lb vserver LB-VIP3 HTTP 10.3.3.254 80 -persistenceType NONE - listenPolicy e33 -cltTimeout 180 -l2Conn ON

add lb vserver FW-VIP-1 ANY * * -persistenceType NONE -lbMethod ROUNDROBIN - listenPolicy e110 -Listenpriority 1 -m MAC -cltTimeout 120

add lb vserver FW-VIP-2 ANY * * -persistenceType NONE -lbMethod ROUNDROBIN - listenPolicy e210 -Listenpriority 2 -m MAC -cltTimeout 120

add lb vserver FW-VIP-3 ANY * * -persistenceType NONE -lbMethod ROUNDROBIN - listenPolicy e310 -Listenpriority 3 -m MAC -cltTimeout 120

add service RD-1 10.1.1.1 ANY * -gslb NONE -maxClient 0 -maxReq 0 -cip DISABLED -usip NO -useproxyport NO -sp ON -cltTimeout 120 -svrTimeout 120 -CKA NO -TCPB NO -CMP NO

add service RD-2 10.2.2.1 ANY * -gslb NONE -maxClient 0 -maxReq 0 -cip DISABLED -usip NO -useproxyport NO -sp ON -cltTimeout 120 -svrTimeout 120 -CKA NO -TCPB NO -CMP NO

add service RD-3 10.3.3.1 ANY * -gslb NONE -maxClient 0 -maxReq 0 -cip DISABLED -usip NO -useproxyport NO -sp ON -cltTimeout 120 -svrTimeout 120 -CKA NO -TCPB NO -CMP NO

bind lb vserver FW-VIP-1 RD-1

bind lb vserver FW-VIP-2 RD-2

bind lb vserver FW-VIP-3 RD-3

Parameters for configuring a servicename

Name of the service. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( ).

serverName

Either the name of a previously created server object, or the IP address of theload-balanced server that hosts this service, in either IPv4 or IPv6 format. When you

Isolating the Network Paths by Using Traffic Domains

444

Page 445: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

provide the IP address of the service, a server object is created with this IP address as itsname. You can also create a server object manually, and then select the server nameinstead of an IP address from the drop-down menu that is associated with this field.

If the server is not reachable from the NetScaler or is not active, the service isdesignated as DOWN.

serviceType

The type of connections that the service will handle. Possible values: HTTP, FTP, TCP,UDP, SSL, SSL_BRIDGE, SSL_TCP, NNTP, RPCSVR, DNS, ADNS, SNMP, RTSP, DHCPRA, ANY,SIP_UDP, DNS_TCP, ADNS_TCP, RADIUS, MYSQL, MSSQL, and RDP. Default: HTTP.

port

Port on which the service listens. The port number must be a positive number notgreater than 65534.

Parameters for configuring a virtual servername

Name of the virtual server. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( )

IPAddress

IP address of the virtual server. This IP address can be an IPv4 or IPv6 address, and isusually a public IP address. Clients send connection requests to this IP address.

serviceType

The type of services to which the virtual server distributes requests. Possible values:HTTP, FTP, TCP, UDP, SSL, SSL_BRIDGE, SSL_TCP, NNTP, DNS, DHCPRA, ANY, SIP_UDP,DNS_TCP, RTSP, PUSH, SSL_PUSH, RADIUS, RDP, MYSQL, and MSSQL. Default: HTTP

port

Port on which the virtual server listens for client connections. The port number must bebetween 0-65535.

l2conn

The tuple used to identify a connection includes the layer 2 parameters

Isolating the Network Paths by Using Traffic Domains

445

Page 446: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure traffic domains by using the configuration

utility1. Add services representing the servers, as described in "Creating a Service."

2. Add each firewall as a service:

a. In the navigation pane, expand Load Balancing, and then click Services.

b. In the details pane, click Add.

c. In the Create Service dialog box, specify values for the following parameters:

• Service Name*—The name that you assign to the service.

• Protocol*—Select ANY from the drop-down list.

• Server*—The firewall's IP address.

• Port*—Specify a value of 80.*A required parameter

d. Click Create.

e. From the Services pane, open the services you created and verify the settings.3. Configure a load balancing virtual server.

a. In the navigation pane, expand Load Balancing, and then click Virtual Servers.

b. In the details pane, click Add.

c. In the Create Virtual Server (Load Balancing) dialog box, specify values for thefollowing parameters, which are described in "Creating a Virtual Server."

• Name*

• Protocol*

• IP Address*

• Port**A required parameter

d. On the Services tab, select the corresponding services.

e. On the Advanced tab, select the L2 Connection check box and, for RedirectionMode, select MAC Based. Then, click the Listen Policy link and create the listenpolicy for the virtual server.

f. Click Create.4. Configure the shadow load balancing virtual server.

a. For the shadow virtual server, specify

Isolating the Network Paths by Using Traffic Domains

446

Page 447: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• Protocol—ANY

• IP Address*—*

• Port*—*

*A required parameter

b. Bind the firewall services to the shadow virtual server.

5. For each network domain, repeat steps 3 and 4.

6. From the Load Balancing Virtual Servers pane, open the virtual servers that you createdand verify the settings.

Isolating the Network Paths by Using Traffic Domains

447

Page 448: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

448

Configuring XenDesktop for LoadBalancing

For an improved performance in the delivery of virtual desktop applications, you canintegrate the NetScaler appliance with Citrix XenDesktop and use the NetScaler loadbalancing feature to distribute the load across the Web Interface servers and the DesktopDelivery Controller (DDC) servers.

Generally, you use XenDesktop in situations where applications are not compatible withrunning on a terminal server or XenApp, or if each virtual desktop has unique requirements.In such cases, you need one desktop host for each user that connects. However, the hostscan be pooled so that you need only one host for each currently connected user.

The core application service deployed for XenDesktop is the Desktop Delivery Controller(DDC). The DDC is installed on a server, and its main function is to register desktop hostsand broker client connections to them.

The DDC also authenticates users and manages the assembly of the users' virtual desktopenvironments by controlling the state of the desktops, and starting and stopping thedesktops.

Generally, multiple DDCs are installed to enhance availability.

The Web Interface servers provide secure access to virtual desktops. The Web Interface isthe initial connection portal to the Desktop Delivery Controller (DDC). The Web browser onthe user's device sends information to the Web server, which communicates with the serverfarm to provide the user with access to the virtual desktop.

The following figure shows the topology of a NetScaler appliance working with XenDesktop.

Page 449: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

Figure 1. Load Balancing of XenDesktop

Note: Although you can use the HTTP protocol, Citrix recommends that you use SSL forcommunication between the client and the NetScaler. You can use the HTTP protocol forcommunication between the NetScaler and the DDC servers even though you use the SSLprotocol for communication with the client.

A wizard is available for configuring basic load balancing in a XenDesktop deployment. Youcan use the wizard to configure Web interface servers and a virtual server for them, andDDC servers and a virtual server for them. The virtual servers that you configure are boundto services specified as Web Interface services and DDC services. Each virtual server isconfigured with the default load balancing method, and the default features are enabled. Amonitor is created and bound to each virtual server.

The wizard creates a basic setup, with default values for options such as the load balancingmethod, policies, persistence, and advanced settings. You can change any of the values ifnecessary.

Configuring XenDesktop for Load Balancing

449

Page 450: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

To configure load balancing for XenDesktop by usingthe configuration utility

1. In the navigation pane, click Load Balancing.

2. In the Getting Started group, click Load balancing wizard for Citrix XenDesktop.

3. Follow the instructions presented by the wizard.

Configuring XenDesktop for Load Balancing

450

Page 451: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

451

Configuring XenApp for Load Balancing

For efficient delivery of applications, you can integrate the NetScaler appliance with CitrixXenApp and use the NetScaler load balancing feature to distribute the load across theXenApp server farms. The following figure is a topology diagram of such a setup.

Figure 1. Load Balancing of XenApp

The Web Interface servers provide secure access to XenApp application resources throughthe user's Web browser. The Web Interface client presents to the users all the resources,such as applications, content, and desktops that are made available in the XenApp serverfarms. Users can access the published resources through a standard Web browser or throughthe Citrix online plug-in.

Page 452: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

The Web browser on the user's device sends information to the Web server, whichcommunicates with the servers on the server farm to provide the user with access to theresources.

The Web Interface and the XML Broker are complementary services. The Web Interfaceprovides users with access to applications, and the XML Broker evaluates the user'spermissions to determine which applications appear in the Web Interface.

The XML service is installed on all the servers in the server farm. The XML service specifiedin the Web Interface functions as an XML broker. On the basis of the user credentials passedby the Web Interface server, the XML Broker server sends a list of applications accessible tothe user.

In large enterprises where multiple Web Interface servers and XML Broker servers aredeployed, Citrix recommends load balancing these servers by using NetScaler. Configureone virtual server to load balance all of the Web Interface servers and another for all of theXML Broker servers. The load balancing method and other features can be configured on thevirtual server as required.

Note: Although you can use the HTTP protocol, Citrix recommends that you use SSL forcommunication between the client and the NetScaler. You can use the HTTP protocol forcommunication between the NetScaler and the WI servers even though you use the SSLprotocol for communication with the client.

The configuration utility provides a wizard for setting up basic load balancing for XenApp.

Through this wizard, you can configure Web Interface servers and a virtual server for them,and XML Broker servers and a virtual server for them. You can also specify the site throughwhich the status of Web Interface servers can be monitored and the software applicationused to monitor the status of the XML Broker servers.

When you complete the wizard, a basic load balancing setup is configured on the NetScaler.The specified virtual servers are created and bound to the services specified as WebInterface services and XML Broker services. Each virtual server is configured with thedefault load balancing method, and the default features are enabled. A monitor is createdand bound to each virtual server.

The wizard creates a basic setup with default values for options such as the load balancingmethod, policies, persistence, and advanced settings. You can change any of the values ifnecessary.

To configure load balancing for XenApp by using theconfiguration utility

1. In the navigation pane, click Load Balancing.

2. In the Getting Started group, click Load balancing wizard for Citrix XenApp.

3. Follow the instructions presented by the wizard.

Configuring XenApp for Load Balancing

452

Page 453: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

453

Troubleshooting Common Problems

Below are a few tips for troubleshooting common problems when configuring load balancingon the NetScaler appliance.

• When a metric bound to a monitor is present in the local and custom metric tables, addthe local prefix to the metric name if the metric is chosen from the local metric table.If the metric is chosen from the custom table, no prefix needs to be added.

• If the metric table is modified (for example, if the OID for the metric is changed), thechange is reflected in the monitoring table. SNMP queries originating from the monitorthen use the new OID.

• Load monitors cannot decide the state of the service. Therefore, setting a weight onthe load monitors is inappropriate.

• If multiple load monitors are bound to a service, then the load on the service is the sumof all the values on the load monitors bound to it. For load balancing to work properly,you must bind the same set of monitors to all the services.

• When you bind a service to a virtual server where the LB method is CUSTOMLOAD, andif the service is up, then the virtual server is put to initial round robin. It continues tobe in round robin if the service has no custom load monitors, or if at least one of thecustom load monitors is not up.

• If you disable a load monitor bound to the service, and if the service is bound to avirtual server, then the virtual server goes to round robin.

• If you disable a metric-based binding, and if this is the last active metric, then thespecific virtual server goes to round robin. A metric is disabled by setting the metricthreshold to zero.

• When a metric bound to a monitor crosses the threshold value, then that particularservice is not considered for load balancing.

If all the services have reached the threshold, then the virtual server goes into roundrobin and an error message “5xx - server busy error” is received.

• All the services that are bound to a virtual server where the load balancing methodis CUSTOMLOAD must have load monitors bound to them.

• The OIDs must be scalar variables.

• For successful load balancing, the interval must be as low as possible. If the intervalis high, the time period for retrieving the load value increases. As a result, loadbalancing takes place using improper values.

• The CUSTOMLOAD load balancing method also follows startup round robin.

• A user cannot modify the local table.

Page 454: NetScaler 9.3 Load Balancing -   · PDF fileAssigning Weights to Services ..... 146 Protecting the Load Balancing Configuration against Failure

• A maximum of 10 metrics from a custom table can be bound to the monitor.

Troubleshooting Common Problems

454