Method, device, electronic device and storage medium for realizing IPFIX flexible selection of attributes for speed measurement
By selecting attribute information in the IPFIX engine module for arithmetic logic operations and storage, the problem of solidification of statistical information in the IPFIX engine module is solved, flexible selection and expansion is realized, and speed measurement and event reporting of counting information are supported.
Patent Information
- Application Number
- CN202211079678.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-09-05
AI Technical Summary
The existing IPFIX engine module supports relatively fixed categories of statistical information after the chip design is completed, cannot support flexible expansion, and cannot implement speed measurement of counting information.
By selecting attribute information to perform arithmetic and logical operations, and storing the results in a custom area of the IPFIX storage unit, it scans regularly and determines whether to report events based on the arithmetic and logical operation results. This enables IPFIX to flexibly select attributes for speed measurement and event reporting.
It realizes the flexible definition of IPFIX storage unit information and the flexible selection of attribute information, supports the flexible expansion of statistical information, and can perform speed measurement and event reporting for attribute information.
Smart Images

Figure CN115460104B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to a method for realizing IPFIX flexible selection of attributes for speed measurement, and a device, equipment and storage medium for realizing the method. Background Art
[0002] The IPFIX engine module can be used to record some information for a certain flow, such as the number of packets, the number of bytes, the delay, etc. It includes an inbound processing module, an outbound processing module and a queue scheduling module. Among them, the inbound processing module can be used to search for messages, obtain forwarding behaviors and edit behaviors; the queue scheduling module is used to queue schedule, copy and buffer messages; the outbound processing module can be used to edit and forward messages. At present, the information recorded by the IPFIX engine module for a certain flow usually comes from the inbound processing module or the outbound processing module. After the chip design is completed, the statistical information categories that IPFIX can support are relatively fixed and cannot support flexible expansion. At the same time, conventional information statistics are just simple counts and cannot support speed measurement for such counts.
[0003] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention
[0004] The purpose of the present invention is to provide a method for realizing IPFIX flexible selection of attributes for speed measurement, which can realize flexible selection of attributes, and perform speed measurement and event reporting for the attributes. At the same time, a device, electronic device and storage medium for realizing the method are also provided.
[0005] To achieve the above object, an embodiment of the present invention provides a method for implementing IPFIX flexible selection of attributes for speed measurement, the method comprising:
[0006] Selecting attribute information, performing an arithmetic logic operation on the attribute information, and storing the arithmetic logic operation result in a custom area of the IPFIX storage unit, wherein the attribute information may be selected from an inbound direction processing module or an outbound direction processing module;
[0007] Periodically scan the information stored in the custom area of the IPFIX storage unit and determine whether to perform arithmetic logic operations, and perform arithmetic logic operations when yes, store the arithmetic logic operation results in the custom area corresponding to the IPFIX storage unit, and determine whether to report the event based on the arithmetic logic operation results.
[0008] In one or more embodiments of the present invention, the attribute information is selected by the following steps:
[0009] Acquire pre-configuration information, where the pre-configuration information is acquired when the IPFIX function is enabled;
[0010] Attribute information is selected according to the pre-configuration information.
[0011] In one or more embodiments of the present invention, the attribute information may also be selected from configurable information.
[0012] In one or more embodiments of the present invention, the arithmetic logic operation includes a comparison operation and / or an arithmetic operation.
[0013] In one or more embodiments of the present invention, the periodic scanning of information stored in the custom area in the IPFIX storage unit and determining whether to perform an arithmetic logic operation includes:
[0014] The corresponding pre-configuration information is obtained by periodic scanning, and it is determined whether to read the information stored in the corresponding custom area to perform arithmetic logic operations according to the pre-configuration information.
[0015] In one or more embodiments of the present invention, the arithmetic logic operation includes three levels of arithmetic logic operations, wherein the first level of arithmetic logic operation is a comparison operation, the second level of arithmetic logic operation is a comparison operation, and the third level of logic operation is an arithmetic operation.
[0016] The present invention also discloses a device for realizing IPFIX flexible selection of attributes for speed measurement, the device comprising:
[0017] The first module is used to select attribute information, perform arithmetic logic operation on the attribute information, and store the arithmetic logic operation result in a custom area of the IPFIX storage unit. The attribute information can be selected from the input direction processing module or the output direction processing module;
[0018] The second module is used to periodically scan the information stored in the custom area of the IPFIX storage unit and determine whether to perform arithmetic and logical operations, and perform arithmetic and logical operations when it is, store the arithmetic and logical operation results in the custom area corresponding to the IPFIX storage unit, and determine whether to report the event based on the arithmetic and logical operation results.
[0019] In one or more embodiments of the present invention, the first module and the second module are provided in the IPFIX engine module.
[0020] The present invention also discloses an electronic device, the electronic device comprising:
[0021] at least one processor; and
[0022] At least one memory is coupled to the at least one processor and stores a computer program for execution by the at least one processor, and when the computer program is executed by the at least one processor, the electronic device executes the method described above.
[0023] The present invention also discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a machine, the method described above is implemented.
[0024] Compared with the prior art, the present invention can flexibly define the meaning of information in the IPFIX storage unit on the one hand, and can flexibly select attribute information on the other hand, and perform speed measurement and event reporting for the attribute information. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of a method according to an embodiment of the present invention;
[0026] Figure 2 is an event reporting flow chart according to an embodiment of the present invention;
[0027] Figure 3 is a block diagram of a device structure according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation modes.
[0029] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.
[0030] like Figure 1 to Figure 2 As shown, according to a preferred embodiment of the present invention, a method for realizing flexible selection of IPFIX attributes for speed measurement can realize flexible selection of attributes, and perform speed measurement and event reporting for the attributes. The method can be implemented by an IPFIX engine module, that is, each step in the method can be executed by the IPFIX engine module or the corresponding components in the IPFIX engine module. Figure 2 As shown, a method for implementing IPFIX flexible selection of attributes for speed measurement includes the following steps:
[0031] S100, selecting attribute information, performing an arithmetic logic operation on the attribute information, and storing the arithmetic logic operation result in a custom area of the IPFIX storage unit, wherein the attribute information may be selected from an inbound processing module or an outbound processing module;
[0032] Specifically, after the chip design is completed, the statistical information categories that the IPFIX engine module can support are relatively fixed and cannot support flexible selection and expansion. In order to avoid the rigidity of IPFIX statistical information and make it flexible, selective and extensible, the present invention first enables these statistical information (also called attribute information), such as the number of packets, the number of bytes, etc., to be flexibly selected, and at the same time, the IPFIX storage unit is provided with a custom area for storing custom statistical information to support flexible expansion of statistical information.
[0033] Furthermore, in order to realize the speed measurement and event reporting of a certain attribute information by IPFIX, the attribute information is first selected according to actual needs. The attribute information here includes but is not limited to the number of packets, the number of bytes, the delay information, the packet loss statistics information, etc. In this embodiment, the attribute information can be selected from the input processing module (IPE) or the output processing module (EPE). Of course, in other embodiments, it can also be selected from programmable information. Since the attribute information can be selected not only from the input processing module, but also from the output processing module and the programmable information, the selection of attribute information has great flexibility, thereby avoiding the problems existing in the traditional IPFIX engine module, such as the fixed supported statistical information categories and the inability to support flexible selection and expansion as described above.
[0034] Furthermore, the attribute information here can be selected through the following steps:
[0035] First, obtain the pre-configuration information. The pre-configuration information here is obtained when the IPFIX function is enabled;
[0036] Finally, attribute information is selected according to the pre-configuration information.
[0037] During implementation, when the IPFIX function is enabled, a pre-configuration information (cfgProfile) is obtained, and the pre-configuration information can be used to select attribute information participating in arithmetic and logical operations and control which arithmetic and logical operations the attribute information participates in.
[0038] Further, after selecting the attribute information, perform an arithmetic logic operation on the attribute information. The arithmetic logic operation here includes comparison operation and / or arithmetic operation, such as the arithmetic logic operation only includes comparison operation, or the arithmetic logic operation only includes arithmetic operation, or the arithmetic logic operation includes comparison operation and arithmetic operation, which can be selected according to actual needs. The comparison operation here includes but is not limited to greater than, less than, equal to, not equal to, etc.; the arithmetic operation includes but is not limited to addition, subtraction, left shift, right shift, etc. After completing the arithmetic logic operation, the arithmetic logic operation result is further stored in the custom area of the IPFIX storage unit.
[0039] In this embodiment, when performing arithmetic logic operation operations, three-level arithmetic logic operations are executed. The three-level arithmetic logic operations include first-level arithmetic logic operations, second-level arithmetic logic operations, and third-level arithmetic logic operations. Among them, the first-level arithmetic logic operation and the second-level arithmetic logic operation are preferably comparison operations, and the third-level arithmetic logic operation is preferably an arithmetic operation. Through the three-level arithmetic logic operation, various counting methods can be realized. For example, when a < x < b, the count result (result) corresponding to X is decremented by one. The count result (result) can ultimately be stored in a custom area in the IPFIX storage unit.
[0040] Of course, whether to specifically select a comparison operation or an arithmetic operation for the first-level arithmetic logic operation, the second-level arithmetic logic operation, and the third-level arithmetic logic operation can be selected according to actual needs. At the same time, the number of levels of arithmetic logic operation operations to be executed can also be selected according to actual needs.
[0041] S200, periodically scan the information stored in the custom area of the IPFIX storage unit and determine whether to perform arithmetic logic operation operations. When performing arithmetic logic operation operations, perform arithmetic logic operation operations, store the arithmetic logic operation result in the corresponding custom area of the IPFIX storage unit, and determine whether to perform event reporting according to the arithmetic logic operation result.
[0042] Specifically, after the arithmetic logic operation result for performing arithmetic logic operations on the selected attribute information is stored in the custom area of the IPFIX storage unit, the information stored in the corresponding custom area of the IPFIX storage unit can be periodically scanned by a timer. By using a timer, the IPFIX storage unit can be scanned at a certain configurable rate. Each time a scan is performed, the pre-configured information corresponding to the custom area can be obtained, and then it can be determined whether to read the information stored in the custom area to participate in the arithmetic logic operation operation according to the pre-configured information. When it is determined according to the pre-configured information that the information stored in the custom area needs to be read to participate in the arithmetic logic operation operation, the information stored in the custom area can be further read and arithmetic logic operation operations are performed with the selected attribute information. When it is determined according to the pre-configured information that the information stored in the custom area does not need to be read to participate in the arithmetic logic operation operation, the information stored in the custom area does not need to be read to participate in the arithmetic logic operation operation.
[0043] In this embodiment, it is best to store the preconfiguration information in the IPFIX entry. During implementation, the preconfiguration information in the corresponding IPFIX entry will be read each time a scan is performed, and then it is determined whether to read the information stored in the custom area in the IPFIX storage unit (IPFIX record) to participate in the arithmetic logic operation based on the preconfiguration information. The preconfiguration information here can correspond to a custom area, that is, each custom area corresponds to a preconfiguration information. Of course, in other embodiments, each preconfiguration information corresponds to multiple custom areas, that is, multiple custom areas correspond to one preconfiguration information. The information stored in these custom areas can be selected for arithmetic logic operations.
[0044] Further, when it is determined according to the pre-configured information that the information stored in the custom area needs to be read to participate in the arithmetic logic operation, the information stored in the custom area can be further read to perform the arithmetic logic operation, and the arithmetic logic operation result can be stored in the custom area corresponding to the IPFIX storage unit. Further, it can be determined whether to report the event based on the arithmetic logic operation result, such as Figure 2 As shown, arithmetic logic operations can be further performed based on the result of the logic operation, such as comparison operations, etc., so as to report the event when it is greater than or less than a certain threshold, and no event reporting is performed in other cases. For example, the pre-configured information obtained during the timed scan is configured as the left and right operand selections, such as the left operand selects the information stored in the custom area in the IPFIX storage unit, the right operand defines a constant, and the arithmetic logic operation is an addition operation, so that the effect of adding tokens at a certain rate (the rate is determined according to the length of timer timing) can be achieved, that is, one adds tokens to the custom area, and one subtracts tokens from the custom area, and once the result is found to be less than zero, a mark will be set, and then the event report will be triggered. Of course, the IPFIX storage unit will also record the event.
[0045] like Figure 3As shown, the present invention also discloses a device for realizing flexible selection of IPFIX attributes for speed measurement, and the device can realize the method for realizing flexible selection of IPFIX attributes for testing as described above. The device includes a first module and a second module. Among them, the first module is used to select attribute information, and perform arithmetic and logical operations on the attribute information, and store the arithmetic and logical operation results in a custom area of the IPFIX storage unit, and the attribute information can be selected from the input direction processing module or the output direction processing module; the second module is used to periodically scan the information stored in the custom area of the IPFIX storage unit and determine whether to perform arithmetic and logical operations, and perform arithmetic and logical operations when performing arithmetic and logical operations and store the arithmetic and logical operation results in the custom area corresponding to the IPFIX storage unit, and determine whether to report an event according to the arithmetic and logical operation results. How the first module and the second module realize the corresponding functions is detailed above, and will not be repeated here one by one.
[0046] In this embodiment, the first module and the second module are preferably two modules inside the IPFIX engine module. Of course, in other embodiments, the first module and the second module can also be set as components independent of the IPFIX engine module according to actual needs. At the same time, when the second module determines that it is necessary to read the information stored in the custom area to participate in the arithmetic logic operation according to the pre-configuration information, it reads the information stored in the custom area to perform the arithmetic logic operation, and further stores the arithmetic logic operation result in the custom area corresponding to the IPFIX storage unit. Determine whether to report the event based on the arithmetic logic operation result. If the pre-configuration information configures the left and right operand selections, such as the left operand selects the custom area information in the IPFIX storage unit, the right operand is a constant, and the arithmetic logic operation is an addition operation, so that the effect of adding tokens at a certain rate can be achieved. For the second module, a token is added to the custom area, and the first module is to subtract tokens from the custom area, and once the result is found to be reduced to zero, a mark will be set, and then the event report will be triggered.
[0047] The electronic device disclosed in one embodiment of the present invention may include, but is not limited to: a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile electronic device, a smart phone, a tablet computer, a cellular phone, a personal digital assistant (PDA), a handheld device, a messaging device, a wearable electronic device, a consumer electronic device, etc. The electronic device can implement the above-mentioned method for implementing flexible selection of attributes for testing of IPFIX, can implement flexible selection of attributes, and perform speed measurement and event reporting for the attributes. Specifically, the electronic device includes at least one memory, at least one processor and a computer program, at least one memory is coupled to the at least one processor, wherein the computer program is stored in the memory and can be run in the processor, such as the computer program is a program for implementing flexible selection of attributes for testing of IPFIX, etc. During implementation, when the processor executes the computer program, each step in the above method can be implemented, such as the step of implementing the selection of attribute information.
[0048] The computer program here can be divided into one or more units, and the one or more units are stored in the memory and executed by the memory to complete the present invention. Among them, one or more units can be a series of computer program instruction segments that can complete specific functions, and the computer program instruction segments are used to describe the execution process of the computer program in the electronic device.
[0049] It should be noted that the electronic equipment here includes but is not limited to the memory, processor and computer program mentioned above, and may also include others, such as input devices for inputting prediction information (such as keyboards, etc.), communication interfaces, etc. These components communicate with each other through a bus.
[0050] The present invention also discloses a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned method for implementing flexible selection of attributes for testing of IPFIX can be implemented. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, executable file or some intermediate form, etc., and the computer-readable medium can include any entity or device, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), etc. that can carry the computer program code.
[0051] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0052] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0053] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0054] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0055] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.
Claims
1. A method for implementing IPFIX flexible selection of attributes for speed measurement, characterized in that: The method comprises: Selecting attribute information, performing an arithmetic logic operation on the attribute information, and storing the arithmetic logic operation result in a custom area of the IPFIX storage unit, wherein the attribute information may be selected from an inbound direction processing module or an outbound direction processing module; Periodically scan the information stored in the custom area of the IPFIX storage unit and determine whether to perform arithmetic logic operations, and perform arithmetic logic operations when yes, store the arithmetic logic operation results in the custom area corresponding to the IPFIX storage unit, and determine whether to report the event based on the arithmetic logic operation results.
2. The method according to claim 1, characterized in that Select the attribute information by following the steps below: Acquire pre-configuration information, where the pre-configuration information is acquired when the IPFIX function is enabled; Attribute information is selected according to the pre-configuration information.
3. The method according to claim 1, characterized in that The attribute information may also be selected from configurable information.
4. The method according to claim 1, characterized in that The arithmetic logic operation includes a comparison operation and / or an arithmetic operation.
5. The method according to claim 4, characterized in that The periodic scanning of information stored in the custom area of the IPFIX storage unit and determining whether to perform an arithmetic logic operation includes: The corresponding pre-configuration information is obtained by periodic scanning, and it is determined whether to read the information stored in the corresponding custom area to perform arithmetic logic operations according to the pre-configuration information.
6. The method according to claim 5, characterized in that The arithmetic logic operation includes three levels of arithmetic logic operations, wherein the first level of arithmetic logic operation is a comparison operation, the second level of arithmetic logic operation is a comparison operation, and the third level of logic operation is an arithmetic operation.
7. A device for realizing IPFIX flexible selection of attributes for speed measurement, characterized in that: The device comprises: The first module is used to select attribute information, perform arithmetic logic operation on the attribute information, and store the arithmetic logic operation result in a custom area of the IPFIX storage unit. The attribute information can be selected from the input direction processing module or the output direction processing module; The second module is used to periodically scan the information stored in the custom area of the IPFIX storage unit and determine whether to perform arithmetic and logical operations, and perform arithmetic and logical operations when it is, store the arithmetic and logical operation results in the custom area corresponding to the IPFIX storage unit, and determine whether to report the event based on the arithmetic and logical operation results.
8. The device according to claim 7, characterized in that The first module and the second module are arranged in the IPFIX engine module.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and At least one memory, the at least one memory is coupled to the at least one processor and stores a computer program for execution by the at least one processor, when the computer program is executed by the at least one processor, the electronic device performs the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a machine, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for expanding IPFIX table entry by utilizing ACL
CN110912826A
Flow monitoring method and device, programmable chip, storage medium and electronic device
CN112671616A
