Configuring Web Cache Services Using WCCP

The Web Cache Communication Protocol (WCCP) is a Cisco-developed content-routing technology that allows you to integrate cache engines (such as the Cisco Cache Engine 550) into your network infrastructure. Cisco IOS Release 12.1 and later releases allow the use of either Version 1 (WCCPv1) or Version 2 (WCCPv2) of the WCCP. This chapter describes how to configure your router to redirect traffic to cache engines (web caches), describes how to manage cache engine clusters (cache farms), and outlines the benefits of using WCCPv2.

The tasks in this chapter assume that you have already configured cache engines on your network. For specific information on hardware and network planning associated with Cisco Cache Engines and WCCP, see the Product Literature and Documentation links available on the Cisco.com Web Scaling site at http://www.cisco.com/warp/public/cc/pd/cxsr/ces/index.shtml.

To identify hardware or software image support for a specific feature, use Feature Navigator on Cisco.com to search for information about the feature or refer to the software release notes for a specific release. For more information, see the "Identifying Platform Support for Cisco IOS Software Features" section in the "About Cisco IOS Software Documentation" chapter.

WCCP enables Cisco IOS routing platforms to transparently redirect content requests. The main benefit of transparent redirection is that users need not configure their browsers to use a web proxy. Instead, they can use the target URL to request content, and have their requests automatically redirected to a cache engine. The word "transparent" is this case means that the end user does not know that a requested file (such as a web page) came from the cache engine instead of from the originally specified server.

When a cache engine receives a request, it attempts to service it from its own local cache. If the requested information is not present, the cache engine issues its own request to the originally targeted server to get the required information. When the cache engine retrieves the requested information, it forwards it to the requesting client and caches it to fulfill future requests, thus maximizing download performance and substantially reducing transmission costs.

WCCP enables a series of cache engines, called a cache engine cluster, to provide content to a router or multiple routers. Network administrators can easily scale their cache engines to handle heavy traffic loads through these clustering capabilities. Cisco clustering technology enables each cache member to work in parallel, resulting in linear scalability. Clustering cache engines greatly improves the scalability, redundancy, and availability of your caching solution. You can cluster up to 32 cache engines to scale to your desired capacity.

Understanding WCCPv1 Configuration

With WCCP-Version 1, only a single router services a cluster. In this scenario, this router is the device that performs all the IP packet redirection. Figure 29 illustrates how this configuration appears.

Content is not duplicated on the cache engines. The benefit of using multiple caches is that you can scale a caching solution by clustering multiple physical caches to appear as one logical cache.

The following sequence of events details how WCCPv1 configuration works:

1. Each cache engine is configured by the system administrator with the IP address of the control router. Up to 32 cache engines can connect to a single control router.

2. The cache engines send their IP addresses to the control router using WCCP, indicating their presence. Routers and cache engines communicate to each other via a control channel; this channel is based on UDP port 2048.

3. This information is used by the control router to create a cluster view (a list of caches in the cluster). This view is sent to each cache in the cluster, essentially making all the cache engines aware of each other. A stable view is established after the membership of the cluster remains the same for a certain amount of time.

4. Once a stable view has been established, one cache engine is elected as the lead cache engine. (The lead is defined as the cache engine seen by all the cache engines in the cluster with the lowest IP address). This lead cache engine uses WCCP to indicate to the control router how IP packet redirection should be performed. Specifically, the lead cache engine designates how redirected traffic should be distributed across the cache engines in the cluster.

Understanding WCCPv2 Configuration

Multiple routers can use WCCPv2 to service a cache cluster. This is in contrast to WCCPv1, in which only one router could redirect content requests to a cluster.Figure 30 illustrates a sample configuration using multiple routers.

Figure 30 Cisco Cache Engine Network Configuration Using WCCP v2

The subset of cache engines within a cluster and routers connected to the cluster that are running the same service is known as a service group. Available services include TCP and User Datagram Protocol (UDP) redirection.

Using WCCPv1, the cache engines were configured with the address of the single router. WCCPv2 requires that each cache engine be aware of all the routers in the service group. To specify the addresses of all the routers in a service group, you must choose one of the following methods:

•Unicast—A list of router addresses for each of the routers in the group is configured on each cache engine. In this case the address of each router in the group must be explicitly specified for each cache engine during configuration.

•Multicast—A single multicast address is configured on each cache engine. In the multicast address method, the cache engine sends a single-address notification that provides coverage for all routers in the service group. For example, a cache engine could indicate that packets should be sent to a multicast address of 224.0.0.100, which would send a multicast packet to all routers in the service group configured for group listening using WCCP (see the ip wccp group-listen interface configuration command for details).

The multicast option is easier to configure because you need only specify a single address on each cache engine. This option also allows you to add and remove routers from a service group dynamically, without needing to reconfigure the cache engines with a different list of addresses each time.

The following sequence of events details how WCCPv2 configuration works:

1. Each cache engine is configured with a list of routers.

2. Each cache engine announces its presence and a list of all routers with which it has established communications. The routers reply with their view (list) of cache engines in the group.

3. Once the view is consistent across all cache engines in the cluster, one cache engine is designated as the lead and sets the policy that the routers need to deploy in redirecting packets.

The following sections describe how to configure WCCPv2 on routers so they may participate in a service group.

Support for Services Other than HTTP

WCCPv2 allows redirection of traffic other than HTTP (TCP port 80 traffic), including a variety of UDP and TCP traffic. WCCPv1 supported the redirection of HTTP (TCP port 80) traffic only. WCCPv2 supports the redirection of packets intended for other ports, including those used for proxy-web cache handling, File Transfer Protocol (FTP) caching, FTP proxy handling, web caching for ports other than 80, and Real Audio, video, and telephony applications.

To accommodate the various types of services available, WCCPv2 introduces the concept of multiple service groups. Service information is specified in the WCCP configuration commands using dynamic services identification numbers (such as "98") or a predefined service keywords (such as "web-cache"). This information is used to validate that service group members are all using or providing the same service.

The cache engines in service group specify traffic to be redirected by protocol (TCP or UDP) and port (source or destination). Each service group has a priority status assigned to it. Packets are matched against service groups in priority order.

Support for Multiple Routers

WCCPv2 allows multiple routers to be attached to a cluster of cache engines. The use of multiple routers in a service group allows for redundancy, interface aggregation, and distribution of the redirection load.

MD5 Security

WCCPv2 provides optional authentication that enables you to control which routers and cache engines become part of the service group using passwords and the HMAC MD5 standard. Shared-secret MD5 one-time authentication (set using the ip wccp [password [0-7] password] global configuration command) enables messages to be protected against interception, inspection, and replay.

Web Cache Packet Return

If a cache engine is unable to provide a requested object it has cached due to error or overload, the cache engine will return the request to the router for onward transmission to the originally specified destination server. WCCPv2 provides a check on packets that determines which requests have been returned from the cache engine unserviced. Using this information, the router can then forward the request to the originally targeted server (rather than attempting to resend the request to the cache cluster). This provides error handling transparency to clients.

Typical reasons why a cache engine would reject packets and initiate the packet return feature include the following:

•Instances when the cache engine is overloaded and has no room to service the packets

•Instances when the cache engine is filtering for certain conditions that make caching packets counterproductive (for example, when IP authentication has been turned on)

Load Distribution

WCCPv2 can be used to adjust the load being offered to individual cache engines to provide an effective use of the available resources while helping to ensure high quality of service (QoS) to the clients. WCCPv2 allows the designated cache to adjust the load on a particular cache and balance the load across the caches in a cluster. WCCPv2 uses three techniques to perform load distribution:

•Hot Spot Handling—Allows an individual hash bucket to be distributed across all the cache engines. Prior to WCCPv2, information from one hash bucket could only go to one cache engine.

•Load Balancing—Allows the set of hash buckets assigned to a cache engine to be adjusted so that the load can be shifted from an overwhelmed cache engine to other members that have available capacity.

•Load Shedding—Enables the router to selectively redirect the load to avoid exceeding the capacity of a cache engine.

The use of these hashing parameters prevents one cache from being overloaded and reduces the potential for bottlenecking.

Restrictions for WCCPv2

The following limitations apply to WCCP v2:

•WCCP works only with IP networks.

•For routers servicing a multicast cluster, the Time To Live (TTL) value must be set at 15 or fewer.

•Because the messages may now be IP multicast, members may receive messages that will not be relevant or are duplicates. Appropriate filtering needs to be performed.

•Service groups can comprise up to 32 cache engines and 32 routers.

•All cache engines in a cluster must be configured to communicate with all routers servicing the cluster.

•Multicast addresses must be from 224.0.0.0 to 239.255.255.255.

Configuring WCCP

The following configuration tasks assume that you have already installed and configured the cache engines you want to include in your network. You must configure the cache engines in the cluster before configuring WCCP functionality on your routers. Refer to the Cisco Cache Engine User Guide for cache engine configuration and setup tasks.

IP must be configured on the router interface connected to the cache engines and on the router interface connected to the Internet. Note that Cisco Cache Engines require use of a Fast Ethernet interface for a direct connection. Examples of router configuration tasks follow this section. For complete descriptions of the command syntax, refer to the Release 12.2 Cisco IOS Configuration Fundamentals Command Reference.

Perform the tasks found in the following sections to configure WCCP on a router:

Specifying a Version of WCCP

Until you configure a WCCP service using the ip wccp {web-cache |service-number} global configuration command, WCCP is disabled on the router. The first use of a form of the ip wccp command enables WCCP. By default WCCPv2 is used for services, but you can use WCCPv1 functionality instead. To change the running version of WCCP from Version 2 to Version 1, or to return to WCCPv2 after an initial change, use the following command in global configuration mode:

Command

Purpose

Router(config)# ip wccp version {1 | 2}

Specifies which version of WCCP to configure on a router. WCCPv2 is the default running version.

WCCPv1 does not use the WCCP commands from earlier Cisco IOS versions. Instead, use the WCCP commands documented in this chapter. If a function is not allowed in WCCPv1, an error prompt will be printed to the screen. For example, if WCCPv1 is running on the router and you try to configure a dynamic service, the following message will be displayed: "WCCP V1 only supports the web-cache service." The show ip wccp EXEC command will display the WCCP protocol version number that is currently running on your router.

Configuring a Service Group Using WCCPv2

WCCPv2 uses service groups based on logical redirection services, deployed for intercepting and redirecting traffic. The standard service is web cache, which intercepts TCP port 80 (HTTP) traffic and redirects that traffic to the cache engines. This service is referred to as a well-known service, because the characteristics of the web cache service are known by both the router and cache engines. A description of a well-known service is not required beyond a service identification (in this case, the Command Line Interface (CLI) provides a web-cache keyword in the command syntax).

In addition to the web cache service, there can be up to seven dynamic services running concurrently in a service group.

Note More than one service can run on a router at the same time, and routers and cache devices can be part of multiple service groups at the same time.

The dynamic services are defined by the cache engines; the cache instructs the router which protocol or ports to intercept, and how to distribute the traffic. The router itself does not have information on the characteristics of the dynamic service group's traffic, because this information is provided by the first web cache to join the group. In a dynamic service, up to eight ports can be specified within a single protocol.

Cisco Cache Engines, for example, use dynamic service 99 to specify a reverse-proxy service. However, other cache devices may use this service number for some other service. The following configuration information deals with enabling general services on Cisco routers. Refer to the cache server documentation for information on configuring services on cache devices.

To enable a service on a router, use the following commands, beginning in global configuration mode:

Specifies a web-cache or dynamic service to enable on the router, specifies the IP multicast address used by the service group, specifies any access lists to use, specifies whether to use MD5 authentication, and enables the WCCP service.

Step 2

Router(config)# interfacetype number

Specifies an interface to configure and enters interface configuration mode.

As indicated by the out and in keyword options in the ip wccp service redirect command, redirection can be specified for outbound interfaces or inbound interfaces. Inbound traffic can be configured to use Cisco Express Forwarding (CEF), Fast Forwarding, or Process Forwarding.

Configuring WCCP for redirection for inbound traffic on interfaces allows you to avoid the overhead associated with CEF forwarding for outbound traffic. Setting an output feature on any interface results in the slower switching path of the feature being taken by all packets arriving at all interfaces. Setting an input feature on an interface results in only those packets arriving at that interface taking the configured feature path; packets arriving at other interfaces will use the faster default path. Configuring WCCP for inbound traffic also allows packets to be classified before the routing table lookup, which translates into faster redirection of packets.

Specifying a Web Cache Service

Using the specific forms of the above commands, you can configure a web-cache service as follows:

Command

Purpose

Step 1

Router(config)# ip wccp web-cache

Enables the web cache service on the router.

Step 2

Router(config)# interfacetype number

Targets an interface number for which the web cache service will run, and enters interface configuration mode.

Step 3

Router(config-if)# ip wccp web-cache redirect {out | in}

Enables the check on packets to determine if they qualify to be redirected to a web cache, using the interface specified in Step 2.

Excluding Traffic on a Specific Interface from Redirection

To exclude any interface from redirecting inbound traffic, use the following commands, beginning in global configuration mode:

Command

Purpose

Step 1

Router(config)# interfacetype number

Specifies an interface to configure, and enters interface configuration mode.

Step 2

Router(config-if)# ip wccp redirect exclude in

Allows inbound packets on this interface to be excluded from redirection.

Registering a Router to a Multicast Address

If you decide to use the multicast address option for your service group, you must configure the router to listen for the multicast broadcasts on an interface using the following commands:

Enables the reception of IP multicast packets (content originating from the cache engines) on the interface specified in Step 2.

For network configurations where redirected traffic needs to traverse an intervening router, the router being traversed must be configured to perform IP multicast routing. You must configure the following two components to enable traversal over an intervening router:

•Enable the interfaces to which the cache engines will connect to receive multicast transmissions using the ip wccp group-listen interface configuration mode command (note that earlier Cisco IOS versions required the use of the ip pim interface configuration command).

Using Access Lists for a WCCP Service Group

To configure the router to use an access list to determine which traffic should be directed to which cache engines, use the following commands, beginning in global configuration mode:

Creates an access list that enables or disables traffic redirection to the cache engine.

Step 2

Router(config)# ip wccp web-cache redirect-listaccess-list

Sets the access list used to enable redirection.

Setting a Password for a Router and Cache Engines

MD5 password security requires that each router and cache engine that wants to join a service group be configured with the service group password. The password can consist of up to seven characters. Each cache engine or router in the service group will authenticate the security component in a received WCCP packet immediately after validating the WCCP message header. Packets failing authentication will be discarded.

To configure an MD5 password for use by the router in WCCP communications, use the following command in global configuration mode:

Command

Purpose

Router(config)# ip wccp web-cache passwordpassword

Sets an MD5 password on the router.

Verifying and Monitoring WCCP Configuration Settings

Use the following commands in EXEC mode, as needed to verify and monitor the configuration settings for WCCP:

Command

Purpose

Router# show ip wccp [web-cache | service-number]

Displays global information related to WCCP, including the protocol version currently running, the number of cache engines in the routers service group, which cache engine group is allowed to connect to the router, and which access list is being used.

Router# show ip wccp {web-cache|service-number} detail

Queries the router for information on which cache engines of a specific service group the router has detected. The information can be displayed for either the web cache service or the specified dynamic service.

Router# show ip interface

Displays status about whether any ip wccp redirection commands are configured on an interface. For example, "Web Cache Redirect is enabled / disabled."

Router# show ip wccp {web-cache|service-number} view

Displays which devices in a particular service group have been detected and which cache engines are having trouble becoming visible to all other routers to which the current router is connected. The view keyword indicates a list of addresses of the service group. The information can be displayed for either the web cache service or the specified dynamic service. For further troubleshooting information, use the show ip wccp {web-cache | service number} service command.

Running a Web Cache Service Example

The following example shows a web cache service configuration session:

router# configure terminal

router(config)# ip wccp web-cache

router(config)# interface ethernet 0

router(config-if)# ip wccp web-cache redirect out

Router(config-if)# ^Z

Router# copy running-config startup-config

The following example shows a configuration session in which redirection of HTTP traffic arriving on interface 0/1 is enabled:

Router# configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)# interface ethernet 0/1

Router(config-if)# ip wccp web-cache redirect in

Router(config-if)# ^Z

Router# show ip interface ethernet 0/1

.

.

.

WCCP Redirect inbound is enabled

WCCP Redirect exclude is disabled

.

.

.

Running a Reverse Proxy Service Example

The following example assumes you a configuring a service group using Cisco Cache Engines, which use dynamic service 99 to run a reverse proxy service:

router# configure terminal

router(config)# ip wccp 99

router(config)# interface ethernet 0

router(config-if)# ip wccp 99 redirect out

Registering a Router to a Multicast Address Example

The following example shows how to register a router to a multicast address of 224.1.1.100:

Router(config)# ip wccp web-cache group-address 224.1.1.100

Router(config)# interface ethernet 0

Router(config-if)# ip wccp web cache group-listen

The following example shows a router configured to run a reverse proxy service, using the multicast address of 224.1.1.1. Redirection applies to packets outgoing via interface ethernet 0:

Router(config)# ip wccp 99 group-address 224.1.1.1

Router(config)# interface ethernet 0

Router(config-if)# ip wccp 99 redirect out

Using Access Lists Example

To achieve better security, you can use a standard access list to notify the router which IP addresses are valid addresses for a cache engine attempting to register with the current router. The following example shows a standard access list configuration session where the access list number is 10 for some sample hosts:

router(config)# access-list 10 permit host 11.1.1.1

router(config)# access-list 10 permit host 11.1.1.2

router(config)# access-list 10 permit host 11.1.1.3

router(config)# ip wccp web-cache group-list 10

To disable caching for certain clients, servers, or client/server pairs, you can use WCCP access lists. The following example shows that any requests coming from 10.1.1.1 to 12.1.1.1 will bypass the cache, and that all other requests will be serviced normally:

Router(config)# ip wccp web-cache redirect-list 120

Router(config)# access-list 120 deny tcp host 10.1.1.1 any

Router(config)# access-list 120 deny tcp any host 12.1.1.1

Router(config)# access-list 120 permit ip any any

The following example configures a router to redirect web-related packets received via interface ethernet 0/1, destined to any host except 209.165.196.51:

Router(config)# access-list 100 deny ip any host 209.165.196.51

Router(config)# access-list 100 permit ip any any

Router(config)# ip wccp web-cache redirect-list 100

Router(config)# interface Ethernet 0/1

Router(config-if)# ip wccp web-cache redirect in

Setting a Password for a Router and Cache Engines Example

The following example shows a WCCPv2 password configuration session where the password is alaska1:

router# configure terminal

router(config)# ip wccp web-cache password alaska1

Verifying WCCP Settings Example

To verify your configuration changes, use the more system:running-config EXECcommand. The following example shows that the both the web cache service and dynamic service 99 are enabled on the router: