Download - Redirection and Load Balancing
Redirection and Load Balancing
Herng-Yow Chen
Outline
HTTP redirection DNS redirection Anycast routing Policy routing IP MAC forwarding IP address forwarding
Outline (cont.)
The Web Cache Coordination Protocol (WCCP) The Intercache Communication Protocol (ICP) The Hyper Text Caching Protocol (HTCP) The Network Element Control Protocol (NECP) The Cache Array Routing Protocol (CARP) The Web Proxy Autodiscovery Protocol (WPAD)
Why Redirect? Redirection is a fact of life in the modern Web
because HTTP applications always want to do three things:
Perform HTTP transactions reliably Minimize delay Conserve network bandwidth
For these reasons, web content often is distribute in multiple locations.
Redirection can be considered as a set of techniques that help to find “best” distributed content.
Redirection vs. load balancing Most redirection deployments include some form of load
balancing. Conversely, any form of load balancing involved redirection
techniques.
Where to redirect General techniques: many redirection techniques
work for web servers, proxies, caches, and gateways because of their common, server-like traits.
Specialized techniques: specially designed for a particular class of endpoint.
Web servers handle requests on a per-IP basis. Distributing requests to duplicate servers means that each request for a specific URL should be sent to an optimal web server (the one nearest to the client, or the least-loaded one, or some other optimization).
Proxies tend to handle requests on a per-protocol basis, all HTTP traffic in the neighborhood of a proxy should go through the proxy.
Overview of redirection protocols
The goal of redirection is to send HTTP messages to available web servers as quickly as possible. Several mechanisms can be provided for redirection: The browser application’s proxy configura
tion. (only for redirecting traffic to proxies) HTTP redirections. DNS resolvers. (can be used for redirecting t
raffic to any server). TCP/IP Routing (e.g. Routers and switches)
HTTP redirections
How it works (next slide)
Basis for rerouting (many options) From round-robin load balancing, to minimizing latency, To choosing the shortest path
Limitation Can be slow – every transaction involves the
extra redirect step. Also, the first server must be able to handle the request load
HTTP Redirections
Alice
Bob
Internet161.58.228.45
161.58.228.46161.58.228.47www.joes-hardware.com
(a)Alice sends HTTP request to www.joes.hardware.com
(b)Server returns 302redirect to 161.58.228.45
(c) Browser resends HTTP request,this time to
161.58.228.45
Alice
BobInternet
161.58.228.45161.58.228.46
161.58.228.47www.joes-hardware.com
(d)Bob sends HTTP request to www.joes.hardware.com
(e)Server returns 302redirect to 161.58.228.46
(f)Browser resends HTTP request,this time to 161.58.228.46
HTTP/1.0 302 RedirectionLocations: http://161....
HTTP Redirection (cont.)
Several disadvantages A significant amount of processing power
is required from the original server. (Sometime almost as much server horse-power is required to issue the redirect as would be to serve up the page itself.)
User delays are increased, because two round trips are required to access pages.
If the redirecting server is broken, the site will be broken.
DNS redirections
How it works (next slide) Try nslookup ccsun.ncnu.edu.tw, www.yaoo.com
Basis for rerouting (many options) From round-robin load balancing, to minimizing latency, To choosing the shortest path
Limitation Need to configure DNS server
DNS Redirection
router
Backbone network
Switch
Edge network
www.joes-hardware.com
www.joes-hardware.com
www.joes-hardware.comwww.joes-hardware.com
10.10.10.3
Server3
10.10.10.2
Server2
10.10.10.1
Server1
10.10.10.4
Server4
DNS server
Decides whether to resolve to
10.10.10.1,
10.10.10.2,
10.10.10.3,
10.10.10.4
DNS round robin for load balancing
Alice
Bob
Internet207.25.71.5
207.25.71.6207.25.71.7DNS Server
(a)Alice asks DNS for IP address of www.cnn.com
(b) DNS replies with 207.25.71.5
(c) Alice sends HTTP request to 207.25.71.5
Alice
BobInternet
DNS Server
(d)Bob asks DNS for IP address of www.cnn.com
(eDNS replies with 207.25.71.6
(f) Bob sends HTTP request to 207.25.71.5207.25.71.5
207.25.71.6207.25.71.7
The impact of DNS caching
DNS address rotation spreads the load around, because each DNS lookup to a server gets a different ordering of server addresses.
However, this load balancing isn’t perfect, because the results of the DNS lookup may be memorized and reused by applications, operating systems, and some primitive child DNS servers.
Many web browsers perform a DNS lookup for a host but then use the same address over and over again, to eliminate the cost of DNS lookups and because some servers prefer to keep talking to the same client.
The impact of DNS caching Furthermore, many OSs perform the DNS look
up automatically, and cache the result, but don’t rotate the addresses.
Consequently, DNS round robin generally doesn’t balance the load of a single client – one client typically will be stuck to one server for a long time.
However, it can spread the aggregate load of multiple clients. As long as there is a modestly large number of clients with similar demand, the load will be relatively well distributed across servers.
Other DNS-based redirection algorithms
Load-balancing algorithms DNS servers keep track of the load on the web
servers and place the least-loaded web servers at the front of the list.
Proximity-routing algorithms DNS servers can attempt to direct users to
nearby web servers, when the farm of web servers is geographically dispersed.
Fault-masking algorithms DNS servers can monitor the health of the
network and route requests away from service interruptions or other faults.
DNS request involving authoritative server
DNS-based redirection (cont.)
Typically, the DNS server that runs sophisticated server-tracking algorithm is an authoritative server that is under the control of the content provider.
Several distributed hosting services use this DNS redirection model.
One drawback The authoritative DNS serer uses to make its
decision is the IP address of the local DNS server, Not the IP address of the client.
Anycast Addressing
router
Backbone network
Switch
Edge network
www.joes-hardware.com
www.joes-hardware.com
www.joes-hardware.com
10.10.10.3
Server3
10.10.10.2
Server2
10.10.10.1
Server1
router
router
IP MAC Forwarding
Client MAC 1
Client MAC 2
Hub MAC3 Switch MAC4
Gateway MAC5
To Internet
IP MAC Forwarding
Client MAC 1
Client MAC 2
Hub MAC3 Switch MAC4
Caching proxy MAC6
To InternetGateway
MAC5Port 80 traffic
IP Address Forwarding
router
Backbone network
Switch
Edge network
Joe’s edge network
Joe’s server
Destination proxy
IP Address Forwarding
HTTP data ■─────────────
─────────────
─────────────
HTTP data ■─────────────
─────────────
─────────────
Form:Client:
1.1.1.1
80 To:Joe’s Server
2.2.2.2
80
Form:NAT device:
3.3.3.3.
80To:Proxy
4.4.4.4
80
Passes through network address translation (NAT) device
Proxy Auto-configuration
PAC file autodiscovery
GRE packet encapsulation
HTTP data ■─────────────
─────────────
─────────────
Form:Client:
1.1.1.1
80 To:Joe’s Server
2.2.2.2
80
Passes through WCCP router
HTTP data ■─────────────
─────────────
─────────────
Form:Client:
1.1.1.1
80 To:Joe’s Server
2.2.2.2
80
To Proxy:
3.3.3.3
8080
Proto:GRE
Cache Array Routing Protocol
Cache Array Routing Protocol
Hyper Text Caching protocol