The Web Cache Communications Protocol (WCCP) is used to redirect traffic (usually Web page requests) to another device in real time. The most common use for WCCP is redirecting Web traffic to a server that provides Web caching, filtering, or other services.
You can enable WCCP on your router, but you should only use WCCP if you have an external machine performing Web caching, logging, reporting, or filtering. Developed by Cisco, WCCP has two versions: WCCPv1 and WCCPv2.
This is how WCCP works:
- A Web browser makes a request, which goes to a router.
- The router intercepts the request.
- The router redirects the request to a new location inside a generic routing encapsulation (GRE) frame to prevent any modifications to the original packet.
- The new device — typically a Web appliance of some type–can choose to masquerade as the real server or send it somewhere else. Assuming it accepts the packet, the new device can provide a response.
The benefit to using WCCP is that we assume the appliance provides services that the router does not–for example, Web content filtering, caching, logging, security, or authentication. I’ve seen WCCP used with Squid proxy servers, Blue Coat Web caching and content filtering appliances, and Cisco content caching engines.
The benefit to transparently routing traffic to a Web appliance is that you don’t have to make any changes to your Web browsers (and you don’t have to configure a proxy server). In addition, Web caching appliances offer these benefits:
- They lower response times for Web requests.
- They optimize bandwidth utilization of the Internet circuit.
- They log Web requests and report on them.
- They filter requested content.
Not surprisingly, WCCPv2 offers a number of features that WCCPv1 does not. WCCPv2 supports protocols other than HTTP, multiple routers, MD5 security, and load distribution.
With WCCP, you can use a “cache cluster” for load balancing, scaling, and fault tolerance. You can also use Hot Standby Router Protocol (HSRP) with your routers to provide redundancy for your WCCP routers.
How do you configure WCCP? The router is the easiest part of any WCCP configuration. Here’s a sample configuration:
cellr1(config)# ip wccp version 2
cellr1(config)# ip wccp web-cache password yourpassword
cellr1(config)# interface F0/0
cellr1(config-if)# ip wccp web-cache redirect out
cellr1(config-if)# ^Z
This tells the router that it should accept WCCP registration requests that use yourpassword as the password. It also tells the WCCP cache engine which routers are running WCCP and registers the cache with the router.
Checking the router’s WCCP status is done as follows:
cellr1# show ip wccp
Global WCCP information:
Router information:
Router Identifier: -not yet determined-
Protocol Version: 2.0
Service Identifier: 2
Number of Cache Engines: 0
Number of routers: 0
Total Packets Redirected: 0
Redirect access-list: -none-
Total Packets Denied Redirect: 0
Total Packets Unassigned: 0
Group access-list: -none-
Total Messages Denied to Group: 0
Total Authentication failures: 0
cellr1#
WCCP isn’t something everyone needs to configure, but it’s still important to understand the underlying concepts.