CN112511385A - Test flow data generation method and device and electronic equipment - Google Patents
Test flow data generation method and device and electronic equipment Download PDFInfo
- Publication number
- CN112511385A CN112511385A CN202011389477.5A CN202011389477A CN112511385A CN 112511385 A CN112511385 A CN 112511385A CN 202011389477 A CN202011389477 A CN 202011389477A CN 112511385 A CN112511385 A CN 112511385A
- Authority
- CN
- China
- Prior art keywords
- flow
- traffic
- load
- destination port
- distributed
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 244
- 238000000034 method Methods 0.000 title claims abstract description 54
- 230000005540 biological transmission Effects 0.000 claims abstract description 126
- 238000005070 sampling Methods 0.000 claims abstract description 67
- 238000012546 transfer Methods 0.000 claims description 23
- 238000004891 communication Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 17
- 238000007726 management method Methods 0.000 description 49
- 230000000694 effects Effects 0.000 description 11
- 238000012545 processing Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 5
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000000903 blocking effect Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 235000003642 hunger Nutrition 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000037351 starvation Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0876—Network utilisation, e.g. volume of load or congestion level
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0876—Network utilisation, e.g. volume of load or congestion level
- H04L43/0894—Packet rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention provides a test flow data generation method and device and electronic equipment, and relates to the technical field of computers. The method comprises the following steps: determining a traffic load to be distributed; determining a distribution mode of the traffic load to be distributed, and distributing a target destination port in a designated network scene for the traffic load to be distributed based on the distribution mode; determining a flow mode of a flow load to be distributed, and determining a transmission parameter of the flow load to be distributed based on the flow mode; generating a test flow file related to the flow load to be distributed based on the sampling result, the target destination port and the transmission parameter, and returning to the step of determining the flow load to be distributed until the number of the obtained test flow files meets the set number; and generating flow data corresponding to each obtained test flow file. Compared with the prior art, the scheme provided by the embodiment of the invention can be used for generating the test flow data which is effective and reasonable and can completely cover various flow modes in probability.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a test flow data generation method and device and electronic equipment.
Background
With the continuous development of network technology, the complexity of the network becomes higher and higher, and the traffic patterns of various network scenes also exhibit the characteristics of complexity and changeability, wherein the traffic pattern refers to: and in the transmission process of the flow data of various network scenes, the transmission mode of the flow data is adopted. For example, a micro-burst traffic pattern in which a traffic burst occurs in a short time, a certain traffic pattern in which a destination port determines and continues to transmit, a micro-burst traffic, a hybrid pattern in which a traffic mixture occurs, and the like.
When different types of traffic patterns appear in a network scene, a cache space management algorithm of the network scene needs to give good consideration to high cache utilization rate, high fairness and high bandwidth and less packet loss of a network environment so as to ensure the processing effect of traffic data.
For example, for a switch shared cache, there is an essential conflict between a high cache utilization rate, high fairness, and high bandwidth and few packet loss, where the high cache utilization rate requires that an already incoming packet is cached in a cache space as much as possible, and thus, there may occur a phenomenon of "starvation" because the available cache space is small and packets of other queues cannot be cached; conversely, high fairness and high bandwidth require a reservation of buffer space to prevent bursty traffic.
Based on this, in the related art, in order to enable the cache space management algorithm of the network scenario to have high cache utilization rate, high fairness, high bandwidth and less packet loss in the network environment when the cache space management algorithm is directed at different types of traffic patterns, so as to ensure the processing effect of the traffic data, a user hopes to test and verify the cache space management algorithm of the set network scenario by using the test traffic data which is effective, reasonable and can completely cover various traffic patterns in probability, thereby improving the processing effect of the cache space management algorithm of the set network scenario on the traffic data in various traffic patterns.
For example, the set switch shared cache management algorithm is tested and verified by using the test traffic data which is effective, reasonable and covers various traffic modes completely in probability, so that the management effect of the switch shared cache management algorithm on the shared cache in various traffic modes is improved, and further, the processing effect of the traffic data is improved.
Based on this, how to generate effective and reasonable test traffic data which covers various traffic patterns completely in probability is called an urgent problem to be solved.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for generating test flow data and electronic equipment, so as to generate the test flow data which is effective and reasonable and can completely cover various flow modes in probability. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for generating test traffic data, where the method includes:
sampling each source port in a specified network scene based on preset transmission time, and determining a flow load to be distributed according to a sampling result;
determining a distribution mode of the traffic load to be distributed according to a preset test traffic data requirement, and distributing a target destination port in the designated network scene for the traffic load to be distributed based on the distribution mode;
determining a flow mode of the flow load to be distributed according to the test flow data requirement, and determining a transmission parameter of the flow load to be distributed based on the flow mode; wherein the transmission parameters include: for each destination port, a traffic rate at which the traffic load allocated to the destination port is transferred between the source port and the destination port, and a transfer start time and a transfer end time of the traffic load allocated to the destination port;
generating a test flow file related to the flow load to be distributed based on the sampling result, the target destination port and the transmission parameter, and returning to execute the step of sampling each source port based on the preset transmission time length until the number of the obtained test flow files meets the number set by the test flow data requirement;
and generating flow data corresponding to each obtained test flow file.
Optionally, in a specific implementation manner, before the step of generating, based on the sampling result, the target destination port, and the transmission parameter, a test traffic file related to the traffic load to be distributed, the method further includes:
determining the priority of each target destination port;
the step of generating a test traffic file about the traffic load to be distributed based on the sampling result, the target destination port, and the transmission parameter includes:
and generating a test flow file related to the flow load to be distributed based on the sampling result, the target destination port, the transmission parameters and the set priority of each target port.
Optionally, in a specific implementation manner, the step of determining the distribution mode of the traffic load to be distributed according to a preset test traffic data requirement includes:
randomly determining a distribution mode of the traffic load to be distributed; or,
and determining the distribution mode of the traffic load to be distributed according to the number of various preset distribution modes and the number of various distribution modes corresponding to the generated test traffic file.
Optionally, in a specific implementation manner, the step of allocating, based on the allocation pattern, a target destination port in the specified network scenario for the traffic load to be allocated includes:
if the distribution mode is a consistency uniform mode, determining each destination port as a target destination port, and determining the load weight of each target destination port; distributing the traffic load to be distributed to each target destination port according to the load weight of each target destination port;
if the distribution mode is a one-out-of-one mode, determining a specified number of target destination ports, and distributing the traffic load to be distributed to the determined target destination ports; wherein the specified number is: half of the number of active source ports characterized by the sampling result;
and if the distribution mode is a full mesh mode, determining each destination port as a target destination port, and distributing the traffic load to be distributed to each target destination port on average.
Optionally, in a specific implementation manner, the step of determining the traffic pattern of the traffic load to be distributed according to the demand of the test traffic data includes:
randomly determining a traffic pattern of the traffic load to be distributed; or,
and determining the flow modes of the flow load to be distributed according to the number of the preset various flow modes and the number of the various flow modes corresponding to the generated test flow file.
Optionally, in a specific implementation manner, the step of determining the transmission parameter of the traffic load to be allocated based on the traffic pattern includes:
if the flow mode is a determined flow, determining a transmission parameter of the flow load to be distributed according to the preset transmission duration;
if the flow mode is background flow, determining transmission parameters of the flow load to be distributed according to the flow load distributed to each target destination port and the preset transmission duration;
and if the flow mode is micro-burst flow, determining the transmission parameters of the flow load to be distributed according to the flow rate of the active source port represented by the sampling result.
In a second aspect, an embodiment of the present invention provides a device for generating test traffic data, where the device includes:
the load determining module is used for sampling each source port in the appointed network scene based on the preset transmission duration and determining the flow load to be distributed according to the sampling result;
the flow distribution module is used for determining a distribution mode of the flow load to be distributed according to a preset test flow data requirement, and distributing a target destination port in the appointed network scene for the flow load to be distributed based on the distribution mode;
the parameter determining module is used for determining a flow mode of the flow load to be distributed according to the test flow data requirement and determining a transmission parameter of the flow load to be distributed based on the flow mode; wherein the transmission parameters include: for each destination port, a traffic rate at which the traffic load allocated to the destination port is transferred between the source port and the destination port, and a transfer start time and a transfer end time of the traffic load allocated to the destination port;
a file generating module, configured to generate a test traffic file related to the traffic load to be distributed based on the sampling result, the target destination port, and the transmission parameter, and trigger the load determining module until the number of the obtained test traffic files meets the number set by the test traffic data requirement;
and the data generation module is used for generating the flow data corresponding to each obtained test flow file.
Optionally, in a specific implementation manner, the apparatus further includes:
a priority determining module, configured to determine a priority of each target destination port before generating a test traffic file regarding the traffic load to be distributed based on the sampling result, the target destination port, and the transmission parameter;
the file generating module is specifically configured to generate a test traffic file related to the traffic load to be distributed based on the sampling result, the target destination port, the transmission parameter, and the set priority of each target port.
Optionally, in a specific implementation manner, the traffic distribution module is specifically configured to:
randomly determining a distribution mode of the traffic load to be distributed; or determining the distribution mode of the traffic load to be distributed according to the number of various preset distribution modes and the number of various distribution modes corresponding to the generated test traffic file.
Optionally, in a specific implementation manner, the traffic distribution module is specifically configured to:
if the distribution mode is a consistency uniform mode, determining each destination port as a target destination port, and determining the load weight of each target destination port; distributing the traffic load to be distributed to each target destination port according to the load weight of each target destination port;
if the distribution mode is a one-out-of-one mode, determining a specified number of target destination ports, and distributing the traffic load to be distributed to the determined target destination ports; wherein the specified number is: half of the number of active source ports characterized by the sampling result;
and if the distribution mode is a full mesh mode, determining each destination port as a target destination port, and distributing the traffic load to be distributed to each target destination port on average.
Optionally, in a specific implementation manner, the parameter determining module is specifically configured to:
randomly determining a traffic pattern of the traffic load to be distributed; or determining the flow modes of the flow load to be distributed according to the number of the preset various flow modes and the number of the various flow modes corresponding to the generated test flow file.
Optionally, in a specific implementation manner, the parameter determining module is specifically configured to:
if the flow mode is a determined flow, determining a transmission parameter of the flow load to be distributed according to the preset transmission duration;
if the flow mode is background flow, determining transmission parameters of the flow load to be distributed according to the flow load distributed to each target destination port and the preset transmission duration;
and if the flow mode is micro-burst flow, determining the transmission parameters of the flow load to be distributed according to the flow rate of the active source port represented by the sampling result.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
the processor is configured to implement the steps of any one of the test traffic data generation methods provided in the first aspect of the embodiments of the present invention when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of any one of the test traffic data generation methods provided in the first aspect of the embodiment of the present invention.
In a fifth aspect, an embodiment of the present invention provides a computer program product containing instructions, which when run on a computer, causes the computer to perform any of the steps of the test flow data generation method provided in the first aspect of the present invention.
The embodiment of the invention has the following beneficial effects:
as can be seen from the above, by applying the scheme provided in the embodiment of the present invention, when generating test traffic data for testing and verifying a cache space management algorithm, a specified network scenario to which the initial traffic data is directed may be determined first, and a requirement for the test traffic data is preset. Therefore, each source port in the specified network scene can be sampled based on the preset transmission duration to obtain the traffic load to be distributed, and then, according to the preset test traffic data requirement, the distribution mode and the traffic mode of the traffic load to be distributed are determined to be used for determining the transmission data of the traffic load to be distributed. Then, a test traffic file may be generated based on the sampling result obtained by sampling each source port, the target destination port determined based on the allocation pattern, and the transmission data of the traffic load to be allocated. Thus, after the above process is repeatedly executed to obtain the number of test traffic files set by the test traffic data requirement, the traffic data corresponding to each test traffic transmission file can be generated to obtain the test traffic data for testing and verifying the cache space management algorithm.
Based on this, by applying the scheme provided by the embodiment of the present invention, for the cache space management algorithm to be tested and verified, the test traffic data for testing and verifying the cache space management algorithm can be generated according to the actual traffic data situation of the specified network scenario to which the cache space management algorithm is directed. The generated test traffic data can better reflect the traffic condition of the specified network scene aimed by the cache space management algorithm, so that the generated test traffic data can have effective rationality and the probability of completely covering various traffic modes can be improved.
Therefore, by applying the scheme provided by the embodiment of the invention, the test traffic data which is effective and reasonable and can completely cover various traffic modes in probability can be generated, so that the cache space management algorithm of the set network scene is tested and verified by using the produced test traffic data, and the processing effect of the cache space management algorithm of the set network scene on the traffic data in various traffic modes can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a test traffic data generation method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of another test traffic data generation method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a test flow data generating apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the related art, in order to enable the cache space management algorithm of the network scenario to have high cache utilization rate, high fairness, high bandwidth and less packet loss in a network environment when the cache space management algorithm is applied to different types of traffic patterns, so as to ensure the processing effect of the traffic data, a user hopes to test and verify the cache space management algorithm of the set network scenario by using test traffic data which is effective, reasonable and can completely cover various traffic patterns in probability, thereby improving the processing effect of the cache space management algorithm of the set network scenario on the traffic data in various traffic patterns. Based on this, how to generate effective and reasonable test traffic data which covers various traffic patterns completely in probability is called an urgent problem to be solved.
In order to solve the above technical problem, an embodiment of the present invention provides a method for generating test traffic data.
The method can be applied to any network scenario where test data needs to be generated to test and verify the cache space management algorithm, for example, the test and verification of the switch shared cache management algorithm are performed in a switch shared cache scenario. The method can be applied to various electronic devices such as servers and desktop computers. Based on this, the embodiment of the present invention does not limit the application scenario and the execution subject of the method.
Further, the method may comprise the steps of:
sampling each source port in a specified network scene based on preset transmission time, and determining a flow load to be distributed according to a sampling result;
determining a distribution mode of the traffic load to be distributed according to a preset test traffic data requirement, and distributing a target destination port in the designated network scene for the traffic load to be distributed based on the distribution mode;
determining a flow mode of the flow load to be distributed according to the test flow data requirement, and determining a transmission parameter of the flow load to be distributed based on the flow mode; wherein the transmission parameters include: for each destination port, a traffic rate at which the traffic load allocated to the destination port is transferred between the source port and the destination port, and a transfer start time and a transfer end time of the traffic load allocated to the destination port;
generating a test flow file related to the flow load to be distributed based on the sampling result, the target destination port and the transmission parameter, and returning to execute the step of sampling each source port based on the preset transmission time length until the number of the obtained test flow files meets the number set by the test flow data requirement;
and generating flow data corresponding to each obtained test flow file.
As can be seen from the above, by applying the scheme provided in the embodiment of the present invention, when generating test traffic data for testing and verifying a cache space management algorithm, a specified network scenario to which the initial traffic data is directed may be determined first, and a requirement for the test traffic data is preset. Therefore, each source port in the specified network scene can be sampled based on the preset transmission duration to obtain the traffic load to be distributed, and then, according to the preset test traffic data requirement, the distribution mode and the traffic mode of the traffic load to be distributed are determined to be used for determining the transmission data of the traffic load to be distributed. Then, a test traffic file may be generated based on the sampling result obtained by sampling each source port, the target destination port determined based on the allocation pattern, and the transmission data of the traffic load to be allocated. Thus, after the above process is repeatedly executed to obtain the number of test traffic files set by the test traffic data requirement, the traffic data corresponding to each test traffic transmission file can be generated to obtain the test traffic data for testing and verifying the cache space management algorithm.
Based on this, by applying the scheme provided by the embodiment of the present invention, for the cache space management algorithm to be tested and verified, the test traffic data for testing and verifying the cache space management algorithm can be generated according to the actual traffic data situation of the specified network scenario to which the cache space management algorithm is directed. The generated test traffic data can better reflect the traffic condition of the specified network scene aimed by the cache space management algorithm, so that the generated test traffic data can have effective rationality and the probability of completely covering various traffic modes can be improved.
Therefore, by applying the scheme provided by the embodiment of the invention, the test traffic data which is effective and reasonable and can completely cover various traffic modes in probability can be generated, so that the cache space management algorithm of the set network scene is tested and verified by using the produced test traffic data, and the processing effect of the cache space management algorithm of the set network scene on the traffic data in various traffic modes can be improved.
Hereinafter, a method for generating test flow data according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a method for generating test traffic data according to an embodiment of the present invention, as shown in fig. 1, the method may include the following steps:
s101: sampling each source port in a specified network scene based on preset transmission time, and determining a flow load to be distributed according to a sampling result;
when it is determined that the set cache space management algorithm needs to be tested and verified, a network scene to which the cache space management algorithm is directed may be determined first, and the network scene is used as a specified network scene, so that test traffic data for testing and verifying the cache space management algorithm may be generated by using a real traffic data condition of the specified network scene.
Multiple source ports may typically be included in a given network scenario, and each source port may be used to receive traffic data flowing into the given network scenario from outside the given network scenario. Therefore, each source port in the appointed network scene can be sampled based on the preset transmission time, and further, the flow load to be distributed for generating the test flow data can be determined according to the sampling result.
Wherein, the sampling result may include: each active source port determined by sampling a plurality of source ports comprised by the given network scenario. By active source port is meant: and the source port continuously receives the traffic data flowing into the specified network scene from the outside of the specified network scene within the preset transmission duration.
That is to say, in step S101, based on the preset transmission duration, sampling each source port included in the specified network scenario may be understood as: and determining active source ports which are kept in an active state within the preset transmission duration in the source ports in the specified network scene. The source port continuously receiving the traffic data flowing from the outside of the specified network scenario into the specified network scenario within the preset transmission duration may be referred to as the source port remaining active for the preset transmission duration.
Furthermore, since the line speeds of the source ports included in the specified network scenario are the same, the product of the sampled number of active source ports and the line speed of each source port may be calculated and used as the traffic load to be distributed. The traffic load to be allocated may be understood as traffic data that is acquired by each active source port within a preset transmission duration and is to be allocated to a destination port.
The line speed of the source port refers to: the source port has the maximum data volume of the traffic data which can be processed in a unit time, and each destination port also has the same wire speed, because of the existence of the wire speed of the destination port, the subsequent micro-burst and background flow can occur in the network scene. In addition, the preset transmission time period may be limited according to requirements in practical applications, for example, may be 0.001s, 0.01s, 0.1s, and the like, and the embodiment of the present invention is not particularly limited.
S102: determining a distribution mode of the traffic load to be distributed according to a preset test traffic data requirement, and distributing a target destination port in a designated network scene for the traffic load to be distributed based on the distribution mode;
in the appointed network scene, the data acquired by each source port can be distributed to each destination port according to various different distribution modes, so that after the traffic load to be distributed is obtained, the distribution mode of the traffic load to be distributed can be determined according to the preset requirement of the test traffic data, and therefore, the target destination port can be selected from the destination ports included in the appointed network scene based on the determined distribution mode, and the target destination port in the appointed network scene is distributed to the traffic load to be distributed.
Each destination port included in the designated network scenario is used for receiving traffic data sent by each source port in the designated network scenario, and sending the received traffic data to the outside of the designated network scenario.
In practical applications, when the types of the traffic data acquired by the source port of a given network scenario are different, the cache space management algorithm of the given network scenario may allocate the destination port to the traffic data in different allocation modes. For example, a destination port may be allocated to the traffic data in a consistent uniform mode, a destination port may be allocated to the traffic data in a one-to-many mode, a destination port may be allocated to the traffic data in a full website fullmesh mode, and the like.
Wherein, the uniform mode is as follows: for each piece of traffic data of a source port, it is possible to go to any destination port in terms of probability, and therefore, it is necessary to determine the probability that the total traffic load acquired by each source port is allocated to each destination port;
the more-one mode is as follows: distributing the total traffic load transmitted by the determined number of full-line-speed active source ports in a fixed time period to destination ports less than the determined number for creating a traffic burst condition;
the fullmesh pattern is: the total traffic load acquired by the source port is evenly distributed to the destination ports.
For a given network scenario, the probability that different types of traffic data are acquired by the source port of the given network scenario conforms to a certain probability distribution, and based on this, when generating test traffic data for testing and verifying the cache space management algorithm of the given network scenario, a test traffic data requirement may be set according to the probability distribution, where the set test traffic data requirement includes a quantity relationship between the finally obtained test traffic data corresponding to different distribution patterns.
For example, in the finally obtained test traffic data, the number of the test traffic data corresponding to different distribution modes satisfies a certain proportional relationship; for another example, it is reasonable that the relationship between the number of test traffic data corresponding to different distribution patterns in the finally obtained test traffic data is random.
Based on this, after the traffic load to be distributed is determined, a distribution mode for distributing the traffic load to be distributed can be determined according to the preset test traffic data requirement, and therefore, a target destination port in a network scene is assigned for the traffic load to be distributed based on the distribution mode.
According to different requirements of the set test flow data, different modes can be adopted to determine the distribution mode of the flow load to be distributed. And for different distribution modes, different distribution methods can be adopted to assign target destination ports in a network scene for the traffic load to be distributed.
For clarity, a specific implementation of the step S102 will be illustrated in the following.
It should be emphasized that, for a certain port in a given network scenario, it may be used as a source port or a destination port, but it cannot be used as both the source port and the destination port; also, the number of source ports and destination ports in a given network scenario may be different during one traffic transfer.
S103: determining a flow mode of a flow load to be distributed according to the demand of the test flow data, and determining a transmission parameter of the flow load to be distributed based on the flow mode;
wherein the transmission parameters include: flow rate, transmission start time, and transmission end time;
in practical applications, the traffic patterns of a plurality of data traffic acquired by instructing a network scenario at different times or at the same time may be different, for example, the traffic patterns may be a deterministic flow, a background flow, or a micro-burst flow.
Specifically, the flow is determined to be a flow transmission mode in which the destination port is determined singly and the flow data is transmitted continuously;
the background flow is a traffic transmission mode in which a destination port completes transmission of all traffic loads at a transmission rate lower than the linear speed, wherein no blocking is caused under the condition of probability averaging, and modeling can be performed through poisson distribution;
the micro burst is a traffic transmission mode in which a traffic burst occurs in a short time, wherein the traffic burst means: high line speeds, can be modeled using an on/off model under a log-normal distribution.
For different traffic patterns, the transmission parameters of the traffic data may be different, and for a given network scenario, the obtained possibilities of the traffic data in different traffic patterns conform to a certain probability distribution, based on which, when generating test traffic data for testing and verifying the cache space management algorithm of the given network scenario, a test traffic data requirement may be set according to the probability distribution, where the set test traffic data requirement includes a quantity relationship of the test traffic data belonging to different traffic patterns in the finally obtained test traffic data.
For example, in the finally obtained test flow data, the number of the test flow data belonging to different flow patterns satisfies a certain proportional relationship; for another example, it is reasonable that the relationship between the quantities of the test traffic data belonging to different traffic patterns in the finally obtained test traffic data is random.
Based on this, after the traffic load to be distributed is determined, the traffic mode of the traffic load to be distributed can be determined according to the preset test traffic data requirement, and thus, the transmission parameter of the traffic load to be distributed is determined based on the traffic mode.
Wherein, the transmission parameters of each flow load to be distributed comprise: for each destination port, a traffic rate at which traffic load assigned to the destination port is transferred between the source port and the destination port, and a transfer start time and a transfer end time of the traffic load assigned to the destination port.
Furthermore, according to different requirements of the set test flow data, different modes can be adopted to determine the flow pattern of the flow load to be distributed. And for different traffic modes, different determination methods can be adopted to determine the transmission parameters of the traffic load to be distributed.
For clarity, a specific implementation manner of the step S103 will be illustrated in the following.
S104: generating a test flow file related to the flow load to be distributed based on the sampling result, the target destination port and the transmission parameter, and returning to execute S101 until the number of the obtained test flow files meets the number set by the test flow data requirement;
after the transmission parameters of the traffic load to be distributed are determined, because the sampling results obtained by sampling each source port in the specified network scene include the sampled active source ports, and the target destination port is specified for the traffic load to be distributed based on the preset test traffic data requirement, a test traffic file related to the determined traffic load to be distributed can be generated based on the sampling results, the target destination port and the transmission parameters.
Wherein, the test flow file may include: for each destination port, the port number of the active source port of the traffic load assigned to the destination port, the port number of the destination port, the traffic rate at which the traffic load assigned to the destination port is transferred between the source port and the destination port, and the transfer start time and the transfer end time of the traffic load assigned to the destination port.
Specifically, a test flow may include a plurality of pieces of data, where each piece of data includes: a port number of a destination port, a port number of an active source port of a traffic load assigned to the destination port, a port number of the destination port, a traffic rate at which the traffic load assigned to the destination port is transferred between the source port and the destination port, and a transfer start time and a transfer end time of the traffic load assigned to the destination port.
Furthermore, in the test traffic file, it is reasonable that the pieces of data are arranged in order of the included port numbers of the active source ports, in order of the included port numbers of the target destination ports, or in a random order.
Based on this, through the above steps S101-S104, a test traffic file can be obtained based on one-time sampling of each source port in the specified network scenario.
Since a plurality of test traffic data are required to test and verify the set cache space management algorithm of the designated network scenario, the test traffic data requirements can be preset, and the set test traffic data requirements can include the number of test traffic data required for algorithm testing and verification.
In this way, after obtaining the test traffic files related to the traffic load to be distributed, the above steps S101 to S104 may be executed in a loop, and after obtaining the test traffic files each time, the number of all the currently obtained test traffic files is counted until the number of all the obtained test traffic files meets the number set by the test traffic data requirement, and the loop is stopped.
S105: and generating flow data corresponding to each obtained test flow file.
After the set number of test flow files meeting the test flow data requirement is obtained, the flow data corresponding to each obtained test flow file can be generated.
For example, NS3(Network Simulator 3, discrete event driven packet level Network Simulator) may be used to generate traffic data corresponding to each test traffic file; the NS3 may create a packet of a given size by calling a packet class, timestamp the packet, call a Socket, and send the packet using a SendTo function in the Socket.
As can be seen from the above, by applying the scheme provided in the embodiment of the present invention, for a cache space management algorithm to be tested and verified, test traffic data for testing and verifying the cache space management algorithm may be generated according to a real traffic data situation of a specified network scenario to which the cache space management algorithm is directed. The generated test traffic data can better reflect the traffic condition of the specified network scene aimed by the cache space management algorithm, so that the generated test traffic data can have effective rationality and the probability of completely covering various traffic modes can be improved.
Therefore, by applying the scheme provided by the embodiment of the invention, the test traffic data which is effective and reasonable and can completely cover various traffic modes in probability can be generated, so that the cache space management algorithm of the set network scene is tested and verified by using the produced test traffic data, and the processing effect of the cache space management algorithm of the set network scene on the traffic data in various traffic modes can be improved.
Optionally, in a specific implementation manner, as shown in fig. 2, the method for generating test traffic data according to the embodiment of the present invention may further include the following steps:
s106: determining the priority of each target destination port;
accordingly, in this specific implementation manner, in the step S104, generating a test traffic file about the traffic load to be distributed based on the sampling result, the target destination port, and the transmission parameter may include the following step S104A:
S104A: and generating a test traffic file related to the traffic load to be distributed based on the sampling result, the target destination port, the transmission parameter and the set priority of each target port.
In some cases, different destination ports may have different priorities, and different source ports may also have different priorities, and even different traffic loads acquired by the source ports may have different priorities. Therefore, in order to make the generated test traffic data closer to the real situation, the priority of each target destination port may be determined for each target destination port allocated for the traffic load to be allocated.
Optionally, the priority of each destination port may be represented by a number, wherein the smaller the number, the higher the priority representing the destination port.
In addition, optionally, when different destination ports have different priorities, the priority of each destination port may be directly obtained, so as to determine the priority of each destination port;
optionally, when different source ports have different priorities, according to an allocation result of allocating a target destination port for the traffic load to be allocated, for each target destination port, determining a priority of an active source port for transmitting the traffic load to the target destination port as a priority of the target destination port;
optionally, when different traffic data has different priorities, for each destination port, the priority of the traffic load received by the destination port may be determined as the priority of the destination port.
Of course, the priority of each target destination port may also be determined in other manners, and thus, the embodiment of the present invention is not limited in particular.
In this way, after determining the priority of each target destination port, a test traffic file related to the determined traffic load to be distributed can be generated based on the sampling result, the target destination port, the transmission parameter, and the priority set for each target destination port.
Wherein, the test flow file may include: a port number of a destination port, a port number of an active source port of a traffic load assigned to the destination port, a port number of the destination port, a priority of the destination port, a traffic rate at which the traffic load assigned to the destination port is transferred between the source port and the destination port, and a transfer start time and a transfer end time of the traffic load assigned to the destination port.
Specifically, a test flow may include a plurality of pieces of data, where each piece of data includes: a port number of a destination port, a port number of an active source port of a traffic load assigned to the destination port, a port number of the destination port, a priority of the destination port, a traffic rate at which the traffic load assigned to the destination port is transferred between the source port and the destination port, and a transfer start time and a transfer end time of the traffic load assigned to the destination port.
Furthermore, in the test traffic file, it is reasonable that the pieces of data are arranged in order of the included port numbers of the active source ports, in order of the included port numbers of the target destination ports, or in a random order.
Optionally, in a specific implementation manner, in the step S102, determining a distribution mode of the traffic load to be distributed according to a preset test traffic data requirement may include the following step 21:
step 21: and randomly determining the distribution mode of the traffic load to be distributed.
In this specific implementation manner, the distribution mode of the traffic load to be distributed may be randomly determined in a plurality of preset distribution modes. In this way, in the finally obtained plurality of test traffic data, the quantity relationship of the test traffic data corresponding to different distribution modes is random, so that the obtained test traffic data can be higher close to the scene of random types of the obtained traffic data in practical application.
Optionally, in another specific implementation manner, in the step S102, determining the distribution mode of the traffic load to be distributed according to the preset test traffic data requirement may include the following step 22:
step 22: and determining the distribution mode of the traffic load to be distributed according to the number of the preset various distribution modes and the number of the various distribution modes corresponding to the generated test traffic file.
In this specific implementation manner, when the test traffic data requirement is set, the number of the test traffic data corresponding to different distribution modes in the finally obtained plurality of test traffic data may be preset, that is, the number of various distribution modes may be preset.
Thus, for the traffic load to be distributed, the distribution mode of the traffic load to be distributed may be determined according to the number of the preset various distribution modes and the number of the test traffic files corresponding to different distribution modes in the generated test traffic files.
In the generated test traffic files, the number of the test traffic files corresponding to different distribution modes may be referred to as the number of various distribution modes corresponding to the generated test traffic files. That is to say, for the traffic load to be distributed, the distribution mode of the traffic load to be distributed may be determined according to the number of the preset various distribution modes and the number of the various distribution modes corresponding to the generated test traffic file.
Optionally, for each type of distribution mode, a difference between a preset number of the distribution modes and a number of the distribution modes corresponding to the generated test traffic file may be calculated, so as to determine, in the generated test traffic file, which number of the test traffic files corresponding to which type of distribution mode does not satisfy the preset number of the distribution modes, and thus, it may be determined that the distribution mode of the traffic load to be distributed is the type of distribution mode, where, when there are multiple types of distribution modes whose number of the corresponding test traffic files does not satisfy the preset number of the distribution modes, the distribution mode of the traffic load to be distributed may be randomly determined in the multiple types of distribution modes; the distribution mode with the largest calculated difference in the multi-class distribution modes can also be determined as the distribution mode of the traffic load to be distributed; of course, it is reasonable to determine the distribution pattern of the traffic load to be distributed in other ways.
Optionally, in a specific implementation manner, in the step S102, based on the allocation mode, assigning a target destination port in a network scenario for traffic load allocation to be allocated may include the following steps 23 to 25:
step 23: if the distribution mode is a consistency uniform mode, determining each destination port as a target destination port, and determining the load weight of each target destination port; distributing the traffic load to be distributed to each target destination port according to the load weight of each target destination port;
step 24: if the distribution mode is a one-out-of-one mode, determining a specified number of target destination ports, and distributing the traffic load to be distributed to the determined target destination ports;
wherein the specified number is: half of the number of active source ports characterized by the sampling result;
step 25: if the distribution mode is the full mesh mode, determining each destination port as a target destination port, and distributing the traffic load to be distributed to each target destination port evenly
For different distribution modes, target destination ports in a network scene can be assigned for traffic load distribution to be distributed in different modes.
When the distribution mode of the traffic load to be distributed is a uniform mode, each destination port included in the specified network scene may be a target destination port, and the load weight of each target destination port may be different, so that each target destination port may obtain the traffic load to be distributed with different data volumes from each active source port. Based on this, after determining that the distribution mode of the traffic load to be distributed is a uniform mode, the load weight of each target destination port can be further determined, and the traffic load to be distributed is distributed to each target destination port according to the load weight of each target destination port.
When the distribution mode of the traffic load to be distributed is a big mode, because in the multi-beat mode, one destination port can acquire data transmitted by multiple active source ports, and an available destination port needs to be reserved for a possibly occurring burst data stream, all destination ports cannot be used as target destination ports. Based on this, one half of the number of active source ports represented by the sampling result can be calculated to obtain the specified data, so that the specified number of target destination ports are determined from the destination ports, and the traffic load to be distributed is distributed to the determined destination ports.
The traffic load to be allocated may be averagely allocated to each determined target destination port, or may be randomly allocated to each determined target destination port, or may be allocated to each determined target destination port according to a load weight of each target destination port. This is all reasonable.
When the distribution mode of the traffic load to be distributed is a full network station fullmesh mode, each destination port included in the designated network scene can be used as a target destination port, and the load weight of each target destination port is the same. Based on this, when the distribution mode of the traffic load to be distributed is determined to be the fullmesh mode, each destination port can be determined to be the target destination port, and the traffic load to be distributed is evenly distributed to each target destination port.
Optionally, in a specific implementation manner, in the step S103, determining the traffic pattern of the traffic load to be distributed according to the demand of the test traffic data may include the following step 31:
step 31: and randomly determining a traffic pattern of the traffic load to be distributed.
In this specific implementation manner, the traffic pattern of the traffic load to be distributed may be randomly determined in a plurality of preset traffic patterns. In this way, in the finally obtained plurality of test traffic data, the quantity relationship of the test traffic data corresponding to different traffic patterns is random, so that the obtained test traffic data can be highly close to the scene of random traffic patterns of the obtained traffic data in practical application.
Optionally, in another specific implementation manner, the step S103 of determining the traffic pattern of the traffic load to be distributed according to the demand of the test traffic data may include the following step 32:
step 32: and determining the flow modes of the flow load to be distributed according to the number of the preset various flow modes and the number of the various flow modes corresponding to the generated test flow file.
In this specific implementation manner, when the requirement of the test traffic data is set, the number of the test traffic data corresponding to different traffic patterns in the finally obtained plurality of test traffic data may be preset, that is, the number of each traffic pattern may be preset.
Thus, for the traffic load to be distributed, the traffic pattern of the traffic load to be distributed may be determined according to the number of the preset various traffic patterns and the number of the test traffic files corresponding to different traffic patterns in the generated test traffic files.
In the generated test traffic files, the number of the test traffic files corresponding to different traffic patterns may be referred to as the number of various traffic patterns corresponding to the generated test traffic files. That is to say, for the traffic load to be distributed, the traffic pattern of the traffic load to be distributed may be determined according to the number of the preset various traffic patterns and the number of the various traffic patterns corresponding to the generated test traffic file.
Optionally, for each type of flow pattern, a difference between a preset number of the flow patterns and a number of the flow patterns corresponding to a generated test flow file may be calculated, so as to determine that, in the generated test flow file, the number of the test flow files corresponding to which type of flow patterns does not satisfy the preset number of the flow patterns, and thus, it may be determined that the flow pattern of the flow load to be distributed is the type of flow pattern, where, when there are multiple types of flow patterns and the number of the test flow files corresponding to the multiple types of flow patterns does not satisfy the preset number of the flow patterns, the flow pattern of the flow load to be distributed may be randomly determined in the multiple types of flow patterns; the traffic pattern with the largest calculated difference in the multi-class traffic patterns can also be determined as the traffic pattern of the traffic load to be distributed; of course, it is reasonable to determine the traffic pattern of the traffic load to be distributed in other ways.
Optionally, in a specific implementation manner, in the step S103, determining the transmission parameter of the traffic load to be allocated based on the traffic mode may include the following steps 33 to 35:
step 33: if the flow mode is flow determination, determining a transmission parameter of a flow load to be distributed according to a preset transmission duration;
step 34: if the flow mode is background flow, determining transmission parameters of the flow load to be distributed according to the flow load distributed to each target destination port and preset transmission duration;
step 35: and if the flow mode is the micro-burst flow, determining the transmission parameters of the flow load to be distributed according to the flow rate of the active source port represented by the sampling result.
For different traffic patterns, the transmission parameters of the traffic load to be distributed may be determined in different ways.
When the traffic mode of the traffic load to be allocated is a deterministic traffic, the target destination port is explicit and continuously transmitted, so that the transmission parameters of the traffic load to be allocated can be determined according to the preset transmission duration. Specifically, the method comprises the following steps: for each target destination port, calculating a ratio of the traffic load allocated to the target destination port to the preset transmission time length, where the ratio is a traffic rate of the traffic load allocated to the target destination port between an active source port and the target destination port, and a transmission start time of the active source port for transmitting the traffic load to the target destination port is a transmission start time of the traffic load, and further, a transmission end time of the active source port is a transmission end time of the traffic load.
When the traffic pattern of the traffic load to be allocated is a background flow, the background flow is the background flow transmitted to the target destination port, and no blocking is caused under the condition of average probability, and the modeling can be performed through poisson distribution, so that the transmission parameters of the traffic load allocated to each target destination port can be determined according to the traffic load allocated to each target destination port and the preset transmission duration based on the modeling. Specifically, the method comprises the following steps: and for each target destination port, determining a lambda parameter of a Poisson distribution model corresponding to the target destination port according to the traffic load distributed to the target destination port, sampling the Poisson distribution model generated based on the determined lambda parameter from zero time according to a preset fixed sampling interval, and determining the traffic rate of the traffic load distributed to the target destination port between an active source port and the target destination port according to a sampling result. And the transmission start time of the active source port for transmitting the traffic load to the target destination port is the transmission start time of the traffic load, and further, the transmission end time of the active source port is the transmission end time of the traffic load.
When the flow pattern of the flow load to be distributed is a micro-burst flow, a flow scene corresponding to a distribution pattern with one more flow appears in a short time, so that an on/off model under lognormal distribution can be used for modeling. Based on this, in the above-described on/off model, there are an on period during which traffic can be transmitted and an off period during which no traffic is transmitted. In this way, the transmission parameter of the traffic load to be distributed can be determined according to the traffic rate of the active source port represented by the sampling result. Specifically, the method comprises the following steps: and for each target destination port, according to the flow load distributed to the target destination port, determining the average interval and the variance of the on period and the off period in an on/off model corresponding to the target destination port, taking the average interval and the variance as parameters of log normal distribution, and sampling respectively. Furthermore, the traffic rate of the traffic load allocated to the destination port between the active source port and the destination port is: the flow rate of the active source port transmitting the traffic load, and the transmission start time and the transmission end time of the traffic load are the start time and the end time of each on period in the obtained on/off model under the log-normal distribution. In each on period, there may be a plurality of traffic segments with different source ports but the same traffic transmission period and traffic rate, that is, there may be multiple traffic transmission in each on period, where the multiple may be a preset fixed multiple or a randomly determined multiple in a preset multiple set, which is reasonable.
Corresponding to the test traffic data generation method provided by the embodiment of the invention, the embodiment of the invention provides a test traffic data generation device.
Fig. 3 is a schematic structural diagram of a test flow data generating device according to an embodiment of the present invention, and as shown in fig. 3, the device may include the following modules:
the load determining module 310 is configured to sample each source port in the specified network scene based on a preset transmission duration, and determine a traffic load to be distributed according to a sampling result;
a traffic distribution module 320, configured to determine a distribution mode of the traffic load to be distributed according to a preset test traffic data requirement, and distribute a target destination port in the designated network scenario for the traffic load to be distributed based on the distribution mode;
a parameter determining module 330, configured to determine a traffic pattern of the traffic load to be allocated according to the test traffic data requirement, and determine a transmission parameter of the traffic load to be allocated based on the traffic pattern; wherein the transmission parameters include: for each destination port, a traffic rate at which the traffic load allocated to the destination port is transferred between the source port and the destination port, and a transfer start time and a transfer end time of the traffic load allocated to the destination port;
a file generating module 340, configured to generate a test traffic file related to the traffic load to be distributed based on the sampling result, the target destination port, and the transmission parameter, and trigger the load determining module 310 until the number of the obtained test traffic files meets the number set by the test traffic data requirement;
and a data generating module 350, configured to generate traffic data corresponding to each obtained test traffic file.
As can be seen from the above, by applying the scheme provided in the embodiment of the present invention, for a cache space management algorithm to be tested and verified, test traffic data for testing and verifying the cache space management algorithm may be generated according to a real traffic data situation of a specified network scenario to which the cache space management algorithm is directed. The generated test traffic data can better reflect the traffic condition of the specified network scene aimed by the cache space management algorithm, so that the generated test traffic data can have effective rationality and the probability of completely covering various traffic modes can be improved.
Therefore, by applying the scheme provided by the embodiment of the invention, the test traffic data which is effective and reasonable and can completely cover various traffic modes in probability can be generated, so that the cache space management algorithm of the set network scene is tested and verified by using the produced test traffic data, and the processing effect of the cache space management algorithm of the set network scene on the traffic data in various traffic modes can be improved.
Optionally, in a specific implementation manner, the apparatus further includes:
a priority determining module, configured to determine a priority of each target destination port before generating a test traffic file regarding the traffic load to be distributed based on the sampling result, the target destination port, and the transmission parameter;
the file generating module 340 is specifically configured to generate a test traffic file related to the traffic load to be distributed, based on the sampling result, the target destination port, the transmission parameter, and the set priority of each target port.
Optionally, in a specific implementation manner, the flow allocation module 320 is specifically configured to:
randomly determining a distribution mode of the traffic load to be distributed; or determining the distribution mode of the traffic load to be distributed according to the number of various preset distribution modes and the number of various distribution modes corresponding to the generated test traffic file.
Optionally, in a specific implementation manner, the flow allocation module 320 is specifically configured to:
if the distribution mode is a consistency uniform mode, determining each destination port as a target destination port, and determining the load weight of each target destination port; distributing the traffic load to be distributed to each target destination port according to the load weight of each target destination port;
if the distribution mode is a one-out-of-one mode, determining a specified number of target destination ports, and distributing the traffic load to be distributed to the determined target destination ports; wherein the specified number is: half of the number of active source ports characterized by the sampling result;
and if the distribution mode is a full mesh mode, determining each destination port as a target destination port, and distributing the traffic load to be distributed to each target destination port on average.
Optionally, in a specific implementation manner, the parameter determining module 330 is specifically configured to:
randomly determining a traffic pattern of the traffic load to be distributed; or determining the flow modes of the flow load to be distributed according to the number of the preset various flow modes and the number of the various flow modes corresponding to the generated test flow file.
Optionally, in a specific implementation manner, the parameter determining module 330 is specifically configured to:
if the flow mode is a determined flow, determining a transmission parameter of the flow load to be distributed according to the preset transmission duration;
if the flow mode is background flow, determining transmission parameters of the flow load to be distributed according to the flow load distributed to each target destination port and the preset transmission duration;
and if the flow mode is micro-burst flow, determining the transmission parameters of the flow load to be distributed according to the flow rate of the active source port represented by the sampling result.
Corresponding to the method for generating test traffic data provided by the above embodiment of the present invention, an embodiment of the present invention further provides an electronic device, as shown in fig. 4, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete mutual communication through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401 is configured to implement the steps of any test traffic data generation method provided in the above embodiments of the present invention when executing the program stored in the memory 403.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of any one of the test flow data generation methods provided in the embodiments of the present invention.
In another embodiment of the present invention, a computer program product containing instructions is further provided, which when run on a computer causes the computer to perform the steps of any of the test flow data generation methods provided in the embodiments of the present invention described above. .
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, apparatus embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are described for simplicity because they are substantially similar to method embodiments, as may be found in some descriptions of method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (10)
1. A method for generating test traffic data, the method comprising:
sampling each source port in a specified network scene based on preset transmission time, and determining a flow load to be distributed according to a sampling result;
determining a distribution mode of the traffic load to be distributed according to a preset test traffic data requirement, and distributing a target destination port in the designated network scene for the traffic load to be distributed based on the distribution mode;
determining a flow mode of the flow load to be distributed according to the test flow data requirement, and determining a transmission parameter of the flow load to be distributed based on the flow mode; wherein the transmission parameters include: for each destination port, a traffic rate at which the traffic load allocated to the destination port is transferred between the source port and the destination port, and a transfer start time and a transfer end time of the traffic load allocated to the destination port;
generating a test flow file related to the flow load to be distributed based on the sampling result, the target destination port and the transmission parameter, and returning to execute the step of sampling each source port based on the preset transmission time length until the number of the obtained test flow files meets the number set by the test flow data requirement;
and generating flow data corresponding to each obtained test flow file.
2. The method according to claim 1, wherein prior to the step of generating a test traffic file regarding the traffic load to be distributed based on the sampling result, the target destination port and the transmission parameters, the method further comprises:
determining the priority of each target destination port;
the step of generating a test traffic file about the traffic load to be distributed based on the sampling result, the target destination port, and the transmission parameter includes:
and generating a test flow file related to the flow load to be distributed based on the sampling result, the target destination port, the transmission parameters and the set priority of each target port.
3. The method according to claim 1 or 2, wherein the step of determining the distribution pattern of the traffic load to be distributed according to a preset test traffic data requirement comprises:
randomly determining a distribution mode of the traffic load to be distributed; or,
and determining the distribution mode of the traffic load to be distributed according to the number of various preset distribution modes and the number of various distribution modes corresponding to the generated test traffic file.
4. The method according to claim 1 or 2, wherein the step of allocating the target destination port in the designated network scenario for the traffic load to be allocated based on the allocation pattern comprises:
if the distribution mode is a consistency uniform mode, determining each destination port as a target destination port, and determining the load weight of each target destination port; distributing the traffic load to be distributed to each target destination port according to the load weight of each target destination port;
if the distribution mode is a one-out-of-one mode, determining a specified number of target destination ports, and distributing the traffic load to be distributed to the determined target destination ports; wherein the specified number is: half of the number of active source ports characterized by the sampling result;
and if the distribution mode is a full mesh mode, determining each destination port as a target destination port, and distributing the traffic load to be distributed to each target destination port on average.
5. The method according to claim 1 or 2, wherein the step of determining the traffic pattern of the traffic load to be distributed according to the test traffic data demand comprises:
randomly determining a traffic pattern of the traffic load to be distributed; or,
and determining the flow modes of the flow load to be distributed according to the number of the preset various flow modes and the number of the various flow modes corresponding to the generated test flow file.
6. The method according to claim 1 or 2, wherein the step of determining the transmission parameters of the traffic load to be allocated based on the traffic pattern comprises:
if the flow mode is a determined flow, determining a transmission parameter of the flow load to be distributed according to the preset transmission duration;
if the flow mode is background flow, determining transmission parameters of the flow load to be distributed according to the flow load distributed to each target destination port and the preset transmission duration;
and if the flow mode is micro-burst flow, determining the transmission parameters of the flow load to be distributed according to the flow rate of the active source port represented by the sampling result.
7. A test traffic data generating apparatus, characterized in that the apparatus comprises:
the load determining module is used for sampling each source port in the appointed network scene based on the preset transmission duration and determining the flow load to be distributed according to the sampling result;
the flow distribution module is used for determining a distribution mode of the flow load to be distributed according to a preset test flow data requirement, and distributing a target destination port in the appointed network scene for the flow load to be distributed based on the distribution mode;
the parameter determining module is used for determining a flow mode of the flow load to be distributed according to the test flow data requirement and determining a transmission parameter of the flow load to be distributed based on the flow mode; wherein the transmission parameters include: for each destination port, a traffic rate at which the traffic load allocated to the destination port is transferred between the source port and the destination port, and a transfer start time and a transfer end time of the traffic load allocated to the destination port;
a file generating module, configured to generate a test traffic file related to the traffic load to be distributed based on the sampling result, the target destination port, and the transmission parameter, and trigger the load determining module until the number of the obtained test traffic files meets the number set by the test traffic data requirement;
and the data generation module is used for generating the flow data corresponding to each obtained test flow file.
8. The apparatus of claim 7, further comprising:
a priority determining module, configured to determine a priority of each target destination port before generating a test traffic file regarding the traffic load to be distributed based on the sampling result, the target destination port, and the transmission parameter;
the file generating module is specifically configured to generate a test traffic file related to the traffic load to be distributed based on the sampling result, the target destination port, the transmission parameter, and the set priority of each target port.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-6 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011389477.5A CN112511385B (en) | 2020-12-02 | 2020-12-02 | Test flow data generation method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011389477.5A CN112511385B (en) | 2020-12-02 | 2020-12-02 | Test flow data generation method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112511385A true CN112511385A (en) | 2021-03-16 |
CN112511385B CN112511385B (en) | 2022-04-08 |
Family
ID=74969805
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011389477.5A Expired - Fee Related CN112511385B (en) | 2020-12-02 | 2020-12-02 | Test flow data generation method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112511385B (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8463860B1 (en) * | 2010-05-05 | 2013-06-11 | Spirent Communications, Inc. | Scenario based scale testing |
US8547974B1 (en) * | 2010-05-05 | 2013-10-01 | Mu Dynamics | Generating communication protocol test cases based on network traffic |
CN105306294A (en) * | 2015-10-20 | 2016-02-03 | 上海斐讯数据通信技术有限公司 | Test case generation system and method for switch |
CN106452850A (en) * | 2016-09-23 | 2017-02-22 | 西安交通大学 | SDN controller performance testing method and system |
CN107659434A (en) * | 2017-09-11 | 2018-02-02 | 上海斐讯数据通信技术有限公司 | A kind of automatic test approach of Devices to test, apparatus and system |
CN107864072A (en) * | 2017-12-04 | 2018-03-30 | 北京信而泰科技股份有限公司 | The ethernet test method of tester and its multiport equipment under test |
CN110221965A (en) * | 2019-05-09 | 2019-09-10 | 阿里巴巴集团控股有限公司 | Test cases technology, test method, device, equipment and system |
CN110289984A (en) * | 2019-05-17 | 2019-09-27 | 中国科学院信息工程研究所 | A kind of network scenario emulation background traffic generates and management method and device |
CN110932879A (en) * | 2018-09-20 | 2020-03-27 | 阿里巴巴集团控股有限公司 | Network performance test method, data processing device and storage medium |
CN110968468A (en) * | 2019-12-18 | 2020-04-07 | 广州唯品会信息科技有限公司 | Pressure testing method, terminal device and computer storage medium |
CN111181801A (en) * | 2019-12-04 | 2020-05-19 | 腾讯云计算(北京)有限责任公司 | Node cluster testing method and device, electronic equipment and storage medium |
-
2020
- 2020-12-02 CN CN202011389477.5A patent/CN112511385B/en not_active Expired - Fee Related
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8463860B1 (en) * | 2010-05-05 | 2013-06-11 | Spirent Communications, Inc. | Scenario based scale testing |
US8547974B1 (en) * | 2010-05-05 | 2013-10-01 | Mu Dynamics | Generating communication protocol test cases based on network traffic |
CN105306294A (en) * | 2015-10-20 | 2016-02-03 | 上海斐讯数据通信技术有限公司 | Test case generation system and method for switch |
CN106452850A (en) * | 2016-09-23 | 2017-02-22 | 西安交通大学 | SDN controller performance testing method and system |
CN107659434A (en) * | 2017-09-11 | 2018-02-02 | 上海斐讯数据通信技术有限公司 | A kind of automatic test approach of Devices to test, apparatus and system |
CN107864072A (en) * | 2017-12-04 | 2018-03-30 | 北京信而泰科技股份有限公司 | The ethernet test method of tester and its multiport equipment under test |
CN110932879A (en) * | 2018-09-20 | 2020-03-27 | 阿里巴巴集团控股有限公司 | Network performance test method, data processing device and storage medium |
CN110221965A (en) * | 2019-05-09 | 2019-09-10 | 阿里巴巴集团控股有限公司 | Test cases technology, test method, device, equipment and system |
CN110289984A (en) * | 2019-05-17 | 2019-09-27 | 中国科学院信息工程研究所 | A kind of network scenario emulation background traffic generates and management method and device |
CN111181801A (en) * | 2019-12-04 | 2020-05-19 | 腾讯云计算(北京)有限责任公司 | Node cluster testing method and device, electronic equipment and storage medium |
CN110968468A (en) * | 2019-12-18 | 2020-04-07 | 广州唯品会信息科技有限公司 | Pressure testing method, terminal device and computer storage medium |
Non-Patent Citations (3)
Title |
---|
WANG WD,TIAN Y,GONG XY等: "Software defined autonomic QoS model for future Internet", 《JOURNAL OF SYSTEMS AND SOFTWARE》 * |
李鹏: "OpenFlow网络的监测子系统的设计与实现", 《中国优秀硕士学位论文全文数据库》 * |
赵盈等: "测试流量生成的设计与实现", 《小型微型计算机系统》 * |
Also Published As
Publication number | Publication date |
---|---|
CN112511385B (en) | 2022-04-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9270527B2 (en) | Methods, systems, and computer readable media for enabling real-time guarantees in publish-subscribe middleware using dynamically reconfigurable networks | |
CN110519183B (en) | Node speed limiting method and device, electronic equipment and storage medium | |
CN114040467B (en) | Transmission path determining method, device, server and storage medium | |
WO2020164476A1 (en) | Data downloading method and related apparatus | |
CN112311628B (en) | Network speed measuring method, system, network equipment and storage medium | |
CN113938435B (en) | Data transmission method, device, electronic equipment, storage medium and program product | |
CN111181873B (en) | Data transmission method, data transmission device, storage medium and electronic equipment | |
CN114500381A (en) | Network bandwidth limiting method, system, electronic device and readable storage medium | |
CN114466226A (en) | Method, device, equipment and computer readable medium for determining bandwidth duration ratio | |
CN112511385B (en) | Test flow data generation method and device and electronic equipment | |
CN115580568B (en) | Method and system for realizing network service quality guarantee based on IPv6 flow label | |
CN116820769A (en) | Task allocation method, device and system | |
WO2020248166A1 (en) | Traffic scheduling method, device, and storage medium | |
US20240129792A1 (en) | Method for determining contention window, access point and station | |
CN109526032B (en) | Method and device for modifying network slice example | |
CN108156086B (en) | Policy rule issuing method and device | |
CN113453285B (en) | Resource adjusting method, device and storage medium | |
CN115378879A (en) | Data control method and related device | |
CN110928693B (en) | Computing equipment and resource allocation method | |
CN109889374B (en) | Bearing evaluation method and device | |
CN113747506A (en) | Resource scheduling method, device and network system | |
CN110381537A (en) | A kind of bandwidth speed limiting method, apparatus, equipment and storage medium based on QoE | |
CN113162990B (en) | Message sending method, device, equipment and storage medium | |
CN113225143B (en) | RDSS master control station receiving performance evaluation method and system based on queuing model | |
CN110650358B (en) | Node distribution method, device, node distribution server and medium |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20220408 |