Cisco CSS 11000 Series Content Services Switches

WebNS 4.0 HTTP Header Load Balancing Application Guide

Document ID: 3839

Updated: Mar 07, 2006



This document provides a sample configuration to apply Cisco WebNS Software Version 4.0 HTTP header load balancing to the Content Services Switch (CSS).



There are no specific requirements for this document.

Components Used

This document is not restricted to specific software and hardware versions.

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.


Refer to the Cisco Technical Tips Conventions for more information on document conventions.

Background Information

In some cases, groups of web servers can contain different representations of the same content that has been modified for different end users. For example, a client that runs a browser on a Palm Pilot may want the same content with less graphics. Or, Swedish users may want to see the content in Swedish or in English, but not in German.

HTTP header load balancing allows the CSS to make more intelligent load-balancing decisions on the basis of HTTP header information in the client request. HTTP header load balancing eliminates the need for the content provider to duplicate content in various forms across all the servers.

This feature enables you to:

  • Split the web farm for different types of users

  • Intelligently bypass noncacheable traffic

  • Prioritize traffic from normal client browsers over the metasearch services

The CSS can use these HTTP header fields in order to make load-balancing decisions:

  msisdn              HTTP extension MSISDN request header
  referer             HTTP Referer request header
  accept              HTTP Accept request header
  encoding            HTTP Accept-Encoding request header
  charset             HTTP Accept-Charset request header
  connection          HTTP Connection general header
  cookies             HTTP Cookie header
  cache-control       HTTP Cache-Control general header
  pragma              HTTP Pragma general header
  host                HTTP Host request header
  language            HTTP Accept-Language request header
  user-agent          HTTP User-Agent request header
  request-line        HTTP Request-Line

With WebNS Software Version 7.x, the CSS can use a custom HTTP header-field type in order to make load-balancing decisions. Here is a description:

  custom              HTTP custom header field tag


In this section, you are presented with the information to configure the features that this document describes.

Note: Use the Command Lookup Tool (registered customers only) to obtain more information on the commands in this section.

You can configure the CSS to inspect incoming content requests for HTTP header-field information. The CSS then directs the requests to the servers that are designed to handle the type of content that is requested. HTTP header load balancing allows a web hoster to specify keywords in the HTTP header to use for server selection.

The HTTP header load balancing feature introduces these new command-line interface (CLI) commands and modes:

  • header-field-group command

  • header-field command

  • header-field-group mode

In order to enable the HTTP header field load-balance function, create a header-field group. Issue the header-field-group command and the header-field command. Then, associate them with a content rule that has the group of services that you want to use for balancing. Use header-field-group in owner/content mode for the content rule.


This document uses these configurations:

Create Header-Field Group
Issue the header-field-group command in configuration mode in order to add or remove a header-field group. The syntax of the command is header-field-group name . The header-field-group command takes you to header-field-group mode. The name is a character string to identify the header-field group, and the length is 1 to 32 bytes. These examples add and remove the Palm Pilot header-field group:
CS100(config)#header-field-group palmpilot 
CS100(config)#no header-field-group palmpilot
The command to add a header field to a header-field group is header-field. The syntax is:
header-field name field_type operator ["header_string"] [search_length] 
  • header-field is the command to issue in header-field-group mode. The command defines a new entry for a header field in the group.
  • name is a string from 1 to 32 bytes in length that is used to identify this header field among others. The name is a requirement because you can use the same field type multiple times in the same header-field group.
  • field_type includes a request line and all the commonly used header fields in an HTTP request header. The field types are:
    • user-agent
    • msisdn
    • language
    • host
    • cache-control
    • pragma
    • encoding
    • charset
    • connection
    • referer
    • accept
    • request-line
    • cookies
    • custom

      Note: The custom field type is in WebNS version 7.x.

  • operator includes:
    • exist
    • not-exist
    • equal
    • not-equal
    • contain
    • not-contain
    For user-agent, the contain operation is most likely to be used. Use the exist and not-exist operators to check if the existence of a specified header field is in the content request header. Thus, you need no more parameters after those operators. Use the equal and not-equal operators in order to match the defined keywords to the contents of the specified header field. Use the contain and not-contain operators to match the configured keywords to a substring in the contents of the specified field type.
  • header_string is a string of characters to be used in the operation. The length of the header string is from 1 to 32 bytes.
  • The optional search_length is the length of the specified header field to be used for the operation. If you do not specify the search length, the entire header field, delimited by a Carriage Return (CR) and Line Feed (LF), is used for the operation.
These are examples for content rules with a user-agent header-field configuration:
  • Add a user-agent header-field configuration to a Palm Pilot tag list.
    CS100(config- header-field-group [palmpilot])#header-field palm1 user-agent
    contain "Palm"

    Note: This command should be on one line.

  • Delete a user-agent header-field configuration from a Palm Pilot header-field group.
    CS100(config- header-field-group [palmpilot])#no header-field palm1

Add Header-Field Group to the Content Rule
Issue the header-field-rule command within the owner/content mode in order to configure a content rule with a predefined header-field group. Multiple content rules can use the same header-field group. Here is the syntax of this command:
header-field-rule group [weight weight_value] 
  • header-field-rule is the command that associates the predefined header-field group with the content rule.
  • group is the name of the preconfigured header-field group. The length is from 1 to 32 bytes.
  • The weight subcommand is optional. Use it to assign a weight value (1 through 1024) to the content rule with the specified header-field group. You can use this subcommand to break a tie in the rule selection if there are multiple rules that are equally specific with use of the header-field group. The rule that has the highest weight value is chosen first when there is more than one rule that is matched on the client request.
  • The weight_value is rule-specific. Different rules that use the same header-field group can have different weight values. If you do not use weight, the CSS chooses the first matched rule for a request.
These are examples that add and delete a content tag list to a content rule for the user-agent configuration:
  • Add a Palm Pilot header-field group to a Layer 5 (L5) content rule configuration.
    palmpilot weight 20

    Note: Each of these commands should be on one line.

  • Delete a Palm Pilot header-field group from a content rule configuration.
    CS100(config-owner-content[layer5])#no header-field-rule 

    Note: This command should be on one line.

Note: When you use HTTP header fields for load balancing, understand that the values in the fields are not mutually exclusive. For example, suppose that you want to load balance a subset of French users to one set of machines, but you also want to differentiate Microsoft Internet Explorer (IE) users from Netscape users. In this case, it is more important that you send the French users to a specific machine than whether they use Netscape or IE. Therefore, you must be sure that you weight the content rule with the language that contains "fr" with a higher value than the weight of the content rules for Netscape and IE.

No Cookie Rule Example
!Generated on 07/04/2000 10:54:28 
!Active version: ap0350067a 
!*************************** GLOBAL ***************************
ip route 1 
!************************** CIRCUIT **************************
circuit VLAN1
ip address
!************************** SERVICE **************************
service cookie-server2 
  ip address 
service cookie_server 
  ip address 
!********************* HEADER FIELD GROUP *********************
header-field-group cookie 
  description "client has cookie" 
  header-field cookie cookies exist 
header-field-group no-cookie 
  description "client has no cookie"
  header-field nocookie cookies not-exist 
!*************************** OWNER ***************************
 content cookie_rule 
    vip address 
    url "/*" 
    header-field-rule cookie weight 10 
    advanced-balance cookies
    add service cookie_server
    add service cookie-server2
    port 80 
    protocol tcp 
 content login 
    protocol tcp 
    vip address 
    port 80 
    url "/" 
    advanced-balance cookies
    add service cookie_server 
    add service cookie-server2
 content no_cookie_rule 
    protocol tcp 
    vip address 
    port 80 
    url "/*" 
    header-field-rule no-cookie weight 20 
    redirect "" 


Use this section to confirm that your configuration works properly.

The Output Interpreter Tool (registered customers only) (OIT) supports certain show commands. Use the OIT to view an analysis of show command output.

Issue the show header-field-group all command in order to verify the configuration:

CS100#show header-field-group all
header field groups:

If the header field group is cookie, the client has cookie header-field cookie cookies.

If the header field group is no-cookie, the client does not have a cookie header field.


There is currently no specific troubleshooting information available for this configuration.

Related Information

Updated: Mar 07, 2006
Document ID: 3839