A data link channel detection method, device and equipment
By obtaining the transmission bandwidth ratio and frame length of the data link, determining the packet gap length, and sending test packets to detect the performance of low-speed data links, solving the problem that detection equipment in the prior art cannot accurately test the performance of low-speed channel, and achieving high-precision performance detection.
Patent Information
- Application Number
- CN202510147384.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-02-11
AI Technical Summary
In the prior art, general network testing instruments cannot accurately detect the channel performance of low-speed data links, especially the bandwidth, transmission delay, packet loss rate and bit error rate at the kbps level, which is greatly affected by operating system and CPU system tasks.
By obtaining the ratio of the transmission bandwidth of the measured data link to the target bandwidth, determining the packet gap length of the test data frame, and sending test packets on the data link, obtaining multiple test results, and calculating performance indicators such as throughput, packet loss rate and delay.
It realizes the performance detection of the kilobit level channel on the 100-gigabit and gigabit transmission bandwidth, improves the accuracy and reliability of the detection, and solves the problem of low-speed data link performance detection.
Smart Images

Figure CN119628766B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method, device and equipment for detecting a channel of a data link. Background Art
[0002] Currently, Ethernet data interface rates are already above 100M and 1000Mbps. When general network test instruments are used to detect the performance of low-speed data link channels, the minimum bandwidth granularity that can be set is 1% of the Ethernet interface. For a 100M Ethernet interface, this is 1Mbps. This bandwidth detection granularity cannot meet the performance requirements of low-speed data links at the kbps level.
[0003] To test the channel performance of such low-speed data links, the Ping tool is often used to simply check channel connectivity and latency. However, this method cannot accurately measure channel performance, such as bandwidth, transmission latency, packet loss rate, and bit error rate. Because the Ping tool uses the system's CPU (central processing unit) to assemble and test packets, the latency accuracy of the test fluctuates due to the influence of the operating system and CPU system tasks, resulting in a certain degree of uncertainty. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a data link channel detection method, device and equipment to solve the problem that the detection equipment in the prior art cannot test the performance of low-speed and small-bandwidth channels.
[0005] In order to solve the above technical problems, the technical solutions of the present invention are as follows:
[0006] A data link channel detection method, comprising:
[0007] Obtaining a ratio of a transmission bandwidth of the data link under test to a target bandwidth, wherein the transmission bandwidth is greater than the target bandwidth;
[0008] Obtaining the frame length of the test data frame transmitted by the data link under test;
[0009] Determining the packet gap length of the test data frame according to the ratio and the frame length;
[0010] According to the packet gap length, sending a test message for n tests on the data link under test to obtain a test result; wherein the test message includes a plurality of the test data frames, and n is a positive integer;
[0011] A performance test result of the tested data link is determined based on the multiple test results.
[0012] Optionally, obtaining a ratio of the transmission bandwidth of the data link under test to the target bandwidth includes:
[0013] The ratio of the transmission bandwidth of the data link under test to the target bandwidth is obtained according to k=LS / HS, where LS is the target bandwidth, HS is the transmission bandwidth, and k is the ratio.
[0014] Optionally, determining the packet gap length of the test data frame according to the proportional relationship and the frame length includes:
[0015] According to (len+m) / (len+gap)=k and gap=((1-k)len) / k+m / k, the packet gap length of the test data frame is obtained;
[0016] Where len is the frame length, gap is the packet gap length, and m is the sum of the lengths of the frame gap, preamble, and start delimiter.
[0017] Optionally, sending test messages for n tests on the data link under test to obtain a test result includes:
[0018] On the data link under test, according to the sending rate R n Send N Tn test messages, each test message including multiple test data frames, wherein the test data frames have a private tag test frame and a timestamp;
[0019] Get the test message received by the receiving port;
[0020] A test result is obtained based on the test messages received and the test messages sent in n tests. The test result includes throughput, packet loss rate and / or delay.
[0021] Optionally, determining a packet loss rate based on the number of received test packets and the number of sent test packets includes:
[0022] according to , determine the packet loss rate;
[0023] Among them, N Rn N is the number of test message packets arriving at the tester's receiving port. Tn The number of test packets sent.
[0024] Optionally, adjust the sending rate, including:
[0025] according to as well as , reduce the sending rate;
[0026] Among them, R n is the sending rate this time, is the next sending rate, are the left and right boundaries of the sending rate; when n=1, = , is the maximum transmission rate.
[0027] Optionally, adjust the sending rate, including:
[0028] according to as well as , increase the sending rate.
[0029] Optionally, a performance test result of the data link under test is determined based on multiple test results, including:
[0030] The average value of M test results is A=(T1+T2+……+T M ) / M, determined as the performance test result of the tested data link; where A is the performance test result, T1, T2, T M They are the first test result, the second test result, and the Mth test result respectively, where M is a positive integer.
[0031] The present invention also provides a data link channel detection device, comprising:
[0032] an acquisition module, configured to acquire a ratio of a transmission bandwidth of a data link under test to a target bandwidth, wherein the transmission bandwidth is greater than the target bandwidth; and to acquire a frame length of a test data frame transmitted by the data link under test;
[0033] A processing module is configured to determine, based on the ratio and the frame length, a packet gap length of the test data frame; send, based on the packet gap length, a test message for n tests on the data link under test to obtain a test result; wherein the test message includes a plurality of the test data frames, and n is a positive integer; and determine, based on the plurality of test results, a performance test result of the data link under test.
[0034] The present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the method described above.
[0035] The above solution of the present invention includes at least the following beneficial effects:
[0036] The above-mentioned solution of the present invention obtains the ratio of the transmission bandwidth of the data link under test to the target bandwidth, and determines the inter-packet gap length of the test data frame based on the ratio and the frame length. According to the inter-packet gap length, a test message is sent on the data link under test n times to obtain a test result. The test message includes multiple test data frames, and n is a positive integer. Based on the multiple test results, the performance test result of the data link under test is determined. This allows for channel performance testing at the kilobit level (i.e., the target bandwidth) in data communication channels with transmission bandwidths of 100 or 1000 Mbps. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a flow chart of a data link channel detection method of the present invention;
[0038] Figure 2 Schematic diagram of the composition of a data frame of the data link channel detection method of the present invention;
[0039] Figure 3 is a performance test flow chart of the data link channel detection method of the present invention;
[0040] Figure 4 1. It is a connection diagram of a test solution of a channel detection method for a data link of the present invention;
[0041] Figure 5 It is a module schematic diagram of the channel detection device of the data link of the present invention. DETAILED DESCRIPTION
[0042] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0043] like Figure 1 As shown, an embodiment of the present invention provides a data link channel detection method, including:
[0044] Step 11, obtaining a ratio of a transmission bandwidth of the data link under test to a target bandwidth, wherein the transmission bandwidth is greater than the target bandwidth;
[0045] Step 12, obtaining the frame length of the test data frame transmitted by the data link under test;
[0046] Step 13, determining the packet gap length of the test data frame according to the ratio and the frame length;
[0047] Step 14, sending a test message for n tests on the data link under test according to the packet gap length, and obtaining a test result; wherein the test message includes a plurality of the test data frames, and n is a positive integer;
[0048] Step 15: Determine the performance test result of the tested data link based on the multiple test results.
[0049] In this embodiment, the transmission bandwidth of the data link under test can be 100 Mbps or 1000 Mbps, and the target bandwidth is a granular bandwidth of 10 kbps. Here, the transmission bandwidth of the data link under test is in the 100-Mbit or 1000-Mbit range, and the target bandwidth is in the kilobit range, which is significantly greater than the target bandwidth. This embodiment determines the inter-packet gap length of the test data frame based on the ratio of the transmission bandwidth of the data link under test to the target bandwidth and the frame length. Test messages are then sent over the data link under test n times according to the inter-packet gap length to obtain a test result. The test message includes multiple test data frames, where n is a positive integer. Based on the multiple test results, a performance test result of the data link under test is determined. This allows for channel performance testing at the kilobit level (i.e., the target bandwidth) in data communication channels with 100- or 1000-Mbps transmission bandwidths.
[0050] In an optional embodiment of the present invention, in step 11, obtaining the ratio of the transmission bandwidth of the data link under test to the target bandwidth includes:
[0051] Step 111 , obtaining the ratio of the transmission bandwidth of the data link under test to the target bandwidth according to k=LS / HS; wherein LS is the target bandwidth, HS is the transmission bandwidth, and k is the ratio.
[0052] Here, the target bandwidth is a preset value, which can be determined according to the actual test accuracy, for example, it can be the above-mentioned 10 kbps, or it can be 20 kbps, etc.
[0053] In an optional embodiment of the present invention, in step 13, determining the packet gap length of the test data frame based on the proportional relationship and the frame length includes:
[0054] Step 131 , according to (len+m) / (len+gap)=k and gap=((1-k)len) / k+m / k, obtain the packet gap length of the test data frame;
[0055] Where len is the frame length, gap is the packet gap length, and m is the sum of the lengths of the frame gap, preamble, and start delimiter.
[0056] Specifically, the frame length len is the sum of the source / destination MAC address byte length, type / length byte length and frame check sequence length. The transmission mode of the test data frame in the data link is as follows: Figure 2 As shown, the data frame includes an Ethernet frame pkt and a packet gap gap.
[0057] For example, a gigabit interface with a full rate of 1000 Mbps must satisfy the following formula to achieve a granular bandwidth of 10 kbps: 10 kbps / 1000 Mbps = (len+20) / (len+gap); gap=99999*len+2000000
[0058] That is, if the frame length is 64 bytes, the packet gap is 8,399,936 bytes.
[0059] If the frame length len is 128 bytes, then the packet gap is 14,799,872 bytes;
[0060] This allows the corresponding packet gap (gap) to be accurately calculated in real time based on each Ethernet frame of a specific frame length (len) sent, thereby always ensuring that the line rate of the data link is precisely controlled at a small granular bandwidth of 10kbps.
[0061] The relationship between the packet gap and the small-granule bandwidth satisfies: (L + 8 + 12) bytes / frame × 8 bits / byte × N frames / s = 100 Mbit / s;
[0062] L is the Ethernet frame length; N is the number of data frames sent by the device per second;
[0063] The 8 in the brackets refers to the 7 preambles + 1 start delimiter in front of each Ethernet frame;
[0064] The 12 in the brackets is the required interframe gap for each Ethernet frame.
[0065] In this embodiment, a corresponding packet gap is calculated and designed according to the frame length of each Ethernet frame sent, thereby realizing kilobit-level channel performance detection in a data communication channel at 100 or 1000 Mbps.
[0066] In an optional embodiment of the present invention, in step 14, the test process of the performance test of the data link of the present invention is as follows: Figure 3 As shown, n test messages are sent on the tested data link to obtain a test result, including:
[0067] Step 141: On the data link under test, according to the sending rate R n Send N Tntest messages, each test message including multiple test data frames, wherein the test data frames have a private tag test frame and a timestamp;
[0068] Step 142, obtaining the test message received by the receiving port;
[0069] Step 143: Obtain a test result based on the test messages received and sent in n tests, where the test result includes throughput, packet loss rate and / or delay.
[0070] In step 143, obtaining the throughput in the test result based on the test messages received and the test messages sent in the n tests includes:
[0071] Step 1431: Determine the accuracy based on the data content of the received test message and the data content of the sent test message. Here, accuracy refers to the ratio of correctly received message data to the total message data, and this ratio is used as an indicator of accuracy. Assuming that 950 out of 1000 test message data are correctly received, the accuracy can be preliminarily calculated as 950 / 1000 = 95%.
[0072] Step 1432: After adjusting the sending rate based on whether the test data frame carries a private tag test frame, the accuracy, and a preset accuracy threshold, the test is performed again until the test number n is reached, and the test rate of the last test is output as the throughput of the data link.
[0073] In step 143, the packet loss rate in the test result is obtained based on the test messages received and the test messages sent in the n tests, including:
[0074] Step 1433: Determine a packet loss rate based on the number of test messages received and the number of test messages sent.
[0075] Step 1434: adjust the sending rate according to the packet loss rate and the preset packet loss threshold, and test again until the test number n is reached.
[0076] Step 1435: Output the average value of the packet loss rates of each test as the packet loss rate of the data link.
[0077] In step 143, the delay in the test result is obtained based on the test messages received and the test messages sent in the n tests, including:
[0078] Step 1436, the difference between the receiving time and the sending timestamp is determined as the delay;
[0079] Step 1437 outputs the average value of the delays of each test as the average delay of the data link. A test result includes the throughput of the data link, the packet loss rate of the data link and / or the average delay of the data link of the above n tests.
[0080] Specifically, the performance test of the data link includes throughput, packet loss rate, and average delay test. In step 141, the test environment is first initialized, and a test data frame is constructed with an initial transmission rate R n Send N Tn Each test message includes a plurality of test data frames, and the test data frames have a private tag test frame and a timestamp.
[0081] In this embodiment, the test environment is initialized: each time a test is performed, the register values in the FPGA need to be restored to the state before the test, and each component needs to be in the initial working state. If not restored, the results of subsequent tests will be affected or the test will not be possible.
[0082] During channel communication, various packets, such as TCP and UDP, often appear. Privately tagged test frames are constructed to prevent other types of data frames from affecting test results. This construction and implementation of privately tagged test frames can be implemented using the transmit logic module in an FPGA (field programmable gate array). This involves encapsulating data, setting flag fields, introducing bit errors, generating load, simulating latency and packet loss, testing QoS, and using a traffic generator.
[0083] In step 1432, the transmission rate is adjusted based on whether the test data frame contains a private tag test frame, the accuracy, and a preset accuracy threshold. The determination of whether the test data frame contains a private tag test frame takes precedence over the accuracy and the preset accuracy threshold. If the test data frame does not contain a private tag test frame, the transmission rate is directly reduced. If the test data frame contains a private tag test frame, a determination is made as to whether the accuracy meets the preset accuracy threshold. If so, the transmission rate is increased; if not, the transmission rate is reduced. The test is repeated until the number of tests is reached, and the test rate of the last test is output as the data link throughput.
[0084] In step 1434, the sending rate is adjusted based on the packet loss rate and the preset packet loss threshold. If the packet loss rate meets the preset packet loss threshold, the sending rate is increased; if not, the sending rate is decreased. The test is repeated until the test number reaches the specified number, and the average of the packet loss rate and delay of each test is output as the packet loss rate and average delay of the data link.
[0085] In an optional embodiment of the present invention, in step 145, determining the packet loss rate based on the number of received test messages and the number of sent test messages includes:
[0086] according to , determine the packet loss rate;
[0087] Among them, N Rn N is the number of test message packets arriving at the tester's receiving port. Tn The number of test packets sent.
[0088] In an optional embodiment of the present invention, in steps 144 and 147, adjusting the sending rate includes:
[0089] according to as well as , reduce the sending rate;
[0090] according to as well as , improve the sending rate;
[0091] Among them, R n is the sending rate this time, is the next sending rate, are the left and right boundaries of the sending rate; when n=1, = , is the maximum transmission rate.
[0092] In an optional embodiment of the present invention, in step 15, determining the performance test result of the tested data link based on the multiple test results includes:
[0093] The average value of M test results is A=(T1+T2+……+T M ) / M, determined as the performance test result of the tested data link; where A is the performance test result, T1, T2, T M They are the first test result, the second test result, and the Mth test result respectively, where M is a positive integer.
[0094] Specifically, T1, T2, ..., T M The test results of throughput, packet loss rate, and average delay of each test of the data link can be used, and their average value is taken as the performance test result of the tested data link, which improves the accuracy and reliability of the test results.
[0095] In specific work, the present invention is based on Figure 4 The test solution connection shown, test steps:
[0096] Step 1: Test equipment A and test equipment B through Figure 4Internet connection;
[0097] Step 2: Select RFC2544 for test device A and the corresponding loopback function for test device B, and configure network parameters.
[0098] Step 3: Configure throughput, frame loss, and delay parameters of device A, such as packet length, sending rate, and test duration.
[0099] Step 4: Run the test on device B first, then on device A. After a while, the RFC2544 test completes. Check the RFC2544 test results.
[0100] The detection equipment can support 10kbps bandwidth granular channel throughput, frame loss and delay testing functions, solving the problem that previous detection equipment could not test the performance of low-speed and small bandwidth channels.
[0101] In the above embodiment of the present invention, the ratio of the transmission bandwidth of the data link under test to the target bandwidth is obtained, and the inter-packet gap length of the test data frame is determined based on the ratio and the frame length. A test message is then sent over the data link under test n times according to the inter-packet gap length to obtain a test result. The test message includes multiple test data frames, and n is a positive integer. Based on the multiple test results, a performance test result of the data link under test is determined. This allows for kilobit (i.e., target bandwidth)-level channel performance testing in data communication channels with 100- or 1000-Mbps transmission bandwidths.
[0102] like Figure 5 As shown, a data link channel detection device 50 in an embodiment of the present invention includes:
[0103] The acquisition module 51 is configured to acquire a ratio of a transmission bandwidth of the data link under test to a target bandwidth, wherein the transmission bandwidth is greater than the target bandwidth; and to acquire a frame length of a test data frame transmitted by the data link under test;
[0104] The processing module 52 is used to determine the packet gap length of the test data frame based on the ratio and the frame length; send a test message for n tests on the data link under test according to the packet gap length to obtain a test result; wherein the test message includes multiple test data frames, and n is a positive integer; and determine the performance test result of the data link under test based on the multiple test results.
[0105] Optionally, obtaining a ratio of the transmission bandwidth of the data link under test to the target bandwidth includes:
[0106] The ratio of the transmission bandwidth of the data link under test to the target bandwidth is obtained according to k=LS / HS, where LS is the target bandwidth, HS is the transmission bandwidth, and k is the ratio.
[0107] Optionally, determining the packet gap length of the test data frame according to the proportional relationship and the frame length includes:
[0108] According to (len+m) / (len+gap)=k and gap=((1-k)len) / k+m / k, the packet gap length of the test data frame is obtained;
[0109] Where len is the frame length, gap is the packet gap length, and m is the sum of the lengths of the frame gap, preamble, and start delimiter.
[0110] Optionally, sending test messages for n tests on the data link under test to obtain a test result includes:
[0111] On the data link under test, according to the sending rate R n Send N Tn test messages, each test message including multiple test data frames, wherein the test data frames have a private tag test frame and a timestamp;
[0112] Get the test message received by the receiving port;
[0113] A test result is obtained based on the test messages received and the test messages sent in n tests. The test result includes throughput, packet loss rate and / or delay.
[0114] Optionally, determining a packet loss rate based on the number of received test packets and the number of sent test packets includes:
[0115] according to , determine the packet loss rate;
[0116] Among them, N Rn N is the number of test message packets arriving at the tester's receiving port. Tn The number of test packets sent.
[0117] Optionally, adjust the sending rate, including:
[0118] according to as well as , reduce the sending rate;
[0119] Among them, R n is the sending rate this time, is the next sending rate, are the left and right boundaries of the sending rate; when n=1, = , is the maximum transmission rate.
[0120] Optionally, adjust the sending rate, including:
[0121] according to as well as , increase the sending rate.
[0122] Optionally, a performance test result of the data link under test is determined based on multiple test results, including:
[0123] The average value of M test results is A=(T1+T2+……+T M ) / M, determined as the performance test result of the tested data link; where A is the performance test result, T1, T2, T M They are the first test result, the second test result, and the Mth test result respectively, where M is a positive integer.
[0124] It should be noted that this device is a device corresponding to the above method, and all implementation methods in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0125] The present invention also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to execute the method described in the above embodiment. All implementations of the above method embodiments are applicable to this embodiment and can achieve the same technical effects.
[0126] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0127] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0128] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0129] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0130] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0131] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, ROM, RAM, a magnetic disk, or an optical disk.
[0132] In addition, it should be noted that, in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it will be understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.
[0133] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general-purpose device. Therefore, the purpose of the present invention can also be achieved simply by providing a program product containing program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but do not necessarily need to be performed in chronological order. Certain steps can be performed in parallel or independently of each other.
[0134] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A data link channel detection method, characterized in that: include: Obtaining a ratio of a transmission bandwidth of the data link under test to a target bandwidth, wherein the transmission bandwidth is greater than the target bandwidth; Obtaining the frame length of the test data frame transmitted by the data link under test; Determining a packet gap length of the test data frame according to the ratio and the frame length; According to the packet gap length, sending a test message for n tests on the data link under test to obtain a test result; wherein the test message includes a plurality of the test data frames, and n is a positive integer; Determine a performance test result of the tested data link based on the multiple test results; The method of obtaining the ratio of the transmission bandwidth of the data link under test to the target bandwidth includes: The ratio of the transmission bandwidth of the data link under test to the target bandwidth is obtained according to k=LS / HS; where LS is the target bandwidth, HS is the transmission bandwidth, and k is the ratio; The step of determining the packet gap length of the test data frame according to the ratio and the frame length includes: According to (len+m) / (len+gap)=k and gap=((1-k)len) / k+m / k, the packet gap length of the test data frame is obtained; Where len is the frame length, gap is the packet gap length, and m is the sum of the lengths of the frame gap, preamble, and start delimiter. The test message is sent on the data link under test n times to obtain a test result, including: On the data link under test, according to the sending rate R n Send N Tn test messages, each test message including multiple test data frames, wherein the test data frames have a private tag test frame and a timestamp; Get the test message received by the receiving port; Obtain a test result based on the test messages received and sent in n tests, wherein the test result includes throughput, packet loss rate and / or latency; The throughput in the test result is obtained based on the test messages received and the test messages sent in n tests, including: The accuracy is determined based on the data content of the received test message and the data content of the sent test message. The accuracy refers to the ratio of the correctly received message data to the total message data. After adjusting the sending rate based on whether the test data frame carries a private tag test frame, the accuracy, and the preset accuracy threshold, the test is performed again until the test number n is reached, and the test rate of the last test is output as the throughput of the data link; wherein, the sending rate is adjusted based on whether the test data frame carries a private tag test frame, the accuracy, and the preset accuracy threshold; the priority of judging whether the test data frame carries a private tag test frame is higher than the accuracy and the preset accuracy threshold; if the test data frame does not carry a private tag test frame, the sending rate is directly reduced; if the test data frame carries a private tag test frame, the accuracy is judged whether it meets the preset accuracy threshold, and if so, the sending rate is increased; if not, the sending rate is reduced; the test is performed again until the test number n is reached, and the test rate of the last test is output as the throughput of the data link; The packet loss rate in the test result is obtained based on the test messages received and the test messages sent in n tests, including: Determine the packet loss rate based on the number of test packets received and the number of test packets sent; Adjust the sending rate according to the packet loss rate and the preset packet loss threshold, and test again until the test number n is reached; Output the average value of the packet loss rate of each test as the packet loss rate of the data link; The delay in the test result is obtained based on the test messages received and the test messages sent in n tests, including: The difference between the receiving time and the sending timestamp is determined as the delay; The average value of the delays of each test is output as the average delay of the data link. A test result includes the throughput of the data link, the packet loss rate of the data link and / or the average delay of the data link of the above n tests.
2. The data link channel detection method according to claim 1, characterized in that: Determine the packet loss rate based on the number of test packets received and sent, including: according to , determine the packet loss rate; Among them, N Rn N is the number of test message packets arriving at the tester's receiving port. Tn The number of test packets sent.
3. The data link channel detection method according to claim 1, characterized in that: Adjust the sending rate, including: according to as well as , reduce the sending rate; Among them, R n is the sending rate this time, is the next sending rate, are the left and right boundaries of the sending rate; when n=1, = , is the maximum transmission rate.
4. The data link channel detection method according to claim 3, characterized in that: Adjust the sending rate, including: according to as well as , increase the sending rate.
5. The data link channel detection method according to claim 1, characterized in that: Determine the performance test results of the data link under test based on multiple test results, including: The average value of M test results is A=(T1+T2+……+T M ) / M, determined as the performance test result of the tested data link; where A is the performance test result, T1, T2, T M They are the first test result, the second test result, and the Mth test result respectively, where M is a positive integer.
6. A data link channel detection device, characterized in that: include: an acquisition module, configured to acquire a ratio of a transmission bandwidth of a data link under test to a target bandwidth, wherein the transmission bandwidth is greater than the target bandwidth; Obtaining the frame length of the test data frame transmitted by the data link under test; A processing module is configured to determine the packet gap length of the test data frame based on the ratio and the frame length; send a test message for n tests on the data link under test according to the packet gap length to obtain a test result; wherein the test message includes a plurality of the test data frames, and n is a positive integer; determine a performance test result of the data link under test based on the plurality of test results; wherein obtaining the ratio of the transmission bandwidth of the data link under test to the target bandwidth includes: obtaining the ratio of the transmission bandwidth of the data link under test to the target bandwidth according to k=LS / HS; wherein LS is the target bandwidth, and H is the target bandwidth. S is the transmission bandwidth, and k is a ratio; wherein, according to the ratio and the frame length, determining the packet gap length of the test data frame includes: according to (len+m) / (len+gap)=k and gap=((1-k)len) / k+m / k, obtaining the packet gap length of the test data frame; wherein, len is the frame length, gap is the packet gap length, and m is the sum of the lengths of the frame gap, the preamble, and the start delimiter; wherein, sending a test message for n tests on the data link under test to obtain a test result includes: on the data link under test, sending the test message at a sending rate R n Send N Tn test messages, each test message includes multiple test data frames, and the test data frame carries a private tag test frame and a timestamp; obtains the test message received by the receiving port; obtains a test result based on the test messages received and the test messages sent in n tests, and the test result includes throughput, packet loss rate and / or delay; wherein, the throughput in the test result is obtained based on the test messages received and the test messages sent in n tests, including: determining the accuracy based on the data content of the received test message and the data content of the sent test message; accuracy refers to the ratio of correctly received message data to total message data; after adjusting the sending rate according to whether the test data frame carries a private tag test frame, the accuracy and the preset accuracy threshold, the test is performed again until the number of tests n is reached, and the test rate of the last test is output as the throughput of the data link; wherein, the sending rate is adjusted according to whether the test data frame carries a private tag test frame, the accuracy and the preset accuracy threshold; the judgment priority of whether the test data frame carries a private tag test frame is higher than the accuracy and the preset accuracy threshold; if the test data frame does not For a test frame with a private tag, the sending rate is directly reduced. If the test data frame has a private tag test frame, it is determined whether the accuracy meets a preset accuracy threshold. If so, the sending rate is increased; if not, the sending rate is reduced; the test is performed again until the number of tests is reached, and the test rate of the last test is output as the throughput of the data link; wherein, based on the test messages received and the test messages sent in n tests, the packet loss rate in the test result is obtained, including: determining the packet loss rate based on the number of test messages received and the number of test messages sent; adjusting the sending rate based on the packet loss rate and a preset packet loss threshold, and testing again until the number of tests n is reached; outputting the average value of the packet loss rates of each test as the packet loss rate of the data link; wherein, based on the test messages received and the test messages sent in n tests, the delay in the test result is obtained, including: determining the difference between the receiving time and the sending timestamp as the delay; and outputting the average value of the delay of each test as the average delay of the data link. A test result includes the data link throughput, the data link packet loss rate and / or the data link average delay of the above-mentioned n tests.
7. A computer-readable storage medium, characterized in that: The device stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and apparatus for generating test packets in a data network
EP1443703A1