Network Layer Implemented Anycast Load Balancing
Total Page:16
File Type:pdf, Size:1020Kb
Network layer implemented Anycast Load Balancing Ricardo Lopes Pereira Teresa Vaz˜ao IST, Inesc-ID IST, Inesc-ID [email protected] [email protected] Abstract only server availability, but also the network distance and conditions along the paths from client to server and vice- This paper presents a server selection method where the versa. This is also what routing protocols such as Open server selection is performed by the network, at the first Shortest Path First (OSPF) do, compute shortest paths. As- router from the client. This method, usable in networks un- signing each server the same anycast address [16] allows der single administrative control, combines network metrics each router to know the path towards the nearest server. (such as traffic or latency) with common server load bal- When clients use the anycast address to reach servers, the ancing metrics (such as load, CPU utilisation or response network layer will automatically forward packets to the time), allowing network conditions to be taken into account nearest server (according to the routing metrics) [9]. This when selecting the server which will handle the request. method is successfully being used today in the Internet to The performance of this technique was compared, by distribute User Datagram Protocol (UDP) queries by the means of simulations, to that of widely used techniques such Domain Name System (DNS) root servers [6]. as random, round robin and least loaded server selection. This paper presents a transparent load balancing tech- nique usable on networks under common administrative control, which aims at providing unmodified clients with 1 Introduction better reply times while maximising the total number of re- quests handled by the set of servers. This method, which was named Network layer implemented Anycast Load Bal- Despite the advent of the Personal Computers (PC) and ancing (NALB), combines network proximity and server distributed computing, the client/server model still plays load information in order to achieve dynamic load balanc- a major role today. Many applications, such as Database ing resorting to anycast addresses and link cost variation on servers and Web Services, remain centralised due to their already deployed routing protocols. This technique was val- nature. The ubiquity of the Internet or intranets, coupled idated by means of simulation using the HyperText Trans- with the emergence of the web browser as a human inter- fer Protocol (HTTP) protocol, although it may be applied face, also dictates that many applications are developed us- to other applications such as DNS, Simple Mail Transfer ing the web server centric paradigm. However, this cen- Protocol (SMTP) or proxy servers. tralised approach has its weaknesses, as it presents a single Section 2 details the anycast concept, its strengths and point of failure. The concentration of all clients on the same limitations. Section 3 presents the proposed load balanc- server may also result in slow response times due to server ing scheme, which was compared with others by means of overload or large network delays or congestion along the simulations, whose results are provided in section 4. The path from client to server. conclusions are presented in section 5. Replicating the application across several servers will eliminate the single point of failure. Server load can be mit- igated by placing the application in a set of servers located 2 IPAnycast in the same Local Area Network (LAN). Network latency and congestion may be avoided by placing servers across The anycast concept was introduced into IP networking a Wide Area Network (WAN), closer to the clients. The in [16], which defines it as: the best effortdeliveryof a data- two methods can be combined by spreading several clusters gram to at least one, and preferably only one, of the servers across a WAN. that accept datagrams for the anycast address. IPv6 is the For each of these approaches different load balancing first version of the IP protocol to support anycasting, albeit methods are used to distribute the clients’ requests [1]. with limitations: anycast addresses may only be assigned to WAN load balancing techniques may take into account, not routers, not hosts; and may only be used as the destination of a packets, never as the source [7]. anycast (SPRA) directs packets to the nearest server; it can Given several servers sharing the same anycast IP ad- be performed on small or confined networks using tradi- dress and a proper routing infrastructure in place, clients tional routing protocols as OSPF [18]. Multi-path routing should be directed to the nearest server (in number of hops distributes packets among all servers within the same dis- or other routing metric). tance. Multi-path or global scale deployment of single-path routing require specialised routing protocols [4,20]. 2.1 Current combined anycast load bal- ancing methods 2.3 Maintaining TCP connections Different research proposals appeared combining any- Stateful connections methods, such as TCP, expect end- cast load balancing methods. points to remain the same throughout the life-time of the Ticket based probing combines anycast with server load connection, But anycast routing does not ensure that packets information by sending probes to several anycast servers. from the same connectionwill always reach the same server. They reply indicating they status (load). The status infor- Routing tables may change due to topology changes or due mation combined with the reply time provides server and to the introduction or removal of anycast servers. Several network information which is used to select the server [3]. proposals address the lack of stateful transport support by This method, however, is not transparent, requiring clients anycast, either by adding support applications, modifying to be modified. Most importantly, it requires routers to be Transmission Control Protocol (TCP) or using IPv6 packet modified, for probe packets to reach several anycast servers. headers. These demands complicate its deployment in a legacy net- A supportapplication may be used to inform the client of work. the unicast address of an anycast server [20]. An UDP ser- Instead of leaving to the client the decision of which vice, running at each anycast server on a well known port server to use, [11] proposes to restore it to the network, by would receive UDP probe packets from the clients, which using an active network. Active networks use routers capa- would use the anycast address as destination. The server ble of running user supplied code on each packet. In this would respond with a UDP message indicating its unicast approach routers communicate with the servers, gathering address, which the client would then use to establish the load information, which may eventually be piggybacked on TCP connection. Should several anycast servers respond, traffic from the servers. This information is then used to only the first would be used. This method requires modifi- forward packets destined to the anycast server address. The cations to the clients and may not be used by legacy clients. router chooses the best server and changes the packet’s tar- Clients will also require a mechanism to know when a target get address from the anycast address to the best server’s uni- address is an anycast address. This method adds a round- cast address. When packets arrive in the opposite direction, trip to the connection establishment process. the source address is changed, from the server’s unicast ad- A client could also determine the servers unicast address dress to the anycast one. This solution requires an active by sending a ping (ICMP ECHO request) to the anycast ad- network, the development of a communication protocol be- dress. The server would then respond (ICMP ECHO reply) tween servers and routers and uses anycast addresses as the using its unicast address [13]. source of packets, which IPv6 disallows. Modifications to the TCP protocol would enable it to A different approach consists in the utilisation of rout- overcome anycast limitations [16]. Just like standard TCP, ing protocols which determine anycast routes using net- clients would send a SYN packet to the server’s anycast ad- work metrics as well as server state information [10]. This dress. However, the SYN-ACK response would arrive not method requires routers to collect and propagate server’s from the anycast address but from the server’s unicast ad- state information. Legacy routers would have to be up- dress, which would be used from then on. A different pro- graded to support these routing protocols. posal is to extend TCP’s tree way handshake to a five way handshake, creating a first phase where the unicast address 2.2 Anycast addressing and routing of the server is determined [20]. These methods do not re- quire the client to know, before hand, when the address is Anycast addresses can not be aggregated with other ad- an anycast one. Large scale TCP implementation substitu- dresses as they may be dispersed by several subnetworks tion, albeit simpler than legacy applications modification, and their world wide deploymentswould result in the explo- still represents a monumental endeavour. sion of the number of routing entries carried by each router. IPv6 packet extension headers may also be used to Nevertheless, they can be successfully used under sin- achieve the same goal [17]. The SYN-ACK response packet gle administrative control and several anycast intra-domain is extended with an header containing the anycast address, routing protocols have been proposed. Single-path routing while it originates on the server’s unicast address. The ex- tension header allows the client to perceive the original ad- routing protocols with server status information. dress as anycast and allows it to match the SYN-ACK to its TCP connection. The ensuing packets will use the unicast 3 Network layer implemented Anycast Load address.