Affinity-based router and routing method
First Claim
1. In a computer network including an encapsulated cluster of nodes, an affinity-based method for routing a plurality of client connections to one of a plurality of server nodes in the cluster, wherein a connection comprises at least one packet, said method comprising the steps of:
- communicating from the client to a router node, one or more packets associated with a first connection to be established with one of said plurality of server nodes in said cluster;
routing the packets of said first connection to a first server from the client;
storing state information about said first connection to said first server at said router;
terminating said first connection;
communicating from the client to the router node, one or more packets associated with a separate subsequent connection to be established with one of said plurality of server nodes in said cluster; and
routing the packets of the subsequent connection from the same client to the first server having affinity with the client according to state information maintained by the router.
1 Assignment
0 Petitions
Accused Products
Abstract
An affinity-based router and method for routing and load balancing in an encapsulated cluster of server nodes is disclosed. The system consists of a multi-node server, wherein any of the server nodes can handle a client request, but wherein clients have affinity to one or more of the server nodes that are preferred to handle a client request. Such affinity is due to state at the servers either due to previous routing requests, or data affinity at the server. At the multi-node server, a node may be designated as a TCP router. The address of the TCP router is given out to clients, and client requests are sent thereto. The TCP router selects one of the nodes in the multi-node server to process the client request, and routes the request to this server; in addition, the TCP router maintains affinity tables, containing affinity records, indicating which node a client was routed to. In processing the client request, the server nodes may determine that another node is better suited to handle the client request, and may reset the corresponding TCP router affinity table entry. The server nodes may also create, modify or delete affinity records in the TCP router affinity table. Subsequent requests from this client are routed to server nodes based on any affinity records, possibly combined on other information (such as load).
271 Citations
19 Claims
-
1. In a computer network including an encapsulated cluster of nodes, an affinity-based method for routing a plurality of client connections to one of a plurality of server nodes in the cluster, wherein a connection comprises at least one packet, said method comprising the steps of:
-
communicating from the client to a router node, one or more packets associated with a first connection to be established with one of said plurality of server nodes in said cluster;
routing the packets of said first connection to a first server from the client;
storing state information about said first connection to said first server at said router;
terminating said first connection;
communicating from the client to the router node, one or more packets associated with a separate subsequent connection to be established with one of said plurality of server nodes in said cluster; and
routing the packets of the subsequent connection from the same client to the first server having affinity with the client according to state information maintained by the router. - View Dependent Claims (2, 4, 5, 6, 7, 8, 9, 13, 15, 16, 18)
determining from the state information if one of the packets is associated with a previous connection; and
if one of the packets is associated with a previous connection, routing the packet to said first server associated with the previous connection; and
if none of the packets are associated with a previous, creating and storing by the router, state information associated with the new connection.
-
-
4. The method of claim 1, wherein the router includes an affinity table for associating one or more client connections with one or more preferred server nodes, the table including one or more affinity records, each record including one or more preferred server node identifiers, one or more client addresses and one or more affinity indices, and wherein the client connection includes one or more affinity indices and wherein said step of routing the packets to a preferred server further comprises the steps of:
-
determining if there is an affinity record having a matching client address and matching affinity index for the client connection; and
if such an affinity record is found, communicating the client connection to a server node identified in said affinity record.
-
-
5. The method of claim 1, wherein said step of routing depends on one or both of a static state and a dynamic state at the server nodes, and wherein the network address of the router is provided to the client, further comprising the steps of:
-
(i) selecting a preferred server node to service the client connection;
(ii) creating an affinity record including the client address, an identifier for the preferred server node, and the time at which the affinity record was created; and
(iii) sending the client connection to the preferred server node, such that responses from the preferred server node go directly to the client.
-
-
6. The method of claim 5, wherein the affinity record further includes a time stamp associated with one or more of the client connections for the creation or modification of the affinity record, the method further comprising the steps of:
-
identifying an affinity record with a matching client address wherein the difference between the current time and the affinity record time stamp is less than a predetermined threshold; and
sending the client connection to a server node indicated in an identified affinity record.
-
-
7. The method of claim 1, wherein the router is a TCP-router.
-
8. The method of claim 1, further comprising the steps of:
-
a server S determining that the client connections should be serviced by a server belonging to a particular set of one or more server nodes; and
said server S causing the state information maintained by the router to be modified, enabling one or more subsequent connections from the client to be routed to a server belonging to said set of one or more server nodes.
-
-
9. The method of claim 1, wherein the encapsulated cluster includes a database partitioned across a plurality of the nodes, further comprising the steps of:
-
routing one or more packets associated with a connection for which the router does not have affinity information, to a server node S in the encapsulated cluster;
said server S determining the preferred server to handle connections from said client based on a database partitioning; and
said server S causing the state information maintained by the router to be modified, enabling one or more subsequent connections from the client to be routed to the preferred server.
-
-
13. The method of claim 1, wherein the client connection includes one or more affinity indices, and wherein said step of routing the packets to a preferred server further comprises the step of identifying the preferred server from an address of the client communicating to the router and the one or more affinity indices included with the client connection.
-
15. The method of claim 4, wherein the client request includes multiple affinity indices, and said determining if there is an affinity record, further comprises the step of:
comparing the affinity indices associated with the client connection with at least one set of affinity indices associated with the affinity record.
-
16. The method of claim 8, wherein said server S is the preferred server.
-
18. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for an affinity-based method of routing client connections to one of a plurality of server nodes in an encapsulated cluster of nodes in a computer network as claimed in claim 1.
-
3. In a computer network including an encapsulated cluster of nodes, an affinity-based method for routing a plurality of client connections to one of a plurality of server nodes in the cluster, wherein a connection comprises at least one packet, said method comprising the steps of:
-
communicating from the client to a router node, one or more packets associated with a first connection to be established with one of said plurality of servers in the cluster;
routing the packets of the first connection to a first server node in said encapsulated cluster; and
said server communicating to the router information for a start of an affinity requirement wherein one or more separate subsequent connections from the same client are routed to a server belonging to the set S associated with the affinity requirement. - View Dependent Claims (14, 17)
communicating to the router, information for an end of affinity requirement, wherein one or more subsequent connection for the client are not routed to a server belonging to said set S.
-
-
17. The method of claim 14, further comprising the step of terminating the affinity requirement by deleting information maintained by the router for said affinity requirement.
-
10. In a multi-node server environment wherein client connections can be satisfied by routing a client connection to a subset of the servers and wherein one or a subset of the servers may be preferred for handling a connection from a client, a preference based on one or both of static and dynamic state at the servers, wherein a client connection comprises at least one packet and has an associated affinity index, wherein a node is designated as a router, and wherein the network address of the router is given out to clients, a method for the router to send client connections to a server node, said method comprising the steps of:
-
(a) determining if there is an affinity record for the client and said affinity index, and if there is no affinity record, performing the additional steps of;
(i) selecting one of said server nodes to service the client connection;
(ii) creating an affinity record containing the client address and the server node selected to handle the connection;
(iii) sending the connection to the selected server node, such that responses from the server go directly to the client; and
(iv) establishing subsequent separate connections from the same client directly to the selected server node. - View Dependent Claims (11, 12, 19)
-
Specification