Packet processing method and network device
AssigneeHuawei Technologies Co., Ltd.
InventorsJing Hu, Shuying Liu
Life of this patent
Estimating the term…
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.
Claims20
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.
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.
Dependencies are inferred from the claim text.