# US 2025/0158923 A1 · Packet forwarding method, apparatus, and device, and chip system

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

- Number: US 2025/0158923 A1
- Document ID: US20250158923A1
- Status: Published application
- Kind: A1
- Application number: 19/025,932
- Filed: 2025-01-16
- Published: 2025-05-15
- Earliest claimed: 2022-07-18
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Rongguo HU; Daming MO; Chang LI; Qi YU; Ying XIONG
- Web page: https://patentgrep.com/patent/US20250158923A1

## CPC

- H04L 45/38: {Flow based routing}
- H04L 47/2441: relying on flow classification, e.g. using integrated services [IntServ]
- H04L 45/02: Topology update or discovery
- H04L 45/021: Ensuring consistency of routing table updates, e.g. by using epoch numbers
- H04L 45/20: {Hop count for routing purposes, e.g. TTL}
- H04L 45/54: {Organization of routing tables}
- H04L 45/566: {Routing instructions carried by the data packet, e.g. active networks}
- H04L 45/745: Address table lookup; Address filtering
- H04L 45/7453: using hashing
- H04L 47/2483: involving identification of individual flows
- H04L 49/111: Switch interfaces, e.g. port details
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A packet forwarding method, apparatus, and device, and a chip system are disclosed. The method is applied to a packet forwarding device including a processor and a coprocessor, and includes: The packet forwarding device receives a first packet, and queries a flow table based on flow identification information carried in the first packet. When a target flow entry matching the flow identification information carried in the first packet exists in the flow table, the coprocessor of the packet forwarding device forwards the first packet based on the target flow entry. The flow entry is a session entry created by the processor of the packet forwarding device based on flow identification information of any received flow, and the target flow entry is a session entry created by the processor of the packet forwarding device based on flow identification information of a first flow to which the first packet belongs.

## Claims

### Claim 1

A packet forwarding method, comprising:
receiving a first packet at a packet forwarding device having a processor and a coprocessor;
querying a flow table based on flow identification information carried in the first packet, wherein the flow table comprises at least one flow entry, and the flow entry is a session entry created by the processor based on flow identification information of any received flow; and
when a target flow entry matching the flow identification information carried in the first packet exists in the flow table, forwarding, by the coprocessor, the first packet based on the target flow entry, wherein the target flow entry is a session entry created by the processor based on flow identification information of a first flow to which the first packet belongs.

### Claim 2 (depends on 1)

The method according to claim 1, wherein when the target flow entry does not exist in the flow table, the flow identification information carried in the first packet is used by the processor to create the target flow entry.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the coprocessor is a network processor (NP), and the processor is a central processing unit (CPU) or an application processor (AP).

### Claim 4 (depends on 1)

The method according to claim 1, further comprising:
determining, using the coprocessor, that aging needs to be performed on the target flow entry; and
reporting, using the coprocessor, aging information of the target flow entry to the processor, wherein the aging information of the target flow entry indicates the processor to perform deletion processing on the target flow entry.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the determining that aging needs to be performed on the target flow entry comprises:
polling the flow entry in the flow table using the coprocessor, to determine whether a second packet is received within aging duration, wherein the second packet carries flow identification information matching the target flow entry; and
when determining that no second packet is received within the aging duration, determining that the aging needs to be performed on the target flow entry.

### Claim 6 (depends on 4)

The method according to claim 4, wherein the packet forwarding device comprises a memory that includes a ring storage queue, the ring storage queue comprises a plurality of storage units distributed in a ring, one storage unit in the ring storage queue is configured to store aging information of one flow entry, the processor is configured to read aging information stored in a storage unit to which a read pointer points in the ring storage queue, and the reporting the aging information of the target flow entry to the processor comprises:
writing, using the coprocessor, the aging information of the target flow entry into a storage unit to which a write pointer points in the ring storage queue, wherein the write pointer is used to point to an empty storage unit in the ring storage queue.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the target flow entry comprises a first pointer pointing to storage space for storing first information, the first information comprises the flow identification information of the first flow and forwarding information of the first flow, and the forwarding information of the first flow indicates a forwarding type and/or a forwarding action of the first flow.

### Claim 8 (depends on 7)

The method according to claim 7, wherein the first information further comprises a second pointer pointing to storage space for storing second information, the second information comprises association data of a newly received packet in the first flow, the association data comprises data for collecting statistics on flow information of the first flow, the flow information is used to locate an exception when the exception occurs during transmission of the first flow, and when the target flow entry matching the flow identification information carried in the first packet exists in the flow table, the method further comprises:
updating the second information using the coprocessor, wherein updated second information comprises association data of the first packet.

### Claim 9 (depends on 7)

The method according to claim 7, wherein the first information further comprises a third pointer pointing to storage space for storing third information comprising a control parameter of a process for processing the first flow in the processor.

### Claim 10 (depends on 9)

The method according to claim 9, wherein the flow entry in the flow table is stored in preset storage space, and wherein the first information, second information, and the third information are stored in storage space that the processor applies for from an address pool when the target flow entry is created.

### Claim 11

A packet forwarding device, comprising:
a memory storing instructions;
at least one processor in communication with the memory, the at least one processor configured, upon execution of the instructions, to create a flow entry based on flow identification information of any flow received by the packet forwarding device, wherein the flow entry indicates the coprocessor to forward a packet; and
a coprocessor in communication with the memory, the coprocessor configured, upon execution of the instructions, to:
receive a first packet;
query a flow table based on flow identification information carried in the first packet, wherein the flow table comprises at least one flow entry, and the flow entry is a session entry created by the at least one processor based on flow identification information of any received flow; and
forward the first packet based on a target flow entry when the target flow entry matching the flow identification information carried in the first packet exists in the flow table, wherein the target flow entry is a session entry created by the at least one processor based on flow identification information of a first flow to which the first packet belongs.

### Claim 12 (depends on 11)

The packet forwarding device according to claim 11, wherein when the target flow entry does not exist in the flow table, the flow identification information carried in the first packet is used by the at least one processor to create the target flow entry.

### Claim 13 (depends on 11)

The packet forwarding device according to claim 11, wherein the coprocessor is a network processor (NP), and the at least one processor is a central processing unit (CPU) or an application processor (AP).

### Claim 14 (depends on 11)

The packet forwarding device according to claim 11, wherein the instructions when executed by the coprocessor further cause the coprocessor to:
determine that aging needs to be performed on the target flow entry, and
report aging information of the target flow entry to the at least one processor, wherein the aging information of the target flow entry indicates the at least one processor to perform deletion processing on the target flow entry.

### Claim 15 (depends on 14)

The packet forwarding device according to claim 14, wherein the instructions when executed by the coprocessor further cause the coprocessor to:
poll the flow entry in the flow table, to determine whether a second packet is received within aging duration, wherein the second packet carries flow identification information matching the target flow entry; and
when determining that no second packet is received within the aging duration, determine that the aging needs to be performed on the target flow entry.

### Claim 16 (depends on 14)

The packet forwarding device according to claim 14, wherein the memory comprises a ring storage queue, the ring storage queue comprises a plurality of storage units distributed in a ring, one storage unit in the ring storage queue is configured to store aging information of one flow entry, and the processor is configured to read aging information stored in a storage unit to which a read pointer points in the ring storage queue; and
the instructions when executed by the coprocessor further cause the coprocessor to:
write the aging information of the target flow entry into a storage unit to which a write pointer points in the ring storage queue, wherein the write pointer is used to point to an empty storage unit in the ring storage queue.

### Claim 17 (depends on 11)

The packet forwarding device according to claim 11, wherein the target flow entry comprises a first pointer pointing to storage space for storing first information, the first information comprises the flow identification information of the first flow and forwarding information of the first flow, and the forwarding information of the first flow indicates a forwarding type and/or a forwarding action of the first flow.

### Claim 18 (depends on 17)

The packet forwarding device according to claim 17, wherein the first information further comprises a second pointer pointing to storage space for storing second information, the second information comprises association data of a newly received packet in the first flow, the association data comprises data for collecting statistics on flow information of the first flow, the flow information is used to locate an exception when the exception occurs during transmission of the first flow, and the instructions when executed by the coprocessor further cause the coprocessor to:
when the target flow entry matching the flow identification information carried in the first packet exists in the flow table, update the second information, wherein updated second information comprises association data of the first packet.

### Claim 19 (depends on 17)

The packet forwarding device according to claim 17, wherein the first information further comprises a third pointer pointing to storage space for storing third information comprising a control parameter of a process for processing the first flow in the at least one processor.

### Claim 20 (depends on 19)

The packet forwarding device according to claim 19, wherein the flow entry in the flow table is stored in preset storage space, and wherein the first information, the second information, and the third information are stored in storage space that the at least one processor applies for from an address pool when the target flow entry is created.
