# US 2019/0173920 A1 · Deterministic load balancing of ipsec processing

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

- Number: US 2019/0173920 A1
- Document ID: US20190173920A1
- Status: Published application
- Kind: A1
- Application number: 15/833,024
- Filed: 2017-12-06
- Published: 2019-06-06
- Earliest claimed: 2017-12-06
- Assignees: Nicira, Inc.
- Applicants: Nicira, Inc.
- Inventors: Sushruth GOPAL; Ly LOI; Yong WANG; Michael PARSA
- Web page: https://patentgrep.com/patent/US20190173920A1

## CPC

- H04L 63/164: {at the network layer}
- G06F 9/5077: {Logical partitioning of resources; Management or configuration of virtualized resources (specific details on emulation or internal functioning of virtual machines G06F9/455)}
- G06F 9/5083: {Techniques for rebalancing the load in a distributed system}
- H04L 63/0272: {Virtual private networks}
- H04L 63/029: {Firewall traversal, e.g. tunnelling or, creating pinholes}
- H04L 63/0428: {wherein the data content is protected, e.g. by encrypting or encapsulating the payload}
- H04L 63/205: {involving negotiation or determination of the one or more network security mechanisms to be used, e.g. by negotiation between the client and the server or between peers or by selection according to the capabilities of the entities involved (negotiation of communication capabilities H04L69/24)}
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Certain embodiments described herein are generally directed to deterministic load balancing of processing encapsulated encrypted data packets at a destination tunnel endpoint. In some embodiments, an IPSec component residing within a destination tunnel endpoint is configured to select a CPU core ID of a virtual CPU using a CPU selection function. In some embodiments, the IPSec component selects an SPI value corresponding to the CPU core ID. In some embodiments, the IPsec component indicates the SPI value to a source tunnel endpoint for use in establishing an in-bound security association, wherein the in-bound security association is used by the source tunnel endpoint to encrypt a data packet received from the source endpoint and destined for the destination endpoint

## Claims

### Claim 1

A method for deterministic load balancing of processing encapsulated encrypted data packets at a destination tunnel endpoint, comprising:
initiating, using an IP Security (IPSec) component, an IPSec tunnel creation with a source tunnel endpoint for encrypting data packets communicated between a source endpoint and a destination endpoint;
selecting, using the IPSec component, a CPU core ID associated with a virtual CPU of a plurality of virtual CPUs residing in the destination tunnel endpoint;
selecting, using the IPSec component, a security parameter index (SPI) value corresponding to the CPU core ID; and
indicating, using the IPSec component, the SPI value to the source tunnel endpoint for use in establishing an in-bound security association, wherein the in-bound security association is used by the source tunnel endpoint to encrypt a data packet received from the source endpoint and destined for the destination endpoint.

### Claim 2 (depends on 1)

The method of claim 1, wherein the method further comprises:
receiving, using a virtual network interface card (VNIC), the encrypted data packet, the encrypted data packet comprising a first header and an encrypted payload, the first header comprising a source IP address of the source tunnel endpoint, a destination IP address of the destination tunnel endpoint, and the SPI value corresponding to the in-bound security association between the source endpoint and the destination endpoint, the encrypted payload comprising a second header comprising a source IP address of the source endpoint and a destination IP address of the destination endpoint;
calculating, using the VNIC, the CPU core ID based at least in part on the SPI value;
assigning, using the VNIC, the encrypted data packet to a VNIC receive side scaling (RSS) queue of a plurality of VNIC RSS queues associated with the VNIC based on the CPU core ID, wherein the VNIC RSS queue corresponds to the virtual CPU; and
processing, using the virtual CPU, the encrypted data packet.

### Claim 3 (depends on 1)

The method of claim 1, wherein the selecting the SPI value further comprises:
generating a first SPI value;
running the first SPI value through a receive side scaling (RSS) hash algorithm used by a virtual network interface card (VNIC) of the destination tunnel endpoint; and
selecting the first SPI value as the SPI value upon determining that the running resulted in the CPU core ID.

### Claim 4 (depends on 3)

The method of claim 3, wherein the selecting the SPI value further comprises:
generating a second SPI value upon determining that the running did not result in the CPU core ID;
running the second SPI value through the RSS hash algorithm used by the VNIC of the destination tunnel endpoint; and
selecting the second SPI value as the SPI value upon determining that the running resulted in the CPU core ID.

### Claim 5 (depends on 1)

The method of claim 1, wherein the selecting the SPI value further comprises:
generating a plurality of SPI values including the SPI value;
running the plurality of SPI values through a receive side scaling (RSS) hash algorithm used by a virtual network interface card (VNIC) of the destination tunnel endpoint resulting in a mapping of the SPI values to a number of CPU core IDs including the CPU core ID; and
selecting the SPI value corresponding to the CPU core ID based on the mapping.

### Claim 6 (depends on 1)

The method of claim 1, wherein the selecting the CPU core ID further comprises using a CPU selection function.

### Claim 7 (depends on 6)

The method of claim 6, wherein the CPU selection function uses a load level of each of the plurality of virtual CPUs as input.

### Claim 8 (depends on 7)

The method of claim 7, wherein a load level of the virtual CPU is lowest among load levels of the plurality of virtual CPUs.

### Claim 9

A non-transitory computer readable medium comprising instructions to be executed in a computer system, wherein the instructions when executed in the computer system perform a method for deterministic load balancing of processing encapsulated encrypted data packets at a destination tunnel endpoint, the method comprising:
initiating, using an IP Security (IPSec) component, an IPSec tunnel creation with a source tunnel endpoint for encrypting data packets communicated between a source endpoint and a destination endpoint;
selecting, using the IPSec component, a CPU core ID associated with a virtual CPU of a plurality of virtual CPUs residing in the destination tunnel endpoint;
selecting, using the IPSec component, a security parameter index (SPI) value corresponding to the CPU core ID; and
indicating, using the IPSec component, the SPI value to the source tunnel endpoint for use in establishing an in-bound security association, wherein the in-bound security association is used by the source tunnel endpoint to encrypt a data packet received from the source endpoint and destined for the destination endpoint.

### Claim 10 (depends on 9)

The non-transitory computer readable medium of claim 9, wherein the method further comprises:
receiving, using a virtual network interface card (VNIC), the encrypted data packet, the encrypted data packet comprising a first header and an encrypted payload, the first header comprising a source IP address of the source tunnel endpoint, a destination IP address of the destination tunnel endpoint, and the SPI value corresponding to the in-bound security association between the source endpoint and the destination endpoint, the encrypted payload comprising a second header comprising a source IP address of the source endpoint and a destination IP address of the destination endpoint;
calculating, using the VNIC, the CPU core ID based at least in part on the SPI value;
assigning, using the VNIC, the encrypted data packet to a VNIC receive side scaling (RSS) queue of a plurality of VNIC RSS queues associated with the VNIC based on the CPU core ID, wherein the VNIC RSS queue corresponds to the virtual CPU; and
processing, using the virtual CPU, the encrypted data packet.

### Claim 11 (depends on 9)

The non-transitory computer readable medium of claim 9, wherein the selecting the SPI value further comprises:
generating a first SPI value;
running the first SPI value through a receive side scaling (RSS) hash algorithm used by a virtual network interface card (VNIC) of the destination tunnel endpoint; and
selecting the first SPI value as the SPI value upon determining that the running resulted in the CPU core ID.

### Claim 12 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein the selecting the SPI value further comprises:
generating a second SPI value upon determining that the running did not result in the CPU core ID;
running the second SPI value through the RSS hash algorithm used by the VNIC of the destination tunnel endpoint; and
selecting the second SPI value as the SPI value upon determining that the running resulted in the CPU core ID.

### Claim 13 (depends on 9)

The non-transitory computer readable medium of claim 9, wherein the selecting the SPI value further comprises:
generating a plurality of SPI values including the SPI value;
running the plurality of SPI values through a receive side scaling (RSS) hash algorithm used by a virtual network interface card (VNIC) of the destination tunnel endpoint resulting in a mapping of the SPI values to a number of CPU core IDs including the CPU core ID; and
selecting the SPI value corresponding to the CPU core ID based on the mapping.

### Claim 14 (depends on 9)

The non-transitory computer readable medium of claim 9, wherein the selecting the CPU core ID further comprises using a CPU selection function.

### Claim 15 (depends on 14)

The non-transitory computer readable medium of claim 14, wherein the CPU selection function uses a load level of each of the plurality of virtual CPUs as input.

### Claim 16 (depends on 15)

The non-transitory computer readable medium of claim 15, wherein a load level of the virtual CPU is lowest among load levels of the plurality of virtual CPUs.

### Claim 17

A computer system, wherein system software for the computer system is programmed to execute a method for deterministic load balancing of processing encapsulated encrypted data packets at a destination tunnel endpoint, the method comprising:
initiating, using an IP Security (IPSec) component, an IPSec tunnel creation with a source tunnel endpoint for encrypting data packets communicated between a source endpoint and a destination endpoint;
selecting, using the IPSec component, a CPU core ID associated with a virtual CPU of a plurality of virtual CPUs residing in the destination tunnel endpoint;
selecting, using the IPSec component, a security parameter index (SPI) value corresponding to the CPU core ID; and
indicating, using the IPSec component, the SPI value to the source tunnel endpoint for use in establishing an in-bound security association, wherein the in-bound security association is used by the source tunnel endpoint to encrypt a data packet received from the source endpoint and destined for the destination endpoint.

### Claim 18 (depends on 17)

The computer system of claim 17, wherein the method further comprises:
receiving, using a virtual network interface card (VNIC), the encrypted data packet, the encrypted data packet comprising a first header and an encrypted payload, the first header comprising a source IP address of the source tunnel endpoint, a destination IP address of the destination tunnel endpoint, and the SPI value corresponding to the in-bound security association between the source endpoint and the destination endpoint, the encrypted payload comprising a second header comprising a source IP address of the source endpoint and a destination IP address of the destination endpoint;
calculating, using the VNIC, the CPU core ID based at least in part on the SPI value;
assigning, using the VNIC, the encrypted data packet to a VNIC receive side scaling (RSS) queue of a plurality of VNIC RSS queues associated with the VNIC based on the CPU core ID, wherein the VNIC RSS queue corresponds to the virtual CPU; and
processing, using the virtual CPU, the encrypted data packet.

### Claim 19 (depends on 17)

The computer system of claim 17, wherein the selecting the SPI value further comprises:
generating a first SPI value;
running the first SPI value through a receive side scaling (RSS) hash algorithm used by a virtual network interface card (VNIC) of the destination tunnel endpoint; and
selecting the first SPI value as the SPI value upon determining that the running resulted in the CPU core ID.

### Claim 20 (depends on 19)

The computer system of claim 19, wherein the selecting the SPI value further comprises:
generating a second SPI value upon determining that the running did not result in the CPU core ID;
running the second SPI value through the RSS hash algorithm used by the VNIC of the destination tunnel endpoint; and
selecting the second SPI value as the SPI value upon determining that the running resulted in the CPU core ID.

### Claim 21 (depends on 17)

The computer system of claim 17, wherein the selecting the SPI value further comprises:
generating a plurality of SPI values including the SPI value;
running the plurality of SPI values through a receive side scaling (RSS) hash algorithm used by a virtual network interface card (VNIC) of the destination tunnel endpoint resulting in a mapping of the SPI values to a number of CPU core IDs including the CPU core ID; and
selecting the SPI value corresponding to the CPU core ID based on the mapping.

### Claim 22 (depends on 17)

The computer system of claim 17, wherein the selecting the CPU core ID further comprises using a CPU selection function.

### Claim 23 (depends on 22)

The computer system of claim 22, wherein the CPU selection function uses a load level of each of the plurality of virtual CPUs as input.

### Claim 24 (depends on 23)

The computer system of claim 23, wherein a load level of the virtual CPU is lowest among load levels of the plurality of virtual CPUs.
