# US 2022/0046117 A1 · Methods and apparatus for memory allocation and reallocation in networking stack infrastructures

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

- Number: US 2022/0046117 A1
- Document ID: US20220046117A1
- Status: Published application
- Kind: A1
- Application number: 17/509,951
- Filed: 2021-10-25
- Published: 2022-02-10
- Earliest claimed: 2018-03-28
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: Cahya Adiansyah MASPUTRA; Delziel Jude FERNANDES; Darrin JEWELL; Sandeep NAIR; Wei Francis SHEN
- Web page: https://patentgrep.com/patent/US20220046117A1

## CPC

- G06F 9/545: {where tasks reside in different layers, e.g. user- and kernel-space}
- G06F 13/1668: {Details of memory controller}
- G06F 9/4411: {Configuring for operating with peripheral devices; Loading of device drivers}
- G06F 9/44526: {Plug-ins; Add-ons}
- G06F 9/5016: {the resource being the memory}
- G06F 9/544: {Buffers; Shared memory; Pipes}
- G06F 12/023: {Free address space management}
- G06F 12/084: with a shared cache
- G06F 12/10: Address translation
- G06F 21/606: {by securing the transmission between two devices or processes}
- G06F 21/6281: {at program execution time, where the protection is within the operating system}
- H04L 12/4641: {Virtual LANs, VLANs, e.g. virtual private networks [VPN] (LAN interconnection over a bridge based backbone H04L12/462; encapsulation techniques H04L12/4633; routing of packets H04L45/00; packet switches H04L49/00; virtual private networks for security H04L63/0272)}
- H04L 43/10: Active monitoring, e.g. heartbeat, ping or trace-route
- H04L 49/9052: {with buffers of different sizes}
- H04L 61/103: across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
- H04L 67/06: specially adapted for file transfer, e.g. file transfer protocol [FTP]
- H04L 69/321: Interlayer communication protocols or service data unit [SDU] definitions; Interfaces between layers
- G06F 2212/657: Virtual address space management
- H04L 63/0485: {Networking architectures for enhanced packet encryption processing, e.g. offloading of IPsec packet processing or efficient security association look-up}
- H04L 63/166: {at the transport layer}
- H04L 2101/622: Layer-2 addresses, e.g. medium access control [MAC] addresses
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- 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)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

Methods and apparatus for memory allocation and reallocation in networking stack infrastructures. Unlike prior art monolithic networking stacks, the exemplary networking stack architecture described hereinafter includes various components that span multiple domains (both in-kernel, and non-kernel). For example, unlike traditional “socket” based communication, disclosed embodiments can transfer data directly between the kernel and user space domains. A user space networking stack is disclosed that enables extensible, cross-platform-capable, user space control of the networking protocol stack functionality. The user space networking stack facilitates tighter integration between the protocol layers (including TLS) and the application or daemon. Exemplary systems can support multiple networking protocol stack instances (including an in-kernel traditional network stack). Due to this disclosed architecture, physical memory allocations (and deallocations) may be more flexibly implemented.

## Claims

### Claim 1

A method for managing memory space, the method comprising:
requesting, by a non-kernel space application, a channel schema to open a channel for the non-kernel space application, wherein the channel schema represents a memory sharing agreement between a kernel space and a user space to create a shared memory area pre-divided into a plurality of data structures; and
configuring the plurality of data structures in accordance with application requirements for the non-kernel space application, comprising configuring a transmission buffer and a receive buffer.

### Claim 2 (depends on 1)

The method of claim 1, wherein the plurality of data structures further includes an allocation buffer or a free buffer.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
establishing, by a flow switch apparatus, the channel between two entities that includes the non-kernel space application.

### Claim 4 (depends on 1)

The method of claim 1, wherein the channel schema is selected from one of a plurality of different pre-designated channel schemas.

### Claim 5 (depends on 1)

The method of claim 1, wherein the non-kernel space application includes a user space application in the user space or a driver application in the kernel space.

### Claim 6 (depends on 1)

The method of claim 1, wherein the configuring the plurality of data structures comprises:
assigning the transmission buffer having a first buffer size; and
assigning the receive buffer having a second buffer size.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
receiving a request for a different size for one or both of the first buffer size and the second buffer size.

### Claim 8 (depends on 7)

The method of claim 7, wherein the receiving the request for the different size for one or both of the first buffer size and the second buffer size comprises increasing a data throughput for one or both of the transmission buffer and the receive buffer.

### Claim 9 (depends on 7)

The method of claim 7, wherein the receiving the request for the different size for one or both of the first buffer size and the second buffer size comprises decreasing an amount of latency for one or both of the transmission buffer and the receive buffer.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
mirroring the plurality of data structures between a user-accessible region of the memory space and a kernel-only accessible region of the memory space; and
applying a common offset from a base address within the user-accessible region and the kernel-only accessible region for a metadata user object and a metadata kernel object associated with the metadata user object.

### Claim 11

A computing system, comprising:
one or more processors;
a flow switch operated by the one or more processors;
a non-kernel space application operated by the one or more processors; and
physical memory coupled to the one or more processors for use by the non-kernel space application and the flow switch, wherein the non-kernel space application and the flow switch are configured to:
request, by the non-kernel space application, a channel schema to open a channel for the non-kernel space application, wherein the channel schema represents a memory sharing agreement between a kernel space and a user space to create a shared memory area of the physical memory, and wherein the shared memory area is divided into a plurality of data structures; and
configure, by the flow switch, the plurality of data structures in accordance with application requirements for the non-kernel space application, wherein the plurality of data structures includes a transmission buffer and a receive buffer.

### Claim 12 (depends on 11)

The computing system of claim 11, wherein the plurality of data structures further includes an allocation buffer or a free buffer.

### Claim 13 (depends on 11)

The computing system of claim 11, wherein the flow switch is further configured to establish the channel between two entities that includes the non-kernel space application.

### Claim 14 (depends on 11)

The computing system of claim 11, wherein the non-kernel space application includes a user space application in the user space or a driver application in the kernel space.

### Claim 15 (depends on 11)

The computing system of claim 11, wherein the channel schema further includes optimized flow advisor settings and operating statistics for the non-kernel space application.

### Claim 16 (depends on 11)

The computing system of claim 11, wherein to configure the plurality of data structures, the flow switch is further configured to:
assign the transmission buffer having a first buffer size; and
assign the receive buffer having a second buffer size.

### Claim 17

One or more non-transitory, computer-readable media comprising instructions that, when executed, cause a computing device to perform operations, the operations including:
requesting, by a non-kernel space application, a channel schema to open a channel for the non-kernel space application, wherein the channel schema represents a memory sharing agreement between a kernel space and a user space to create a shared memory area pre-divided into a plurality of data structures; and
configuring the plurality of data structures in accordance with application requirements for the non-kernel space application, wherein the configuring the plurality of data structures includes configuring a transmission buffer and a receive buffer.

### Claim 18 (depends on 17)

The one or more non-transitory, computer-readable media of claim 17, wherein the configuring the plurality of data structures further includes configuring an allocation buffer or a free buffer.

### Claim 19 (depends on 17)

The one or more non-transitory, computer-readable media of claim 17, wherein the non-kernel space application includes a user space application in the user space or a driver application in the kernel space.

### Claim 20 (depends on 17)

The one or more non-transitory, computer-readable media of claim 17, wherein the channel schema further includes optimized flow advisor settings and operating statistics for the non-kernel space application.
