# US 11,310,153 B2 · Packet processing method and network device

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

- Number: US 11,310,153 B2
- Document ID: US11310153B2
- Status: Granted
- Kind: B2
- Application number: 16/567,619
- Filed: 2019-09-11
- Published: 2020-01-02
- Granted: 2022-04-19
- Earliest claimed: 2017-03-13
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Jing Hu; Shuying Liu
- Web page: https://patentgrep.com/patent/US11310153B2

## CPC

- H04L 45/306: {Route determination based on the nature of the carried application}
- H04L 45/38: {Flow based routing}
- H04L 45/74: Address processing for routing
- H04L 47/2441: relying on flow classification, e.g. using integrated services [IntServ]
- H04L 67/60: Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources (admission control or resource allocation H04L47/70)
- H04L 69/22: Parsing or analysis of headers
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A packet processing method and a network device, where the method includes: receiving, by a network device, a packet, where the packet includes classification information, and the classification information includes M fields; determining, by the network device, K fields in the M fields according to indication information stored by the network device; determining, by the network device, a target classification rule based on a first classification rule set stored by the network device and the K fields, and processing the packet according to the target classification rule.

## Claims

### Claim 1

A packet processing method, comprising:
receiving, by a network device, a packet, wherein the packet comprises classification information, wherein the classification information comprises M fields, wherein the M fields comprise X fields and K fields, wherein the M fields comprise N bits, wherein the X fields comprise P bits, wherein the K fields comprise Q bits, wherein N is a positive integer greater than or equal to 2, wherein N is equal to a sum of Q and P, wherein a quantity of the M fields is equal to a sum of a quantity of the K fields and a quantity of the X fields, wherein Q, P, K, and X are all positive integers greater than or equal to 1, and wherein M is a positive integer greater than or equal to 2;
determining, by the network device, the K fields in the M fields according to indication information stored by the network device, wherein the indication information comprises M indication digits, wherein the M fields are in a one-to-one correspondence with the M indication digits, wherein a value of one of the M indication digits corresponding to each of the K fields is equal to a first value, wherein a value of another one of the M indication digits corresponding to each of the X fields is equal to a second value, and wherein the first value is not equal to the second value;
determining, by the network device, a target classification rule based on a first classification rule set stored by the network device and the K fields, wherein the target classification rule is a first classification rule in the first classification rule set, wherein the first classification rule set comprises T first classification rules, wherein each of the T first classification rules comprises K match fields, wherein each of the K match fields in each of the T first classification rules comprises Q digits, wherein the K match fields in each of the T first classification rules are in a one-to-one correspondence with the K fields, and wherein T is a positive integer greater than or equal to 1; and
processing, by the network device, the packet according to the target classification rule.

### Claim 2 (depends on 1)

The method according to claim 1, wherein M′, N, and Q′ meet the following relationship: M′+Q′ is less than 2N, wherein M′ denotes a quantity of bits in the M indication digits, and wherein Q′ denotes a quantity of bits in the K match fields in each of the T first classification rules.

### Claim 3 (depends on 1)

The method according to claim 1, wherein before determining the K fields, the method further comprises obtaining, by the network device, a second classification rule set, wherein the second classification rule set comprises T second classification rules, wherein a tth second classification rule in the T second classification rules comprises N digits, wherein the tth second classification rule comprises M match fields, wherein a quantity of digits in a first mth match field in the M match fields in the tth second classification rule is equal to a quantity of bits in a second mth field in the M fields, wherein t=1, . . . , and T, and wherein m=1, . . . , and M.

### Claim 4 (depends on 3)

The method according to claim 3, wherein before determining the K fields, the method further comprises determining, by the network device, a type of each of the M match fields in the tth second classification rule, wherein a match field in the M match fields in the tth second classification rule is of a first type or a second type, wherein K match fields in the M match fields in the tth second classification rule are of the first type, wherein X match fields in the M match fields in the tth second classification rule are of the second type, wherein a quantity of digits in a kth match field in the K match fields in the M match fields in the tth second classification rule is equal to a quantity of bits in a kth field in the K fields, wherein the K match fields in the M match fields in the tth second classification rule comprise Q digits, and wherein k=1, . . . , and K.

### Claim 5 (depends on 4)

The method according to claim 4, wherein before determining the K fields, the method further comprises determining, by the network device, the M indication digits and a tth first classification rule in the T first classification rules based on the type of each of the M match fields in the tth second classification rule and the K match fields in the M match fields in the tth second classification rule, wherein the tth first classification rule comprises K match fields, and wherein the K match fields in the first classification rule are the K match fields in the M match fields.

### Claim 6 (depends on 5)

The method according to claim 5, wherein determining the type of each of the M match fields in the tth second classification rule comprises determining, by the network device, that the mth match field is of the first type when determining that values of the digits in the mth match field in the M match fields in the tth second classification rule comprise at least one specific value.

### Claim 7 (depends on 6)

The method according to claim 6, wherein determining the type of each of the M match fields comprises determining, by the network device, that the mth match field is of the second type when a value of each digit in the mth match field in the M match fields in the tth second classification rule is a general value, wherein the at least one specific value comprises a first specific value and a second specific value, wherein a first bit matches the first specific value, wherein a second bit matches the second specific value, wherein both the first bit and the second bit match the general value, wherein a value of the first bit is 1, and wherein a value of the second bit is 0.

### Claim 8 (depends on 4)

The method according to claim 4, wherein when P is a positive integer greater than or equal to 2, determining, by the network device, the type of each of the M match fields in the tth second classification rule comprises determining, by the network device, whether values of the digits in the mth match field in the M match fields in the tth second classification rule are the same as values of digits in an mth match field in M match fields in a second classification rule other than the tth second classification rule in the T second classification rules.

### Claim 9 (depends on 8)

The method according to claim 8, further comprising responsive to determining that the values of the digits in the mth match field in the M match fields in the tth second classification rule are not the same as values of digits in the mth match field in M match fields in the second classification rule other than the tth second classification rule, determining that the mth match field in the M match fields in the tth second classification rule is of the first type.

### Claim 10 (depends on 8)

The method according to claim 8, further comprising responsive to determining, by the network device, that the values of the digits in the mth match field in the M match fields in the tth second classification rule are the same as values of digits in the mth match field in M match fields in the second classification rule other than the tth second classification rule, determining that the mth match field in the M match fields in the tth second classification rule is of the second type.

### Claim 11

A network device, wherein the network device comprises:
at least one processor; and
a computer-readable storage medium storing a program to be executed by the processor, the program including instructions that, when executed by the processor, cause the network device to:
receive a packet, wherein the packet comprises classification information, wherein the classification information comprises M fields, wherein the M fields comprise X fields and K fields, wherein the M fields comprise N bits, wherein the X fields comprise P bits, wherein the K fields comprise Q bits, wherein N is a positive integer greater than or equal to 2, wherein N is equal to a sum of Q and P, wherein a quantity of the M fields is equal to a sum of a quantity of the K fields and a quantity of the X fields, wherein Q, P, K, and X are all positive integers greater than or equal to 1, and wherein M is a positive integer greater than or equal to 2;
store indication information and a first classification rule set;
determine the K fields according to the indication information, wherein the indication information comprises M indication digits, wherein the M fields are in a one-to-one correspondence with the M indication digits, wherein a value of one of the M indication digits corresponding to each of the K fields is equal to a first value, wherein a value of another one of the M indication digits corresponding to each of the X fields is equal to a second value, and wherein the first value is not equal to the second value;
determine a target classification rule based on the first classification rule set stored and the K fields, wherein the target classification rule is a first classification rule in the first classification rule set, wherein the first classification rule set comprises T first classification rules, wherein each of the T first classification rules comprises K match fields, wherein each of the K match fields in each of the T first classification rules comprises Q digits, wherein the K match fields in each of the T first classification rules are in a one-to-one correspondence with the K fields, and wherein T is a positive integer greater than or equal to 1; and
process the packet according to the target classification rule.

### Claim 12 (depends on 11)

The network device according to claim 11, wherein M′, N, and Q′ meet the following relationship: M′+Q′ is less than 2N, wherein M′ denotes a quantity of bits in the M indication digits, and wherein Q′ denotes a quantity of bits in the K match fields in each of the T first classification rules.

### Claim 13 (depends on 11)

The network device according to claim 11, wherein the instructions, when executed by the processor, further cause the network device to obtain a second classification rule set, wherein the second classification rule set comprises T second classification rules, wherein a tth second classification rule in the T second classification rules comprises N digits, wherein the tth second classification rule comprises M match fields, wherein a quantity of digits in a first mth match field in the M match fields in the tth second classification rule is equal to a quantity of bits in a second mth field in the M fields, wherein t=1, . . . , and T, and wherein m=1, . . . , and M.

### Claim 14 (depends on 13)

The network device according to claim 13, wherein the instructions, when executed by the processor, further cause the network device to determine a type of each of the M match fields in the tth second classification rule, wherein a match field in the M match fields in the tth second classification rule is of a first type or a second type, wherein K match fields in the M match fields in the tth second classification rule are of the first type, wherein X match fields in the M match fields in the tth second classification rule are of the second type, wherein a quantity of digits in a kth match field in the K match fields in the M match fields in the tth second classification rule is equal to a quantity of bits in a kth field in the K fields, wherein the K match fields in the M match fields in the tth second classification rule comprise Q digits, and wherein k=1, . . . , and K.

### Claim 15 (depends on 14)

The network device according to claim 14, wherein the instructions, when executed by the processor, further cause the network device to:
determine the M indication digits and a tth first classification rule in the T first classification rules based on the type of each of the M match fields in the tth second classification rule and the K match fields in the M match fields in the tth second classification rule, wherein the tth first classification rule comprises K match fields, and wherein the K match fields in the first classification rule are the K match fields in the M match fields; and
store the tth first classification rule in the T first classification rules and the M indication digits.

### Claim 16 (depends on 15)

The network device according to claim 15, wherein the instructions, when executed by the processor, further cause the network device to determine that the mth match field is of the first type when determining that values of the digits in the mth match field in the M match fields in the tth second classification rule comprise at least one specific value.

### Claim 17 (depends on 16)

The network device according to claim 16, wherein the instructions, when executed by the processor, further cause the network device to determine that the mth match field is of the second type when determining that a value of each digit in the mth match field in the M match fields in the tth second classification rule is a general value, wherein the at least one specific value comprises a first specific value and a second specific value, wherein a first bit matches the first specific value, wherein a second bit matches the second specific value, wherein both the first bit and the second bit match the general value, wherein a value of the first bit is 1, and wherein a value of the second bit is 0.

### Claim 18 (depends on 15)

The network device according to claim 15, wherein the instructions, when executed by the processor, further cause the network device to be configured such that when P is a positive integer greater than or equal to 2, the network device determines whether values of the digits in the mth match field in the M match fields in the tth second classification rule are the same as values of digits in an mth match field in M match fields in a second classification rule other than the tth second classification rule in the T second classification rules.

### Claim 19 (depends on 18)

The network device according to claim 18, wherein the instructions, when executed by the processor, further cause the network device to be configured such that when the network device determines that the values of the digits in the mth match field in the M match fields are not the same as values of digits in the mth match field in M match fields in the second classification rule other than the tth second classification rule in the T second classification rules, the network device determines that the mth match field in the M match fields in the tth second classification rule is of the first type.

### Claim 20 (depends on 18)

The network device according to claim 18, wherein the instructions, when executed by the processor, further cause the network device to be configured such that when the network device determines that the values of the digits in the mth match field in the M match fields are the same as values of digits in the mth match field in M match fields in the second classification rule other than the tth second classification rule in the T second classification rules, the network device determines that the mth match field in the M match fields in the tth second classification rule is of the second type.
