CN111865713A - Throughput testing method and device, storage medium and electronic equipment - Google Patents

Throughput testing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111865713A
CN111865713A CN202010583181.0A CN202010583181A CN111865713A CN 111865713 A CN111865713 A CN 111865713A CN 202010583181 A CN202010583181 A CN 202010583181A CN 111865713 A CN111865713 A CN 111865713A
Authority
CN
China
Prior art keywords
forwarding
core
target
message
session
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010583181.0A
Other languages
Chinese (zh)
Other versions
CN111865713B (en
Inventor
刘健男
党丽娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neusoft Corp
Original Assignee
Neusoft Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Neusoft Corp filed Critical Neusoft Corp
Priority to CN202010583181.0A priority Critical patent/CN111865713B/en
Publication of CN111865713A publication Critical patent/CN111865713A/en
Application granted granted Critical
Publication of CN111865713B publication Critical patent/CN111865713B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0888Throughput
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure relates to a throughput testing method, apparatus, storage medium, and electronic device, where the method is applied to a multi-core system, and includes: acquiring configuration information, and determining quadruple information for testing according to the configuration information; determining the quantity of the quadruple information corresponding to a target forwarding core for the throughput test in the multi-core system according to the total quantity of the quadruple information; for each target forwarding core, determining a message forwarding speed corresponding to each session in the target forwarding core according to the number of quadruplet information corresponding to the target forwarding core and the test forwarding speed; and the target forwarding core forwards the test message based on each session according to the message forwarding speed corresponding to the session. Therefore, each target forwarding core can correspondingly process messages from a fixed number of test IP addresses, and load balance of a plurality of target forwarding cores can be guaranteed to a certain extent. And can meet the forwarding performance requirements for performing throughput testing.

Description

Throughput testing method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a throughput testing method and apparatus, a storage medium, and an electronic device.
Background
For network security vendors, high performance throughput forwarding of firewalls becomes a serious concern for each vendor. With the development of computer technology, it is also crucial to test how the forwarding performance of firewalls is. In the prior art, the test can be performed through a hardware tester, however, different test types require different hardware testers to be purchased, and the test is expensive and inconvenient to unify.
The throughput test method is to simulate a client and a server and test the performance of UDP message forwarding of a pair of or a plurality of pairs of interfaces of a small packet with 64 bytes, a middle packet with 512 bytes and a long packet with 1518 bytes. For a tester to test firewall performance, its own throughput requirements must be wire-speed forwarded. In the prior art, the performance of the firewall can be tested by a software simulation mode based on the multi-core system, however, because a user may be random when configuring test IP addresses used for testing, especially when the number of the test IP addresses is small, severe load imbalance occurs when the multi-core system processes messages of the IP addresses, the forwarding performance requirement of the test is difficult to achieve, and a high-performance software testing method for testing the firewall is difficult to achieve.
Disclosure of Invention
The purpose of the present disclosure is to provide a load balancing, high-performance throughput testing method, device, storage medium and electronic device.
In order to achieve the above object, according to a first aspect of the present disclosure, there is provided a throughput testing method applied to a multi-core system, the method including:
acquiring configuration information, and determining quadruple information for testing according to the configuration information, wherein each quadruple information comprises a quadruple for message sending and message receiving;
determining the quantity of the quadruple information corresponding to a target forwarding core for the throughput test in the multi-core system according to the total quantity of the quadruple information;
for each target forwarding core, determining a message forwarding speed corresponding to each session in the target forwarding core according to the target forwarding core and a test forwarding speed, wherein the session is created according to each target quadruple information in the target forwarding core;
and the target forwarding core forwards the test message based on each session according to the message forwarding speed corresponding to the session.
Optionally, the determining, according to the total amount of the quadruple information, the number of quadruple information corresponding to a target forwarding core for throughput testing in the multi-core system includes:
Determining the number of initial forwarding cores for forwarding the message according to the throughput testing line speed;
determining whether the four-tuple information is evenly distributed to each initial forwarding core according to the total amount of the four-tuple information and the number of the initial forwarding cores;
and under the condition that the four-tuple information is determined to be averagely distributed to each initial forwarding core, determining the initial forwarding cores as the target forwarding cores, and determining the number corresponding to the averagely distributed four-tuple information as the number of the four-tuple information corresponding to each target forwarding core.
Optionally, the determining, according to the total amount of the quadruple information, the number of quadruple information corresponding to a target forwarding core for throughput testing in the multi-core system further includes:
upon determining that the quad information cannot be evenly distributed to each of the initial forwarding cores:
if the number of forwarding cores of the multi-core system is larger than the number of the initial forwarding cores, adding one to the number of the initial forwarding cores, and returning to the step of determining whether the four-tuple information is evenly distributed to each initial forwarding core according to the total amount of the four-tuple information and the number of the initial forwarding cores;
If the number of the initial forwarding cores is equal to the number of forwarding cores of the multi-core system, determining the forwarding cores in the multi-core system as the target forwarding cores, wherein the target forwarding cores include first forwarding cores and second forwarding cores, and the sum of the number of the quadruplet information corresponding to each first forwarding core and each second forwarding core is the total amount of the quadruplet information.
Optionally, the number of the quadruple information corresponding to the first forwarding core is obtained by rounding down the quotient of the total amount of the quadruple information and the number of forwarding cores of the multi-core system, the number of the quadruple information corresponding to the second forwarding core is obtained by rounding up the quotient of the total amount of the quadruple information and the number of forwarding cores of the multi-core system, and the number of the second forwarding core is the remainder of the total amount of the quadruple information and the number of forwarding cores of the multi-core system.
Optionally, the determining, for each target forwarding core, a packet forwarding speed corresponding to each session in the target forwarding core according to the target forwarding core and the test forwarding speed includes:
determining the quotient of the test forwarding speed and the number of the target forwarding cores as the message forwarding speed corresponding to each target forwarding core;
Determining the quotient of the message forwarding speed corresponding to the target forwarding core and the number of the sessions as the message forwarding speed corresponding to each session under the condition that the number of the sessions of the target forwarding core is the same, wherein the number of the sessions of the target forwarding core is the same as the number of the quadruple information;
determining a third forwarding core and a fourth forwarding core in the target forwarding cores under the condition that the number of sessions of the target forwarding cores is not all the same, wherein the number of sessions of the third forwarding core is one less than the number of sessions of the fourth forwarding core;
for the third forwarding core, determining the quotient of the message forwarding speed corresponding to the target forwarding core and the number of the sessions as the message forwarding speed corresponding to each session;
and determining a first session and a second session in the fourth forwarding core aiming at the fourth forwarding core, wherein the message forwarding speed corresponding to the first session is the quotient of the message forwarding speed corresponding to the target forwarding core and the number of the sessions, and the ratio of the message forwarding speed corresponding to the second session to the message forwarding speed corresponding to the first session is (K-1)/K, wherein K is the number of the second sessions.
Optionally, after determining, according to the total amount of the quadruple information, the number of quadruple information corresponding to a target forwarding core for throughput testing in the multi-core system, the method further includes:
determining message distribution parameters of the network card according to the quantity of the quadruple information corresponding to each target forwarding core;
determining the target quadruplet information corresponding to each target forwarding core according to the message distribution parameters;
and aiming at each target forwarding core, determining a session corresponding to the target forwarding core according to the target four-tuple information corresponding to the target forwarding core.
Optionally, the determining, for the number of quadruplets corresponding to each target forwarding core, a message distribution parameter of the network card includes:
acquiring an initial message distribution parameter;
performing message distribution test on the four-tuple information according to the initial message distribution parameters and the number of the target forwarding cores;
and if the quantity of the quadruple information in any one group is determined to exceed a target threshold value, updating the initial message distribution parameters until the quantity of the quadruple information in any one group is determined not to exceed the target threshold value, and determining the updated initial message distribution parameters as the message distribution parameters, wherein the target threshold value is the maximum value of the quantity of the quadruple information corresponding to each target forwarding core.
Optionally, according to the packet forwarding speed corresponding to each session, performing test packet forwarding based on the session includes:
taking the session identifier of the session as a message identifier of a header of a test message, and forwarding the test message at the message forwarding speed, wherein the session identifier is an ID of the session in a session array of the target forwarding core;
the method further comprises the following steps:
the target forwarding core acquires a message identifier from a header of a received message;
determining a session corresponding to the received message from the session array according to the message identifier under the condition that the message identifier belongs to a target range;
and processing the received message according to the determined session.
According to a second aspect of the present disclosure, there is provided a throughput testing apparatus applied to a multi-core system, the apparatus including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring configuration information and determining four-tuple information for testing according to the configuration information, and each four-tuple information comprises four-tuple used for message sending and message receiving;
the first determining module is used for determining the number of the quadruple information corresponding to a target forwarding core for throughput testing in the multi-core system according to the total amount of the quadruple information;
A second determining module, configured to determine, for each target forwarding core, a packet forwarding speed corresponding to each session in the target forwarding core according to the target forwarding core and a test forwarding speed, where the session is created according to each target quadruple information in the target forwarding core;
and the forwarding module is used for the target forwarding core to forward the test message based on each session according to the message forwarding speed corresponding to the session.
Optionally, the first determining module includes:
the first determining submodule is used for determining the number of initial forwarding cores for forwarding the message according to the throughput testing line speed;
a second determining submodule, configured to determine whether the quadruple information is evenly allocated to each initial forwarding core according to the total amount of the quadruple information and the number of the initial forwarding cores;
and a third determining submodule, configured to determine, when it is determined that the quadruple information is averagely allocated to each of the initial forwarding cores, the initial forwarding core as the target forwarding core, and determine the number of the quadruple information averagely allocated to the target forwarding core as the number of the quadruple information corresponding to each of the target forwarding cores.
Optionally, the first determining module further includes:
a fourth determining submodule, configured to, if it is determined that the quadruple information cannot be evenly distributed to each of the initial forwarding cores:
if the number of forwarding cores of the multi-core system is larger than the number of the initial forwarding cores, adding one to the number of the initial forwarding cores, and returning to the step of determining whether the four-tuple information is evenly distributed to each initial forwarding core according to the total amount of the four-tuple information and the number of the initial forwarding cores;
if the number of the initial forwarding cores is equal to the number of forwarding cores of the multi-core system, determining the forwarding cores in the multi-core system as the target forwarding cores, wherein the target forwarding cores include first forwarding cores and second forwarding cores, and the sum of the number of the quadruplet information corresponding to each first forwarding core and each second forwarding core is the total amount of the quadruplet information.
Optionally, the number of the quadruple information corresponding to the first forwarding core is obtained by rounding down the quotient of the total amount of the quadruple information and the number of forwarding cores of the multi-core system, the number of the quadruple information corresponding to the second forwarding core is obtained by rounding up the quotient of the total amount of the quadruple information and the number of forwarding cores of the multi-core system, and the number of the second forwarding core is the remainder of the total amount of the quadruple information and the number of forwarding cores of the multi-core system.
Optionally, the second determining module includes:
a fifth determining submodule, configured to determine a quotient of the test forwarding speed and the number of the target forwarding cores as a packet forwarding speed corresponding to each target forwarding core;
a sixth determining submodule, configured to determine, when the number of sessions of the target forwarding core is the same, a quotient of a packet forwarding speed corresponding to the target forwarding core and the number of sessions as a packet forwarding speed corresponding to each session, where the number of sessions of the target forwarding core is the same as the number of quadruple information;
a seventh determining sub-module, configured to determine, when the number of sessions of the target forwarding core is not all the same, a third forwarding core and a fourth forwarding core in the target forwarding core, where the number of sessions of the third forwarding core is one less than the number of sessions of the fourth forwarding core;
an eighth determining submodule, configured to determine, for the third forwarding core, a quotient of a packet forwarding speed corresponding to the target forwarding core and the number of the sessions as a packet forwarding speed corresponding to each of the sessions; and determining a first session and a second session in the fourth forwarding core aiming at the fourth forwarding core, wherein the message forwarding speed corresponding to the first session is the quotient of the message forwarding speed corresponding to the target forwarding core and the number of the sessions, and the ratio of the message forwarding speed corresponding to the second session to the message forwarding speed corresponding to the first session is (K-1)/K, wherein K is the number of the second sessions.
Optionally, after determining, according to the total amount of the quadruple information, the number of quadruple information corresponding to a target forwarding core for throughput testing in the multi-core system, the apparatus further includes:
the third determining module is used for determining the message distribution parameters of the network card according to the quantity of the quadruple information corresponding to each target forwarding core;
a fourth determining module, configured to determine, according to the message distribution parameter, the target quadruple information corresponding to each target forwarding core;
and a fifth determining module, configured to determine, for each target forwarding core, a session corresponding to the target forwarding core according to the target quadruple information corresponding to the target forwarding core.
Optionally, the fourth determining module includes:
the obtaining submodule is used for obtaining an initial message distribution parameter;
the distribution submodule is used for carrying out message distribution test on the four-tuple information according to the initial message distribution parameters and the number of the target forwarding cores;
and the updating submodule is used for updating the initial message distribution parameters under the condition that the quantity of the quadruple information in any one of the groups is determined to exceed a target threshold value until the quantity of the quadruple information in any one of the groups is determined not to exceed the target threshold value, and determining the updated initial message distribution parameters as the message distribution parameters, wherein the target threshold value is the maximum value of the quantity of the quadruple information corresponding to each target forwarding core.
Optionally, the forwarding module includes:
a forwarding submodule, configured to use a session identifier of the session as a message identifier of a header of a test message, and forward the test message at the message forwarding speed, where the session identifier is an ID of the session in a session array of the target forwarding core;
the device further comprises:
a second obtaining module, configured to obtain, by the target forwarding core, a packet identifier from a header of the received packet;
a sixth determining module, configured to determine, according to the packet identifier, a session corresponding to the received packet from the session array under the condition that the packet identifier belongs to a target range;
and the processing module is used for processing the received message according to the determined conversation.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods of the first aspect described above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of the first aspect.
In the technical scheme, configuration information is obtained, and quadruple information for testing is determined according to the configuration information; and determining the quantity of the quadruple information corresponding to the target forwarding core for the throughput test in the multi-core system according to the total quantity of the quadruple information, so that the message forwarding speed corresponding to each session in the target forwarding core can be determined according to the target forwarding core and the test forwarding speed aiming at each target forwarding core, and the test message forwarding is carried out by the target forwarding core according to the message forwarding speed corresponding to each session and based on the session. Therefore, by the technical scheme, the four-tuple information used for the throughput test is obtained, and the number of the four-tuple information corresponding to each target forwarding core is determined, so that each target forwarding core correspondingly processes the messages from the fixed number of test IP addresses, and the load balance of a plurality of target forwarding cores can be ensured to a certain extent. By determining the message forwarding speed corresponding to each session and forwarding the test message based on the message forwarding speed, the method can realize the line speed forwarding of the test message, meet the forwarding performance requirement of the throughput test, ensure the accuracy of the result of the throughput test on the firewall and improve the application range of the throughput test method.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a flow diagram of a throughput testing method provided in accordance with one embodiment of the present disclosure;
FIG. 2 is a block diagram of a throughput testing apparatus provided in accordance with one embodiment of the present disclosure;
FIG. 3 is a block diagram illustrating an electronic device in accordance with an exemplary embodiment;
FIG. 4 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
As shown in the background art, in the prior art, testing of the throughput performance of the firewall is usually realized by purchasing a high-performance hardware tester, or testing is performed based on a multi-core system or a platform design software testing method. However, the applicant has found through research that, for a software testing method, since a user generally configures a test IP address randomly, especially when the number of test IP addresses is small, a problem of severe load imbalance among multiple cores occurs when a multi-core system processes messages from each test IP address, the advantages of the multi-core system cannot be applied, and it is difficult to meet a forwarding performance requirement corresponding to a test, and it is difficult to implement a high-performance software testing method.
Based on this, the present disclosure provides the following examples. Fig. 1 is a flowchart of a throughput testing method applied to a multi-core system according to an embodiment of the present disclosure, where the method includes:
in step 11, configuration information is obtained, and quadruple information for testing is determined according to the configuration information, where each quadruple information includes a quadruple used for message transmission and message reception.
The user may pre-configure IP address information for testing, where the IP address information includes a plurality of test IP addresses for performing throughput testing. Therefore, after the user configuration is completed, the IP address information can be obtained by acquiring the configuration information. The throughput test function is mainly to simulate the client side to send messages and the service side to receive messages at the same time, and the quadruple information obtained in the embodiment comprises the quadruple used for sending and receiving the messages. Illustratively, in a quadruplet information, the quadruplet sent by the message is (source IP address Sip, destination IP address Dip, source port number Sport, destination port number Dport), and in the quadruplet information, the quadruplet received by the message is (Dip, Sip, Dport, Sport). In this embodiment, the quadruple information corresponding to each test IP address configured by the user may be determined according to each test IP address.
In step 12, the number of quadruplet information corresponding to the target forwarding core for the throughput test in the multi-core system is determined according to the total amount of the quadruplet information.
In the above example, each quadruple information includes a message sending quadruple and a message receiving quadruple, and the total amount of the quadruple information, the number of the message sending quadruple, the number of the message receiving quadruple, and the number of the test IP addresses included in the configuration information, which are determined based on the configuration information, are all the same.
Based on different forwarding performance requirements when the firewall is subjected to throughput testing, part or all of the forwarding cores can be selected for testing. And the selected forwarding core for performing the throughput test is the target forwarding core. In a possible implementation manner, if the forwarding performance requirement is low when the throughput test is performed, some forwarding cores may be selected as target forwarding cores to perform the test, and if the forwarding performance requirement is low when the throughput test is performed, all forwarding cores may be selected as target forwarding cores to perform the test.
In step 13, for each target forwarding core, determining a packet forwarding speed corresponding to each session in the target forwarding core according to the number of quadruple information corresponding to the target forwarding core and the test forwarding speed, where the session is created according to each target quadruple information in the target forwarding core, and the target quadruple information is the quadruple information of the packet forwarded by the target forwarding core.
The test forwarding speed is preset according to the performance requirement of the throughput test, and the test forwarding speed can be set to be greater than or equal to the forwarding speed of the firewall which actually needs to be tested. In this embodiment, after the number of target forwarding cores for performing the throughput test is determined, the target forwarding cores may be further determined, and a plurality of sessions exist in each target forwarding core, and then, a packet forwarding speed corresponding to each session in each target forwarding core may be determined, so as to ensure that the sum of the packet sending speeds of each session of each target forwarding core is the test forwarding speed.
For example, after the number of the quadruple information corresponding to each target forwarding core is determined, the target quadruple information corresponding to the target forwarding core may be further determined, so that a session may be created according to the target quadruple information.
In step 14, the target forwarding core forwards the test packet based on each session according to the packet forwarding speed corresponding to the session.
After the message forwarding speed corresponding to each session is determined, the test message forwarding can be performed based on the session, so as to perform throughput testing. Illustratively, the test forwarding speed is W, the number of target forwarding cores is N, and after the packet forwarding speed Vij of the jth session Sij of the ith target forwarding core Ci is determined, when performing throughput test, the test packet may be forwarded at the speed Vij based on the session Sij, that is, the number of packets forwarded by Vij in unit time based on the session Sij, so as to ensure that the number of packets forwarded by each session of each target forwarding core in unit time is W.
In the technical scheme, configuration information is obtained, and quadruple information for testing is determined according to the configuration information; and determining the quantity of the quadruple information corresponding to the target forwarding core for the throughput test in the multi-core system according to the total quantity of the quadruple information, so that the message forwarding speed corresponding to each session in the target forwarding core can be determined according to the target forwarding core and the test forwarding speed aiming at each target forwarding core, and the test message forwarding is carried out by the target forwarding core according to the message forwarding speed corresponding to each session and based on the session. Therefore, by the technical scheme, the four-tuple information used for the throughput test is obtained, and the number of the four-tuple information corresponding to each target forwarding core is determined, so that each target forwarding core correspondingly processes the messages from the fixed number of test IP addresses, and the load balance of a plurality of target forwarding cores can be ensured to a certain extent. By determining the message forwarding speed corresponding to each session and forwarding the test message based on the message forwarding speed, the method can realize the line speed forwarding of the test message, meet the forwarding performance requirement of the throughput test, ensure the accuracy of the result of the throughput test on the firewall and improve the application range of the throughput test method.
In order to make those skilled in the art understand the technical solutions provided by the embodiments of the present invention, the following detailed descriptions are provided for the above steps.
Optionally, in step 12, according to the total amount of the quadruple information, an exemplary implementation manner of determining the number of quadruple information corresponding to a target forwarding core for throughput testing in the multi-core system is as follows, and the step may include:
and determining the number of initial forwarding cores for forwarding the message according to the throughput test line speed.
The corresponding relationship between various wire speed throughputs and the number of forwarding cores can be set in advance according to an actual test scene. For example, a pair of interfaces for throughput testing of a large packet line speed is preset to correspond to two forwarding cores, so that when the throughput testing is performed, the number of the forwarding cores can be determined according to the corresponding relation and the throughput testing line speed, so as to meet the basic testing requirement in the throughput testing.
Then, determining whether the four-tuple information is evenly distributed to each initial forwarding core according to the total amount of the four-tuple information and the number of the initial forwarding cores;
and under the condition that the four-tuple information is determined to be averagely distributed to each initial forwarding core, determining the initial forwarding cores as the target forwarding cores, and determining the number corresponding to the averagely distributed four-tuple information as the number of the four-tuple information corresponding to each target forwarding core.
For example, whether the quadruplet information can be evenly distributed to each initial forwarding core can be determined through mod remainder calculation based on the total amount of the quadruplet information and the number of the initial forwarding cores. As an example, if the total amount of the quadruplet information is Y and the number of the initial forwarding cores is M, the remainder calculation may be performed as follows:
R=Y mod M;
if R is 0, that is, Y is divisible by M, it means that the quadruple information may be evenly allocated to each initial forwarding core, and if R is not 0, it means that the quadruple information may not be evenly allocated to each initial forwarding core.
In this example, when it is determined that the quadruple information is averagely allocated to each of the initial forwarding cores, the initial forwarding core is determined to be the target forwarding core, that is, it is determined that the number of forwarding cores for performing throughput testing is M, and the number (Y/M) of the evenly allocated quadruple information is determined to be the number of quadruple information corresponding to each of the target forwarding cores.
Therefore, by the technical scheme, the number of the forwarding cores for carrying out the throughput test in the multi-core system can be rapidly determined, and the corresponding quadruple information is uniformly distributed for each target forwarding core, so that the load balance of each target forwarding core is ensured, technical support is provided for carrying out the throughput test based on the test forwarding speed, and meanwhile, the accuracy and reliability of the test result of the subsequent throughput test can be improved.
Optionally, in step 12, another exemplary implementation manner of determining, according to the total amount of the quadruple information, the number of quadruple information corresponding to a target forwarding core for throughput testing in the multi-core system is as follows, and the step may further include:
upon determining that the quad information cannot be evenly distributed to each of the initial forwarding cores:
if the number of forwarding cores of the multi-core system is larger than the number of the initial forwarding cores, adding one to the number of the initial forwarding cores, and returning to the step of determining whether the four-tuple information is evenly distributed to each initial forwarding core according to the total amount of the four-tuple information and the number of the initial forwarding cores;
if the number of the initial forwarding cores is equal to the number of forwarding cores of the multi-core system, determining the forwarding cores in the multi-core system as the target forwarding cores, wherein the target forwarding cores include first forwarding cores and second forwarding cores, and the sum of the number of the quadruplet information corresponding to each first forwarding core and each second forwarding core is the total amount of the quadruplet information.
In a possible implementation manner, when it is determined that the quadruplet information cannot be evenly distributed to each initial forwarding core, that is, R is not 0, it is determined whether there are other forwarding cores in the multi-core system, that is, it is determined whether the number Num of forwarding cores of the multi-core system is greater than the number M of the initial forwarding cores, and if Num is greater than M, it indicates that there are other forwarding cores in the multi-core system, at this time, the number of the initial forwarding cores is increased by one, so as to determine whether the total amount of the quadruplet information can be evenly divided by the number of the initial forwarding cores.
For example, if the number M of initial forwarding cores is 2, it is determined that R (Y mod 2) is not 0 and the number of forwarding cores in the multi-core system is 4, that is, it is determined that the quadruple information cannot be evenly distributed to each initial forwarding core, and the number of forwarding cores of the multi-core system is greater than the number of initial forwarding cores, the number of initial forwarding cores is increased by one, that is, M is M +1, and if M is 3, a step of determining whether the quadruple information is evenly distributed to each initial forwarding core, that is, it is determined whether R (Ymod 3) is 0 again, if Y mod 3 is 0, it indicates that the quadruple information can be evenly distributed to the 3 forwarding cores, and this step may be ended, and the number of initial forwarding cores (that is, M is 3) is determined as the number of target forwarding cores, and determining the number corresponding to the four-tuple information which is evenly distributed as the number of the four-tuple information corresponding to each target forwarding core, namely Y/3.
If Y mod 3 is not 0, where the number of forwarding cores of the multi-core system is 4 and is greater than the number of initial forwarding cores 3, then M is M +1, that is, M is 4, and it is determined whether R (Ymod 4) is 0 again. For example, when R (Y mod 4) is determined to be 0, the number of quadruple information corresponding to each target forwarding core may be determined to be Y/4 in the above manner; when it is determined that R (Y mod 4) is not 0, that is, it is determined that the quadruple information cannot be evenly distributed to each initial forwarding core, and the number of initial forwarding cores is equal to the number of forwarding cores of the multi-core system, which indicates that when all forwarding cores in the multi-core system are used for testing, the quadruple information cannot be evenly distributed to each initial forwarding core yet.
The following describes the determination of the number of quadruplet information corresponding to each class of forwarding cores in detail.
Illustratively, the number of the quadruplet information corresponding to the first forwarding core is obtained by rounding down the quotient of the total amount of the quadruplet information and the number of forwarding cores of the multi-core system, the number of the quadruplet information corresponding to the second forwarding core is obtained by rounding up the quotient of the total amount of the quadruplet information and the number of forwarding cores of the multi-core system, and the number of the second forwarding core is the remainder of the total amount of the quadruplet information and the number of forwarding cores of the multi-core system.
In this embodiment, when determining the number of the quadruple information corresponding to each of the first forwarding core and the second forwarding core, in order to ensure load balancing of each forwarding core to the maximum extent, the number of the first forwarding core and the second forwarding core may be determined according to the total amount of the quadruple information and the number of the target forwarding cores.
Illustratively, the number of target forwarding cores is 4, and a remainder R between the total amount of the quadruplet information and the number of forwarding cores of the multi-core system is determined to be 1, at this time, it may be determined that the number of second forwarding cores is 1, and the number of first forwarding cores is 3 (4-1). In this embodiment, for the first forwarding core, the number of the corresponding quadruplet information is obtained by rounding down the quotient of the total amount of the quadruplet information and the number of the forwarding cores of the multi-core system, for example, the number of the quadruplet information is P, and the number of the quadruplet information corresponding to the second forwarding core is P +1, so that 1 forwarding core may be selected from 4 forwarding cores of the target forwarding core as the second forwarding core, the number of the corresponding quadruplet information is P +1, the remaining 3 forwarding cores are the first forwarding cores, and the number of the corresponding quadruplet information is P. Therefore, when the quadruple information cannot be evenly distributed to each target forwarding core, the target forwarding cores are divided into the first forwarding core and the second forwarding core, so that the average degree of the number of the quadruple information corresponding to each target forwarding core can be ensured to a certain extent, the load balance of each target forwarding core is ensured, and technical support is provided for improving the accuracy of the test result of the throughput test.
In summary, according to the above technical solution, when it is determined that the quadruple information cannot be evenly distributed to each of the initial forwarding cores, the number of the quadruple information can be tried to be evenly distributed to each of the initial forwarding cores by increasing the initial forwarding cores one by one, so that it can be ensured that the number of the quadruple information corresponding to each of the target forwarding cores determined by the above method is relatively balanced, and not only can the utilization rate and load balance of each forwarding core in the multi-core system be ensured, but also the efficiency of the throughput test can be ensured, and the usage requirements of the user can be met.
Optionally, in step 13, for each target forwarding core, according to the number of the quadruplet information corresponding to the target forwarding core and the test forwarding speed, an exemplary implementation manner of determining a packet forwarding speed corresponding to each session in the target forwarding core is as follows, and the step may include:
and determining the quotient of the test forwarding speed and the number of the target forwarding cores as the message forwarding speed corresponding to each target forwarding core. After the target forwarding cores are determined, the message forwarding speed V ═ W/N corresponding to each target forwarding core can be determined according to the test forwarding speed.
As an example, when the number of sessions of the target forwarding core is the same, determining the quotient of the packet forwarding speed corresponding to the target forwarding core and the number of sessions as the packet forwarding speed corresponding to each session, where the number of sessions of the target forwarding core is the same as the number of quadruple information.
Illustratively, the number of sessions in each target forwarding core is P, and the packet forwarding speed V ═ V/P ═ W/N/P corresponding to each session.
As another example, in a case that the number of sessions of the target forwarding core is not all the same, determining a third forwarding core and a fourth forwarding core in the target forwarding core, wherein the number of sessions of the third forwarding core is one less than the number of sessions of the fourth forwarding core;
for the third forwarding core, determining the quotient of the message forwarding speed corresponding to the target forwarding core and the number of the sessions as the message forwarding speed corresponding to each session;
and determining a first session and a second session in the fourth forwarding core aiming at the fourth forwarding core, wherein the message forwarding speed corresponding to the first session is the quotient of the message forwarding speed corresponding to the target forwarding core and the number of the sessions, and the ratio of the message forwarding speed corresponding to the second session to the message forwarding speed corresponding to the first session is (K-1)/K, wherein K is the number of the second sessions.
In this example, the number of sessions in the target forwarding core is not all the same, and in order to ensure that the packet forwarding speed corresponding to each target forwarding core is the same, the packet forwarding speed corresponding to part or all of the sessions in the target forwarding core needs to be set.
The manner of determining the third forwarding core and the fourth forwarding core in the target forwarding core is the same as the manner of determining the first forwarding core and the second forwarding core in the foregoing, and details are not described here again. Illustratively, the number of the sessions in the third forwarding core is determined to be P, and the number of the sessions in the fourth forwarding core is determined to be P + 1. Therefore, the packet forwarding speed corresponding to each session in the P third forwarding cores may be directly determined by the number of sessions, for example, V/P W/N/P. Therefore, the message forwarding speed corresponding to the target forwarding core can be guaranteed to be W/N.
For the fourth forwarding core, K sessions may be selected as second sessions, the number of the first sessions is P +1-K, the determined packet forwarding speed corresponding to the first session is W/N/P, the packet forwarding speed corresponding to the second session is ((K-1)/K) × (W/N/P), and the packet forwarding speed corresponding to the fourth forwarding core is also W/N and is the same as the packet forwarding speed corresponding to the third forwarding core by using the following formula:
V=(P+1-K)×(W/N/P)+K×((K-1)/K)×(W/N/P)
=(P+1-K)×(W/N/P)+(K-1)×(W/N/P)
=((P+1-K)+(K-1))×(W/N/P)
=W/N
For example, if the value of K is 2, the packet forwarding speed corresponding to the first P-1 sessions in the fourth forwarding core may be set to V, and the packet forwarding speed corresponding to the last 2 sessions in the fourth forwarding core may be set to V/2, so as to ensure that the packet forwarding speed corresponding to the fourth forwarding core is V.
Therefore, by the technical scheme, the packet forwarding speeds corresponding to the third forwarding core and the fourth forwarding core with different session numbers are the same, load balance of each target forwarding core for performing throughput testing in the multi-core system is further ensured, throughput performance of the multi-core system can be linearly increased along with increase of the number of the forwarding cores, and the use range of the throughput testing method is widened.
Optionally, after the step 12 of determining the number of quadruplet information corresponding to a target forwarding core for throughput testing in the multi-core system according to the total amount of the quadruplet information, the method may further include:
and determining the message distribution parameters of the network card according to the quantity of the quadruple information corresponding to each target forwarding core. For example, the network card may perform message distribution according to an RSS (receive Side scaling) algorithm, and the message distribution parameter may be an RSS key in the RSS algorithm.
For example, the exemplary implementation manner of determining the message distribution parameter of the network card for the four-tuple number corresponding to each target forwarding core may include:
obtaining an initial message distribution parameter, wherein the initial message distribution parameter may be a set default value.
And carrying out message distribution test on the four-tuple information according to the initial message distribution parameters and the number of the target forwarding cores. For example, N packets may be generated according to the number N of target forwarding cores, and then the results of RSS calculation performed on the Y quadruple information may be hashed based on the initial packet distribution parameter to obtain a hash value, and a packet to which each quadruple information belongs is determined according to the hash value.
And if the quantity of the quadruple information in any one group is determined to exceed a target threshold value, updating the initial message distribution parameters until the quantity of the quadruple information in any one group is determined not to exceed the target threshold value, and determining the updated initial message distribution parameters as the message distribution parameters, wherein the target threshold value is the maximum value of the quantity of the quadruple information corresponding to each target forwarding core.
In step 12, the number of the quadruple information corresponding to each target forwarding core is determined, so that if the number of the quadruple information in any packet obtained based on the initial message distribution parameter exceeds the target threshold, it indicates that the initial message distribution parameter cannot be distributed according to the determined number of the quadruple information corresponding to each target forwarding core, and at this time, the initial message distribution parameter needs to be updated until a message distribution parameter that can satisfy that the number of the quadruple information in any packet does not exceed the target threshold is determined. Therefore, the messages received by the network card can be evenly distributed through the configuration of the network card hardware, the average degree of the number of the messages in each network card queue is ensured, and the load balance of each target forwarding core is ensured.
And then, determining the target four-tuple information corresponding to each target forwarding core according to the message distribution parameters. For example, after the message distribution parameter is determined, the four-tuple information may be distributed in the same manner as described above to obtain the four-tuple information corresponding to each group, and the number of the four-tuple information in each group does not exceed the target threshold. The packet corresponds to the target forwarding core one to one, and then the quadruple information in the packet can be determined as the quadruple information corresponding to the target forwarding core corresponding to the quadruple information.
And aiming at each target forwarding core, determining a session corresponding to the target forwarding core according to the target four-tuple information corresponding to the target forwarding core.
In this embodiment, after determining the target quadruple information corresponding to each target forwarding core, a session corresponding to each quadruple information may be directly created in the target forwarding core for each quadruple information. Therefore, when the network card receives the message, the message can be distributed to the forwarding core where the session of the message is located according to the message distribution parameters and the quadruple of the message, so that the message can be directly forwarded based on the session in the forwarding core, on one hand, the session does not need to be established in the process of test forwarding, thereby effectively reducing the extra overhead in the process of message forwarding, improving the efficiency of message forwarding, and ensuring the accuracy of the throughput test of the firewall based on the multi-core system. On the other hand, a session can be created in advance for each target forwarding core, the sessions in different forwarding cores are different, and the message can be directly sent to the forwarding core corresponding to the session based on the network card, so that the overhead of core reversing in the message forwarding process is further reduced, and the efficiency of throughput testing is further improved.
Optionally, in step 14, according to the packet forwarding speed corresponding to each session, an exemplary implementation manner of performing test packet forwarding based on the session is as follows, and the step includes:
and taking the session identifier of the session as a message identifier of a header of a test message, and forwarding the test message at the message forwarding speed, wherein the session identifier is an ID of the session in a session array of the target forwarding core.
In the prior art, when a throughput test is performed, if the number of configuration sessions is large, when a packet forwarding query session is performed, the query is slow due to a large number of sessions, the probability of query miss is increased, and the consumption performance is high, so that the performance of receiving and sending packets is reduced. Therefore, in the embodiment of the present disclosure, a session corresponding to each target forwarding core is created in advance according to the quadruple information corresponding to the target forwarding core, and when a test packet is generated and forwarded, a session identifier of the session corresponding to the test packet is used as a packet identifier of a header of the test packet, so that a session corresponding to the session identifier is directly queried according to the session identifier, a query miss situation in the prior art does not occur, and efficiency and accuracy of session query can be effectively improved.
Based on this, the method further comprises:
the target forwarding core acquires a message identifier from a header of a received message;
determining a session corresponding to the received message from the session array according to the message identifier under the condition that the message identifier belongs to a target range; the target range is a range which is greater than or equal to 0 and less than or equal to the number of sessions of the target forwarding core.
And processing the received message according to the determined session.
In this embodiment, when a message is received, the message identifier may be directly obtained from the header of the message. If the message is used for carrying out the throughput test, the message identifier is the session identifier, so that the corresponding session can be directly determined from the session array according to the message identifier, and the message is forwarded based on the session. Illustratively, the session array is sess _ quick [ ], and the message identifier in the header of the test message is 2, then the session corresponding to the message can be directly determined to be sess _ quick [2], so that the session corresponding to the test message can be rapidly determined.
After the message identifier is obtained, whether the message is a message for performing a throughput test can be determined by determining whether the message identifier belongs to a target range, and a session can be directly determined from a session array according to the message identifier and the message can be processed under the condition that the message identifier belongs to the target range. Therefore, the message identification is added in the constructed test message header, the processing efficiency of the received message is improved, the session query process corresponding to the message is simplified, the session query efficiency and accuracy are improved, and technical support can be provided for calculating the whole test throughput.
The present disclosure also provides a throughput testing apparatus, which is applied to a multi-core system, as shown in fig. 2, the apparatus 10 includes:
a first obtaining module 100, configured to obtain configuration information, and determine, according to the configuration information, quadruple information used for testing, where each of the quadruple information includes a quadruple used for message sending and message receiving;
a first determining module 200, configured to determine, according to the total amount of the quadruple information, the number of quadruple information corresponding to a target forwarding core for a throughput test in the multi-core system;
a second determining module 300, configured to determine, for each target forwarding core, a packet forwarding speed corresponding to each session in the target forwarding core according to the target forwarding core and a test forwarding speed, where the session is created according to each target quadruple information in the target forwarding core;
a forwarding module 400, configured to forward, by the target forwarding core, the test packet based on the session according to the packet forwarding speed corresponding to each session.
Optionally, the first determining module includes:
the first determining submodule is used for determining the number of initial forwarding cores for forwarding the message according to the throughput testing line speed;
A second determining submodule, configured to determine whether the quadruple information is evenly allocated to each initial forwarding core according to the total amount of the quadruple information and the number of the initial forwarding cores;
and a third determining submodule, configured to determine, when it is determined that the quadruple information is averagely allocated to each of the initial forwarding cores, the initial forwarding core as the target forwarding core, and determine the number of the quadruple information averagely allocated to the target forwarding core as the number of the quadruple information corresponding to each of the target forwarding cores.
Optionally, the first determining module further includes:
a fourth determining submodule, configured to, if it is determined that the quadruple information cannot be evenly distributed to each of the initial forwarding cores:
if the number of forwarding cores of the multi-core system is larger than the number of the initial forwarding cores, adding one to the number of the initial forwarding cores, and returning to the step of determining whether the four-tuple information is evenly distributed to each initial forwarding core according to the total amount of the four-tuple information and the number of the initial forwarding cores;
if the number of the initial forwarding cores is equal to the number of forwarding cores of the multi-core system, determining the forwarding cores in the multi-core system as the target forwarding cores, wherein the target forwarding cores include first forwarding cores and second forwarding cores, and the sum of the number of the quadruplet information corresponding to each first forwarding core and each second forwarding core is the total amount of the quadruplet information.
Optionally, the number of the quadruple information corresponding to the first forwarding core is obtained by rounding down the quotient of the total amount of the quadruple information and the number of forwarding cores of the multi-core system, the number of the quadruple information corresponding to the second forwarding core is obtained by rounding up the quotient of the total amount of the quadruple information and the number of forwarding cores of the multi-core system, and the number of the second forwarding core is the remainder of the total amount of the quadruple information and the number of forwarding cores of the multi-core system.
Optionally, the second determining module includes:
a fifth determining submodule, configured to determine a quotient of the test forwarding speed and the number of the target forwarding cores as a packet forwarding speed corresponding to each target forwarding core;
a sixth determining submodule, configured to determine, when the number of sessions of the target forwarding core is the same, a quotient of a packet forwarding speed corresponding to the target forwarding core and the number of sessions as a packet forwarding speed corresponding to each session, where the number of sessions of the target forwarding core is the same as the number of quadruple information;
a seventh determining sub-module, configured to determine, when the number of sessions of the target forwarding core is not all the same, a third forwarding core and a fourth forwarding core in the target forwarding core, where the number of sessions of the third forwarding core is one less than the number of sessions of the fourth forwarding core;
An eighth determining submodule, configured to determine, for the third forwarding core, a quotient of a packet forwarding speed corresponding to the target forwarding core and the number of the sessions as a packet forwarding speed corresponding to each of the sessions; and determining a first session and a second session in the fourth forwarding core aiming at the fourth forwarding core, wherein the message forwarding speed corresponding to the first session is the quotient of the message forwarding speed corresponding to the target forwarding core and the number of the sessions, and the ratio of the message forwarding speed corresponding to the second session to the message forwarding speed corresponding to the first session is (K-1)/K, wherein K is the number of the second sessions.
Optionally, after determining, according to the total amount of the quadruple information, the number of quadruple information corresponding to a target forwarding core for throughput testing in the multi-core system, the apparatus further includes:
the third determining module is used for determining the message distribution parameters of the network card according to the quantity of the quadruple information corresponding to each target forwarding core;
a fourth determining module, configured to determine, according to the message distribution parameter, the target quadruple information corresponding to each target forwarding core;
and a fifth determining module, configured to determine, for each target forwarding core, a session corresponding to the target forwarding core according to the target quadruple information corresponding to the target forwarding core.
Optionally, the fourth determining module includes:
the obtaining submodule is used for obtaining an initial message distribution parameter;
the distribution submodule is used for carrying out message distribution test on the four-tuple information according to the initial message distribution parameters and the number of the target forwarding cores;
and the updating submodule is used for updating the initial message distribution parameters under the condition that the quantity of the quadruple information in any one of the groups is determined to exceed a target threshold value until the quantity of the quadruple information in any one of the groups is determined not to exceed the target threshold value, and determining the updated initial message distribution parameters as the message distribution parameters, wherein the target threshold value is the maximum value of the quantity of the quadruple information corresponding to each target forwarding core.
Optionally, the forwarding module includes:
a forwarding submodule, configured to use a session identifier of the session as a message identifier of a header of a test message, and forward the test message at the message forwarding speed, where the session identifier is an ID of the session in a session array of the target forwarding core;
the device further comprises:
a second obtaining module, configured to obtain, by the target forwarding core, a packet identifier from a header of the received packet;
A sixth determining module, configured to determine, according to the packet identifier, a session corresponding to the received packet from the session array under the condition that the packet identifier belongs to a target range;
and the processing module is used for processing the received message according to the determined conversation.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 3 is a block diagram illustrating an electronic device 700 according to an example embodiment. As shown in fig. 3, the electronic device 700 may include: a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input/output (I/O) interface 704, and a communication component 705.
The processor 701 is configured to control the overall operation of the electronic device 700, so as to complete all or part of the steps in the throughput testing method. The memory 702 is used to store various types of data to support operation at the electronic device 700, such as instructions for any application or method operating on the electronic device 700 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and the like. The Memory 702 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia components 703 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 702 or transmitted through the communication component 705. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 705 may thus include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the throughput testing methods described above.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the throughput testing method described above is also provided. For example, the computer readable storage medium may be the memory 702 described above including program instructions that are executable by the processor 701 of the electronic device 700 to perform the throughput testing method described above.
Fig. 4 is a block diagram illustrating an electronic device 1900 according to an example embodiment. For example, the electronic device 1900 may be provided as a server. Referring to fig. 4, an electronic device 1900 includes a processor 1922, which may be one or more in number, and a memory 1932 for storing computer programs executable by the processor 1922. The computer program stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processor 1922 may be configured to execute the computer program to perform the throughput testing method described above.
Additionally, electronic device 1900 may also include a power component 1926 and a communication component 1950, the power component 1926 may be configured to perform power management of the electronic device 1900, and the communication component 1950 may be configured to enable communication, e.g., wired or wireless communication, of the electronic device 1900. In addition, the electronic device 1900 may also include input/output (I/O) interfaces 1958. The electronic device 1900 may operate based on an operating system, such as a Windows Server, stored in memory 1932TM,Mac OSXTM,UnixTM,LinuxTMAnd so on.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the throughput testing method described above is also provided. For example, the computer readable storage medium may be the memory 1932 described above that includes program instructions that are executable by the processor 1922 of the electronic device 1900 to perform the throughput testing method described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-mentioned throughput testing method when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, various possible combinations will not be separately described in this disclosure.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A throughput testing method is applied to a multi-core system, and comprises the following steps:
acquiring configuration information, and determining quadruple information for testing according to the configuration information, wherein each quadruple information comprises a quadruple for message sending and message receiving;
determining the quantity of the quadruple information corresponding to a target forwarding core for the throughput test in the multi-core system according to the total quantity of the quadruple information;
For each target forwarding core, determining a message forwarding speed corresponding to each session in the target forwarding core according to the number of quadruplet information corresponding to the target forwarding core and the test forwarding speed, wherein the sessions are respectively created according to each target quadruplet information in the target forwarding core;
and the target forwarding core forwards the test message based on each session according to the message forwarding speed corresponding to the session.
2. The method of claim 1, wherein the determining, according to the total amount of the quadruple information, the number of quadruple information corresponding to a target forwarding core for throughput testing in the multi-core system comprises:
determining the number of initial forwarding cores for forwarding the message according to the throughput testing line speed;
determining whether the four-tuple information is evenly distributed to each initial forwarding core according to the total amount of the four-tuple information and the number of the initial forwarding cores;
and under the condition that the four-tuple information is determined to be averagely distributed to each initial forwarding core, determining the initial forwarding cores as the target forwarding cores, and determining the number corresponding to the averagely distributed four-tuple information as the number of the four-tuple information corresponding to each target forwarding core.
3. The method of claim 2, wherein the determining the number of quadruplet information corresponding to a target forwarding core for throughput testing in the multi-core system according to the total amount of the quadruplet information further comprises:
upon determining that the quad information cannot be evenly distributed to each of the initial forwarding cores:
if the number of forwarding cores of the multi-core system is larger than the number of the initial forwarding cores, adding one to the number of the initial forwarding cores, and returning to the step of determining whether the four-tuple information is evenly distributed to each initial forwarding core according to the total amount of the four-tuple information and the number of the initial forwarding cores;
if the number of the initial forwarding cores is equal to the number of forwarding cores of the multi-core system, determining the forwarding cores in the multi-core system as the target forwarding cores, wherein the target forwarding cores include first forwarding cores and second forwarding cores, and the sum of the number of the quadruplet information corresponding to each first forwarding core and each second forwarding core is the total amount of the quadruplet information.
4. The method of claim 3, wherein the number of quadruplet information corresponding to the first forwarding core is obtained by rounding down the quotient of the total amount of the quadruplet information and the number of forwarding cores of the multi-core system, the number of quadruplet information corresponding to the second forwarding core is obtained by rounding up the quotient of the total amount of the quadruplet information and the number of forwarding cores of the multi-core system, and the number of the second forwarding core is a remainder of the total amount of the quadruplet information and the number of forwarding cores of the multi-core system.
5. The method according to claim 1, wherein the determining, for each target forwarding core, a packet forwarding speed corresponding to each session in the target forwarding core according to the number of quadruplet information corresponding to the target forwarding core and the test forwarding speed comprises:
determining the quotient of the test forwarding speed and the number of the target forwarding cores as the message forwarding speed corresponding to each target forwarding core;
determining the quotient of the message forwarding speed corresponding to the target forwarding core and the number of the sessions as the message forwarding speed corresponding to each session under the condition that the number of the sessions of the target forwarding core is the same, wherein the number of the sessions of the target forwarding core is the same as the number of the quadruple information;
determining a third forwarding core and a fourth forwarding core in the target forwarding cores under the condition that the number of sessions of the target forwarding cores is not all the same, wherein the number of sessions of the third forwarding core is one less than the number of sessions of the fourth forwarding core;
for the third forwarding core, determining the quotient of the message forwarding speed corresponding to the target forwarding core and the number of the sessions as the message forwarding speed corresponding to each session;
And determining a first session and a second session in the fourth forwarding core aiming at the fourth forwarding core, wherein the message forwarding speed corresponding to the first session is the quotient of the message forwarding speed corresponding to the target forwarding core and the number of the sessions, and the ratio of the message forwarding speed corresponding to the second session to the message forwarding speed corresponding to the first session is (K-1)/K, wherein K is the number of the second sessions.
6. The method of claim 1, wherein after determining the number of quad information corresponding to a target forwarding core for throughput testing in the multi-core system according to the total amount of the quad information, the method further comprises:
determining message distribution parameters of the network card according to the quantity of the quadruple information corresponding to each target forwarding core;
determining the target quadruplet information corresponding to each target forwarding core according to the message distribution parameters;
and aiming at each target forwarding core, determining a session corresponding to the target forwarding core according to the target four-tuple information corresponding to the target forwarding core.
7. The method of claim 1, wherein performing test packet forwarding based on each session according to the packet forwarding speed corresponding to the session comprises:
Taking the session identifier of the session as a message identifier of a header of a test message, and forwarding the test message at the message forwarding speed, wherein the session identifier is an ID of the session in a session array of the target forwarding core;
the method further comprises the following steps:
the target forwarding core acquires a message identifier from a header of a received message;
determining a session corresponding to the received message from the session array according to the message identifier under the condition that the message identifier belongs to a target range;
and processing the received message according to the determined session.
8. A throughput testing apparatus, applied to a multi-core system, includes:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring configuration information and determining four-tuple information for testing according to the configuration information, and each four-tuple information comprises four-tuple used for message sending and message receiving;
the first determining module is used for determining the number of the quadruple information corresponding to a target forwarding core for throughput testing in the multi-core system according to the total amount of the quadruple information;
a second determining module, configured to determine, for each target forwarding core, a packet forwarding speed corresponding to each session in the target forwarding core according to the target forwarding core and a test forwarding speed, where the session is created according to each target quadruple information in the target forwarding core;
And the forwarding module is used for the target forwarding core to forward the test message based on each session according to the message forwarding speed corresponding to the session.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 7.
CN202010583181.0A 2020-06-23 2020-06-23 Throughput testing method and device, storage medium and electronic equipment Active CN111865713B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010583181.0A CN111865713B (en) 2020-06-23 2020-06-23 Throughput testing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010583181.0A CN111865713B (en) 2020-06-23 2020-06-23 Throughput testing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111865713A true CN111865713A (en) 2020-10-30
CN111865713B CN111865713B (en) 2022-02-08

Family

ID=72988620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010583181.0A Active CN111865713B (en) 2020-06-23 2020-06-23 Throughput testing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111865713B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104065538A (en) * 2014-07-07 2014-09-24 北京瑞汛世纪科技有限公司 Network performance measurement control method, control server and system
CN105812276A (en) * 2016-04-27 2016-07-27 深圳市风云实业有限公司 Message forwarding adaptive system and method adopting multi-core processor
CN106533978A (en) * 2016-11-24 2017-03-22 东软集团股份有限公司 Network load balancing method and system
US20170244604A1 (en) * 2014-12-04 2017-08-24 Amazon Technologies, Inc. Automated determination of maximum service throughput
CN108667730A (en) * 2018-04-17 2018-10-16 东软集团股份有限公司 Message forwarding method, device, storage medium based on load balancing and equipment
CN110677397A (en) * 2019-09-18 2020-01-10 广东网堤信息安全技术有限公司 NAT data forwarding method based on DPDK

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104065538A (en) * 2014-07-07 2014-09-24 北京瑞汛世纪科技有限公司 Network performance measurement control method, control server and system
US20170244604A1 (en) * 2014-12-04 2017-08-24 Amazon Technologies, Inc. Automated determination of maximum service throughput
CN105812276A (en) * 2016-04-27 2016-07-27 深圳市风云实业有限公司 Message forwarding adaptive system and method adopting multi-core processor
CN106533978A (en) * 2016-11-24 2017-03-22 东软集团股份有限公司 Network load balancing method and system
CN108667730A (en) * 2018-04-17 2018-10-16 东软集团股份有限公司 Message forwarding method, device, storage medium based on load balancing and equipment
CN110677397A (en) * 2019-09-18 2020-01-10 广东网堤信息安全技术有限公司 NAT data forwarding method based on DPDK

Also Published As

Publication number Publication date
CN111865713B (en) 2022-02-08

Similar Documents

Publication Publication Date Title
US10015090B2 (en) Packet steering
US20200127922A1 (en) Hybrid network processing load distribution in computing systems
Qi et al. Assessing container network interface plugins: Functionality, performance, and scalability
US9602428B2 (en) Method and apparatus for locality sensitive hash-based load balancing
CN112039796B (en) Data packet transmission method and device, storage medium and electronic equipment
CN106878194B (en) Message processing method and device
JP2005006303A (en) Virtual network address
CN113326228B (en) Message forwarding method, device and equipment based on remote direct data storage
KR20210038686A (en) Packet processing method and apparatus, and related devices
US11444808B1 (en) Scaling network address translation (NAT) and firewall functionality to support public cloud networks
CN106921578B (en) Method and device for generating forwarding table item
CN113472900B (en) Message processing method, device, storage medium and computer program product
CN112788060A (en) Data packet transmission method and device, storage medium and electronic equipment
CN112910793A (en) Method for connection multiplexing in seven-layer load balancing and load balancer
CN112787913A (en) Intelligent network card assembly, physical machine, cloud service system and message sending method
CN114629816B (en) Public network IP network state detection method and system
CN106716974B (en) Access distribution method, device and system
CN111865713B (en) Throughput testing method and device, storage medium and electronic equipment
EP3610615B1 (en) Packet batch processing with graph-path based pre-classification
US10764722B2 (en) Subscriber sampling for network packet forwarding based upon unique subscriber identifiers
CN116264520A (en) Artificial intelligence supported network telemetry using data processing units
CN112511440B (en) Message forwarding method, system, storage medium and electronic equipment
CN114640679A (en) Data packet transmission method and device, storage medium and electronic equipment
CN113169936B (en) Service chaining mechanism for data stream processing
Baldi et al. Network Function Modeling and Performance Estimation.

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant