Method and apparatus for processing flow table entry in flow table
AssigneeHangzhou Alicloud Feitian Information Technology Co., Ltd.
InventorShoujing Bo
Life of this patent
Estimating the term…
Abstract
The present application provides a method and an apparatus for processing a flow entry in a flow table. Through a large-small relationship between “a time interval between a current time point and a first hit time point at which a target flow entry is hit in a historical process” and “a first interval threshold which is set in an application program in advance by a tenant corresponding to the target flow entry and is suitable for the tenant corresponding to the target flow entry”, whether to delete the target flow entry in a flow table is determined. The flow entry corresponding to the tenant can be deleted from the flow table according to an actual need of the tenant.
Claims20
A method for processing a flow entry in a flow table, applied to an electronic device, wherein the electronic device comprises a network interface card;
- a flow table is recorded in the network interface card, and the flow table comprises a flow entry;
- an application program for managing the network interface card runs on the electronic device;
- the method comprises:
- obtaining, based on the network interface card, a first hit time point at which a target flow entry in the flow table is hit in a historical process, and obtaining an identifier of the target flow entry;
- sending, based on the network interface card, the first hit time point and the identifier to the application program;
- receiving, based on the application program, the first hit time point and the identifier;
- obtaining, based on the application program, a first interval threshold according to the identifier, wherein the first interval threshold comprises an interval threshold which is set in the application program in advance by a tenant corresponding to the target flow entry and is used for the tenant;
- determining, based on the application program, whether a first time interval between a current time point of the application program and the first hit time point is greater than or equal to the first interval threshold;
- in a case that the first time interval is greater than or equal to the first interval threshold, sending, based on the application program, a deleting instruction carrying the identifier to the network interface card;
- receiving, based on the network interface card, the deleting instruction;
- and
- deleting, based on the network interface card, the target flow entry in the flow table according to the identifier in the deleting instruction.
An electronic device for processing a flow entry in a flow table, wherein the electronic device comprises a network interface card;
- a flow table is recorded in the network interface card, and the flow table comprises a flow entry;
- an application program for managing the network interface card runs on the electronic device;
- wherein the electronic device further comprises a memory, a processor, and a computer program which is stored in the memory and is runnable on the processor, wherein when the processor executes the computer program, the processor is caused to:
- obtain, based on the network interface card, a first hit time point at which a target flow entry in the flow table is hit in a historical process, and obtain an identifier of the target flow entry;
- send, based on the network interface card, the first hit time point and the identifier to the application program;
- receive, based on the application program, the first hit time point and the identifier;
- obtain, based on the application program, a first interval threshold according to the identifier, wherein the first interval threshold comprises an interval threshold which is set in the application program in advance by a tenant corresponding to the target flow entry and is used for the tenant;
- determine, based on the application program, whether a first time interval between a current time point of the application program and the first hit time point is greater than or equal to the first interval threshold;
- send, based on the application program, a deleting instruction carrying the identifier to the network interface card, in a case that the first time interval is greater than or equal to the first interval threshold;
- receive, based on the network interface card, the deleting instruction;
- and
- delete, based on the network interface card, the target flow entry in the flow table according to the identifier in the deleting instruction.
A non-transitory computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the following operations are implemented:
- obtaining, based on a network interface card of an electronic device, a first hit time point at which a target flow entry in a flow table recorded in the network interface card is hit in a historical process, and obtaining an identifier of the target flow entry;
- sending, based on the network interface card, the first hit time point and the identifier to an application program for managing the network interface card, wherein the application program runs on the electronic device;
- receiving, based on the application program, the first hit time point and the identifier;
- obtaining, based on the application program, a first interval threshold according to the identifier, wherein the first interval threshold comprises an interval threshold which is set in the application program in advance by a tenant corresponding to the target flow entry and is used for the tenant;
- determining, based on the application program, whether a first time interval between a current time point of the application program and the first hit time point is greater than or equal to the first interval threshold;
- in a case that the first time interval is greater than or equal to the first interval threshold, sending, based on the application program, a deleting instruction carrying the identifier to the network interface card;
- receiving, based on the network interface card, the deleting instruction;
- and
- deleting, based on the network interface card, the target flow entry in the flow table according to the identifier in the deleting instruction.
Dependencies are inferred from the claim text.