# US 2020/0396320 A1 · Packet-programmable statelets

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

- Number: US 2020/0396320 A1
- Document ID: US20200396320A1
- Status: Published application
- Kind: A1
- Application number: 17/008,347
- Filed: 2020-08-31
- Published: 2020-12-17
- Earliest claimed: 2018-03-01
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co, Ltd.
- Inventors: Alexander Clemm; Uma S. Chunduri; Renwei Li
- Web page: https://patentgrep.com/patent/US20200396320A1

## CPC

- H04L 47/00: Traffic control in data switching networks (arrangements for detecting or preventing errors in the information received H04L1/00)
- H04L 69/22: Parsing or analysis of headers
- H04L 45/74: Address processing for routing
- G06F 3/061: {Improving I/O performance}
- G06F 3/0659: {Command handling arrangements, e.g. command buffers, queues, command scheduling}
- G06F 3/067: {Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]}
- 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

A network device includes a statelet storage storing statelets that retain state information associated with a packet flow through the network device and that the network device can interact with to control processing performed on packets of the data flow. The network device implements a set of instructions that interpret commands in the data packets to manage and interact with statelets. The statelets in the statelet storage are organized by a statelet key that is derived from information identifying the packet flow. Responsive to the commands in the packets, the network device can create, read, write, or delete statelets from the statelet storage. The statelet storage includes multiple statelets each statelet including multiple fields. The network device may access the statelets to control/monitor a packet flow using information in a network data plane without receiving control information from a network control plane.

## Claims

### Claim 1

A computer-implemented method for processing a data flow in a network device associated with a statelet storage, the method comprising:
parsing a first packet of a data flow to extract a first command and flow information identifying the data flow from a first header of the first packet;
generating a first statelet key from the extracted flow information; and
executing the first command to access a first statelet associated with the first statelet key, the first statelet being stored in the statelet storage of the network device.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising:
parsing a second packet of the data flow to extract a second command and the flow information identifying the data flow from a second header of the second packet;
generating the first statelet key from the flow information extracted from the second header of the second packet;
responsive to the second command, accessing the first statelet having the first statelet key including at least one of: reading a field value from the first statelet, writing a field value to the first statelet, modifying a value in a field of the first statelet, adding a value to a list in the first statelet, or removing a value from a list in the first statelet; and
storing a second freshness value in the freshness field of the first statelet, the second freshness value indicating a time at which the first statelet is accessed responsive to the second command.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein:
the accessing of the first statelet responsive to the second command includes reading the field value from the first statelet; and
the computer-implemented method further comprises controlling processing of the second packet by the network device responsive to the field value read from the first statelet.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein executing of the first command comprises:
creating the first statelet in the statelet storage of the network device, the first statelet having a key field including the first statelet key; and
storing a first freshness value in a freshness field of the first statelet, the first freshness value indicating a time at which the first statelet is created.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4 wherein the statelet storage includes a plurality of statelets and the method further comprises:
comparing, by the network device, respective freshness values in the freshness fields of each of the plurality of statelets to a current time value; and
responsive to a difference between the current time value and the freshness value in the freshness field of one statelet of the plurality of statelets being greater than a threshold value, reclaiming memory occupied by the one statelet.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein the executing of the first command to access the first statelet writes a data value into a field of the first statelet responsive to metadata in the first header of the first packet.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein the executing of the first command to access the first statelet includes incrementing a value in a field of the first statelet.

### Claim 8 (depends on 1)

The computer implemented method of claim 1, wherein the executing of the first command includes deleting the first statelet from the statelet storage of the network device.

### Claim 9 (depends on 1)

The computer implemented method of claim 1, wherein:
generating the first statelet key includes combining N values from the flow information; and
executing the first command to access the first statelet associated with the first statelet key includes selecting the first statelet responsive to a statelet key of the first statelet including M values of the N values in the first statelet key, where M is less than N.

### Claim 10 (depends on 9)

The computer implemented method of claim 9, wherein the first command includes a statelet key mask and the selecting of the first statelet includes selecting the M values in the first statelet key responsive to the statelet key mask.

### Claim 11 (depends on 1)

The computer-implemented method of claim 1, wherein:
parsing the first packet includes extracting the first command and a second command from the first header of the first packet;
executing the first command includes testing a condition to produce a result based on data in the first statelet; and
the computer implemented method further comprises conditionally executing the second command responsive to the result produced by the first command.

### Claim 12

An apparatus for use in a network device, the apparatus comprising:
a memory including statelet storage and computer program instructions; and
a processor, coupled to the memory, wherein the processor is configured by the computer program instructions to:
parse a first packet of a data flow to extract a first command and flow information identifying the data flow from a first header of the first packet;
generate a first statelet key from the extracted flow information; and
execute the first command to access a first statelet associated with the first statelet key, the first statelet being stored in the statelet storage.

### Claim 13 (depends on 12)

The apparatus of claim 12, wherein the computer program instructions that condition the processor to execute the first command comprise computer program instructions that condition the processor to:
create the first statelet in the statelet storage of the network device, the first statelet having a key field including the first statelet key; and
store a first freshness value in a freshness field of the first statelet, the first freshness value indicating a time at which the first statelet is created.

### Claim 14 (depends on 12)

The apparatus of claim 12, wherein the computer program instructions further condition the processor to:
parse a second packet of the data flow to extract a second command and the flow information identifying the data flow from a second header of the second packet;
generate the first statelet key from the flow information extracted from the second header of the second packet;
access the first statelet;
execute the second command, wherein the second command conditions the processor to at least one of: read a field value from the first statelet, write a field value to the first statelet, modify a value in a field of the first statelet, add a value to a list in the first statelet, or remove a value from a list in the first statelet; and
store a second freshness value in the freshness field of the first statelet, the second freshness value indicating a time at which the first statelet is accessed responsive to the second command.

### Claim 15 (depends on 12)

The apparatus of claim 12, wherein the computer program instructions that configure the processor to execute the first command configure the processor to write a data value into a field of the first statelet responsive to metadata in a header of the first packet.

### Claim 16 (depends on 12)

The apparatus of claim 12, wherein the computer program instructions that configure the processor to execute the first command configure the processor to delete the first statelet from the statelet storage of the network device.

### Claim 17 (depends on 12)

The apparatus of claim 12, wherein:
the program instructions that condition the processor to generate the first statelet key include program instructions that condition the processor to combine N values from the flow information; and
the program instructions that condition the processor to execute the first command to access the first statelet associated with the first statelet key include program instructions that condition the processor to select the first statelet responsive to at statelet key of the first statelet including M values of the N values in the first statelet key, where M is less than N.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein the command includes a statelet key mask and the program instructions that condition the processor to select or the first statelet include program instructions that cause the processor to select the M values responsive to the statelet key mask.

### Claim 19 (depends on 12)

The apparatus of claim 12, wherein:
the computer program instructions that condition the processor to parse the first packet includes computer program instructions that cause the processor to extract the first command and a second command from the first header of the first packet;
the computer program instructions that condition the processor to execute the first command include computer program instructions that condition the processor to test a condition to produce a result based on data in the first statelet; and
the computer program instructions further condition the processor to conditionally execute the second command responsive to the result produced by the first command.

### Claim 20

A non-transitory computer-readable medium storing computer instructions for processing a data flow in a network device, the computer instructions, when executed by a processor configure the processor to perform the following operations, comprising:
parse a first packet of a data flow to extract a first command and flow information identifying the data flow from a first header of the first packet;
generate a first statelet key from the extracted flow information; and
execute the first command to access a first statelet associated with the first statelet key, the first statelet being stored in a statelet storage associated with the network device.
