A method for simulating network delay impairments based on fiber optic transmission

By using a delay impairment simulation method based on optical fiber transmission, and by configuring parameters such as fiber length and delay time, combined with user-space network drivers to realize link forwarding and memory queue caching, the problems of high complexity, resource waste and low accuracy in delay impairment simulation in existing technologies are solved, and high-flexibility and high-precision delay impairment simulation is achieved.

CN116319456BActive Publication Date: 2025-10-31SHANGHAI UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310113845.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-14
Publication Date
2025-10-31
Estimated Expiration
2043-02-14

AI Technical Summary

Technical Problem

Existing latency impairment simulation methods rely on the kernel protocol stack, which is complex to develop, inflexible in testing and verification, requires a lot of memory resources, has a single configuration, is prone to resource waste, and has low accuracy in high latency impairment simulation scenarios.

Method used

A simulated network latency impairment method based on fiber optic transmission is adopted. The latency impairment simulation is completed through a single system without relying on the kernel protocol stack. By using fiber length and latency time configuration parameters, combined with user-space network driver to realize link forwarding and memory queue caching, the latency impairment simulation is achieved.

Benefits of technology

It reduces memory overhead, lowers system costs, improves flexibility and accuracy, meets latency impairment requirements in various scenarios, avoids resource waste, and is suitable for large latency impairment simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319456B_ABST
    Figure CN116319456B_ABST
Patent Text Reader

Abstract

This invention discloses a method for simulating network latency impairment based on optical fiber transmission. The latency impairment simulation system is deployed between two devices under test (DUTs). Packets are forwarded via an internal link through a pair of internal ports. A long optical fiber is used as the transmission medium to introduce a large transmission delay for latency impairment simulation. The internal link forwarding is performed cyclically between the two ports until a set latency value is reached. Then, a memory queue is used to buffer packets for fine-grained error control, thereby achieving the effect of latency impairment. This invention provides a method for simulating network latency impairment based on optical fiber transmission. It simulates latency impairment through a single system, without relying on a kernel protocol stack, offering high flexibility. It significantly reduces memory overhead and system costs. The latency impairment simulation capabilities provided by the system can be adjusted by changing configuration information to meet latency impairment requirements in various scenarios, making the test completely controllable, avoiding resource waste, and offering high accuracy and wide range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network testing, and more particularly to a method for simulating network latency impairment based on optical fiber transmission. Background Technology

[0002] With the rapid development of the internet, people have increasingly higher requirements for network transmission quality and real-time performance. However, since most application services transmit data via wide area networks (WANs), there are significant differences compared to the LAN environment used for development and testing, in terms of bandwidth stability, transmission latency, and bit error rate. External interference, control information data flow, network equipment performance limitations, and transmission medium limitations can all have a series of negative impacts on the data path. Network impairment problems greatly affect network transmission quality. Therefore, it is essential to study network impairment simulation, conduct comprehensive assessments of network impairments, and ensure the reliability and quality of service of network applications.

[0003] Latency, as one of the most fundamental network performance metrics, is crucial for many real-time applications. Simulating latency impairments is a vital part of service development and testing. Furthermore, the rapid development of satellite communications in recent years has spurred the demand for inter-satellite link network simulation, with the design of large latency impairment simulation schemes being a pressing issue. Most network latency impairment implementations rely on the kernel protocol stack, resulting in high development complexity and relatively inflexible testing and verification, thus increasing development costs. Additionally, traditional software queue-based latency impairment schemes require significant memory resources, placing high demands on the equipment itself; their capabilities are relatively fixed, configurations are relatively simple, and one-time resource allocation can easily lead to resource waste; and they also exhibit low accuracy in large latency impairment simulation scenarios. Summary of the Invention

[0004] In view of the aforementioned shortcomings of existing technologies, the technical problem to be solved by this invention is that existing latency impairment simulation methods rely on kernel protocol stacks, resulting in high development complexity, relatively inflexible testing and verification, increased development costs, and the need for large amounts of memory resources. These methods also place high demands on equipment, have limited configuration options, and are prone to resource waste. This invention provides a method for simulating network latency impairments based on fiber optic transmission. It simulates latency impairments through a single system, operates independently of kernel protocol stacks, and offers high flexibility. It significantly reduces memory overhead and system costs. Furthermore, the latency impairment simulation capabilities provided by the system can be adjusted by changing configuration information to meet latency impairment requirements in various scenarios, making testing fully controllable, avoiding resource waste, and offering high accuracy and a wide range of applications.

[0005] To achieve the above objectives, the present invention provides a method for simulating network delay impairment based on optical fiber transmission, comprising the following steps:

[0006] The configuration PC configures the delay impairment simulation parameters and constructs an information message, which is then sent to the delay impairment simulation system. Upon receiving the impairment simulation parameters sent by the configuration PC, the delay impairment simulation system starts according to the configuration parameters.

[0007] After startup, the time delay impairment simulation system receives raw message data from the input port;

[0008] Initialized metadata information is appended to the end of the original message using message tags;

[0009] The message with appended metadata is forwarded through a pair of internal ports to complete the set delay time. During the internal link forwarding process, after the message with appended metadata is received by the internal receiving port, the current round number and completion flag in its metadata are updated. Then, the completion flag in its metadata is used to determine whether the message has completed the delay impairment. Messages that have completed the delay impairment are put into the buffer queue; otherwise, the message will be forwarded through the internal link again.

[0010] A message placed in the buffer queue is dequeued by comparing the target timestamp in the metadata with the current timestamp. If the target timestamp is less than or equal to the current timestamp, the message is dequeued; otherwise, it waits.

[0011] The message after dequeueing is the message with completed latency impairment. After metadata stripping and internal system latency statistics, it is sent by the output port.

[0012] Furthermore, the PC is configured to configure the latency impairment simulation parameters and construct information messages, which are then sent to the latency impairment simulation system. Specifically, this includes:

[0013] Users configure delay impairment simulation parameters using a configuration PC. The simulation parameters include fiber length and delay time.

[0014] After the simulation parameters are configured, the configuration PC communicates with the time delay impairment simulation system and exchanges information to form information messages. The information messages constructed by the configuration PC are then sent to the time delay impairment simulation system.

[0015] Furthermore, after receiving a message, the delay impairment simulation system calculates the target round number based on the delay time. The target round number determines the number of loops the message will be forwarded through the internal link of the delay impairment simulation system.

[0016] Furthermore, the transmission delay caused by link forwarding is related to the fiber length, fiber transmission speed, and number of forwarding cycles; the relationship between them can be expressed by the following formula:

[0017]

[0018] Where T forward It is the transmission delay, LOF V is the fiber length, V is the fiber transmission speed, and R is the number of forwarding cycles.

[0019] Furthermore, during the internal link forwarding process, after the packet with appended metadata is received by the internal receiving port, the current round number and completion flag in its metadata will be updated. Specifically, each time the packet is received by the internal receiving port, the current round number is incremented by 1; the current round number and the target round number are compared, and if they are equal, the completion flag is recorded as 1, otherwise the completion flag is not updated.

[0020] Furthermore, the completion flag in the metadata is set to 1 to determine whether the packet has completed coarse-grained latency impairment. When the completion flag is set to 1, it is determined that the coarse-grained latency impairment has been completed, and the packet that has completed the coarse-grained latency impairment is placed in the buffer queue. Otherwise, the packet is returned to perform internal link forwarding.

[0021] Furthermore, the metadata stripping setting removes metadata appended to the end of the message to ensure the integrity and correctness of the messages in the latency-impaired simulation system.

[0022] 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 calculation of the real-time packet loss rate; statistics on the received timestamps and sent timestamps of messages, and calculation of the internal system latency, including maximum latency, minimum latency and average latency.

[0023] Furthermore, the delay impairment simulation system is deployed between two devices under test. Messages are forwarded through an internal link via a pair of internal ports. The transmission medium uses long optical fibers to introduce large transmission delays for delay impairment simulation. The internal link forwarding is performed cyclically between the two ports until the set delay value is reached. Then, the messages are buffered through a memory queue for fine-grained error control, thereby achieving the effect of delay impairment.

[0024] Furthermore, the delay impairment simulation system includes a message receiving module, a message sending module, a message marking module, a delay impairment module, a metadata update module, a message decision module, a message buffering module, a parameter configuration module, and a message statistics module. The message receiving module receives input messages and passes the original messages to the message marking module. The message marking module appends initialized metadata information to the end of the original message and passes the marked message to the delay impairment module. The delay impairment module forwards the messages through internal ports via internal links. During the forwarding process, the metadata update module is responsible for updating the message metadata received by the internal receiving port. The data information is updated and the updated message is transmitted to the message decision module. The message decision module determines whether the message has completed coarse-grained delay impairment based on the metadata information. Messages that have completed coarse-grained delay impairment are transmitted to the message buffer module. The message buffer module controls the message dequeueing based on the timestamp information. After the message is dequeued, it is transmitted to the message sending module. The message sending module outputs the message that has completed 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 configuring the impairment parameters before the delay impairment simulation system starts and for counting the messages entering and leaving the system during the system operation, respectively.

[0025] Technical effect

[0026] This invention provides a method for simulating network latency impairment based on fiber optic transmission. The simulation of latency impairment is completed using a single system. The network I / O related functions of the latency impairment simulation system are implemented based on user-space network drivers, operating independently of the kernel protocol stack. This provides reliable performance guarantees while offering greater flexibility in design and development. Compared to traditional software queue latency impairment methods, this significantly reduces memory overhead and system costs. The latency impairment simulation capabilities provided by the system can be adjusted by changing configuration information to meet latency impairment requirements in various scenarios. This ensures complete controllability of testing, avoids resource waste, and offers high accuracy and a wide range, making it particularly suitable for simulating large latency impairment scenarios.

[0027] The following will further explain the concept, specific structure, and technical effects of the present invention in conjunction with the accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention. Attached Figure Description

[0028] Figure 1 This is a flowchart illustrating a preferred embodiment of the present invention of a method for simulating network delay impairment based on optical fiber transmission.

[0029] Figure 2 This is a schematic diagram of the delay impairment simulation system of a method for simulating network delay impairment based on optical fiber transmission, which is a preferred embodiment of the present invention. Detailed Implementation

[0030] To make the technical problems to be solved, the technical solutions, and the beneficial effects of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.

[0031] In the following description, specific details, such as particular internal procedures and techniques, are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will appreciate that the invention may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of the invention with unnecessary detail.

[0032] like Figure 1 As shown, this invention provides a method for simulating network delay impairment based on optical fiber transmission, specifically including the following steps:

[0033] Step 101: Configure the PC to configure the delay impairment simulation parameters and construct the information message, and then send it to the delay impairment simulation system;

[0034] The hardware device of this invention includes two devices under test (DUTs), a configuration PC, and a latency impairment simulation system. Both DUTs and the configuration PC are connected to the latency impairment simulation system. The latency impairment simulation system is connected in series between the two DUTs. The two DUTs act as the input source for latency impairment messages and the output source for impairment completion, respectively. This can be two separate devices or two network ports of a single device.

[0035] Users configure the required parameters via PC. The latency impairment simulation parameters include fiber length and delay time. The fiber length is set according to the actual fiber length used in the internal forwarding links of the system, and the fiber length determines the transmission delay of the internal forwarding links per unit round. The delay time is configured by the user, and the system implements the corresponding latency impairment effect according to this parameter.

[0036] The configuration PC and the system exchange information via socket communication. After the parameters are configured, the configuration PC constructs an information message and sends it to the system via socket communication. The message uses a user-defined protocol, and each information message is 32 bits long, as defined in Table 1. The frame header is fixed at 0x3C, and of the 16 bits of the delay time, 12 bits are data bits and 4 bits are unit indicator bits.

[0037]

[0038] Table 1 Configuration Information Message Definitions

[0039] In this embodiment, there are three types of unit indicator bits:

[0040] 0001: us;

[0041] 0010: ms;

[0042] 0100: s;

[0043] After receiving the configuration information message, the system calculates the target number of rounds based on the delay time parameter. The target number of rounds determines the number of times the message passes through the delay impairment module. The correspondence between delay time and target number of rounds is as follows:

[0044] R = α * T delay / (L OF / V+β)

[0045] Where R is the target number of rounds; T delay This is a delay time; the information is sent to the system after the user configures their PC. OF β is the fiber optic length, configured by the user on the PC and then sent to the system. Different fiber optic lengths result in different transmission delays per unit number of rounds provided by the system. V is the transmission speed, a fixed value measured experimentally, representing the transmission speed per unit length of fiber in a real-world scenario. β is the system overhead, a fixed value measured experimentally, which includes the overhead of system message sending and receiving, buffer queue enqueue and dequeue overhead, and the processing overhead of internal link forwarding in each round by the delay impairment module. α is the scaling factor used for error control. The delay impairment module performs coarse-grained delay impairment, while the message buffer module performs fine-grained delay impairment and error control.

[0046] This step enables the system to adjust its latency impairment simulation capabilities by changing configuration information, thereby meeting the latency impairment requirements in various scenarios.

[0047] Step 102: After receiving message data from the input port, the delay impairment simulation system appends the initialized metadata to the end of the message using message markers.

[0048] Message tagging refers to the system initializing corresponding metadata for each message and appending the metadata to the end of the message. The purpose of message tagging is to obtain and update necessary information in subsequent steps to perform specific operations based on this information. The metadata is 18 bytes long and includes the message sequence number, current loop number, completion flag, and output target timestamp, as shown in Table 1. The message sequence number records the order in which messages enter the system; this value serves as a unique identifier for each message and can also be used to determine if there are any out-of-order output anomalies. The current loop number records the number of times the message passes through the latency impairment module; comparing this value with the target loop number parameter determines whether the message's coarse-grained latency impairment is complete. The completion flag indicates whether the message has completed coarse-grained latency impairment. The output target timestamp records the target time for the message's output, and its calculation formula is as follows:

[0049] T output =T input +T delay

[0050] Among them, T output It outputs the target timestamp, T input It is the input timestamp, T delay It is a delay time.

[0051] Message sequence number Current loop number Complete mark Output target timestamp 8 Bytes 1 Byte 1 Byte 8 Bytes

[0052] Table 1 Metadata Definitions

[0053] Metadata is an important medium for information exchange within a system. It carries necessary information for internal modules to access and update. Metadata is appended to the end of a message after it enters the system and removed before it leaves the system, thus ensuring the integrity and correctness of the message. Leaving the system refers to sending the message out of the system via an output port.

[0054] Step 103: The packet is forwarded through the internal port via the internal link to complete the coarse-grained latency impairment; the internal link forwarding is to use the forwarding delay to simulate latency impairment.

[0055] The network I / O functions involved in this method, such as the link forwarding function in this step and the message receiving and sending functions at input and output, are all implemented based on high-performance user-space network drivers, bypassing the kernel protocol stack. This not only avoids the additional processing overhead of traditional kernel-space network drivers, enabling the system to have high-performance network I / O capabilities and providing reliable performance guarantees for latency impairment simulation, but also allows for greater flexibility in the design and development of the system. Traditional kernel protocol stacks focus more on general-purpose design, which greatly limits the framework design and function customization of some systems implemented based on kernel protocol stacks. In addition, the kernel protocol stack framework is large, the logic is complex, the development is very difficult, and the testing process is cumbersome, all of which bring great uncertainty to the system's implementation cycle and function iteration speed. The system implemented based on user-space drivers can solve the above problems well, not only allowing for greater space in framework design and function customization, but also having a significant advantage in development and testing costs compared to traditional kernel protocol stacks.

[0056] The system's network I / O functions are implemented based on user-space network drivers, providing performance guarantees and scalability for framework design and function customization, achieving a highly flexible technical effect.

[0057] System latency impairment simulation is achieved through two main steps: coarse-grained latency impairment is achieved by utilizing the transmission delay generated by link forwarding on internal ports; fine-grained latency impairment and error control are achieved by buffering packets in a memory queue. Link forwarding, as a coarse-grained latency impairment method, aims to achieve most of the set delay time without requiring additional memory resources. This design is the biggest difference from traditional latency impairment schemes and one of the main innovations of this method. Its formula is described as follows:

[0058] T delay =T forward +T buffer

[0059] T forward =α*T delay

[0060] T buffer = (1-α)*T delay

[0061] Among them, T delay It is the delay time, T forward The transmission delay T is caused by link forwarding. bufferα is the memory queue buffer time, and α is a scaling factor used to characterize the proportion of transmission delay to the total delay time. The larger α is, the more delay is required for the link forwarding process, the less memory queue buffer time is needed, and the less memory resources are required. However, the accuracy of error control is more difficult to guarantee, and the overall system implementation precision is worse. Therefore, determining the value of α is a result of balancing memory resource usage and system implementation precision.

[0062] The transmission delay caused by link forwarding is related to the fiber length, fiber transmission speed, and the number of forwarding cycles. The relationship between them can be expressed by the following formula:

[0063]

[0064] Where T forward It is the transmission delay, L OF V is the fiber length, V is the fiber transmission speed, and R is the number of forwarding cycles.

[0065] Since fiber optic transmission speed is constant, different transmission delays can be achieved by changing the fiber length and the number of forwarding cycles. The fiber length determines the transmission delay per unit of forwarding cycles; the longer the fiber, the stronger the simulation capability of delay impairment per unit of cycles. The transmission delay per unit of forwarding cycles is also called the base transmission delay. To meet the requirements of large delay impairment simulation scenarios, the base transmission delay needs to be sufficiently large. Therefore, the transmission medium of the forwarding link needs to be selected with an appropriate fiber length based on the scenario requirements. The fiber length is selected by the user and the parameter configuration is completed in step 101. After the base transmission delay is determined, the number of forwarding cycles can be calculated based on the user-set delay time. The good transmission stability and long transmission distance of fiber optic transmission make its transmission delay relatively stable, thus demonstrating its feasibility as a coarse-grained implementation scheme for delay impairment.

[0066] By leveraging the transmission delay generated by the internal forwarding link, coarse-grained latency impairment is achieved, thus addressing the issue of excessive memory resource requirements in traditional latency impairment schemes. This results in optimized memory resource utilization and reduced system costs.

[0067] Step 104: After the message is received by the internal receiving port, the current round count and completion flag in the metadata are updated. The update rule is that the current round count is incremented by 1 each time the message is received through the internal receiving port. The current round count and the target round count are compared. If they are equal, the completion flag is set to 1; otherwise, the completion flag is not updated. After the message enters the latency impairment simulation system, the current round count in its metadata is initialized to 0 during the message marking phase. Subsequently, the current round count is incremented by 1 each time the message is forwarded through an internal link until it equals the target round count. At this point, the completion flag is set to 1, indicating that the coarse-grained latency impairment of the message has been completed.

[0068] Step 105: Based on the completion flag in the metadata, determine whether the packet has completed coarse-grained latency impairment. Packets that have completed coarse-grained latency impairment are placed in the buffer queue; otherwise, the packet is returned for internal link forwarding. Packets that have completed coarse-grained latency impairment are limited by the base transmission delay, resulting in insufficient precision. Furthermore, due to internal system processing overhead, the actual latency of coarse-grained latency impairment varies among different packets. To achieve more accurate and stable latency impairment, a buffer queue is needed to implement fine-grained latency impairment and error control.

[0069] Step 106: Fine-grained latency impairment and error control are achieved by caching packets in a memory queue. The target timestamp and current timestamp in the packet metadata of the cache queue are retrieved cyclically. If the target timestamp is less than or equal to the current timestamp, the packet is dequeued; otherwise, it waits. Implementing fine-grained latency impairment through the cache queue overcomes the limitations of base transmission delay accuracy, improving system impairment accuracy and meeting the application needs of more scenarios. Furthermore, it effectively mitigates the latency jitter problem in the coarse-grained latency impairment process implemented through link forwarding, further reducing impairment errors.

[0070] Compared to software queues in traditional latency impairment schemes, cached queues require less memory resources, while simultaneously achieving the technical effects of saving memory resources and ensuring the accuracy and stability of system impairment.

[0071] Step 107: After the message is dequeued, the metadata is stripped and the system's internal latency is calculated. The result is then sent by the output port.

[0072] Metadata stripping involves removing the metadata appended to the end of the message in step 102 to ensure the integrity and correctness of messages passing through the system.

[0073] Internal system latency statistics involve recording message output timestamps, calculating the internal latency by subtracting the output and input times, and then calculating and storing the maximum, minimum, and average latency values. Internal system latency statistics provide a more intuitive understanding of the system's current damage accuracy and stability, ensuring reliable system operation.

[0074] In this embodiment of the invention, the latency impairment simulation system is deployed between two devices under test. Packets are forwarded via a pair of internal ports, and a long optical fiber is used as the transmission medium to introduce a large transmission delay for latency impairment simulation. Link forwarding is performed cyclically between the two ports until a set latency value is reached. Then, a memory queue is used to buffer packets for fine-grained error control, thereby achieving the effect of latency impairment. Compared to traditional latency impairment simulation systems, the innovations of this system are mainly reflected in two aspects: First, it implements relevant network I / O functions based on a high-performance user-space network driver, bypassing the kernel protocol stack. This not only avoids the additional processing overhead of traditional kernel-space network drivers, enabling the system to have high-performance network I / O capabilities and providing reliable performance guarantees for latency impairment simulation tasks, but also allows for greater flexibility in the design and development process due to its independence from the kernel protocol stack. Second, by using the transmission delay generated by link forwarding through a pair of internal ports using a long optical fiber as the transmission medium as a coarse-grained latency impairment method, the system memory resource usage is greatly reduced, resource allocation is optimized, and system costs are lowered. The latency impairment simulation system includes a message receiving module, a message sending module, a message marking module, a latency impairment module, a metadata update module, a message decision module, a message buffering module, a parameter configuration module, and a message statistics module. The message receiving module receives input messages and passes the original messages to the message marking module. The message marking module appends initialized metadata information to the end of the original message and passes the marked message to the latency impairment module. The latency impairment module forwards the messages through internal ports via internal links. During forwarding, the metadata update module updates the metadata information of the messages received by the internal receiving port and passes the updated messages to the message decision module. The message decision module determines whether the message has achieved coarse-grained latency impairment based on the metadata information. Messages with completed coarse-grained latency impairment are passed to the message buffering module. The message buffering module controls message dequeueing based on timestamp information. After dequeueing, the messages are passed to the message sending module. The message sending module outputs the latency-impaired messages from the output port. In addition, the parameter configuration module and the message statistics module are relatively independent modules, which are respectively responsible for configuring the damage parameters before the delay damage simulation system is started and for counting the messages entering and leaving the system during the system operation.

[0075] Each module in the time delay impairment simulation system is responsible for its corresponding function:

[0076] (1) The message receiving / sending module is responsible for the following functions:

[0077] Receive messages from external systems and pass the received messages to the message marking module; retrieve messages that have completed latency impairment from the buffer module and send them to the external system;

[0078] The reception and transmission of messages are implemented based on user-space network drivers, bypassing the kernel protocol stack. This gives the system high-performance network I / O capabilities while making it more flexible in the design and development of subsequent frameworks and functions.

[0079] (2) The message marking module is responsible for the following functions:

[0080] Metadata initialization, in which the message sequence number is incremented according to the message receiving order; the output target timestamp is calculated based on the receiving timestamp and the delay time obtained from the parameter configuration module; the current loop number and completion flag are initialized to 0; metadata is appended to the end of the message to facilitate information exchange and status updates 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 removed from the end of the message before the message leaves the system.

[0081] (3) The delay impairment module is responsible for the following functions:

[0082] The message requiring delay impairment is sent from the internal sending port; the long optical fiber is used as the transmission medium to complete the link forwarding of the message between the internal ports. The large transmission delay introduced by the long optical fiber can be used as a coarse-grained delay impairment method to complete most of the set delay time; the message is received from the internal receiving port and passed to the metadata update module.

[0083] The transmission delay caused by link forwarding is related to the fiber length, fiber transmission speed, and the number of forwarding cycles. The relationship between them can be expressed by the following formula:

[0084]

[0085] Where T forward It is the transmission delay, L OF V is the fiber length, V is the fiber transmission speed, and R is the number of forwarding cycles.

[0086] Internal link forwarding is also implemented based on user-space network drivers, thus providing performance guarantees. At the same time, the transmission delay generated by internal link forwarding can achieve coarse-grained latency impairment, which can significantly optimize the use of system memory resources and reduce system costs. However, the accuracy and stability of coarse-grained latency impairment are relatively poor.

[0087] (4) The metadata update module is responsible for the following functions:

[0088] Update the current cycle number in the message metadata; compare the current cycle number with the target cycle number calculated in the parameter configuration module, and update the completion flag in the metadata;

[0089] (5) The message decision module is responsible for the following functions:

[0090] For messages whose flag has been set to 0, the message is returned to the latency impairment module for the next round of latency impairment; for messages whose flag has been set to 1, it means that coarse-grained latency impairment has been completed and the message is directly passed to the message buffer module.

[0091] (6) The message caching module is responsible for the following functions:

[0092] For messages that have not reached the target timestamp in the metadata, wait; for messages that have reached the target timestamp in the metadata, dequeue and pass them to the message sending module.

[0093] The message caching module caches messages in a memory queue to achieve fine-grained latency impairment and error control, which effectively improves the poor accuracy and stability of coarse-grained latency impairment. This further improves the system's impairment accuracy, meets the application needs of more scenarios, and also optimizes the error control of the impairment results.

[0094] (7) The message statistics module is responsible for the following functions:

[0095] The system collects statistics on all message sending and receiving data and calculates the real-time packet loss rate. It also collects the message receiving and sending timestamps and calculates the internal system latency, including the maximum latency, minimum latency, and average latency.

[0096] The statistics module can provide a more intuitive understanding of the current operating status of the system. It can promptly obtain relevant data on system inputs, outputs, and damage results, and report them when necessary to ensure the normal and reliable operation of the system.

[0097] (8) The parameter configuration module is responsible for the following functions:

[0098] The system receives the fiber optic length and delay time parameters from the configuration PC. The fiber optic length is set based on the actual fiber optic length used in the system's internal forwarding links, determining the transmission delay per unit number of rounds. The delay time is configured by the user, and the system implements the corresponding delay impairment effect according to this parameter. The system calculates the corresponding target number of rounds based on the delay time to determine whether the delay impairment is complete. The correspondence between delay time and target number of rounds is as follows:

[0099] R = α * T delay / (L OF / V+β)

[0100] Where R is the target number of rounds; T delay It is the delay time; L OF α is the fiber length; V is the transmission speed, a fixed value measured experimentally; β is the system overhead, a fixed value measured experimentally; α is the scaling factor, used for error control.

[0101] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A method for simulating network delay impairments based on optical fiber transmission, characterized in that, Coarse-grained delay impairment is achieved by using the transmission delay generated by link forwarding through internal ports. Fine-grained latency impairment and error control are achieved by buffering packets in a memory queue; link forwarding, as a coarse-grained latency impairment method, includes the following steps: The configuration PC configures the delay impairment simulation parameters and constructs an information message, which is then sent to the delay impairment simulation system. Upon receiving the impairment simulation parameters sent by the configuration PC, the delay impairment simulation system starts according to the configuration parameters. The user configures the delay impairment simulation parameters using the configuration PC, and the simulation parameters include fiber length and delay time. After the simulation parameters are configured, the configuration PC communicates with the delay impairment simulation system and exchanges information to form an information message. The information message constructed by the configuration PC is then sent to the delay impairment simulation system. After receiving the message, the delay impairment simulation system calculates the target number of rounds based on the delay time. The target number of rounds determines the number of loops the message needs to be forwarded through the internal link of the delay impairment simulation system. The correspondence between the delay time and the target number of rounds is as follows: R=α*T delay / (L OF / V+β) Where R is the target number of rounds; T delay This is a delay time; the information is sent to the system after the user configures their PC. OF β is the fiber optic length, configured by the user on the PC and then sent to the system. Different fiber optic lengths result in different transmission delays per unit number of rounds provided by the system. V is the fiber optic transmission speed, a fixed value measured experimentally, representing the transmission speed per unit length of fiber in a real-world scenario. β is the system overhead, a fixed value measured experimentally, which includes the overhead of system message sending and receiving, buffer queue enqueue and dequeue overhead, and the processing overhead of internal link forwarding in each round by the delay impairment module. α is the scaling factor used for error control. The delay impairment module performs coarse-grained delay impairment, while the message buffer module performs fine-grained delay impairment and error control. After startup, the time delay impairment simulation system receives raw message data from the input port; Initialized metadata information is appended to the end of the original message using message tags; The message with appended metadata is forwarded through a pair of internal ports to complete the set delay time. During the internal link forwarding process, after the message with appended metadata is received by the internal receiving port, the current round number and completion flag in its metadata are updated. Then, the completion flag in its metadata is used to determine whether the message has completed the delay impairment. Messages that have completed the delay impairment are put into the buffer queue; otherwise, the message will be forwarded through the internal link again. A message placed in the buffer queue is dequeued by comparing the target timestamp in the metadata with the current timestamp. If the target timestamp is less than or equal to the current timestamp, the message is dequeued; otherwise, it waits. The message after dequeueing is the message with completed latency impairment. After metadata stripping and internal system latency statistics, it is sent by the output port.

2. The method for simulating network delay impairment based on optical fiber transmission as described in claim 1, characterized in that, The transmission delay caused by link forwarding is related to the fiber length, fiber transmission speed, and target round number; the relationship between them can be expressed by the following formula: Where T forward It is the transmission delay, L OF V is the fiber length, V is the fiber transmission speed, and R is the target number of rounds.

3. The method for simulating network delay impairment based on optical fiber transmission as described in claim 2, characterized in that, During internal link forwarding, after the packet with appended metadata is received by the internal receiving port, the current round number and completion flag in its metadata will be updated. Specifically, each time the packet is received by the internal receiving port, the current round number is incremented by 1; the current round number and the target round number are compared. If they are equal, the completion flag is recorded as 1; otherwise, the completion flag is not updated.

4. The method for simulating network delay impairment based on optical fiber transmission as described in claim 3, characterized in that, Whether a packet has completed coarse-grained latency impairment is determined by whether the completion flag in the metadata is 1. When the completion flag is 1, it is determined that coarse-grained latency impairment has been completed, and the packet that has completed coarse-grained latency impairment is placed in the buffer queue; otherwise, the packet is returned for internal link forwarding.

5. The method for simulating network delay impairment based on optical fiber transmission as described in claim 1, characterized in that, The metadata stripping is configured to remove metadata appended to the end of the message, ensuring the integrity and correctness of the messages passed through the delay impairment simulation system.

6. The method for simulating network delay impairment based on optical fiber transmission as described in claim 1, characterized in that, It also includes message statistics, specifically 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 received timestamps and sent timestamps of messages, and calculation of the internal system latency, including maximum latency, minimum latency and average latency.

7. The method for simulating network delay impairment based on optical fiber transmission as described in claim 1, characterized in that, The delay impairment simulation system is deployed between two devices under test. Messages are forwarded through an internal link via a pair of internal ports. The transmission medium uses long optical fibers to introduce large transmission delays for delay impairment simulation. The internal link forwarding is performed cyclically between the two ports until the set delay value is reached. Then, the messages are buffered through a memory queue for fine-grained error control, thereby achieving the effect of delay impairment.

8. The method for simulating network delay impairment based on optical fiber transmission as described in claim 7, characterized in that, The latency impairment simulation system includes a message receiving module, a message sending module, a message marking module, a latency impairment module, a metadata update module, a message decision module, a message caching module, a parameter configuration module, and a message statistics module. The message receiving module receives input messages and transmits the original messages to the message marking module. The message marking module appends initialized metadata information to the end of the original messages and transmits the marked messages to the latency impairment module. The latency impairment module forwards packets through internal ports via internal links. During forwarding, the metadata update module updates the packet metadata information received by the internal receiving port and passes the updated packet to the packet decision module. The packet decision module then determines whether the packet has completed coarse-grained latency impairment based on the metadata information. Packets that have completed coarse-grained latency impairment are passed to the packet buffer module. The packet buffer module controls packet dequeueing based on timestamp information, and after dequeueing, the packets are passed to the packet sending module. The packet sending module outputs the packets that have completed latency impairment from the output port. In addition, the parameter configuration module and the packet statistics module are relatively independent modules, responsible for configuring impairment parameters before the latency impairment simulation system starts and for statistically analyzing the packets entering and leaving the system during system operation, respectively.

Citation Information

Patent Citations

  • FIFO cache sharing router based on fiber delay lines and working method thereof

    CN103731359A

  • Memory delay modeling method, device and equipment and medium

    CN114330229A

  • System and method for automatically carrying out network damage simulation on all interactive messages between two entities

    CN114640596A