To send client requests to the best-suited CE, you have three options using ACNS:
Simplified Hybrid Routing
With SHR, your CR decides which CE to route client requests to, using coverage zone information you specify with an XML file. The coverage zone file includes the mapping of source IP subnets to CE IP address. When you register your CEs with the CDM, the CDM creates a default coverage zone file including the subnet that the CE resides on and the IP address of the CE. For example, based on the zones in Figure 14-15, the CDM will create the coverage zone file in Example 14-2. You can manually adjust the default coverage zones in the coverage zone XML file if you need toin this example, the second entry for 10..30.0/24 with metric 30 was manually added as a backup to the entry with metric 20. This way, the central branch CE can server Branch 2, if necessary.
Figure 14-15. Simplified Hybrid Routing
Example 14-2. Sample Coverage File
In order for your CR at the headquarters to receive the client A record requests, you must delegate authority to the CR for the appropriate subdomains.
Based on Figure 14-16, the following sequence takes place:
Figure 14-16. Dynamic PAC
Recall from Chapter 12, "Exploring Global Server Load Balancing," that most GSLB solutions use the client DNS server to select a site to it, which sends the client's request. GSLB assumes that the client DNS server is in close proximity to the requesting clients. However, SHR does not make this assumption, because most often clients issue DNS requests to the organization's DNS server, which is located in the corporate headquartersthe same location as the CR. This is why the CR uses the HTTP GET request from the client to determine which CE to redirect to.
Dynamic Proxy Auto-Configuration
Recall from Chapter 13 that you can configure your client browsers with direct proxy routing, by specifying the proxy that the client should use for requests. With Dynamic Proxy Autoconfiguration (PAC), you instead specify the IP address of the PAC proxy server in client browsers or media players. The PAC proxy server returns a script that the browser executes to determine which proxy to use for requests.
With Dynamic PAC in ACNS, you configure a CE as a PAC file server, create a PAC file template, and associate a coverage zone file to the template. When a user opens a browser, the browser sends a request for the PAC file to the PAC file server CE, which populates the PAC file on-the-fly with edge-CE IP addresses from the coverage zone file, based on the source IP address of the requesting client. The client browser executes the script in the PAC file for each request that the client makes, to select the CE to which it sends the request. Figure 14-16 illustrates the traffic flow for Dynamic PAC.
When you write the PAC file template for the PAC file server, you must specify a function called FindProxyForURL. When executed by the client browser, FindProxyForURL returns a list of the closest IP addresses to use as the proxy for all browser requests. Two examples of resulting strings returned from this function are
The client attempts to connect to the entries from left to right until it finds a CE that is available or when it reaches the DIRECT keyword. Then the browser sends the request directly to the origin server. These sample strings are based on the two coverages for clients that are located within Branch 2 subnet 10.1.30.0/24, in Example 14-2. The coverage with the lower metric is listed first in the "PROXY" string, and therefore the client browser attempts to connect to this CE first.
You can use the following macros in the PAC template that the PAC file server substitutes with CEs from the coverage zone file, where n can be a value between 1 and 5.
You can use these macros in the template as literal constants within the FindProxyForURL function. For example, you can use the simple function in Example 14-3 to return the IP addresses of CEs that are ranked in terms of proximity to the client. If no proxy is available, clients go directly to the origin server.
Example 14-3. Sample PAC File Template
The parameter called url is the requested URL within the client's HTTP GET request. The host parameter is the domain name within the requested URL (for example, http://www.cisco.com is a URL, and www.cisco.com is the associated host). You can use these parameters if you need to handle certain URLs differently from others, but you may not need to use these parameters at all in your PAC file template, as demonstrated with Example 14-3.
If a client browser in Branch 2 requests the PAC file, the headquarters CE returns the file in Example 14-4 based on the source IP address of the client.
Example 14-4. Sample PAC File
When the client at Branch 2 runs this function, the following value is returned:
You should include checks in the script to ensure that the PAC file server populates the macros with data from the coverage file (that is, "if (ce2 != "")"). For example, if you did not include these checks and the coverage had only a single entry for the specific requesting source, the resultant PROXY string would contain an erroneous entry:
Dynamic PAC is useful in roaming office environments, where clients move from office-to-office or home-to-office but still require pre-positioned content. A disadvantage with Dynamic PAC is that you still have to configure all browsers with the central PAC file server URL.