A method and measuring device for measuring the length of a line speed frame
By defining and updating the test interval in network devices and gradually narrowing the interval length, the problem of inaccurate measurement in existing technologies is solved, and efficient and accurate line-rate frame length measurement is achieved.
Patent Information
- Application Number
- CN202011232027.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-06
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2040-11-06
AI Technical Summary
Existing technologies are insufficient to accurately measure the minimum line-rate frame length of network devices, resulting in inaccurate measurement results that fail to meet practical requirements.
By defining the test interval as a preset frame length interval, determining the test frame length based on the test interval, and updating the test interval by receiving and comparing the number of frames, the interval length is gradually reduced, and finally the minimum line-rate frame length is determined.
It improves the accuracy and efficiency of measuring linear velocity frame length, and can quickly obtain the accurate minimum linear velocity frame length under preset precision.
Smart Images

Figure CN114465923B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method and measuring device for measuring linear velocity frame length. Background Technology
[0002] With the development of communication technology, network devices are becoming increasingly powerful. Line-rate frame length is an important indicator for measuring the switching and forwarding capabilities of network devices. Line-rate frame length refers to the frame length at which a network device forwards data at line speed without dropping frames.
[0003] One method for measuring the minimum line-rate frame length in Ethernet is roughly as follows: A frame length sequence is pre-configured, with frame lengths arranged in ascending order, such as 64 bytes, 128 bytes, 256 bytes, 512 bytes, 1024 bytes, 1518 bytes, etc. First, the test frame length is set to 64 bytes. A 64-byte data frame is sent within the set duration. If no frames are dropped within the set duration, then 64 bytes is the minimum line-rate frame length. If frames are dropped within the set duration, the test frame length is adjusted to 128 bytes. Then, a 128-byte data frame is sent within the set duration. If no frames are dropped within the set duration, then 128 bytes is the minimum line-rate frame length. If frames are dropped within the set duration, then the test frame length is adjusted to 256 bytes. This process continues, with each test increasing in number of tests until the last test frame without frame drops is identified as the minimum line-rate frame length.
[0004] The above measurement method can only obtain an approximate value for the minimum line-rate frame length. For example, the actual minimum line-rate frame length is 209 bytes, but the above measurement method measures a line-rate frame length of 256 bytes. Therefore, this measurement method is not accurate enough and cannot meet actual measurement requirements. Summary of the Invention
[0005] In view of this, this application provides a method and apparatus for measuring linear velocity frame length, which can improve measurement accuracy.
[0006] The first aspect provides a method for measuring line-rate frame length, comprising the following steps: Step A: Determine the test interval as a preset frame length interval; Step B: Determine the test frame length based on the test interval; Step C: Determine the first frame number based on the preset bandwidth, preset duration, and test frame length; Step D: Send a data frame of the test frame length to the network device; Step E: Receive the data frame sent by the network device; Step G: Compare the first frame number with the second frame number; Step G: Update the test interval to a sub-interval based on the comparison result; Step H: When the length of the test interval is greater than the preset length, trigger steps B to G until the length of the test interval is less than or equal to the preset length; When the length of the test interval is less than or equal to the preset length, determine the minimum line-rate frame length as the last test frame length without frame loss. Wherein, the length of the preset frame length interval is greater than the preset length, and the upper limit of the preset frame length interval is less than or equal to the maximum transmission unit of the network device. The second frame number is the total number of data frames received within the preset duration.
[0007] In this manner, based on the frame drop detection results during the test period, the test interval can be automatically updated to sub-intervals, thus gradually reducing the length of the test interval. As the number of tests increases, the measurement accuracy becomes increasingly higher. When the length of the test interval is less than or equal to the preset length, a line-rate frame length that meets the desired accuracy can be obtained, thereby improving the measurement accuracy.
[0008] In one possible implementation, determining the test frame length based on the test interval includes: calculating the average of the lower limit and the upper limit of the test interval; when the average is an integer, determining the test frame length as the average; when the average is not an integer, rounding the average to the nearest integer to determine the test frame length as the rounded average. Rounding can be done by rounding down, rounding to the nearest integer, or rounding up. This provides a specific method for calculating the test frame length based on the test interval.
[0009] In another possible implementation, updating the test interval to its sub-intervals based on the comparison results includes: when the second frame number equals the first frame number, updating the test interval to the first sub-interval, where the lower limit of the first sub-interval is the lower limit of the test interval, and the upper limit of the first sub-interval is the test frame length; when the second frame number is less than the first frame number, updating the test interval to the second sub-interval, where the lower limit of the second sub-interval is the test frame length, and the upper limit of the second sub-interval is the upper limit of the test interval. When the test frame length equals this average value, this implementation allows the length of the next test interval to be equal to half the length of the current test interval, resulting in an exponential decrease in the test interval length and significantly improving the efficiency of measuring line velocity frame length.
[0010] In another possible implementation, before determining the test interval as a preset frame length interval, a data frame of the first frame length is sent to the network device, with the first frame length being the lower limit of the preset frame length interval; the first frame length data frame sent by the network device is received; if no frame loss is detected within a preset time period, the first frame length is determined to be the minimum line-rate frame length; if frame loss is detected within the preset time period, the step of determining the test interval as the preset frame length interval is triggered. This allows for testing whether the first frame length is the minimum line-rate frame length first, improving measurement flexibility.
[0011] In another possible implementation, the preset length is 1 byte. A preset length of 1 byte means the test interval is equal to 1 byte, in which case the minimum line-rate frame length of the network device can be obtained.
[0012] A second aspect provides a measuring device comprising a first determining unit, a second determining unit, a third determining unit, a transmitting unit, a receiving unit, a comparison unit, an updating unit, a judging unit, and a line-speed frame length acquisition unit. The first determining unit determines a test interval as a preset frame length interval, the upper limit of which is less than or equal to the maximum transmission unit of the network device. The second determining unit determines a test frame length based on the test interval. The third determining unit determines a first frame number based on a preset bandwidth, a preset duration, and the test frame length. The transmitting unit transmits a data frame of the test frame length to the network device. The receiving unit receives a data frame transmitted by the network device, the length of which is the test frame length. The comparison unit compares the first frame number with a second frame number, the second frame number being the total number of data frames received within a preset duration. The updating unit updates the test interval to a sub-interval based on the comparison result. The judging unit judges whether the length of the test interval is greater than a preset length; if so, it triggers the second determining unit; otherwise, it triggers the line-speed frame length acquisition unit. The line-speed frame length acquisition unit determines the line-speed frame length as the length of the last test frame without frame loss when the length of the test interval is less than or equal to the preset length.
[0013] In one possible implementation, the second determining unit is specifically used to calculate the average of the lower limit and the upper limit of the test interval; when the average is an integer, the test frame length is determined to be the average; when the average is not an integer, the average is rounded down to determine the test frame length as the rounded average.
[0014] In another possible implementation, the update unit is specifically used to update the test interval to the first sub-interval when the second frame number is equal to the first frame number, with the lower limit of the first sub-interval being the lower limit of the test interval and the upper limit of the first sub-interval being the test frame length; when the second frame number is less than the first frame number, the test interval is updated to the second sub-interval, with the lower limit of the second sub-interval being the test frame length and the upper limit of the second sub-interval being the upper limit of the test interval.
[0015] In another possible implementation, the sending unit is further configured to send a data frame of the first frame length to the network device before the first determining unit determines the test interval as the preset frame length interval, wherein the first frame length is the lower limit of the preset frame length interval; the receiving unit is further configured to receive the data frame of the first frame length sent by the network device; the line-rate frame length acquisition unit is further configured to determine the first frame length as the minimum line-rate frame length if no frame loss is detected within the preset time period; and if frame loss is detected within the preset time period, trigger the first determining unit to perform the step of determining the test interval as the preset frame length interval.
[0016] In another possible implementation, the default length is 1 byte.
[0017] The steps and beneficial effects of the measuring device in the second aspect can be referred to the corresponding description in the first aspect.
[0018] A third aspect provides a measuring device including a processor and a memory, the memory being used to store a program; the processor executing the program to implement the method of the first aspect.
[0019] The fourth aspect provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described above.
[0020] The fifth aspect provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the methods described above. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of a wired router measurement scenario in an embodiment of this application;
[0022] Figure 2 This is a flowchart illustrating a method for measuring linear velocity frame length in an embodiment of this application.
[0023] Figure 3 This is a schematic diagram of the measuring device in an embodiment of this application;
[0024] Figure 4 This is another structural schematic diagram of the measuring device in an embodiment of this application. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0026] First, let's introduce some of the terminology used in this application:
[0027] A data frame is a protocol data unit at the data link layer, consisting of three parts: a header, a data portion, and a trailer. The header and trailer contain essential control information, such as synchronization information, address information, and error control information; the data portion contains data transmitted from the network layer, such as IP packets.
[0028] Frame length refers to the length of a data frame, which can also be understood as the size of a data frame.
[0029] This application provides a method for measuring line-rate frame length that can be applied to scenarios involving measuring the forwarding performance of network devices. The network device can be a wired router or a switch. It should be understood that this measurement method can also be used to measure an interface board within a wired router or switch.
[0030] Figure 1 This is a schematic diagram illustrating a scenario involving the measurement of a wired router. (See attached image.) Figure 1 The measuring device 101 is connected to the wired router 102 via a cable. After the measuring device 101 sends data to the wired router 102, the wired router 102 forwards the data to the measuring device 101. The measuring device 101 can detect whether the wired router 102 has forwarded the prescribed amount of data based on the amount of data received. The amount of data received can be determined according to the number of received data frames or the number of received data packets.
[0031] The following describes the method for measuring linear velocity frame length in this application, using a measuring device as the main execution device:
[0032] See Figure 2 One embodiment of the method for measuring linear velocity frame length in this application includes:
[0033] Step 201: Determine the test interval as the preset frame length interval.
[0034] In this embodiment, a preset frame length interval is used as the initial interval of the test interval. The length of the preset frame length interval is greater than a preset length, which can be set according to actual needs, such as 1 byte, 2 bytes, or 3 bytes, etc., and is not limited in this application. The upper limit of the preset frame length interval is less than or equal to the maximum transmit unit (MTU) of the network device. The maximum transmit unit of the network device is related to the hardware performance of the network device, for example, 9000 bytes. The upper limit of the preset frame length interval can be, but is not limited to, 1518 bytes, 1024 bytes, or 1000 bytes, etc. The lower limit of the preset frame length interval can be, but is not limited to, 64 bytes.
[0035] Step 202: Determine the test frame length based on the test interval.
[0036] Optionally, step 202 includes: calculating the average of the lower limit and the upper limit of the test interval; when the average is an integer, determining the test frame length as the average; when the average is not an integer, rounding the average to determine the test frame length as the rounded average. The rounding method can be rounding down, rounding to the nearest integer, or rounding up. When rounding down, retaining the integer part of the average and discarding the decimal part yields the rounded average. After determining the test frame length based on the test interval, the test frame length is stored in memory, thus obtaining the test frame length for each test.
[0037] Step 203: Determine the number of the first frame based on the preset bandwidth, preset duration, and test frame length.
[0038] Optionally, the preset bandwidth W, preset duration T, test frame length S, and first frame number N1 satisfy the following formula:
[0039]
[0040] The preset bandwidth can be, but is not limited to, the maximum bandwidth of the network device. The preset duration is the length of the test period, which can be tens of seconds, such as 20 seconds, or several minutes, such as 1 minute, 2 minutes, etc. The specific duration can be set according to the actual situation, and this application does not impose any limitations. L1 is the preamble length, and its value can be, but is not limited to, 8 bytes. L2 is the gap length, and its value can be, but is not limited to, 12 bytes.
[0041] Step 204: Send a data frame of test frame length to the network device.
[0042] There is no fixed order between steps 203 and 204, and step 204 can be performed before step 203.
[0043] Step 205: Receive data frames sent by the network device. The length of the data frames is the test frame length.
[0044] Step 206: Compare the first frame count with the second frame count, where the second frame count is the total number of data frames received within a preset duration.
[0045] The system detects the total number of data frames received within a preset time period. When the first frame count equals the second frame count, it indicates that the network device transmitted data frames of the test frame length without frame loss. When the first frame count is greater than the second frame count, it indicates that the network device transmitted data frames of the aforementioned test frame length with frame loss.
[0046] Step 207: Update the test interval to a sub-interval of the test interval based on the comparison results.
[0047] Optionally, the test interval can be divided into a first sub-interval and a second sub-interval based on the test frame length. Updating the test interval to the first or second sub-interval can narrow down the test interval.
[0048] Step 208: Determine whether the length of the test interval is greater than the preset length. If yes, proceed to steps 202 to 207. If no, proceed to step 209.
[0049] After updating the test interval, if the length of the updated test interval is greater than the preset length, it indicates that the measured linear velocity frame length has not reached the expected accuracy, even if there are no frame drops in one or more test periods, the test frame length in the aforementioned test periods is not accurate enough. Iteratively executing steps 202 to 207 can continue to narrow the test interval until the length of the test interval is less than or equal to the preset length.
[0050] Step 209: Determine the line-rate frame length as the last test frame length without frame drops.
[0051] When the length of the updated test interval is less than or equal to the preset length, the length of the last test frame without frame loss is taken as the line-rate frame length of the network device. At this time, the measured line-rate frame length can achieve the expected accuracy.
[0052] Optionally, the preset length is 1 byte. For example, the test interval is [S1, S2], where S2 = S1 + 1. In this case, both data frames from S1 and S2 have been tested. If frame drops occur when testing with data frames from S1, but not when testing with data frames from S2, then S2 is the minimum line-rate frame length. If frame drops occur when testing with both data frames from S1 and S2, then the length of the most recent test frame without frame drops, S3, is taken as the minimum line-rate frame length. The values of S1, S2, and S3 are all positive integers. This allows for accurate measurement of the line-rate frame length.
[0053] In this embodiment, the test interval can be updated to a sub-interval based on the comparison result between the first frame count and the second frame count, thus gradually reducing the length of the test interval. As the number of tests increases, the measurement accuracy becomes higher and higher. When the length of the test interval is less than or equal to a preset length, a line-rate frame length that meets the desired accuracy can be obtained, thereby improving the measurement accuracy.
[0054] In an optional embodiment, updating the test interval to a sub-interval of the test interval based on the comparison result includes: updating the test interval to a first sub-interval when the second frame number is equal to the first frame number; and updating the test interval to a second sub-interval when the second frame number is less than the first frame number.
[0055] In this embodiment, the lower limit of the first sub-interval is the lower limit of the test interval, the upper limit of the first sub-interval is the test frame length, the lower limit of the second sub-interval is the test frame length, and the upper limit of the second sub-interval is the upper limit of the test interval.
[0056] When the test frame length equals the average of the upper limit of the test interval and the upper limit of the test interval, the next test interval length is set to half the current test interval length using the bisection method. This causes the test interval length to decrease exponentially, significantly improving measurement efficiency. Similarly, when the test frame length is approximately equal to the average of the upper limit of the test interval and the upper limit of the test interval, this implementation method can determine that the next test interval length is close to half the current test interval length, also causing the test interval length to decrease exponentially, thus enabling rapid measurement of the line speed frame length.
[0057] In another optional embodiment, before determining the test interval as a preset frame length interval, the above method for measuring the line speed frame length further includes: sending a data frame of the first frame length to the network device, wherein the first frame length is the lower limit of the preset frame length interval; receiving the data frame of the first frame length sent by the network device; if no frame loss is detected within a preset time period, determining the first frame length as the minimum line speed frame length; and if frame loss is detected within the preset time period, triggering step 201.
[0058] In this embodiment, the first step is to test whether the length of the first frame is the minimum linear velocity frame length. If no frame drops are detected within a preset time period, the length of the first frame is determined to be the minimum linear velocity frame length. This improves measurement flexibility.
[0059] To facilitate understanding, the method for measuring linear velocity frame length provided in this application will be described below using a specific application scenario:
[0060] Input the minimum test frame length and the maximum test frame length into the measuring device. The minimum test frame length is 64 bytes, and the maximum test frame length is 1024 bytes. The preset frame length range obtained is [64, 1024].
[0061] The preset length is 1 byte as an example. Table 1 below illustrates the test frame length, test results, lower limit of the test interval, and upper limit of the test interval for each test process:
[0062] Number of tests Lower limit of test interval Upper limit of test interval Test interval length Test frame length Test Results 1 64 1024 960 64 Frame dropping 2 64 1024 960 544 No frame drops 3 64 544 480 304 No frame drops 4 64 304 240 184 Frame dropping 5 184 304 120 244 No frame drops 6 184 244 60 214 No frame drops 7 184 214 30 199 Frame dropping 8 199 214 15 206 Frame dropping 9 206 214 8 210 Frame dropping 10 210 214 4 212 Frame dropping 11 212 214 2 213 No frame drops 12 212 213 1
[0063] Table 1
[0064] The units for the test frame length, test interval length, lower limit of the test interval, and upper limit of the test interval are all bytes. The test frame length is rounded down. For example, the test interval for the 8th test is [199, 214]. The average of 199 and 214 is 206.5, which is rounded down to 206 as the test frame length.
[0065] As can be seen from Table 1, when the test interval length is reduced to 1 byte, the length of the last test frame without frame loss is 213 bytes, and 213 bytes is determined to be the minimum line-rate frame length.
[0066] In another example, when the preset length is 2 bytes, the last test frame without frame loss is 214 bytes long, and 214 bytes is determined to be the line-rate frame length.
[0067] The above describes the method for measuring linear velocity frame length. The following describes the measuring device used to implement this method. (See attached document for details.) Figure 3 One embodiment of the measuring device 300 provided in this application includes:
[0068] The first determining unit 301 is used to determine the test interval as a preset frame length interval;
[0069] The second determining unit 302 is used to determine the test frame length according to the test interval;
[0070] The third determining unit 303 is used to determine the number of the first frame based on the preset bandwidth, preset duration and test frame length;
[0071] The sending unit 304 is used to send a data frame of test frame length to the network device;
[0072] The receiving unit 305 is used to receive data frames sent by the network device, the length of which is the test frame length;
[0073] The comparison unit 306 is used to compare the first frame number with the second frame number, where the second frame number is the total number of data frames received within a preset time period;
[0074] Update unit 307 is used to update the test interval to a sub-interval of the test interval based on the comparison result;
[0075] The judgment unit 308 is used to determine whether the length of the test interval is greater than the preset length. If it is, the second determination unit 302 is triggered to execute the step of determining the test frame length based on the test interval. If not, the line speed frame length acquisition unit 309 is triggered to determine the line speed frame length as the last test frame length without frame loss.
[0076] Get the line speed frame length unit 309, which is used to determine the line speed frame length as the last test frame length without frame loss.
[0077] In this embodiment, the functions of the first determining unit 301, the second determining unit 302, the third determining unit 303, the comparison unit 306, the update unit 307, the judgment unit 308, and the line-rate frame length acquisition unit 309 can all be implemented by the central processing unit. The functions of the sending unit 304 and the receiving unit 305 can be implemented by the communication interface.
[0078] In one alternative embodiment,
[0079] The second determining unit 302 is specifically used to calculate the average of the lower limit and the upper limit of the test interval; when the average is an integer, the test frame length is determined to be the average; when the average is not an integer, the average is rounded down to determine the test frame length as the rounded average.
[0080] In another alternative embodiment,
[0081] Update unit 307 is specifically used to update the test interval to the first sub-interval when the second frame number is less than the first frame number, with the lower limit of the first sub-interval being the lower limit of the test interval and the upper limit of the first sub-interval being the test frame length; when the second frame number is equal to the first frame number, update the test interval to the second sub-interval, with the lower limit of the second sub-interval being the test frame length and the upper limit of the second sub-interval being the upper limit of the test interval.
[0082] In another alternative embodiment,
[0083] The sending unit 304 is also used to send a data frame of the first frame length to the network device before the first determining unit determines the test interval as the preset frame length interval, wherein the first frame length is the lower limit of the preset frame length interval;
[0084] The receiving unit 305 is also used to receive a data frame of the first frame length sent by the network device;
[0085] The linear frame length acquisition unit 309 is also used to determine the first frame length as the minimum linear frame length if no frame drops are detected within a preset time period; and to trigger the first determination unit to determine the test interval as the preset frame length interval if frame drops are detected within the preset time period.
[0086] In another alternative embodiment, the preset length is 1 byte.
[0087] The steps and beneficial effects of each unit in the measuring device 300 can be referenced. Figure 2 The corresponding descriptions of the illustrated embodiments or optional embodiments will not be repeated here.
[0088] The measuring device is described below from the perspective of its hardware structure. (See attached document.) Figure 4 The measuring device 400 provided in this application includes a processor 401, a memory 402, and a communication interface 403 connected via a bus 404. The number of processors 401, memory 402, and communication interfaces 403 can be one or more.
[0089] Processor 401 can be a central processing unit (CPU), or other general-purpose processors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0090] Memory 402 is used to store programs and data. Memory 402 may include dynamic random access memory (DRAM) or cache memory. For general-purpose processors, DSPs, ASICs, FPGAs, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., the cache memory may be integrated into the processor.
[0091] Communication interface 403 is used to receive or send data. Communication interface 403 can be a wired network interface or a wireless network interface.
[0092] Processor 401 implements the program stored in memory 402 by calling the program. Figure 2 The method for measuring linear velocity frame length shown in the embodiment or optional embodiment. It should be understood that the measuring device 400 may also include one or more power supply units, one or more input / output devices, etc.
[0093] This application provides a computer storage medium including instructions that, when executed on a computer, cause the computer to perform the audio data processing method in any of the above embodiments or optional embodiments.
[0094] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0095] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0096] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for measuring linear velocity frame length, characterized in that, include: Step A: Determine the test interval as the preset frame length interval; Step B: Determine the test frame length based on the test interval; wherein, if the average of the lower limit and the upper limit of the test interval is an integer, the test frame length is the average value; if the average value is not an integer, the test frame length is the rounded average value. Step C: Determine the number of the first frame based on the preset bandwidth, preset duration, and the test frame length; Step D: Send a data frame of the specified test frame length to the network device; Step E: Receive a data frame sent by the network device, the length of which is the length of the test frame; Step F: Compare the first frame count with the second frame count, where the second frame count is the total number of data frames received within the preset duration; Step G: Update the test interval to a sub-interval based on the comparison result; Step H: When the length of the test interval is greater than the preset length, trigger steps B to G until the length of the test interval is less than or equal to the preset length; Step 1: When the length of the test interval is less than or equal to the preset length, determine the line speed frame length as the last test frame length without frame loss.
2. The method according to claim 1, characterized in that, Determining the test frame length based on the test interval includes: Calculate the average of the lower limit and the upper limit of the test interval; When the average value is an integer, the test frame length is determined to be the average value; When the average value is not an integer, the average value is rounded down to determine the test frame length as the rounded average value.
3. The method according to claim 2, characterized in that, The step of updating the test interval to a sub-interval of the test interval based on the comparison result includes: When the second frame number equals the first frame number, the test interval is updated to the first sub-interval, the lower limit of the first sub-interval is the lower limit of the test interval, and the upper limit of the first sub-interval is the test frame length; When the second frame number is less than the first frame number, the test interval is updated to a second sub-interval, the lower limit of the second sub-interval is the test frame length, and the upper limit of the second sub-interval is the upper limit of the test interval.
4. The method according to any one of claims 1 to 3, characterized in that, Before determining the test interval as a preset frame length interval, the method further includes: A data frame of the first frame length is sent to the network device, wherein the first frame length is the lower limit of the preset frame length range; Receive a data frame of the first frame length sent by the network device; If no frame drops are detected within the preset time period, the first frame length is determined to be the minimum linear velocity frame length. If a frame drop is detected within the preset duration, the step of determining the test interval as a preset frame length interval is triggered.
5. The method according to any one of claims 1 to 3, characterized in that, The preset length is 1 byte.
6. A measuring device, characterized in that, include: The first determining unit is used to determine the test interval as a preset frame length interval; The second determining unit is used to determine the test frame length based on the test interval; wherein, when the average of the lower limit and the upper limit of the test interval is an integer, the test frame length is the average value; when the average value is not an integer, the test frame length is the rounded average value. The third determining unit is used to determine the number of the first frame based on the preset bandwidth, the preset duration and the test frame length; A sending unit is used to send a data frame of the test frame length to the network device; A receiving unit is configured to receive data frames sent by the network device, wherein the length of the data frame is the test frame length; The comparison unit is used to compare the first frame number with the second frame number, where the second frame number is the total number of data frames received within the preset duration; An update unit is used to update the test interval to a sub-interval of the test interval based on the comparison result; The judgment unit is used to determine whether the length of the test interval is greater than the preset length. If it is, the second determination unit is triggered; if not, the line speed frame length acquisition unit is triggered. The unit for obtaining the linear frame length is used to determine the linear frame length as the length of the last test frame without frame loss.
7. The measuring device according to claim 6, characterized in that, The second determining unit is specifically used to calculate the average of the lower limit of the test interval and the upper limit of the test interval; when the average is an integer, the test frame length is determined to be the average; when the average is not an integer, the average is rounded down to determine the test frame length as the rounded average.
8. The measuring device according to claim 6, characterized in that, The update unit is specifically configured to update the test interval to a first sub-interval when the second frame number is equal to the first frame number, wherein the lower limit of the first sub-interval is the lower limit of the test interval and the upper limit of the first sub-interval is the test frame length; and to update the test interval to a second sub-interval when the second frame number is less than the first frame number, wherein the lower limit of the second sub-interval is the test frame length and the upper limit of the second sub-interval is the upper limit of the test interval.
9. The measuring device according to any one of claims 6 to 8, characterized in that, The sending unit is further configured to send a data frame of the first frame length to the network device before the first determining unit determines the test interval as a preset frame length interval, wherein the first frame length is the lower limit of the preset frame length interval; The receiving unit is further configured to receive a data frame of the first frame length sent by the network device; The linear frame length acquisition unit is also used to determine the first frame length as the minimum linear frame length if no frame loss is detected within the preset time period. If a frame drop is detected within a preset time period, the first determining unit is triggered to determine the test interval as a preset frame length interval.
10. The measuring device according to any one of claims 6 to 8, characterized in that, The preset length is 1 byte.
11. A computer storage medium comprising instructions, characterized in that, When it is run on a computer, it causes the computer to perform the method for measuring the linear velocity frame length as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Module for realizing throughput analysis and bit error rate test in industrial sensor network
CN106027333A