Image quality verification method, device and electronic equipment
Through virtual bridge flow table statistics and clock synchronization, the quality of traffic port image acquisition in the virtual network environment is identified, the missed acquisition phenomenon is solved, the accuracy of traffic analysis and operation and maintenance efficiency is improved, and network security is ensured.
Patent Information
- Application Number
- CN202011187168.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-30
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2040-10-30
AI Technical Summary
The quality of traffic port mirror acquisition in a virtual network environment is uncontrollable, resulting in frequent leakage acquisition phenomena, affecting the quality of traffic analysis and network security.
By obtaining the business traffic information and mirror traffic information when the virtual machine executes business processes, using the digitized field in the virtual bridge flow table to count the business traffic and mirror traffic, the mirror quality verification of the traffic port is realized, the missed acquisition phenomenon is identified, and the clock is used Synchronous and flow table configuration detection ensures data accuracy.
Effectively distinguish between business traffic and mirror traffic, realize traffic reconciliation, improve operation and maintenance efficiency, timely discover and solve missed collection problems, and ensure the integrity and security of network traffic.
Smart Images

Figure CN114531380B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a mirror quality verification method, device and electronic equipment. Background Art
[0002] At present, traffic port mirroring in a virtual network environment is mainly completed on a virtual bridge (Open VSwitch, OVS). The pre-configured mirroring strategy is sent to the virtual bridge to which each virtual machine belongs through a software defined network (Software Defined Network, SDN) controller. The mirroring collection strategy exists in each virtual bridge in the form of a flow table, and finally the virtual bridge performs mirroring-related flow table matching to complete the port mirroring collection of network traffic.
[0003] Port mirroring is a traffic collection method used by many traffic analysis tools as a real-time network traffic collection method, playing an important role in network operation and maintenance. While using virtual bridge traffic port mirroring to collect traffic has the advantages of flexible collection, it also brings the risk of uncontrollable collection quality. If a large number of missed collections occur, it will inevitably lead to a decline in the quality of traffic analysis, resulting in network risks and even security risks that cannot be discovered in time, causing unnecessary losses. Summary of the invention
[0004] The purpose of the present invention is to provide an image quality verification method, device and electronic equipment to solve the image quality problem caused by leaky collection of image traffic.
[0005] To achieve the above object, an embodiment of the present invention provides an image quality verification method, comprising:
[0006] Obtaining business flow information and mirror flow information when the virtual machine executes business processes;
[0007] The mirroring quality of the traffic port is determined according to the service traffic information and the mirroring traffic information.
[0008] Optionally, the obtaining of service flow information and mirror flow information when the virtual machine executes the service process includes:
[0009] Obtaining first service flow information in the first virtual bridge;
[0010] Obtaining second service flow information and mirror flow information in the second virtual bridge;
[0011] The first virtual network bridge is deployed at a service flow start node in a physical server corresponding to the virtual machine, and the second virtual network bridge is deployed at a service flow end node in the physical server.
[0012] Optionally, the acquiring the first service flow information in the first virtual bridge includes:
[0013] Obtaining a service flow table of the first virtual bridge;
[0014] Parsing the service flow table to obtain the first service flow information;
[0015] The first service flow information includes the number of data packets matched by the service flow table.
[0016] Optionally, the acquiring the second service flow information in the second virtual bridge includes:
[0017] Obtaining a service flow encapsulation flow table of the second virtual bridge;
[0018] Parsing the service flow encapsulation flow table to obtain the second service flow information;
[0019] The second service flow information includes the number of data packets matched by the service flow encapsulation flow table.
[0020] Optionally, obtaining the mirrored traffic information in the second virtual bridge includes:
[0021] Obtaining a mirrored traffic encapsulation flow table of the second virtual bridge;
[0022] Parsing the mirrored traffic encapsulation flow table to obtain the mirrored traffic information;
[0023] The mirrored traffic information includes the number of data packets matched by the mirrored traffic encapsulation flow table.
[0024] Optionally, determining the mirroring quality of the traffic port according to the service traffic information and the mirrored traffic information includes:
[0025] Respectively obtain the first data packet quantity in the first service flow information, the second service flow information and the mirrored flow information at a first moment;
[0026] Respectively obtain the number of second data packets in the first service flow information, the second service flow information and the mirrored flow information at a second moment;
[0027] Determining the mirroring quality of the traffic port according to the quantity difference between the first data packet quantity and the second data packet quantity;
[0028] The second moment is the previous moment of the first moment.
[0029] Optionally, determining the mirroring quality of the traffic port according to the quantity difference between the first data packet quantity and the second data packet quantity includes:
[0030] The mirroring quality of the traffic port is determined according to a relationship between a first quantity difference corresponding to the first service traffic information, a second quantity difference corresponding to the second service traffic information, and a third quantity difference corresponding to the mirrored traffic information.
[0031] Optionally, before obtaining the service flow information and the mirrored flow information when the virtual machine executes the service process, the method further includes:
[0032] Get image collection configuration information;
[0033] According to the mirror image collection configuration information, configuring clock synchronization for the physical server;
[0034] extracting a flow table of a virtual network bridge deployed in the physical server;
[0035] A flow table static configuration detection is performed according to the flow table.
[0036] Optionally, the image acquisition configuration information includes image source address information and image destination address information;
[0037] The configuring clock synchronization for the physical server according to the mirror image acquisition configuration information includes:
[0038] Clock synchronization is configured for a first server corresponding to the mirroring source address information and a second server corresponding to the mirroring destination address information.
[0039] Optionally, the performing flow table static configuration detection according to the flow table includes:
[0040] Distinguishing a service flow table and a mirror flow table according to a flow table number of the flow table;
[0041] In the case where the service flow table is configured, if the mirror flow table is partially or completely not configured, it is determined that the traffic port mirroring is missed.
[0042] To achieve the above object, an embodiment of the present invention provides an image quality verification device, comprising:
[0043] The first acquisition module is used to acquire the business flow information and the mirror flow information when the virtual machine executes the business process;
[0044] The determination module is used to determine the mirroring quality of the traffic port according to the service traffic information and the mirroring traffic information.
[0045] Optionally, the first acquisition module includes:
[0046] A first acquisition unit, configured to acquire first service flow information in a first virtual network bridge;
[0047] A second acquisition unit, used to acquire second service flow information and mirror flow information in the second virtual bridge;
[0048] The first virtual network bridge is deployed at a service flow start node in a physical server corresponding to the virtual machine, and the second virtual network bridge is deployed at a service flow end node in the physical server.
[0049] Optionally, the first acquiring unit is specifically configured to:
[0050] Obtaining a service flow table of the first virtual bridge;
[0051] Parsing the service flow table to obtain the first service flow information;
[0052] The first service flow information includes the number of data packets matched by the service flow table.
[0053] Optionally, the second acquiring unit is specifically configured to:
[0054] Obtaining a service flow encapsulation flow table of the second virtual bridge;
[0055] Parsing the service flow encapsulation flow table to obtain the second service flow information;
[0056] The second service flow information includes the number of data packets matched by the service flow encapsulation flow table.
[0057] Optionally, the second acquiring unit is specifically configured to:
[0058] Obtaining a mirrored traffic encapsulation flow table of the second virtual bridge;
[0059] Parsing the mirrored traffic encapsulation flow table to obtain the mirrored traffic information;
[0060] The mirrored traffic information includes the number of data packets matched by the mirrored traffic encapsulation flow table.
[0061] Optionally, the determining module includes:
[0062] A third acquisition unit, used to respectively acquire the first service flow information, the second service flow information and the first data packet quantity in the mirrored flow information at a first moment;
[0063] A fourth acquisition unit, used to respectively acquire the number of second data packets in the first service flow information, the second service flow information and the mirrored flow information at a second moment;
[0064] A determining unit, configured to determine the mirroring quality of the traffic port according to a quantity difference between the quantity of the first data packets and the quantity of the second data packets;
[0065] The second moment is the previous moment of the first moment.
[0066] Optionally, the determining unit is specifically configured to:
[0067] The mirroring quality of the traffic port is determined according to a relationship between a first quantity difference corresponding to the first service traffic information, a second quantity difference corresponding to the second service traffic information, and a third quantity difference corresponding to the mirrored traffic information.
[0068] Optionally, the device further comprises:
[0069] The second acquisition module is used to acquire image acquisition configuration information;
[0070] A configuration module, configured to configure clock synchronization for a physical server according to the mirrored collection configuration information;
[0071] An extraction module, used for extracting a flow table of a virtual bridge deployed in the physical server;
[0072] A detection module is used to perform flow table static configuration detection according to the flow table.
[0073] Optionally, the image acquisition configuration information includes image source address information and image destination address information;
[0074] The configuration module is specifically used to configure clock synchronization for a first server corresponding to the mirror source address information and a second server corresponding to the mirror destination address information.
[0075] Optionally, the detection module is specifically used to:
[0076] Distinguishing a service flow table and a mirror flow table according to a flow table number of the flow table;
[0077] In the case where the service flow table is configured, if the mirror flow table is partially or completely not configured, it is determined that the traffic port mirroring is missed.
[0078] To achieve the above object, an embodiment of the present invention provides an electronic device, including a processor and a transceiver, wherein:
[0079] The transceiver is used to obtain business flow information and mirror flow information when the virtual machine executes the business process;
[0080] The processor is used to determine the mirroring quality of the traffic port according to the service traffic information and the mirroring traffic information.
[0081] Optionally, when acquiring the service flow information and the mirrored flow information when the virtual machine executes the service process, the transceiver is further used to:
[0082] Obtaining first service flow information in the first virtual bridge;
[0083] Obtaining second service flow information and mirror flow information in the second virtual bridge;
[0084] The first virtual network bridge is deployed at a service flow start node in a physical server corresponding to the virtual machine, and the second virtual network bridge is deployed at a service flow end node in the physical server.
[0085] Optionally, the acquiring the first service flow information in the first virtual bridge includes:
[0086] Obtaining a service flow table of the first virtual bridge;
[0087] Parsing the service flow table to obtain the first service flow information;
[0088] The first service flow information includes the number of data packets matched by the service flow table.
[0089] Optionally, obtaining second service flow information in the second virtual bridge includes:
[0090] Obtaining a service flow encapsulation flow table of the second virtual bridge;
[0091] Parsing the service flow encapsulation flow table to obtain the second service flow information;
[0092] The second service flow information includes the number of data packets matched by the service flow encapsulation flow table.
[0093] Optionally, obtaining the mirrored traffic information in the second virtual bridge includes:
[0094] Obtaining a mirrored traffic encapsulation flow table of the second virtual bridge;
[0095] Parsing the mirrored traffic encapsulation flow table to obtain the mirrored traffic information;
[0096] The mirrored traffic information includes the number of data packets matched by the mirrored traffic encapsulation flow table.
[0097] Optionally, when determining the mirroring quality of the traffic port according to the service traffic information and the mirrored traffic information, the processor is further configured to:
[0098] Respectively obtain the first data packet quantity in the first service flow information, the second service flow information and the mirrored flow information at a first moment;
[0099] Respectively obtain the number of second data packets in the first service flow information, the second service flow information and the mirrored flow information at a second moment;
[0100] Determining the mirroring quality of the traffic port according to the quantity difference between the first data packet quantity and the second data packet quantity;
[0101] The second moment is the previous moment of the first moment.
[0102] Optionally, determining the mirroring quality of the traffic port according to the quantity difference between the first data packet quantity and the second data packet quantity includes:
[0103] The mirroring quality of the traffic port is determined according to a relationship between a first quantity difference corresponding to the first service traffic information, a second quantity difference corresponding to the second service traffic information, and a third quantity difference corresponding to the mirrored traffic information.
[0104] Optionally, the transceiver is further used to: obtain mirror image acquisition configuration information;
[0105] The processor is further used to: configure clock synchronization for the physical server according to the mirror acquisition configuration information;
[0106] The transceiver is also used to: extract the flow table of the virtual bridge deployed in the physical server;
[0107] The processor is further configured to: perform flow table static configuration detection according to the flow table.
[0108] Optionally, the image acquisition configuration information includes image source address information and image destination address information;
[0109] When the processor configures clock synchronization for the physical server according to the mirroring collection configuration information, the processor is further used to:
[0110] Clock synchronization is configured for a first server corresponding to the mirroring source address information and a second server corresponding to the mirroring destination address information.
[0111] Optionally, when performing flow table static configuration detection according to the flow table, the processor is further configured to:
[0112] Distinguishing a service flow table and a mirror flow table according to a flow table number of the flow table;
[0113] In the case where the service flow table is configured, if the mirror flow table is partially or completely not configured, it is determined that the traffic port mirroring is missed.
[0114] To achieve the above-mentioned purpose, an embodiment of the present invention provides an electronic device, including a transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; when the processor executes the program or instruction, the image quality verification method as described above is implemented.
[0115] To achieve the above object, an embodiment of the present invention provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps in the image quality verification method as described above are implemented.
[0116] The beneficial effects of the above technical solution of the present invention are as follows:
[0117] The embodiments of the present invention utilize the counting fields in the virtual bridge flow table to respectively count the business flow information and the mirror flow information of a certain port, so as to better distinguish the normal business flow and the mirror flow under a certain port, and realize the reconciliation function of the business flow and the mirror flow according to the obtained business flow and mirror flow statistical information, so as to better perceive the phenomenon of network flow leakage collection and improve the overall operation and maintenance efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0118] Figure 1 This is a flow chart of a method for checking image quality according to an embodiment of the present invention;
[0119] Figure 2 The second flowchart of the image quality verification method according to the embodiment of the present invention;
[0120] Figure 3 The third flowchart of the image quality verification method according to the embodiment of the present invention;
[0121] Figure 4 It is a structural schematic diagram of an image quality verification device according to an embodiment of the present invention;
[0122] Figure 5 This is one of the structural schematic diagrams of an electronic device according to an embodiment of the present invention;
[0123] Figure 6 This is a second structural schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0124] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0125] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present invention. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0126] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0127] Additionally, the terms "system" and "network" are often used interchangeably herein.
[0128] In the embodiments provided in the present application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.
[0129] When describing the embodiments of the present invention, some concepts used in the following description are first explained.
[0130] The traffic port collection solution in the virtual network environment is mainly implemented through the following two types of service instances:
[0131] 1. Tap Service: describes the traffic mirroring destination address information. The Tap Service instance contains the following information:
[0132] 1) Image service name: indicates the name of the "Image service instance";
[0133] 2) Port ID: the ID number of the mirror destination port;
[0134] 3) Tenant ID: The ID number of the tenant who needs the image service.
[0135] 2. Tap Flow: It describes the information of the traffic mirroring source address. Each Tap Flow instance needs to be associated with a traffic mirroring source port. The Tap Flow instance contains the following information:
[0136] 1) Image stream name: indicates the name of the "image stream instance";
[0137] 2) Mirror source port: indicates the port ID where traffic mirroring is required;
[0138] 3) Image service instance ID: indicates that the "image stream instance" is associated and paired with the corresponding "image service instance";
[0139] 4) Tenant ID: The ID number of the tenant who needs the image service;
[0140] 5) Virtual Local Area Network (VLAN) filter flag: a set of VLAN values used for packet filtering;
[0141] 6) Direction filter flag: There are "out" direction, "in" direction, and "BOTH" direction.
[0142] By associating the "Mirror Service Instance" with the "Mirror Flow Instance", a mirror source address and a mirror destination address can be paired. When a data packet passes through the virtual bridge of the node where the mirror source address is located, it will be determined whether the data packet needs to be mirrored to the mirror destination address after matching the virtual bridge flow table rules.
[0143] like Figure 1 As shown, an embodiment of the present invention provides an image quality verification method, comprising:
[0144] Step 101: Obtain service flow information and mirror flow information when a virtual machine executes a service process.
[0145] The communication traffic between virtual machines can be collected through the traffic collector, such as Figure 2 As shown, taking the traffic interaction process between virtual machine 1 and virtual machine 2 as an example, the image quality verification tool obtains the flow table in the virtual bridge (br-int and br-tun) at a fixed time period, obtains the number of matching packets recorded in real time in the business flow table and the mirror flow table, and realizes the statistics of business traffic and mirror traffic.
[0146] Step 102: Determine the mirroring quality of the traffic port according to the service traffic information and the mirroring traffic information.
[0147] According to the relationship between the acquired service flow information and the mirrored flow information, the port flow mirroring quality is judged and the missed collection phenomenon is detected.
[0148] The embodiments of the present invention utilize the counting fields in the virtual bridge flow table to respectively count the business flow information and the mirror flow information of a certain port, so as to better distinguish the normal business flow and the mirror flow under a certain port, and realize the reconciliation function of the business flow and the mirror flow according to the obtained business flow and mirror flow statistical information, so as to better perceive the phenomenon of network flow leakage collection and improve the overall operation and maintenance efficiency.
[0149] Alternatively, if Figure 3As shown, before obtaining the service flow information and the mirror flow information when the virtual machine executes the service process, the method also includes:
[0150] Step 301: Obtain image collection configuration information.
[0151] In this embodiment, when performing image quality verification, the image policy is first extracted. After the image policy configuration is completed, the port image quality verification tool obtains the image acquisition configuration information (TAP Flow and TAP Service), pairs the TAP Flow with the relevant TAP Service, parses the image acquisition configuration, and records the information of the service source end, the service destination end, and the image destination end as shown in Table 1:
[0152] Table 1: Information about the mirror source, mirror destination, and mirror destination.
[0153]
[0154] Step 302: Configure clock synchronization for the physical server according to the mirror collection configuration information.
[0155] Specifically, the mirror acquisition configuration information includes mirror source address information and mirror destination address information; configuring clock synchronization for the physical server according to the mirror acquisition configuration information includes: configuring clock synchronization for the first server corresponding to the mirror source address information and the second server corresponding to the mirror destination address information.
[0156] Configure clock synchronization for each relevant physical server. The image quality verification tool finds the physical server corresponding to the relevant business virtual machine according to the "image source address" and "image destination address" obtained in step 301, and synchronizes the clock of each physical server. The "relevant business virtual machine" is the virtual machine that carries the business, for example Figure 2 For VM 1 and VM 2 in the example, the traffic sent by the VM needs to be mirrored. Since mirror records need to be obtained, each record needs to have a timestamp, which involves multiple physical servers. It is necessary to ensure that the timestamps on each server are consistent, so the physical servers are configured with clock synchronization.
[0157] Step 303: extract the flow table of the virtual bridge deployed in the physical server.
[0158] Step 304: Perform flow table static configuration detection according to the flow table.
[0159] Specifically, the flow table static configuration detection is performed according to the flow table, including: distinguishing between the business flow table and the mirror flow table according to the flow table number of the flow table; when the business flow table is configured, if the mirror flow table is partially or completely not configured, determining that the traffic port mirroring is leaked.
[0160] This embodiment is a static configuration test of the flow table, which verifies the compliance of the mirror flow table configuration. Figure 2 For example, the image quality verification tool extracts the configured flow tables in each virtual bridge (br-int, br-tap, br-tun) in the server "HOST_1" and the server "HOST_2". The business flow table and the image flow table can be distinguished according to the flow table number. If the business flow table has been configured while the image flow table is not configured or not configured completely, it is judged as missed collection.
[0161] In this embodiment, by statically checking the mirror flow table, the quality of the traffic port mirroring can be detected and the situation of mirroring leakage can be perceived. When it has been determined that the traffic port mirroring leakage has occurred, there is no need to perform the step of determining the mirroring quality of the traffic port based on the business traffic information and the mirrored traffic information.
[0162] Specifically, the obtaining of the service flow information and the mirrored flow information when the virtual machine executes the service process may include:
[0163] (1) Obtaining first service flow information in the first virtual bridge.
[0164] The first virtual network bridge is deployed at the service flow start node of the physical server corresponding to the virtual machine, such as Figure 2 As shown, the first virtual bridge may be a br-int bridge.
[0165] Specifically, obtaining the first service flow information in the first virtual bridge includes: obtaining a service flow table of the first virtual bridge; parsing the service flow table to obtain the first service flow information; the first service flow information includes the number of data packets matched by the service flow table.
[0166] like Figure 2 As shown, the virtual machine is Figure 2 Taking virtual machine 1 and virtual machine 2 in the example, where the first virtual bridge is a br-int bridge deployed in the virtual machine, the specific implementation process of obtaining the first service flow information in the first virtual bridge is described.
[0167] (a): Obtain the correspondence between the PORT, VLAN, and MAC addresses recorded in br-int of the server HOST_1 and the server HOST_2 at a fixed time period. In HOST_1 and HOST_2, first obtain the correspondence between the port (PORT), VLAN, and LAN address (Media Access Control Address, MAC) recorded in br-int through commands, and record them as shown in Table 2:
[0168] Table 2: br-int bridge PORT, VLAN, MAC address correspondence table
[0169] Serial number Timestamp Bridge Number Business Port VLAN MAC Address … … … … … …
[0170] (b): Obtain the flow table of br-int in HOST_1 and HOST_2 in the same time period as in step (a), and obtain the service flow statistics information of virtual machine 1 and virtual machine 2 in the outgoing direction (sent outward). In HOST_1 and HOST_2, the service flow of virtual machine 1 and virtual machine 2 first passes through br-int, so the service-related flow table of br-int can be extracted in a certain time period, the service flow table can be parsed, and the number of data packets matched by the service flow table can be obtained (the default field is n_packets), which is recorded as the service flow statistics information table of the port, and associated with "Table 1" and "Table 2" through the "Source PORT" field, and the "VLAN" and "Source MAC" addresses are backfilled into "Table 3". The information including the number of data packets obtained by parsing the service flow table is the first service flow information.
[0171] Table 3: br-int bridge service traffic statistics
[0172]
[0173] (2) Obtaining second service flow information and mirror flow information in the second virtual bridge. The second virtual bridge is deployed at the service flow end node in the physical server, such as Figure 2 As shown, the second virtual bridge may be a br-tun bridge.
[0174] Specifically, obtaining the second business flow information in the second virtual bridge includes: obtaining the business flow encapsulation flow table of the second virtual bridge; parsing the business flow encapsulation flow table to obtain the second business flow information; the second business flow information includes the number of data packets matched by the business flow encapsulation flow table.
[0175] Obtaining the mirrored traffic information in the second virtual bridge includes: obtaining the mirrored traffic encapsulation flow table of the second virtual bridge; parsing the mirrored traffic encapsulation flow table to obtain the mirrored traffic information; the mirrored traffic information includes the number of data packets matched by the mirrored traffic encapsulation flow table.
[0176] like Figure 2 As shown, the virtual machine is Figure 2 Taking virtual machine 1 and virtual machine 2 in the example, where the first virtual bridge is a br-int bridge deployed in the virtual machine, the specific implementation process of obtaining the second service flow information and the mirror flow information in the second virtual bridge is described.
[0177] (A): Obtain the flow table of br-tun in server HOST_1 and server HOST_2 in the same time period as in the above step (a), and obtain the service traffic and mirror traffic statistics of virtual machine 1 and virtual machine 2. In HOST_1 and HOST_2, the service traffic of virtual machine 1 and virtual machine 2 reaches the physical network card through br-int and br-tun, and the mirror traffic reaches the physical network card through br-int, br-tap and br-tun. Since both the service traffic and the mirror traffic need to pass through br-tun, the information of service traffic and mirror traffic can be counted in br-tun, and the quality of the mirror can be judged by comparing the service traffic and the mirror traffic.
[0178] Among them, the second service flow information acquisition method:
[0179] In br-tun, the service traffic is encapsulated into the tunnel, such as Generic Routing Encapsulation (GRE) or Virtual eXtensible Local Area Network (VXLAN), and forwarded to the switch (Top of Rack, TOR) connected to the physical server. The tunnel encapsulation flow table of all service traffic in br-tun of HOST_1 and HOST_2 is obtained in the same time period as in step (a) (the default is flow table 20, table=20), and the flow table is parsed to obtain "VLAN", "destination MAC", "network identifier (VXLAN Network Identifier, VNI)" and the number of matched packets. Then, according to the information recorded in "Table 1" and "Table 2", the "source MAC" and "source PORT" fields can be backfilled, and the above information can be recorded as the br-tun bridge service traffic statistics information table, as shown in Table 4:
[0180] Table 4: br-tun bridge service traffic statistics
[0181]
[0182] The method for obtaining the mirrored traffic information:
[0183] In br-tun, the mirror traffic and service traffic match different flow tables and are encapsulated into the tunnel (GRE or VXLAN). The service traffic and mirror traffic can be distinguished by the flow table number, and then forwarded to the TOR connected to the physical server. In the br-tun of HOST_1 and HOST_2, the tunnel encapsulation flow table of all mirror traffic (the default is flow table 30, table=30) is obtained in the same time period as in step (a), and the flow table is parsed to obtain "VLAN", "destination MAC", "VNI" and the number of matched packets. Then, according to the information recorded in "Table 1" and "Table 2", the "Source MAC" and "Source PORT" fields can be backfilled, and the above information can be recorded as the br-tun bridge mirror traffic statistics table, as shown in Table 5:
[0184] Table 5: br-tun bridge mirror traffic statistics
[0185]
[0186] Specifically, determining the mirroring quality of the traffic port according to the service traffic information and the mirrored traffic information may include:
[0187] Respectively obtain the number of first data packets in the first business flow information, the second business flow information and the mirrored flow information at a first moment; respectively obtain the number of second data packets in the first business flow information, the second business flow information and the mirrored flow information at a second moment; determine the mirroring quality of the flow port according to the difference between the number of the first data packets and the number of the second data packets; wherein the second moment is the previous moment of the first moment.
[0188] When determining the mirroring quality of a traffic port, obtain the number of first data packets in the first business traffic information at the first moment, the number of first data packets in the second business traffic information at the first moment, and the number of first data packets in the mirrored traffic information at the first moment; and obtain the number of second data packets in the first business traffic information at the second moment, the number of second data packets in the second business traffic information at the second moment, and the number of second data packets in the mirrored traffic information at the second moment.
[0189] Determining the mirroring quality of the traffic port based on the quantity difference between the first data packet quantity and the second data packet quantity includes: determining the mirroring quality of the traffic port based on the relationship between a first quantity difference corresponding to the first business traffic information, a second quantity difference corresponding to the second business traffic information, and a third quantity difference corresponding to the mirrored traffic information.
[0190] In this embodiment, the reconciliation function of the business flow and the mirrored flow is implemented according to the acquired business flow information and the mirrored flow information, and the port mirroring quality is judged. Wherein, the first quantity difference corresponding to the first business flow information refers to: the difference between the number of data packets in the first business flow information at the first moment and the number of data packets in the first business flow information at the second moment; the second quantity difference corresponding to the second business flow information refers to: the difference between the number of data packets in the second business flow information at the first moment and the number of data packets in the second business flow information at the second moment; the third quantity difference corresponding to the mirrored flow information refers to: the difference between the number of data packets in the mirrored flow information at the first moment and the number of data packets in the mirrored flow information at the second moment.
[0191] The following is a specific example to illustrate the implementation process of determining the mirroring quality of the traffic port based on the relationship between the first quantity difference corresponding to the first business traffic information, the second quantity difference corresponding to the second business traffic information, and the third quantity difference corresponding to the mirrored traffic information.
[0192] For example, for a port P on a given bridge B, the difference values ΔN1, ΔN2, and ΔN3 in the number of data packets between time T (i.e., the first time) and the previous time (i.e., the second time) are obtained from Table 3, Table 4, and Table 5. The port mirroring status is determined by the quantitative relationship between the three values. The determination method can be as follows:
[0193] 1) If ΔN1 = ΔN2 = ΔN3, there is no packet loss in the entire service traffic forwarding and traffic mirroring process.
[0194] 2) If ΔN1=ΔN2>ΔN3, there is no packet loss in the business traffic, but packet loss occurs during the forwarding of the mirrored traffic. The packet loss rate of the mirrored traffic at time T is L=(N2-N3) / N2. If the packet loss rate is greater than a given threshold, it is determined that missed collection occurs. The given threshold can be set according to demand.
[0195] 3) If ΔN1>ΔN2=ΔN3, both the service traffic and the mirrored traffic have packet loss, and the packet loss location is br-int. Because the sent service traffic is equal to the mirrored traffic, this situation does not belong to missed collection.
[0196] 4) If ΔN1>ΔN2>ΔN3, packet loss occurs in the service traffic and the mirror traffic. The packet loss rate of the mirror traffic at time T is L=(ΔN2-ΔN3) / ΔN2. If the packet loss rate is greater than a given threshold, it is determined that missed collection occurs.
[0197] 5) If ΔN1>ΔN3>ΔN2, packet loss occurs in the service traffic and the mirror traffic. The packet loss rate of the mirror traffic at time T is L=(ΔN1-ΔN3) / ΔN1. If the packet loss rate is greater than a given threshold, it is determined that missed collection occurs.
[0198] 6) If ΔN1=ΔN3>ΔN2, packet loss occurs in the service traffic, but no packet loss occurs in the mirrored traffic. In this case, no missed collection occurs.
[0199] It should be noted that the above is only an exemplary embodiment for determining whether mirrored traffic is missed, and other methods may be used to determine whether service traffic and mirrored traffic are lost or missed according to actual needs.
[0200] The embodiments of the present invention utilize the counting fields in the virtual bridge flow table to respectively count the business flow information and the mirror flow information of a certain port, so as to better distinguish the normal business flow and the mirror flow under a certain port, and realize the reconciliation function of the business flow and the mirror flow according to the obtained business flow and mirror flow statistical information, so as to better perceive the phenomenon of network flow leakage collection and improve the overall operation and maintenance efficiency.
[0201] like Figure 4 As shown, an image quality checking device 400 according to an embodiment of the present invention includes:
[0202] The first acquisition module 410 is used to acquire the service flow information and the mirror flow information when the virtual machine executes the service process;
[0203] The determination module 420 is used to determine the mirroring quality of the traffic port according to the service traffic information and the mirroring traffic information.
[0204] Optionally, the first acquisition module 410 includes:
[0205] A first acquisition unit, configured to acquire first service flow information in a first virtual network bridge;
[0206] A second acquisition unit, used to acquire second service flow information and mirror flow information in the second virtual bridge;
[0207] The first virtual network bridge is deployed at a service flow start node in a physical server corresponding to the virtual machine, and the second virtual network bridge is deployed at a service flow end node in the physical server.
[0208] Optionally, the first acquiring unit is specifically configured to:
[0209] Obtaining a service flow table of the first virtual bridge;
[0210] Parsing the service flow table to obtain the first service flow information;
[0211] The first service flow information includes the number of data packets matched by the service flow table.
[0212] Optionally, the second acquiring unit is specifically configured to:
[0213] Obtaining a service flow encapsulation flow table of the second virtual bridge;
[0214] Parsing the service flow encapsulation flow table to obtain the second service flow information;
[0215] The second service flow information includes the number of data packets matched by the service flow encapsulation flow table.
[0216] Optionally, the second acquiring unit is specifically configured to:
[0217] Obtaining a mirrored traffic encapsulation flow table of the second virtual bridge;
[0218] Parsing the mirrored traffic encapsulation flow table to obtain the mirrored traffic information;
[0219] The mirrored traffic information includes the number of data packets matched by the mirrored traffic encapsulation flow table.
[0220] Optionally, the determining module includes:
[0221] A third acquisition unit, used to respectively acquire the first service flow information, the second service flow information and the first data packet quantity in the mirrored flow information at a first moment;
[0222] A fourth acquisition unit, used to respectively acquire the number of second data packets in the first service flow information, the second service flow information and the mirrored flow information at a second moment;
[0223] A determining unit, configured to determine the mirroring quality of the traffic port according to a quantity difference between the quantity of the first data packets and the quantity of the second data packets;
[0224] The second moment is the previous moment of the first moment.
[0225] Optionally, the determining unit is specifically configured to:
[0226] The mirroring quality of the traffic port is determined according to a relationship between a first quantity difference corresponding to the first service traffic information, a second quantity difference corresponding to the second service traffic information, and a third quantity difference corresponding to the mirrored traffic information.
[0227] Optionally, the device further comprises:
[0228] The second acquisition module is used to acquire image acquisition configuration information;
[0229] A configuration module, configured to configure clock synchronization for a physical server according to the mirrored collection configuration information;
[0230] An extraction module, used for extracting a flow table of a virtual bridge deployed in the physical server;
[0231] A detection module is used to perform flow table static configuration detection according to the flow table.
[0232] Optionally, the image acquisition configuration information includes image source address information and image destination address information;
[0233] The configuration module is specifically used to configure clock synchronization for a first server corresponding to the mirror source address information and a second server corresponding to the mirror destination address information.
[0234] Optionally, the detection module is specifically used to:
[0235] Distinguishing a service flow table and a mirror flow table according to a flow table number of the flow table;
[0236] In the case where the service flow table is configured, if the mirror flow table is partially or completely not configured, it is determined that the traffic port mirroring is missed.
[0237] It should be noted here that the above-mentioned device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.
[0238] like Figure 5 As shown, an electronic device 500 according to an embodiment of the present invention includes a processor 510 and a transceiver 520, wherein:
[0239] The transceiver 520 is used to obtain the service flow information and mirror flow information when the virtual machine executes the service process;
[0240] The processor 510 is configured to determine the mirroring quality of the traffic port according to the service traffic information and the mirrored traffic information.
[0241] Optionally, when acquiring the service flow information and the mirrored flow information when the virtual machine executes the service process, the transceiver 520 is further used to:
[0242] Obtaining first service flow information in the first virtual bridge;
[0243] Obtaining second service flow information and mirror flow information in the second virtual bridge;
[0244] The first virtual network bridge is deployed at a service flow start node in a physical server corresponding to the virtual machine, and the second virtual network bridge is deployed at a service flow end node in the physical server.
[0245] Optionally, the acquiring the first service flow information in the first virtual bridge includes:
[0246] Obtaining a service flow table of the first virtual bridge;
[0247] Parsing the service flow table to obtain the first service flow information;
[0248] The first service flow information includes the number of data packets matched by the service flow table.
[0249] Optionally, obtaining second service flow information in the second virtual bridge includes:
[0250] Obtaining a service flow encapsulation flow table of the second virtual bridge;
[0251] Parsing the service flow encapsulation flow table to obtain the second service flow information;
[0252] The second service flow information includes the number of data packets matched by the service flow encapsulation flow table.
[0253] Optionally, obtaining the mirrored traffic information in the second virtual bridge includes:
[0254] Obtaining a mirrored traffic encapsulation flow table of the second virtual bridge;
[0255] Parsing the mirrored traffic encapsulation flow table to obtain the mirrored traffic information;
[0256] The mirrored traffic information includes the number of data packets matched by the mirrored traffic encapsulation flow table.
[0257] Optionally, when determining the mirroring quality of the traffic port according to the service traffic information and the mirrored traffic information, the processor 510 is further configured to:
[0258] Respectively obtain the first data packet quantity in the first service flow information, the second service flow information and the mirrored flow information at a first moment;
[0259] Respectively obtain the number of second data packets in the first service flow information, the second service flow information and the mirrored flow information at a second moment;
[0260] Determining the mirroring quality of the traffic port according to the quantity difference between the first data packet quantity and the second data packet quantity;
[0261] The second moment is the previous moment of the first moment.
[0262] Optionally, determining the mirroring quality of the traffic port according to the quantity difference between the first data packet quantity and the second data packet quantity includes:
[0263] The mirroring quality of the traffic port is determined according to a relationship between a first quantity difference corresponding to the first service traffic information, a second quantity difference corresponding to the second service traffic information, and a third quantity difference corresponding to the mirrored traffic information.
[0264] Optionally, the transceiver 520 is further used to: obtain mirror image acquisition configuration information;
[0265] The processor 510 is further configured to: configure clock synchronization for the physical server according to the mirror collection configuration information;
[0266] The transceiver 520 is also used to: extract the flow table of the virtual bridge deployed in the physical server;
[0267] The processor 510 is further configured to: perform flow table static configuration detection according to the flow table.
[0268] Optionally, the image acquisition configuration information includes image source address information and image destination address information;
[0269] When the processor configures clock synchronization for the physical server according to the mirroring collection configuration information, the processor is further used to:
[0270] Clock synchronization is configured for a first server corresponding to the mirroring source address information and a second server corresponding to the mirroring destination address information.
[0271] Optionally, when performing flow table static configuration detection according to the flow table, the processor is further configured to:
[0272] Distinguishing a service flow table and a mirror flow table according to a flow table number of the flow table;
[0273] In the case where the service flow table is configured, if the mirror flow table is partially or completely not configured, it is determined that the traffic port mirroring is missed.
[0274] It should be noted that the above-mentioned electronic device provided by the embodiment of the present invention can implement all the method steps implemented by the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.
[0275] An electronic device according to another embodiment of the present invention, such as Figure 6 As shown, it includes a transceiver 610, a processor 600, a memory 620, and a program or instruction stored in the memory 620 and executable on the processor 600; when the processor 600 executes the program or instruction, the steps of the above-mentioned resource pre-deployment method are implemented.
[0276] The transceiver 610 is used to receive and send data under the control of the processor 600 .
[0277] Among them, Figure 6 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 600 and memory represented by memory 620. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 610 may be a plurality of components, i.e., including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 600 is responsible for managing the bus architecture and general processing, and the memory 620 may store data used by the processor 600 when performing operations. The processor 600 is responsible for managing the bus architecture and general processing, and the memory 620 may store data used by the processor 600 when performing operations.
[0278] A readable storage medium according to an embodiment of the present invention stores a program or instruction thereon. When the program or instruction is executed by a processor, the steps in the image quality verification method as described above are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0279] The processor is the processor in the image quality verification method described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0280] It should be further explained that the electronic devices described in this specification include but are not limited to smart phones, tablet computers, etc., and many of the functional components described are called modules in order to more particularly emphasize the independence of their implementation methods.
[0281] In the embodiment of the present invention, module can be implemented with software so that it can be executed by various types of processors. For example, an executable code module of an identification can include one or more physical or logical blocks of computer instructions, for example, it can be constructed as an object, process or function. Nevertheless, the executable code of the identified module does not need to be physically located together, but can include different instructions stored in different positions, and when these instructions are logically combined together, it constitutes a module and realizes the specified purpose of the module.
[0282] In fact, executable code module can be a single instruction or many instructions, and can even be distributed on a plurality of different code segments, distributed among different programs, and distributed across a plurality of memory devices. Similarly, operating data can be identified in the module, and can be implemented and organized in the data structure of any appropriate type according to any appropriate form. The operating data can be collected as a single data set, or can be distributed in different locations (including on different storage devices), and can only be present on a system or network as an electronic signal at least in part.
[0283] When a module can be implemented by software, considering the level of existing hardware technology, a person skilled in the art can build a corresponding hardware circuit to implement the corresponding function of the module that can be implemented by software without considering the cost. The hardware circuit includes a conventional very large scale integration (VLSI) circuit or gate array and existing semiconductors such as logic chips, transistors, or other discrete components. The module can also be implemented by a programmable hardware device, such as a field programmable gate array, a programmable array logic, a programmable logic device, etc.
[0284] The above exemplary embodiments are described with reference to the accompanying drawings, and many different forms and embodiments are feasible without departing from the spirit and teachings of the present invention. Therefore, the present invention should not be constructed as a limitation of the exemplary embodiments proposed herein. More specifically, these exemplary embodiments are provided so that the present invention will be perfect and complete, and the scope of the present invention will be conveyed to those who are familiar with the technology. In these figures, the component sizes and relative sizes may be exaggerated for clarity. The terms used here are only based on the purpose of describing specific exemplary embodiments and are not intended to be limiting. As used herein, unless the text clearly indicates otherwise, the singular forms "one", "an" and "the" are intended to include these multiple forms. It will be further understood that the terms "including" and / or "comprising" when used in this specification indicate the presence of the features, integers, steps, operations, components and / or components, but do not exclude the presence or increase of one or more other features, integers, steps, operations, components, components and / or their groups. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of that range and any subranges therebetween.
[0285] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for checking image quality, characterized in that: include: Obtaining business flow information and mirror flow information when the virtual machine executes business processes; Determining the mirroring quality of the traffic port according to the service traffic information and the mirroring traffic information; The obtaining of the service flow information and the mirror flow information when the virtual machine executes the service process includes: Obtaining first service flow information in the first virtual bridge; Obtaining second service flow information and mirror flow information in the second virtual bridge; The first virtual network bridge is deployed at a service flow start node in a physical server corresponding to the virtual machine, and the second virtual network bridge is deployed at a service flow end node in the physical server; The determining the mirroring quality of the traffic port according to the service traffic information and the mirrored traffic information includes: Respectively obtain the first data packet quantity in the first service flow information, the second service flow information and the mirrored flow information at a first moment; Respectively obtain the number of second data packets in the first service flow information, the second service flow information and the mirrored flow information at a second moment; Determining the mirroring quality of the traffic port according to the quantity difference between the first data packet quantity and the second data packet quantity; The second moment is the previous moment of the first moment.
2. The method according to claim 1, characterized in that The obtaining of first service flow information in the first virtual bridge includes: Obtaining a service flow table of the first virtual bridge; Parsing the service flow table to obtain the first service flow information; The first service flow information includes the number of data packets matched by the service flow table.
3. The method according to claim 1, characterized in that: Acquiring second service flow information in the second virtual bridge includes: Obtaining a service flow encapsulation flow table of the second virtual bridge; Parsing the service flow encapsulation flow table to obtain the second service flow information; The second service flow information includes the number of data packets matched by the service flow encapsulation flow table.
4. The method according to claim 1, characterized in that: Obtain the mirrored traffic information in the second virtual bridge, including: Obtaining a mirrored traffic encapsulation flow table of the second virtual bridge; Parsing the mirrored traffic encapsulation flow table to obtain the mirrored traffic information; The mirrored traffic information includes the number of data packets matched by the mirrored traffic encapsulation flow table.
5. The method according to claim 1, characterized in that The determining the mirroring quality of the traffic port according to the quantity difference between the first data packet quantity and the second data packet quantity includes: The mirroring quality of the traffic port is determined according to a relationship between a first quantity difference corresponding to the first service traffic information, a second quantity difference corresponding to the second service traffic information, and a third quantity difference corresponding to the mirrored traffic information.
6. The method according to claim 1, characterized in that Before obtaining the service flow information and the mirror flow information when the virtual machine executes the service process, the method further includes: Get image collection configuration information; According to the mirror image collection configuration information, configuring clock synchronization for the physical server; extracting a flow table of a virtual network bridge deployed in the physical server; A flow table static configuration detection is performed according to the flow table.
7. The method according to claim 6, characterized in that The image acquisition configuration information includes image source address information and image destination address information; The configuring clock synchronization for the physical server according to the mirror image acquisition configuration information includes: Clock synchronization is configured for a first server corresponding to the mirroring source address information and a second server corresponding to the mirroring destination address information.
8. The method according to claim 7, characterized in that The performing flow table static configuration detection according to the flow table includes: Distinguishing a service flow table and a mirror flow table according to a flow table number of the flow table; In the case where the service flow table is configured, if the mirror flow table is partially or completely not configured, it is determined that the traffic port mirroring is missed.
9. An image quality verification device, characterized in that: include: The first acquisition module is used to acquire the business flow information and the mirror flow information when the virtual machine executes the business process; A determination module, used to determine the mirroring quality of the traffic port according to the service traffic information and the mirroring traffic information; The first acquisition module includes: A first acquisition unit, configured to acquire first service flow information in a first virtual network bridge; A second acquisition unit, used to acquire second service flow information and mirror flow information in the second virtual bridge; The first virtual network bridge is deployed at a service flow start node in a physical server corresponding to the virtual machine, and the second virtual network bridge is deployed at a service flow end node in the physical server; The determination module comprises: A third acquisition unit, used to respectively acquire the first service flow information, the second service flow information and the first data packet quantity in the mirrored flow information at a first moment; A fourth acquisition unit, used to respectively acquire the number of second data packets in the first service flow information, the second service flow information and the mirrored flow information at a second moment; A determining unit, configured to determine the mirroring quality of the traffic port according to a quantity difference between the quantity of the first data packets and the quantity of the second data packets; The second moment is the previous moment of the first moment.
10. An electronic device, characterized in that: include: transceivers and processors; The transceiver is used to obtain business flow information and mirror flow information when the virtual machine executes the business process; The processor is used to determine the mirroring quality of the traffic port according to the service traffic information and the mirroring traffic information; When the transceiver obtains the service flow information and the mirrored flow information when the virtual machine executes the service process, it is also used to: Obtaining first service flow information in the first virtual bridge; Obtaining second service flow information and mirror flow information in the second virtual bridge; The first virtual network bridge is deployed at a service flow start node in a physical server corresponding to the virtual machine, and the second virtual network bridge is deployed at a service flow end node in the physical server; When the processor determines the mirroring quality of the traffic port according to the service traffic information and the mirroring traffic information, the processor is further configured to: Respectively obtain the first data packet quantity in the first service flow information, the second service flow information and the mirrored flow information at a first moment; Respectively obtain the number of second data packets in the first service flow information, the second service flow information and the mirrored flow information at a second moment; Determining the mirroring quality of the traffic port according to the quantity difference between the first data packet quantity and the second data packet quantity; The second moment is the previous moment of the first moment.
11. An electronic device, comprising: A transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; wherein the processor implements the image quality verification method according to any one of claims 1 to 8 when executing the program or instruction.
12. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by the processor, the steps in the image quality verification method according to any one of claims 1 to 8 are implemented.
