# US 8,788,570 B2 · Systems and methods for retaining source IP in a load balancing multi-core environment

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,788,570 B2
- Document ID: US8788570B2
- Status: Granted
- Kind: B2
- Application number: 12/489,165
- Filed: 2009-06-22
- Published: 2010-12-23
- Granted: 2014-07-22
- Earliest claimed: 2009-06-22
- Assignees: Citrix Systems, Inc.
- Applicants: Deepak Goel
- Inventors: Deepak Goel
- Web page: https://patentgrep.com/patent/US8788570B2

## CPC

- G06F 9/505: {considering the load}
- H04L 45/745: Address table lookup; Address filtering
- H04L 69/22: Parsing or analysis of headers
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Described herein is a method and system for distributing requests and responses across a multi-core system. Each core executes a packet engine that further processes data packets allocated to that core. A flow distributor executing within the multi-core system forwards client requests to a packet engine on a core that is selected based on a value generated when a hash is applied to a tuple comprising a client IP address, a client port, a server IP address and a server port identified in the request. The packet engine maintains the client IP address, selects a first port of the core, and determines whether a hash of a tuple comprising those values identifies the selected core. A modification is then made to the client request so that the client request includes a tuple comprising the client IP address, the server IP address, the first port and the server port.

## Claims

### Claim 1

A method comprising:
a) receiving, from a flow distributor by a packet engine executing on a first core of a multi-core system comprising a plurality of cores, the multi-core system is intermediary to a client and a server, a client request identifying a first tuple comprising a source internet protocol address corresponding to a client internet protocol address, a source port corresponding to a client port, a server internet protocol address and a server port, the flow distributor forwarding the client request to the first core responsive to applying a first hash of the first tuple;
b) determining, by the packet engine, to proxy the source port of the client request by modifying the source port of the client request to be a port of the multi-core system and to maintain the client internet protocol address of the client as the source internet protocol address of the client request transmitted by the multi-core system to the server;
c) computing, by the packet engine, a second hash of the client internet protocol address and the server internet protocol address to select a port allocation table of the first core from a plurality of port allocation tables;
d) selecting an available port from the selected port allocation table such that a hash of a second tuple comprising the selected port and the client internet protocol address identifies the first core; and
e) responsive to determining to proxy the source port of the client request, modifying, by the packet engine, the source port of the-client request to include the selected port for the first core as the source port of the client request transmitted by the multi-core system to the server such that the multi-core system can identify the selected port responsive to receiving a response from the server.

### Claim 2 (depends on 1)

The method of claim 1, wherein step (e) further comprises transmitting, by the packet engine, the modified client request to the server.

### Claim 3 (depends on 1)

The method of claim 1, wherein step (d) further comprises determining, by the packet engine, that a first port of the selected port allocation table is unavailable.

### Claim 4 (depends on 3)

The method of claim 3, further comprising:
determining, by the packet engine, that a second port is available.

### Claim 5 (depends on 3)

The method of claim 3, wherein determining that the first port is unavailable further comprises determining the first port is in use.

### Claim 6 (depends on 1)

The method of claim 1, further comprising storing the plurality of port allocation tables on each core in the multi-core system.

### Claim 7 (depends on 6)

The method of claim 6, wherein each port allocation table is located at a proxy internet protocol address of a core on which the port allocation table is stored.

### Claim 8 (depends on 7)

The method of claim 7, wherein a packet engine selects the port allocation table based in part on a hash of a client internet protocol address and a server internet protocol address of a first data packet.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
receiving, by the flow distributor, a first data packet and a second data packet;
forwarding, by the flow distributor, the first data packet to a first core in the multi-core system based in part on the hash of a first tuple comprising at least a first client internet protocol address and a first server internet protocol address of the first data packet; and
forwarding, by the flow distributor, the second data packet to a second core in the multi-core system based in part on a hash of a second tuple comprising at least a second client internet protocol address and a second server internet protocol address of the second data packet.

### Claim 10 (depends on 2)

The method of claim 2, wherein transmitting further comprises transmitting to the server located at the server internet protocol address.

### Claim 11 (depends on 1)

The method of claim 1, further comprising updating the selected port allocation table to list the selected port as unavailable.

### Claim 12

A system for providing symmetrical request and response processing comprising:
a multi-core system comprising a plurality of cores, the multi-core system intermediary to a client and a server;
a flow distributor receiving a request of a client to a server, and selecting a first core based on a hash of a first tuple comprising a source internet protocol address corresponding to a client internet protocol address, a source port corresponding to a client port of the client, a server internet protocol address and a server port identified in the client request; and
a packet engine executing on a first core of the multi-core system, the packet engine:
receiving the client request,
determining to proxy the client port of the request by modifying the source port of the client request to be a port of the multi-core system and maintain the client internet protocol address of the client as a source internet protocol address of the client request transmitted by the multi-core system to the server,
computing a second hash of the client internet protocol address and the server internet protocol address to select a port allocation table of the first core from a plurality of port allocation tables,
selecting an available port from the selected port allocation table such that a hash of a second tuple comprising the selected port and the client internet protocol address identifies the first core; and,
responsive to determining to proxy the source port of the client request, modifying the source port of the-client request to include the selected port for the first core as the source port of the client request transmitted by the multi-core system to the server such that the multi-core system can identify the selected port responsive to receiving a response from the server.

### Claim 13 (depends on 12)

The system of claim 12, wherein the packet engine transmits the modified client request to the server.

### Claim 14 (depends on 12)

The system of claim 12, wherein the packet engine determines that a first port of the selected port allocation table is unavailable.

### Claim 15 (depends on 14)

The system of claim 14, wherein the packet engine:
determines that a second port is available.

### Claim 16 (depends on 14)

The system of claim 14, wherein the packet engine determines the first port is in use.

### Claim 17 (depends on 12)

The system of claim 12, wherein each core in the multi-core system stores a plurality of port allocation tables.

### Claim 18 (depends on 17)

The system of claim 17, wherein each port allocation table is located at a proxy internet protocol address of a core on which the port allocation table is stored.

### Claim 19 (depends on 18)

The system of claim 18, wherein a packet engine selects the port allocation table based in part on the hash of a client internet protocol address and a server internet protocol address of a first data packet.

### Claim 20 (depends on 12)

The system of claim 12, wherein the flow distributor:
receives a first data packet and a second data packet;
forwards the first data packet to a first core in the multi-core system based in part on a hash of a first tuple comprising at least a first client internet protocol address and a first server internet protocol address of the first data packet; and
forwards the second data packet to a second core in the multi-core system based in part on a hash of a second tuple comprising at least a second client internet protocol address and a second server internet protocol address of the second data packet.

### Claim 21 (depends on 13)

The system of claim 13, wherein the packet engine transmits the modified client request to the server located at the server internet protocol internet protocol address.

### Claim 22 (depends on 12)

The system of claim 12, wherein the packet engine updates the port allocation table to list the selected port as unavailable.
