A NTA device configuration strategy method for automatically adapting hardware resources
By automatically collecting hardware information and optimizing configuration strategies, the problem of mismatch between hardware and software configuration of NTA equipment is solved, and automatic optimization adaptation of NTA equipment is realized, which reduces operational difficulty and configuration errors and improves system processing capabilities.
Patent Information
- Application Number
- CN202111427700.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-11-26
AI Technical Summary
In the prior art, the hardware and software configurations of NTA devices do not match, resulting in poor processing capabilities, making it difficult for operators to understand complex configuration parameters, and increasing operational difficulty.
By automatically collecting hardware information, computing and binding the acquisition and business processing threads, optimizing the configuration strategy, ensuring that all processing processes are completed on the same NUMA node, reducing cross-NUMA performance losses.
Automatic optimization and adaptation of NTA equipment is realized, reducing the burden on operators, avoiding configuration errors, and improving the overall processing capability of the system.
Smart Images

Figure CN114138482B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet, and in particular to an NTA device configuration strategy method for automatically adapting hardware resources. Background Art
[0002] At present, Internet technology has been widely used in all walks of life, so it is particularly important to maintain network security. In order to ensure people's online security, it is necessary to properly monitor many behaviors on the Internet, so network traffic analysis technology has become increasingly important. With the continuous development of network technology, traffic analysis technology has become more and more complex. For example, on the one hand, it will require a deeper level of parsing of messages, and on the other hand, the processing performance requirements of network traffic analysis (NTA) devices are also getting higher and higher. The processing capacity of NTA devices is often closely related to the use of hardware. For example, we hope that network messages are in the same three-level cache from reception to processing, that is, in the NUMA system, the reception and processing of messages should not cross NUMA. We also hope to reasonably allocate hardware resources to the NTA software system according to the size of network traffic. However, in order to adapt to the general hardware platform, current software applications often do not pay special attention to the joint use with hardware, which will lead to a problem: the coordination of software and hardware is not in place, resulting in the overall processing capacity of the system not being optimal. Therefore, in order to adapt to specific hardware, operators need to manually configure some parameters. However, since these configuration parameters have a large amount of content and complex relationships, it is difficult for most operators to understand the relationship between some of the hardware and software parameters, which will cause great confusion to the adapters and increase the difficulty of operation. Summary of the invention
[0003] The purpose of the present invention is to provide a NTA device configuration strategy and method for automatically adapting hardware resources. When configuring the system for the NTA device, it is necessary to pay attention to some hardware characteristics, and configure the software system based on these hardware characteristics to make the operation state of the entire device optimal. According to the hardware characteristics and related strategies, automatic adaptation of the NTA device can greatly reduce the burden on operators and effectively avoid the impact caused by configuration errors.
[0004] On the one hand, the NTA software system generally has the main configuration information: the number of packet receiving ports, the number of packet receiving queues, the number of packet receiving threads, the number of business processing threads, the setting relationship between packet receiving threads and business processing threads, etc. On the other hand, the configuration of the NTA software system generally depends on the following hardware information: the negotiation rate of the packet receiving port, the number of packet receiving ports, the number and characteristics of the packet receiving queues, the NUMA where the network card is located, etc. These two aspects influence and restrain each other, mainly reflected in: First, the port negotiation rate and the number of packet receiving ports. If it is a 1000Mbps port, because the packet receiving volume is small, a receiving thread can receive messages from more than a dozen receiving ports at the same time when it occupies one logical core; if it is a 10000Mbps port, because the packet receiving volume of a port is large, a receiving thread can only receive messages from 1 or 2 receiving ports when it occupies one logical core. Second, we can use the RSS packet splitting feature of the network card queue to divide different traffic into different business processing threads, so the use of the network card hardware queue can also determine the division of software system threads. Third, under the NUMA architecture of the CPU, in order to reduce the performance loss caused by cross-NUMA, we hope that all processing flows of each message are completed on the same NUMA. That is to say, if the network card is on NUMA0, then when the CPU resources are sufficient, when the packet receiving thread and business processing thread that receive the message of this network card monopolize the CPU, we hope that these threads are bound to the logical core on NUMA0.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] An NTA device configuration strategy method for automatically adapting hardware resources, characterized in that it includes the following steps:
[0007] S1. Collect hardware information, including:
[0008] 4) Check the CPU configuration information, record the number of NUMA nodes, and the logical core number on each NUMA node;
[0009] 5) Check the network card information, record the number of available ports, model, maximum negotiation rate, and NUMA number of each network card;
[0010] 6) Check the available logical cores on the NUMA node where the network card is located, record the corresponding relationship, and the number of logical cores;
[0011] S2. Set up the packet receiving thread, including:
[0012] 3) Calculate the number of packet receiving threads. Two or less 10GE interfaces on the same NUMA share one packet receiving thread. Eight or less GE interfaces on the same NUMA share one packet receiving thread. The packet receiving threads corresponding to ports on different NUMAs are calculated separately.
[0013] 4) Bind the packet receiving thread. Bind the packet receiving thread to the logical core corresponding to the NUMA where the port it receives is located;
[0014] S3. Set up the business processing thread and the communication ring between the packet receiving thread and the business processing thread, including:
[0015] 4) Calculation method of the number of service cores: 1 service processing core is allocated to 4 or fewer GE ports, and 2 service processing cores are allocated to 1 10GE port;
[0016] 5) Business thread binding core policy. If the number of logical cores on the same NUMA is sufficient, the logical cores with the packet receiving PCIe interface and packet receiving thread in the same NUMA are preferentially selected to perform the business thread core binding operation; if the number of logical cores in the same NUMA is insufficient, only the number of business processing threads is set, and core binding is not performed, allowing the operating system to perform scheduling;
[0017] 6) The number of communication rings between the packet receiving thread and the business processing thread is equal to the number of business processing cores;
[0018] S4. Calculate the number of packet receiving queues: the number of packet receiving port queues is equal to the number of business processing threads on the corresponding NUMA;
[0019] S5. Set the corresponding relationship between the port, packet receiving thread, and business processing thread:
[0020] 3) For 10GE ports, the number of packet receiving queues set for each port is equal to the number of its corresponding service processing threads. Each packet receiving thread is responsible for receiving all messages from "number of ports / number of packet receiving threads" ports. The packet receiving thread then sends the messages in packet receiving queue 0 of all ports to service thread 0 and the messages in packet receiving queue 1 to service thread 1 through the corresponding ring, and so on.
[0021] For GE ports, all packets of 8 or less GEs are sent to a receiving thread assigned to it. The receiving thread then sends the packets in the receiving queue 0 of all ports to the business thread 0 and the packets in the receiving queue 1 to the business thread 1 through the corresponding ring, and so on.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] The method for automatically configuring NTA equipment provided by the present invention can automatically and optimally adapt different types of equipment, does not require special personnel to perform adaptation operations, and reduces the burden on operators. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 Automatically configure a flow chart for the present invention;
[0025] Figure 2 This is a diagram of the packet receiving framework of this embodiment. DETAILED DESCRIPTION
[0026] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0027] Example 1
[0028] like Figure 1 , Figure 2 As shown, the specific steps are as follows:
[0029] Check the NUMA node status of the CPU and record it.
[0030] Select the network port to be used for traffic collection, record the number of network ports to be used, PCIe number, and maximum negotiation rate, find the NUMA node where the network card is located, record the network port and the corresponding logical core on the NUMA node, and prepare to use the corresponding logical core as much as possible to receive the message received by this network port. Figure 1 The network ports to be used are P0\P1\P2\P3\P4\P5\P6\P7\P8\P9, where P0\P1\P2\P3 are on NUMA0 and P4\P5\P6\P7\P8\P9 are on NUMA1. You need to use the logical cores in NUMA0 to process the messages of the P0\P1\P2\P3 ports, and use the logical cores in NUMA1 to process the messages of the P4\P5\P6\P7\P8\P9 ports.
[0031] Set the packet receiving thread of the NTA system. Policy: 2 or less 10GE interfaces on the same NUMA share 1 packet receiving thread, and 8 or less GE interfaces on the same NUMA share 1 packet receiving thread. Figure 1There are 10 interfaces for traffic collection, including 4 10GE interfaces (P0\P1\P2\P3) and 6 GE interfaces (P4\P5\P6\P7\P8\P9). Therefore, 3 receiving threads are required. Threads rx-thread0\rx-thread1 are bound to 2 logical cores in NUMA0 as receiving threads for 4 10GE interfaces; thread rx-thread2 is bound to 1 logical core in NUMA1 as receiving thread for 6 GE interfaces.
[0032] Set the service processing thread of the NTA system. Policy: 1 service processing thread is allocated to 4 or fewer GE ports, and 2 service processing threads are allocated to 1 10GE port. Figure 1 , select 8 logical cores from NUMA0 as the business processing cores of the interface (P0\P1\P2\P3), and bind threads respectively:
[0033] worker-thread0\worker-thread1\worker-thread2\worker-thread3\worker-thread4\worker-thread5\worker-thread6\worker-thread7;
[0034] Select two logical cores from NUMA1 as the business processing cores of the interface (P4\P5\P6\P7\P8\P9), and bind threads worker-thread8\worker-thread9 respectively.
[0035] Set the ring for communication between the packet receiving thread and the business processing thread. Strategy: The number of rings for communication between the packet receiving thread and the business processing thread is equal to the number of business processing threads.
[0036] Set the number of NTA system port packet receiving queues. Strategy: The number of port queues is equal to the number of business processing threads on the corresponding NUMA. Figure 1 , allocate 2 packet receiving queues (rxqueue0\rxqueue1) to each of the 6 GE ports, and allocate 8 packet receiving queues to each of the 4 10GE ports:
[0037] rxqueue0\rxqueue1\rxqueue2\rxqueue3\rxqueue4\rxqueue5\rxqueue6\rxqueue7.
[0038] Set the correspondence between ports, packet receiving threads, and business processing threads. Strategy: 1) For 10GE ports, the number of packet receiving queues set for each port is equal to the number of its corresponding business processing threads. Each packet receiving thread is responsible for receiving all packets from ports with "number of ports / number of packet receiving threads". The packet receiving thread then sends the packets in packet receiving queue 0 of all ports to business processing thread 0, and the packets in packet receiving queue 1 to business processing thread 1 through the corresponding ring, and so on. 2) For GE ports, all packets of GE with a number of 8 or less are sent to a packet receiving thread assigned to it. The packet receiving thread then sends the packets in packet receiving queue 0 of all ports to business processing thread 0, and the packets in packet receiving queue 1 to business processing thread 1 through the corresponding ring, and so on. Figure 1 The packet receiving thread rx-thread0 of the 10GE port receives the packets from P0\P1, and then distributes the packets to worker-thread0 to worker-thread7 according to 8 queues through the corresponding rings. The packet receiving thread rx-thread1 receives the packets from P2\P3, and then distributes the packets to worker-thread0 to worker-thread7 according to 8 queues through the corresponding rings. The packet receiving thread rx-thread2 of the GE port receives the packets from P4 to P9, and then distributes the packets to worker-thread8 and worker-thread9 according to 2 queues through the corresponding rings.
[0039] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only preferred examples of the invention and are not intended to limit the present invention. Without departing from the novel spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A NTA device configuration strategy method for automatically adapting hardware resources, It is characterized in that The steps include: S1. Collect hardware information, including: 1) Check the CPU configuration information, record the number of NUMA nodes, and the logical core number on each NUMA node; 2) Check the network card information and record the number of available ports, model, maximum negotiation rate, and NUMA number of each network card; 3) Check the available logical cores on the NUMA node where the network card is located, record the corresponding relationship, and the number of logical cores; S2. Set up the packet receiving thread, including: 1) Calculate the number of packet receiving threads. Two or less 10GE interfaces on the same NUMA share one packet receiving thread. Eight or less GE interfaces on the same NUMA share one packet receiving thread. The packet receiving threads corresponding to ports on different NUMAs are calculated separately. 2) Bind the packet receiving thread to the logical core corresponding to the NUMA where the port where the packet is received is located; S3. Set up the business processing thread and the communication ring between the packet receiving thread and the business processing thread, including: 1) Calculation method of the number of service cores: 1 service processing core is allocated to 4 or fewer GE ports, and 2 service processing cores are allocated to 1 10GE port; 2) Business thread binding core policy: If the number of logical cores on the same NUMA is sufficient, the logical cores in the same NUMA as the packet receiving PCIe interface and the packet receiving thread are preferentially selected to perform the business thread core binding operation; if the number of logical cores in the same NUMA is insufficient, only the number of business processing threads is set without core binding, and the operating system is allowed to perform scheduling; 3) The number of communication rings between the packet receiving thread and the business processing thread is equal to the number of business processing cores; S4. Calculate the number of packet receiving queues: the number of packet receiving port queues is equal to the number of business processing threads on the corresponding NUMA; S5. Set the corresponding relationship between the port, packet receiving thread, and business processing thread: 1) For 10GE ports, the number of packet receiving queues set for each port is equal to the number of its corresponding service processing threads. Each packet receiving thread is responsible for receiving all messages from "number of ports / number of packet receiving threads" ports. The packet receiving thread then sends the messages in packet receiving queue 0 of all ports to service thread 0 and the messages in packet receiving queue 1 to service thread 1 through the corresponding ring, and so on; 2) For GE ports, all packets of 8 or less GE ports are sent to a packet receiving thread assigned to it. The packet receiving thread then sends the packets in the packet receiving queue 0 of all ports to the service thread 0 and the packets in the packet receiving queue 1 to the service thread 1 through the corresponding ring, and so on.
