Multi-session flow dynamic time delay simulation method based on time delay range strategy
Through the multi-session flow dynamic delay simulation method based on the delay range strategy, the problems of small number of simulation links, low flexibility and large resource utilization in the prior art are solved, and high-precision and low-cost delay damage simulation are realized, which is suitable for large-scale conversation flow scenarios.
Patent Information
- Application Number
- CN202411785502.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-08
AI Technical Summary
The existing dedicated channel damage instruments and software delay control solutions have problems such as small number of analog links, low flexibility, and high resource utilization, and cannot be suitable for large-scale conversation flow scenarios.
The dynamic delay simulation method of multi-session flow based on the delay range strategy is adopted. The simulation of delay damage is completed through a single system, and it does not rely on the kernel protocol stack to run. The resource scheduling preprocessing module is used to pre-calculate the memory buffer queue resources to reduce memory overhead, and high-precision delay control is achieved through the fine-grained damage simulation module.
It realizes delay loss simulation with high flexibility and low memory overhead, which can meet the delay loss requirements in multi-session flow scenarios, and the test is completely controllable, avoids resource waste, and has high accuracy and wide range.
Smart Images

Figure CN119788581A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network testing, and in particular to a method for simulating dynamic delay of multiple session flows based on a delay range strategy. Background Art
[0002] With the rapid development of the Internet, people's requirements for network transmission quality and real-time performance are increasing. However, the vast majority of application services transmit data through the wide area network. Compared with the local area network environment used in development and testing, the wide area network has significant differences in bandwidth stability, transmission delay, bit error rate, etc. Factors such as external interference, control information flow, network equipment performance limitations, and transmission medium limitations will have a series of adverse effects on data communication. Network damage problems have a huge negative impact on network transmission quality. Therefore, it is crucial to study network damage simulation and comprehensively evaluate network damage to ensure the reliability and service quality of network applications.
[0003] Delay is one of the basic indicators of network performance, and is particularly critical for services that require high real-time performance. Therefore, simulating delay impairments in service development and testing has also become crucial. In addition, the rapid development of satellite communications in recent years has further promoted the demand for interstellar link network simulation. Satellite network simulation can provide an effective test and verification environment for related research, and delay is also an important performance indicator in satellite networks. Therefore, delay control is an important function of satellite network simulation, which can simulate the end-to-end delay in the satellite communication process (including transmission delay, propagation delay, queuing delay and processing delay, etc.), so as to truly and accurately restore the delay situation in the satellite network.
[0004] As the number of satellites continues to grow, inter-satellite networking strategies are becoming increasingly diverse. The corresponding complex network topology has led to a sharp increase in the number of inter-satellite communication links, which has led to an increasing demand for simulation from the L2 data link layer to the L3 network layer. Traditional dedicated channel impairment instruments and current software delay control solutions have problems such as a small number of simulated links, low flexibility, and high resource usage. In addition, traditional software and physical devices use a flow-corresponding strategy in the delay impairment simulation of multiple session flows, that is, a corresponding memory channel is allocated to each session flow. This method consumes a lot of memory resources and is not suitable for large-scale session flow scenarios. Summary of the invention
[0005] In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present invention is that the existing dedicated channel damage instrument and the current software delay control solution have problems such as a small number of simulated links, low flexibility, and high resource occupation, and cannot be applied to large-scale conversation flow scenarios. The present invention provides a method for dynamic delay simulation of multi-conversation flows based on delay range strategy, which completes the simulation of delay damage through a single system, does not rely on the operation of the kernel protocol stack, and has high flexibility; greatly reduces memory overhead and reduces system costs; the delay damage simulation capability provided by the system can be adjusted by changing the configuration information to meet the delay damage in various scenarios, making the test fully controllable, avoiding resource waste, and with high accuracy and a wide range.
[0006] To achieve the above object, the present invention provides a method for simulating dynamic delay of multi-session flows based on delay range strategy, comprising the following steps:
[0007] The configuration PC configures the delay impairment simulation parameters and constructs an information message, and then sends the information message to the delay impairment simulation system. After the delay impairment simulation system receives the impairment simulation parameters sent by the configuration PC, it starts according to the configuration parameters.
[0008] After receiving all the information messages sent by the configuration PC, the delay impairment simulation system uses the resource scheduling preprocessing module to pre-calculate the required memory buffer queue resources and make reasonable plans to avoid additional memory overhead;
[0009] After the delay impairment simulation system is started, the original message data is received from the input port;
[0010] After receiving the original message data, the initialized metadata information is added to the end of the original message through the message tag;
[0011] The message with metadata information attached enters the coarse-grained damage simulation module and is buffered by the intermediate medium to complete the set delay time. It determines whether the message has completed the delay damage. If the message has completed the delay damage, it will enter the fine-grained damage simulation module, otherwise the message will wait.
[0012] The message entering the fine-grained damage simulation first performs range judgment and is imported into the corresponding different memory buffer queues. Then, the target timestamp in the metadata is compared with the current timestamp to decide whether to leave the queue. If the target timestamp is less than or equal to the current timestamp, the message is removed from the queue, otherwise it waits.
[0013] The message after being dequeued is the message with completed delay damage. After metadata stripping and system internal delay statistics, it is sent from the output port.
[0014] Furthermore, the PC is configured to configure the delay impairment simulation parameters and construct the information message, and then the information message is sent to the delay impairment simulation system, specifically including
[0015] Use the configuration PC to configure the delay impairment simulation parameters, which include the tuple consisting of the source MAC address and the destination MAC address and the delay time.
[0016] After the delay impairment simulation parameters are configured, the configuration PC communicates with the delay impairment simulation system and exchanges information to form an information message, and sends the information message constructed by the configuration PC to the delay impairment simulation system.
[0017] Furthermore, after receiving the message, the delay impairment simulation system evenly inserts the message into the flow identification hash table through Jenkins hash calculation according to the tuple information, and saves the corresponding delay time as the value.
[0018] Furthermore, after the delay impairment simulation system receives all the information messages sent by the configured PCs, it uses the resource scheduling preprocessing module to pre-calculate the required memory buffer queue resources and reasonably plan them to avoid generating additional memory overhead. Specifically, after the delay impairment simulation system receives all the information messages sent by the configured PCs, in order to better perform delay control in the fine-grained memory buffer stage for the session flows with different target simulation delay values, the required memory buffer queue resources are pre-calculated in the overall process, and the corresponding delay value is mapped to the corresponding memory buffer queue index, and reasonable planning is performed to avoid generating additional memory overhead.
[0019] The relationship between the number of buffer queues and the delay value is as follows:
[0020]
[0021] Where N q is the number of buffer queues, T max is the maximum delay, T min is the minimum delay value, and t is the basic error threshold.
[0022] Furthermore, the message with the additional metadata information enters the coarse-grained damage simulation module and is buffered by the intermediate medium to complete the set delay time; it is judged whether the message has completed the delay damage. The message that has completed the delay damage will enter the fine-grained damage simulation module, otherwise the message will wait. Specifically, during the link buffering process, the message with the additional metadata information is cyclically read and written by the internal ring queue, and the batch reading is compared with the current timestamp and the target output timestamp in the message metadata information minus the memory buffer delay value to judge whether the message has completed the delay damage. The message that has completed the delay damage will enter the fine-grained damage simulation module, otherwise the message will wait.
[0023] Furthermore, the current timestamp is compared with the target output timestamp in the message metadata minus the memory buffer delay value to determine whether the message has completed delay damage. When the current timestamp is greater than or equal to the target output timestamp in the message metadata minus the memory buffer delay value, it is determined that the coarse-grained delay damage is completed, and the message that has completed the coarse-grained delay damage is placed in the fine-grained delay simulation module, otherwise the message waits in place.
[0024] Furthermore, for the message entering the fine-grained delay simulation module, a range judgment is first performed, and a mapping between the message and the queue is established based on the pre-allocated delay value and the corresponding memory buffer queue index mapping, and the message is imported into the buffer queue corresponding to the index mapping; the message is cached in the memory queue to complete fine-grained delay damage and error control, and the target timestamp and current timestamp in the message metadata in the cache queue are cyclically retrieved. When the target timestamp is less than or equal to the current timestamp, the message is dequeued, otherwise it waits.
[0025] Furthermore, it also includes message statistics, specifically including statistics on the total number of received messages and the total number of successfully sent messages, and calculating the real-time packet loss rate; statistics on the receiving timestamp and sending timestamp of the message, and calculating the internal delay of the system, including the maximum delay, minimum delay and average delay.
[0026] Furthermore, the delay impairment simulation system is deployed between two devices under test. The Jenkins hash function is used to evenly configure the hash table based on the binary group consisting of the source MAC address and the destination MAC address. The required memory buffer queue resources are pre-calculated to obtain the index mapping between the delay value and the memory buffer queue. After the traditional large transmission delay, the message is merged into the corresponding memory buffer queue after the range judgment according to the pre-allocated mapping relationship, and fine-grained error control is performed through the memory queue cache, thereby achieving the effect of delay impairment.
[0027] Further, the delay impairment simulation system includes a message receiving module, a message sending module, a resource scheduling preprocessing module, a message marking module, a coarse-grained impairment simulation module, a message judgment module, a fine-grained impairment simulation module, a parameter configuration module, and a message statistics module;
[0028] Among them, the message receiving module receives the input message and passes the original message to the message marking module. The message marking module appends the initialized metadata information to the end of the original message and passes the marked message to the coarse-grained damage simulation module; the delay damage module buffers the message through the intermediate medium for internal link, and the message judgment module determines whether the message has completed the coarse-grained delay damage according to the metadata information. The message that has completed the coarse-grained delay damage is passed to the fine-grained damage simulation module; the message cache module controls the message dequeue according to the timestamp information, and the message is passed to the message sending module after being dequeued; the message sending module outputs the message that has completed the delay damage from the output port; in addition, the parameter configuration module and the message statistics module are relatively independent modules, which are respectively responsible for the damage parameter configuration before the delay damage simulation system is started and the statistics of the messages entering and leaving the system during the operation of the system.
[0029] Technical Effects
[0030] The present invention provides a method for dynamic delay simulation of multi-session flows based on delay range strategy, which completes the simulation of delay damage through a single system. The network IO related functions of the delay damage simulation system are implemented based on user-mode network drivers and do not rely on kernel protocol stack operation. While providing reliable performance guarantee, it has higher flexibility in the design and development process. Compared with the flow response strategy of traditional software for multi-session flows, it greatly reduces memory overhead and reduces system cost. The delay damage simulation capability provided by the system can be adjusted by changing the configuration information to meet the delay damage in various scenarios, so that the test is fully controllable and resource waste is avoided. It has high accuracy and wide range, and is particularly suitable for delay damage simulation scenarios of multi-session flows.
[0031] The concept, specific structure and technical effects of the present invention will be further described below in conjunction with the accompanying drawings to fully understand the purpose, characteristics and effects of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a flowchart of a method for dynamic delay simulation of multi-session flows based on delay range strategy in a preferred embodiment of the present invention;
[0033] Figure 2 It is a structural schematic diagram of a method for dynamic delay simulation of multi-session flows based on delay range strategy in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0035] In the following description, specific details such as specific internal procedures and techniques are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0036] like Figure 1 As shown, the embodiment of the present invention provides a method for dynamic delay simulation of multi-session flows based on delay range strategy, which specifically includes the following steps:
[0037] Step 101, configure the PC to configure the delay impairment simulation parameters and construct an information message, and then send it to the delay impairment simulation system;
[0038] In this embodiment, the hardware device includes two devices under test, a configuration PC and a delay impairment simulation system, and the two devices under test and the configuration PC are connected to the delay impairment simulation system. The delay impairment simulation system is connected in series between the two devices under test, and the two devices under test serve as the input side of the delay impairment message and the output side of the impairment completion, respectively, and can be two devices or two network ports of one device.
[0039] The user configures the required parameters by configuring the PC. The delay impairment simulation parameters include the delay time and the binary consisting of the source MAC address and the destination MAC address. The delay time is configured by the user, and the system implements the corresponding delay impairment effect according to the parameter.
[0040] The configuration PC and the system exchange information through socket communication. After the parameter configuration is completed, the configuration PC constructs an information message and sends it to the system through socket communication. The message uses a user-defined protocol. The length of each information message is 72 bits (bits). The specific definition is shown in Table 1. The frame header is fixed to 0x3C, the MAC address needs to be represented by 48 bits, and of the 16 bits of the delay time, 12 bits are data bits and 4 bits are unit indicator bits.
[0041] Table 1 Configuration information message definition
[0042]
[0043] In this embodiment, there are three types of unit indicator bits:
[0044] 0001:us;
[0045] 0010:ms;
[0046] 0100:s;
[0047] In this embodiment, a two-tuple consisting of the source MAC address and the destination MAC address of the data packet is used as the flow feature. This design is the biggest difference compared to the traditional flow identification scheme, and it is also one of the main innovations of this method. In traditional flow identification, a five-tuple of a data packet is used as a flow feature, including: source Internet Protocol (IP) address, destination IP address, source port, destination port and protocol type. Data packets belonging to the same flow have the same five-tuple, and the identification of large-scale data flows mainly lies in the difference in Media Access Control (MAC) addresses.
[0048] In addition, the traditional five-tuple needs to perform deep analysis of the data packet content during the acquisition process to obtain the field content of the IP layer and the network layer, so there is additional analysis overhead. The MAC address is located in the Ethernet frame header of the data packet and is easy to access for the following reasons:
[0049] (1) Parsing depth and size: The MAC address is located in the Ethernet frame header of the data packet and is usually easier to access. Each MAC address is only 6 bytes long, while the entire Ethernet frame header (including two MAC addresses and Ethernet type) is usually 14 bytes. In contrast, the IP address and port number are located in the IP and transport layer protocol headers, which require multiple layers of parsing, and each layer increases processing time.
[0050] (2) Protocol complexity: The structure of IP and transport layer protocol headers is more complex than that of Ethernet frame headers and contains more variable fields. For example, the IP header may contain option fields, and the transport layer protocol header may have option fields of different lengths. Processing these variable parts requires more time and computing resources.
[0051] In addition, due to the rapid increase in the size of network data, the IP addresses currently used by the IP layer are gradually mixed from the 4-byte IPv4 protocol to the 16-byte IPv6 protocol, and the resource overhead required for the traditional five-tuple will also increase accordingly. In summary, the embodiment of the present invention uses a two-tuple of the source MAC address and the destination MAC address instead of the traditional five-tuple as the flow identifier for hash calculation.
[0052] This step achieves the technical effect of adjusting the delay impairment simulation capability provided by the system by changing the configuration information to meet the delay impairment needs in various scenarios.
[0053] Step 102, after receiving the information message of the configuration PC structure, the delay impairment simulation system establishes a session flow identification hash table, wherein the key of the hash table is the value of the MAC address in the information message after being processed by the Jenkins hash function, and the corresponding value is the delay time corresponding to the MAC address.
[0054] The design of Jenkins hash makes it very suitable for scenarios with fast lookup and low collision probability, such as network packet routing, data distribution, etc. Jenkins hash converts the input data into a 32-bit hash value through several steps, ensuring that the hash value is evenly distributed and sensitive to small changes in the input data.
[0055] After receiving all the information packets of the configuration PC structure, in order to better control the delay of the session flow with different target simulation delay values in the fine-grained memory buffer stage, the required memory buffer queue resources are pre-calculated and reasonably planned in the overall process to avoid additional memory overhead. The relationship between the number of buffer queues and the delay value can be expressed as follows:
[0056]
[0057] Where N q is the number of buffer queues, T max is the maximum delay, T min is the minimum delay value, and t is the basic error threshold.
[0058] The number of memory buffer queues obtained based on the basic error value may be redundant. Since there may be no actual delay value in some intervals, a secondary check is required.
[0059] All the delay values received by the data source are sorted in advance to obtain the max and min of the delay values, and then divided according to the basic error threshold t, and the data is stored in an array. The number of memory buffer queues obtained based on the basic error value may be redundant, because there may be no actual delay value in some intervals, so a second check is required.
[0060] Traverse all the delay values again and mark the queue position where they are located. If there is valid delay data in the queue, mark it as 1; if the position is already 1, end this marking and enter the next marking judgment. Finally, traverse all the queue arrays, count the number of positions marked as 1, and map the corresponding delay value with the corresponding memory buffer queue index to facilitate indexing in the range judgment stage.
[0061] N f =N q -N r
[0062] Where N f is the number of index queues created, N q is the total number of queues, N r is the number of redundant queues.
[0063] Step 103: After receiving the message data from the input port, the delay impairment simulation system attaches the initialized metadata information to the end of the message through the message tag.
[0064] Message marking means that the system will initialize the corresponding metadata for each message and attach the metadata to the end of the message. The purpose of message marking is to obtain and update the necessary information in the subsequent steps so as to perform specific operations based on this information. The length of the metadata is 16 bytes, including the message sequence number and the output target timestamp, such as
[0065] As shown in the table. Among them, the message sequence number is used to record the order in which the message enters the system. This value can be used as a unique identifier to distinguish each message, and can also be used to determine whether there is an out-of-order output anomaly; the output target timestamp is used to record the target time of the message output, and its calculation formula is as follows:
[0066] T tx =T rx +T delay
[0067] Among them, T tx is the output target timestamp, T rx is the input timestamp, T delay The delay time value is obtained from the session flow identification hash table after the system receives the message data, disassembles the MAC address information in the Ethernet frame header, calculates the key through the same Jenkins hash function, and obtains it.
[0068] Table 2 Metadata definition
[0069] Message sequence number Output target timestamp 8Bytes 8Bytes
[0070] Metadata is an important medium for information exchange within the system. It carries necessary information for the system's internal modules to obtain and judge. Metadata is attached to the end of the message after it enters the system and is stripped from the end of the message before it leaves the system, thereby ensuring the integrity and correctness of the message. Leaving the system means leaving the system through the output port.
[0071] In step 104, the message is internally buffered in a circular queue of an intermediate medium to achieve coarse-grained delay impairment; the internal link buffer is used to simulate delay impairment by using buffering delay.
[0072] The message with attached metadata information is buffered in the link through the circular queue to complete the set delay time; during the disk internal link buffering process, the message with attached metadata is read and written cyclically by the internal circular queue, and the batch reading is compared with the target output timestamp in the message metadata minus the memory buffer delay value to determine whether the message has completed the delay damage. The message with completed delay damage will be placed in the cache queue, otherwise the message will wait, and the cyclic reading, writing and judgment operations will be repeated in the internal circular queue until the delay damage is completed. On the one hand, the message with coarse-grained delay damage is limited by the transmission delay of the intermediate medium, and the accuracy is insufficient; on the other hand, due to the internal processing overhead of the system, the actual delay of coarse-grained delay damage has a certain jitter between different messages. In order to achieve a more accurate and stable delay damage effect, it is necessary to use a cache queue to achieve fine-grained delay damage and error control.
[0073] Step 105: The message enters the fine-grained delay simulation module, which first performs a range decision on the target delay in the message metadata, and establishes a mapping between the message and the queue based on the index mapping relationship established during pre-allocation.
[0074] Step 106, the message is imported into the buffer queue corresponding to the index mapping. Fine-grained delay damage and error control is achieved by caching messages in the memory queue. The target timestamp and current timestamp in the message metadata in the cache queue are cyclically retrieved. When the target timestamp is less than or equal to the current timestamp, the message is dequeued, otherwise it waits and repeats the cyclic retrieval operation in the cache queue until the delay damage is completed. Fine-grained delay damage achieved through the cache queue not only breaks through the limitation of the base transmission delay accuracy, improves the system damage accuracy, and meets the application requirements in more scenarios; on the other hand, it also improves the delay jitter problem in the coarse-grained delay damage process and further reduces the damage error.
[0075] Compared with the software queue in the traditional delay impairment solution, the cache queue requires less memory resources, while achieving the technical effect of saving memory resources and ensuring the accuracy and stability of system impairment.
[0076] Step 107, after the dequeued message is stripped of metadata and internal system delay statistics, the result is sent out through the output port.
[0077] Metadata stripping is to strip off the metadata attached to the end of the message in step 102 to ensure the integrity and correctness of the message passing through the system.
[0078] The system internal delay statistics records the message output timestamp, and calculates the internal delay of the system by subtracting the message output time from the input time. The maximum delay, minimum delay, and average delay values are counted and saved. The calculation formula is as follows:
[0079] Among them, T avg is the average delay value, Represents the sum of the delay values of each packet, and n represents the number of packets.
[0080] The system's internal delay statistics can more intuitively obtain the system's current damage accuracy and stability, ensuring the reliable operation of the system.
[0081] In the embodiment of the present invention, the delay impairment simulation system is deployed between two devices to be tested, and a uniform configuration hash table is implemented through the Jenkins hash function according to the binary group, and the required memory buffer queue resources are pre-calculated to obtain the index mapping of the delay value and the memory buffer queue. After the traditional large transmission delay, the message is merged into the corresponding memory buffer queue according to the pre-allocated mapping relationship, and fine-grained error control is performed through the memory queue cache, thereby achieving the effect of delay impairment. Compared with the traditional delay impairment simulation system, the advantages of this system are mainly reflected in two aspects: first, the binary group of the source MAC address and the destination MAC address replaces the traditional five-tuple as the flow identifier for hash calculation, which greatly reduces the parsing overhead, saves time resources, computing resources and memory resources, and provides reliable performance guarantee for the delay impairment simulation task, which is suitable for the processing of large-scale data flows; second, in order to better perform delay control in the fine-grained memory buffer stage for the session flow with different target simulation delay values, the queue merging method based on the delay range strategy is used in the overall process to pre-statistic the overall required queue resources and schedule and allocate them. Subsequently, the data for completed flow identification is marked, and a series of information tags including simulation delay value and output timestamp are added to the initial data to facilitate completion judgment of each stage during delay impairment simulation and avoid additional memory overhead.
[0082] like Figure 2As shown, the delay impairment simulation system includes a message receiving module, a message sending module, a resource scheduling preprocessing module, a message marking module, a coarse-grained impairment simulation module, a message judgment module, a fine-grained impairment simulation module, a parameter configuration module, and a message statistics module. The message receiving module receives the input message and passes the original message to the message marking module. The message marking module appends the initialized metadata information to the end of the original message and passes the marked message to the coarse-grained impairment simulation module. The delay impairment module buffers the message through the intermediate medium for the internal link, and the message judgment module determines whether the message has completed the coarse-grained delay impairment according to the metadata information, and the message that has completed the coarse-grained delay impairment is passed to the fine-grained impairment simulation module. The message buffer module controls the message dequeue according to the timestamp information, and the message is passed to the message sending module after dequeueing. The message sending module outputs the message that has completed the delay impairment from the output port. In addition, the parameter configuration module and the message statistics module are relatively independent modules, which are responsible for the damage parameter configuration before the delay damage simulation system is started and the statistics of the messages entering and leaving the system during the operation of the system.
[0083] Each module of the delay impairment simulation system is responsible for the corresponding functions:
[0084] (1) The message receiving / sending module is responsible for the following functions:
[0085] Receive messages input from the external system and pass the received messages to the message marking module; obtain the messages with completed delay damage from the damage simulation module and send them to the external system;
[0086] The reception and transmission of messages are implemented based on the user-mode network driver, bypassing the kernel protocol stack. This enables the system to have high-performance network IO capabilities while being more flexible in the design and development of subsequent frameworks and functions.
[0087] (2) The resource scheduling preprocessing module is responsible for the following functions:
[0088] After receiving all the information messages configured with the PC structure, pre-calculate the required memory buffer queue resources and plan them reasonably to avoid additional memory overhead. Sort all the delay values received by the data source in advance, obtain the max and min in the delay value, and then divide them according to the basic error threshold t, and use an array to store the data. The number of memory buffer queues obtained according to the basic error value may be redundant. Since there may be no actual delay value in some intervals, a secondary check is required. Traverse all the delay values again and mark the queue position where they are located. If there is valid delay data in the queue, mark it as 1; if the position is already 1, end this marking and enter the next marking judgment. Finally, traverse all the queue arrays, count the number of positions marked as 1, and map the corresponding delay value with the corresponding memory buffer queue index to facilitate indexing in the range judgment stage.
[0089] (3) The message marking module is responsible for the following functions:
[0090] Metadata initialization, in which the message sequence number is accumulated in the order in which the messages are received; the output target timestamp is calculated based on the receiving timestamp and the delay time obtained from the parameter configuration module; the metadata is attached to the end of the message to facilitate information exchange and status update between system modules. In order to ensure the correctness and integrity of the message before and after entering and leaving the system, the metadata needs to be stripped from the end of the message before it leaves the system.
[0091] (4) The coarse-grained damage simulation module is responsible for the following functions:
[0092] The message that needs to be delayed is sent from the internal sending port; the link buffer of the traditional intermediate medium is used to complete most of the set delay time;
[0093] Internal link buffering is also implemented based on user-mode network drivers to provide performance guarantees. At the same time, the coarse-grained delay impairment effect achieved through the transmission delay generated by the internal link buffer can greatly optimize the use of system memory resources, thereby reducing system costs, but the accuracy and stability of coarse-grained delay impairment are relatively poor.
[0094] (5) The message judgment module is responsible for the following functions:
[0095] Compare the current timestamp with the target output timestamp in the message metadata minus the memory buffer delay value to determine whether the message has completed the coarse-grained delay damage. For messages that do not meet the time requirements, wait on the spot. For messages that currently meet the time requirements, it means that the coarse-grained delay damage has been completed and is directly transmitted to the message cache module.
[0096] (6) The fine-grained damage simulation module is responsible for the following functions:
[0097] First, the target delay in the message metadata is determined, and the mapping between the message and the queue is established according to the mapping relationship between the pre-assigned delay value and the corresponding memory buffer queue index, and the message is imported into the corresponding different memory buffer queues. The target timestamp and current timestamp in the message metadata in the cache queue are cyclically retrieved. When the target timestamp is less than or equal to the current timestamp, the message is dequeued and passed to the message sending module, otherwise it waits;
[0098] On the one hand, the fine-grained delay impairment achieved through the cache queue breaks through the limitation of the base transmission delay accuracy and improves the system impairment accuracy. On the other hand, it also improves the delay jitter problem in the coarse-grained delay impairment process and further reduces the impairment error, thereby further improving the system impairment accuracy and meeting the application requirements of more scenarios. At the same time, it also optimizes the error control of the impairment results.
[0099] (7) The message statistics module is responsible for the following functions:
[0100] Statistics on all message sending and receiving, and calculate the real-time packet loss rate of the system; statistics on the receiving and sending timestamps of messages, and calculate the internal delay of the system, including the maximum delay, minimum delay and average delay.
[0101] The statistics module can obtain the current operation status of the system more intuitively, and can obtain relevant data on system input, output and damage results in a timely manner, and report them when necessary to ensure the normal and reliable operation of the system.
[0102] (8) The parameter configuration module is responsible for the following functions:
[0103] Receive the two-tuple and delay time and other parameters sent by the configuration PC, where the two-tuple consists of the source MAC and destination MAC addresses of the data flow; the delay time is configured by the user, and the system implements the corresponding delay damage effect according to the parameter; after the delay damage simulation system receives the information message constructed by the configuration PC, it establishes a session flow identification hash table, where the key of the hash table is the value of the MAC address in the information message after being processed by the Jenkins hash function, and the corresponding value is the delay time corresponding to the MAC address.
[0104] The embodiment of the present invention discloses a method for dynamic delay simulation of multi-session flow based on delay range strategy, deploys the delay damage simulation system between two devices to be tested, and inserts the simulation parameters into the hash table evenly through Jenkins hashing. The message is internally buffered through the traditional coarse-grained ring queue until the set delay value is reached, and then the messages with target delay values in the adjacent range are divided into the same memory buffer queue, the overall required queue resources are calculated, and the corresponding delay value is indexed and mapped with the buffer queue, and then the message is cached by the memory queue for fine-grained error control, so as to achieve the effect of delay damage. The method for dynamic delay simulation of multi-session flow based on delay range strategy of the present invention is highly flexible, greatly reduces memory overhead and reduces system cost; the delay damage simulation capability provided by the system can be adjusted by changing the configuration information to meet the delay damage in the multi-session flow scenario, so that the test is fully controllable, avoiding resource waste, and has high accuracy and wide range.
[0105] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A method for dynamic delay simulation of multi-session flows based on delay range strategy, characterized in that: The following steps are involved: The configuration PC configures the delay impairment simulation parameters and constructs an information message, and then sends the information message to the delay impairment simulation system. After the delay impairment simulation system receives the impairment simulation parameters sent by the configuration PC, it starts according to the configuration parameters; After receiving all the information messages sent by the configuration PC, the delay impairment simulation system uses the resource scheduling preprocessing module to pre-calculate the required memory buffer queue resources and reasonably plan them to avoid generating additional memory overhead; After the delay impairment simulation system is started, original message data is received from the input port; After receiving the original message data, the initialized metadata information is added to the end of the original message through the message tag; The message with metadata information attached enters the coarse-grained damage simulation module and is buffered by the intermediate medium to complete the set delay time. It determines whether the message has completed the delay damage. If the message has completed the delay damage, it will enter the fine-grained damage simulation module, otherwise the message will wait. The message entering the fine-grained damage simulation first performs range judgment and is imported into the corresponding different memory buffer queues. Then, the target timestamp in the metadata is compared with the current timestamp to decide whether to dequeue. If the target timestamp is less than or equal to the current timestamp, the message is dequeued, otherwise it waits. The message after being dequeued is the message with completed delay damage. After metadata stripping and system internal delay statistics, it is sent from the output port.
2. A method for simulating dynamic delay of multi-session flows based on delay range strategy as claimed in claim 1, characterized in that: Configure the PC to configure the delay impairment simulation parameters and construct the information message, and then send the information message to the delay impairment simulation system, specifically including Using a configuration PC to configure a delay impairment simulation parameter, the delay impairment simulation parameter includes a tuple consisting of a source MAC address and a destination MAC address and a delay time; After the delay impairment simulation parameters are configured, the configuration PC communicates with the delay impairment simulation system and exchanges information to form an information message, and the information message constructed by the configuration PC is sent to the delay impairment simulation system.
3. A method for simulating dynamic delay of multi-session flows based on delay range strategy as claimed in claim 2, characterized in that: After receiving the message, the delay impairment simulation system evenly inserts the binary information into the flow identification hash table through Jenkins hash calculation and saves the corresponding delay time as a value.
4. The method for simulating dynamic delay of multiple conversation flows based on delay range strategy as claimed in claim 1, characterized in that: After the delay impairment simulation system receives all the information messages sent by the configured PC, the resource scheduling preprocessing module is used to pre-calculate the required memory buffer queue resources, and reasonable planning is performed to avoid generating additional memory overhead. Specifically, after the delay impairment simulation system receives all the information messages sent by the configured PC, in order to better perform delay control at the fine-grained memory buffer stage for the session flows with different target simulation delay values, the required memory buffer queue resources are pre-calculated in the overall process, and the corresponding delay value is mapped with the corresponding memory buffer queue index, and reasonable planning is performed to avoid generating additional memory overhead. The relationship between the number of buffer queues and the delay value is as follows: Where N q is the number of buffer queues, T max is the maximum delay, T min is the minimum delay value, and t is the basic error threshold.
5. The method for simulating dynamic delay of multiple conversation flows based on delay range strategy as claimed in claim 1, characterized in that: The message with the additional metadata information enters the coarse-grained damage simulation module and is buffered by the intermediate medium to complete the set delay time. It is judged whether the message has completed the delay damage. The message that has completed the delay damage will enter the fine-grained damage simulation module, otherwise the message will wait. Specifically, during the link buffering process, the message with the additional metadata information is cyclically read and written by the internal ring queue. The batch reading is compared with the current timestamp and the target output timestamp in the message metadata information minus the memory buffer delay value to judge whether the message has completed the delay damage. The message that has completed the delay damage will enter the fine-grained damage simulation module, otherwise the message will wait.
6. A method for simulating dynamic delay of multiple conversation flows based on delay range strategy as claimed in claim 5, characterized in that: Whether the message has completed delay damage is determined by comparing the current timestamp with the target output timestamp in the message metadata minus the memory buffer delay value. When the current timestamp is greater than or equal to the target output timestamp in the message metadata minus the memory buffer delay value, it is determined that the coarse-grained delay damage is completed, and the message that has completed the coarse-grained delay damage is placed in the fine-grained delay simulation module, otherwise the message waits in place.
7. The method for dynamic delay simulation of multi-session flows based on delay range strategy as claimed in claim 1, characterized in that: The message entering the fine-grained delay simulation module first undergoes range determination, and then establishes a mapping between the message and the queue based on the pre-assigned delay value and the corresponding memory buffer queue index mapping relationship, and then enters the buffer queue corresponding to the index mapping; Fine-grained delay damage and error control are achieved by caching messages in the memory queue. The target timestamp and current timestamp in the message metadata in the cache queue are cyclically retrieved. When the target timestamp is less than or equal to the current timestamp, the message is dequeued, otherwise it waits.
8. The method for simulating dynamic delay of multiple conversation flows based on delay range strategy as claimed in claim 1, characterized in that: It also includes message statistics, including statistics on the total number of received messages and the total number of successfully sent messages, and calculation of the real-time packet loss rate; statistics on the receiving timestamp and sending timestamp of the messages, and calculation of the internal delay of the system, including the maximum delay, minimum delay and average delay.
9. The method for dynamic delay simulation of multi-session flows based on delay range strategy as claimed in claim 1, characterized in that: The delay impairment simulation system is deployed between two devices to be tested. A uniform configuration hash table is implemented through the Jenkins hash function according to the binary group consisting of the source MAC address and the destination MAC address, and the required memory buffer queue resources are pre-calculated to obtain the index mapping between the delay value and the memory buffer queue. After the traditional large transmission delay, according to the pre-allocated mapping relationship, the message is merged into the corresponding memory buffer queue after the range judgment, and fine-grained error control is performed through the memory queue cache, thereby achieving the effect of delay impairment.
10. The method for dynamic delay simulation of multi-session flows based on delay range strategy as claimed in claim 9, characterized in that: The delay impairment simulation system includes a message receiving module, a message sending module, a resource scheduling preprocessing module, a message marking module, a coarse-grained impairment simulation module, a message judgment module, a fine-grained impairment simulation module, a parameter configuration module, and a message statistics module; Among them, the message receiving module receives the input message and passes the original message to the message marking module, the message marking module appends the initialized metadata information to the end of the original message, and passes the marked message to the coarse-grained damage simulation module; the delay damage module performs internal link buffering on the message through an intermediate medium, and the message judgment module determines whether the message has completed the coarse-grained delay damage according to the metadata information, and the message that has completed the coarse-grained delay damage is passed to the fine-grained damage simulation module; the message caching module controls the message dequeueing according to the timestamp information, and the message is passed to the message sending module after being dequeued; the message sending module outputs the message that has completed the delay damage from the output port; in addition, the parameter configuration module and the message statistics module are relatively independent modules, which are respectively responsible for the damage parameter configuration before the delay damage simulation system is started and the situation of the messages entering and leaving the system during the operation of the statistics system.
Citation Information
Patent Citations
Method for measuring network transmission delay of any two nodes in programmable network
CN116094962A
Network flow IP speed limiting method and device
CN117793026A
Method for simulating network time delay damage based on disk buffering
CN117896289A
Traffic forwarding method and device
WO2022068736A1