# US 2023/0066013 A1 · Dual user space-kernel space datapaths for packet processing operations

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

- Number: US 2023/0066013 A1
- Document ID: US20230066013A1
- Status: Published application
- Kind: A1
- Application number: 17/446,145
- Filed: 2021-08-26
- Published: 2023-03-02
- Earliest claimed: 2021-08-26
- Assignees: Juniper Networks, Inc.
- Applicants: Juniper Networks, Inc.
- Inventors: Darrell Ball
- Web page: https://patentgrep.com/patent/US20230066013A1

## CPC

- G06F 21/53: by executing in a restricted environment, e.g. sandbox or secure virtual machine
- H04L 49/25: Routing or path finding in a switch fabric
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/545: {where tasks reside in different layers, e.g. user- and kernel-space}
- G06F 21/606: {by securing the transmission between two devices or processes}
- H04L 49/15: Interconnection of switching modules
- H04L 63/0227: {Filtering policies (mail message filtering H04L51/212)}
- G06F 2009/45595: {Network integration; Enabling network access in virtual machine instances}
- 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

In general, techniques are described for enhancing packet processing in a computing device of a network. The computing device is configured to in response to receiving ingress data of a flow from the first network device via the first network interface, execute, based on a hook point in kernel space of the device, a kernel program to transfer, via a first socket of a user module, the ingress data for packet processing; configure an code point for the second network interface, wherein the user module is configured to couple a second socket with the code point; and in response to determining the second network device as a next hop for the flow, transfer, based on the code point, egress data of the flow via the second socket to the second network interface, wherein the second network interface is operative to output the egress data to the second network device.

## Claims

### Claim 1

A method for a computing device comprising at least two network interfaces communicatively coupled with at least two network devices, comprising:
configuring, in a kernel space of the computing device, a hook point for ingress from a first network interface, wherein the hook point is to couple a kernel program with a first socket accessible by a user module configured to run in user space of the computing device, wherein the first network interface communicatively couples a first network device with the computing device;
configuring, in the kernel space of the computing device, a code point for egress to a second network interface, wherein the code point is to couple the kernel program with a second socket accessible by the user module, wherein the second network interface communicatively couples a second network device with the computing device;
in response to receiving ingress data of a flow from the first network device, executing, based on the hook point, the kernel program to transfer, via the first socket, the ingress data to the user module; and
in response to the user module determining the second network device as a next destination for the flow, transferring, via the second socket, egress data of the flow to the code point for the second network interface, wherein the second network interface is operative to output the egress data to the second network device.

### Claim 2 (depends on 1)

The method of claim 1, wherein configuring the hook point further comprises configuring an extended Berkeley Packet Filter (eBPF) program to run as the kernel program at the hook point.

### Claim 3 (depends on 1)

The method of claim 1, wherein configuring the hook point further comprises configuring an extended Berkeley Packet Filter (eBPF) program to run as the kernel program at the hook point for an eXpress datapath (XDP).

### Claim 4 (depends on 1)

The method of claim 1, wherein configuring the hook point further comprises configuring an extended Berkeley Packet Filter (eBPF) program to run as the kernel program at an eXpress datapath (XDP) of a network interface card (NIC).

### Claim 5 (depends on 1)

The method of claim 1, wherein configuring the hook point further comprises configuring an extended Berkeley Packet Filter (eBPF) program with a first address-family eXpress datapath (AF_XDP) socket as the first socket and a second AF_XDP socket as the second socket.

### Claim 6 (depends on 1)

The method of claim 1, wherein configuring the hook point further comprises configuring a control program to run in user space as the user module and loading an extended Berkeley Packet Filter (eBPF) program to generate a first address-family eXpress datapath (AF_XDP) socket as the first socket and a second AF_XDP socket as the second socket.

### Claim 7 (depends on 1)

The method of claim 1, wherein configuring the hook point further comprises configuring a control program to run in user space for an extended Berkeley Packet Filter (eBPF) program running in kernel space, wherein the control program is configured to use the eBPF program to receive, via a first AF_XDP socket, incoming packet data from the first network device and to transmit, via a second AF_XDP socket, outgoing packet data to the second network interface to the second network device.

### Claim 8 (depends on 1)

The method of claim 1, wherein configuring the hook point further comprises configuring, for an extended Berkeley Packet Filter (eBPF) program running in the kernel space, a first address-family eXpress datapath (AF_XDP) socket as the first socket and a second AF_XDP socket as the second socket, wherein the first AD XDP socket is coupled to a physical network device as the first network device and the second AD XDP socket is coupled to a virtual network device as the second network device.

### Claim 9 (depends on 1)

The method of claim 1, wherein configuring the hook point further comprises configuring the kernel program to share, with the user module, a kernel space memory area for storing a packet of the ingress data, wherein the user module is configured to perform packet processing on the packet of the ingress data by modifying the ingress data to generate, in the shared memory area, the egress data for the second network device.

### Claim 10 (depends on 1)

The method of claim 1 further comprising:
in response to determining the second network device as the next destination for a first packet of the flow, transferring, from an extended Berkeley Packet Filter (eBPF) program running in the kernel space at the hook point for an eXpress datapath (XDP), subsequent packets of the flow to a networking stack in the kernel space.

### Claim 11

A device, comprising:
a first network interface communicatively coupled to a first network device;
a second network interface communicatively coupled to a second network device;
memory; and
a processor connected to the memory and the network interface, wherein the memory includes instructions that, when executed by the processor, cause the processor to:
in response to receiving ingress data of a flow from the first network device via the first network interface, execute, based on a hook point in kernel space of the device, a kernel program to transfer, via a first socket of a user module, the ingress data for packet processing;
configure a code point in the kernel space for data transmission via the second network interface, wherein the user module is configured to couple a second socket with the code point; and
in response to determining the second network device as a next destination for the flow, transfer, via the second socket, egress data of the flow to the code point for the second network interface, wherein the second network interface is operative to output the egress data to the second network device.

### Claim 12 (depends on 11)

The device of claim 11, wherein the memory further includes instructions that, when executed by the processor, cause the processor to:
configure, in the kernel space, the hook point for the first network interface, wherein the hook point is configured to couple the kernel program with the first socket of the user module running in the device.

### Claim 13 (depends on 11)

The device of claim 11, wherein to execute the kernel program, the instructions further cause the processor to:
execute an extended Berkeley Packet Filter (eBPF) program to run as the kernel program at the hook point.

### Claim 14 (depends on 11)

The device of claim 11, wherein to execute the kernel program, the instructions further cause the processor to:
configure an extended Berkeley Packet Filter (eBPF) program to run as the kernel program at the hook point for an eXpress datapath (XDP).

### Claim 15 (depends on 11)

The device of claim 11, wherein to execute the kernel program, the instructions further cause the processor to:
execute an extended Berkeley Packet Filter (eBPF) program to run as the kernel program at an eXpress datapath (XDP) of a network interface card (NIC) as the first network interface.

### Claim 16 (depends on 11)

The device of claim 11, wherein to execute the kernel program, the instructions further cause the processor to:
configure, for an extended Berkeley Packet Filter (eBPF) program running in kernel space, with a first address-family eXpress datapath (AF_XDP) socket as the first socket and a second AF_XDP socket as the second socket.

### Claim 17 (depends on 11)

The device of claim 11, wherein to execute the kernel program, the instructions further cause the processor to:
configure, for an extended Berkeley Packet Filter (eBPF) program running in user space, with a first address-family eXpress datapath (AF_XDP) socket as the first socket and a second AF_XDP socket as the second socket, wherein the first AD XDP socket is coupled to a physical network device as the first network device and the second AD XDP socket is coupled to a virtual network device as the second network device.

### Claim 18 (depends on 11)

The device of claim 11, wherein the memory further includes instructions that, when executed by the processor, cause the processor to:
in response to determining the second network device as the next destination for a first packet of the flow, transfer, from an extended Berkeley Packet Filter (eBPF) program running in the kernel space at the hook point for an eXpress datapath (XDP), subsequent packets of the flow to a networking stack in the kernel space.

### Claim 19

A network system comprising:
a switch fabric comprising a plurality of switches interconnected to form a physical network;
a virtual network controller device configured to configure and manage one or more virtual networks within the physical network; and
a plurality of servers interconnected by the switch fabric, wherein each of the servers comprises an operating environment executing one or more virtual machines in communication via virtual routing instances to the one or more virtual networks, wherein each server includes a host operating system (OS) executing in kernel space on the server, wherein a kernel program executes in kernel space and a user module executes in user space on each server in a virtual network stack connected to one or more of the virtual networks, wherein each pair of kernel program and user module is configured to extend the one or more virtual networks to the operating environments of the virtual machines,
wherein the first server is configured to:
configure, in the kernel space of a computing device, a hook point for a first network interface, wherein the kernel program is configured to couple the hook point with a first socket of a user module of the computing device, wherein the first network interface communicatively couples a first network device with the computing device;
configure, in the kernel space of the computing device, an code point for a second network interface, wherein the user module is configured to couple the code point with a second socket of the user module, wherein the second network interface communicatively couples a second network device with the computing device;
in response to receiving ingress data of a flow from the first network device, execute, based on the hook point, the kernel program to transfer, via the first socket, the ingress data to the user module; and
in response to determining the second network device as a next hop for the ingress data, transfer, based on the code point, egress data of the flow via the second socket to the second network interface, wherein the second network interface is operative to output the egress data to the second network device.

### Claim 20 (depends on 19)

The network system of claim 19 further comprising a network device comprising:
a hardware unit for forwarding packet data comprising:
a first network interface card configured for packet reception;
a second network interface card configured for packet transmission;
at least one packet processor operably coupled to a memory, executable by processing circuitry, and configured to run in user space;
an internal datapath comprising logic to run in the kernel space for transferring incoming packets from the first network interface card to the at least one packet processor, wherein the at least one packet processor for determining a next destination for the incoming packets, and further comprising logic to run in the user space for transferring outgoing packets from the at least one packet processor to the second network interface card, wherein at least a portion of the internal datapath is stored to the memory and is executable by processing circuitry.
