CN111245675B - Network delay and lost data packet detection method and system - Google Patents
Network delay and lost data packet detection method and system Download PDFInfo
- Publication number
- CN111245675B CN111245675B CN202010011053.9A CN202010011053A CN111245675B CN 111245675 B CN111245675 B CN 111245675B CN 202010011053 A CN202010011053 A CN 202010011053A CN 111245675 B CN111245675 B CN 111245675B
- Authority
- CN
- China
- Prior art keywords
- data packet
- packet
- timestamp
- equipment
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 12
- 238000000034 method Methods 0.000 claims description 20
- 238000012360 testing method Methods 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 11
- 230000005540 biological transmission Effects 0.000 abstract description 4
- 238000004891 communication Methods 0.000 description 13
- 238000010586 diagram Methods 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0852—Delays
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0823—Errors, e.g. transmission errors
- H04L43/0829—Packet loss
Landscapes
- Engineering & Computer Science (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a network delay and lost data packet detection method, which comprises the following steps: the first equipment terminal marks the sequence number and the first time stamp of the current data packet in the data packet and then sends the data packet; the second equipment end receives the data packet, and after adding a second timestamp of the received data packet in the data packet, the second equipment end sends the data packet to the first equipment end; when the first equipment side records the sequence number, the first timestamp and the second timestamp counted in the data packet; the first equipment terminal transmits data packets for a first preset time and counts the data packet transmission rate; after receiving the data packet without the sequence number and the timestamp, the second equipment starts to count the speed of the received data packet within first preset time; the packet length of the data packet is increased by 10 bytes, and the above steps are repeated. Compared with the prior art, the time of the sending end and the receiving end can be accurately recorded; and the packet sequence number is added in the packet, so that the packet loss sequence can be accurately judged.
Description
Technical Field
The application relates to the field of Internet of things, in particular to a network delay and lost data packet detection method.
Background
NBIOT (Narrow-Band Internet of Things) communication quality is always an important index of the technology, and how to reasonably and comprehensively detect the communication quality is very important. Delay and packet loss rate are important indicators of communication. Through statistics of loss delay and packet loss rate, the transmission characteristics and the real-time communication state of the network can be effectively detected, the positioning problem can be effectively assisted in a research and development stage and practical application, and the solution progress is accelerated. The existing communication quality detection is mainly based on ping and UDP (User data gram Protocol) \ TCP to transmit data, and provides communication quality according to packet loss rate and speed of a transmitting end and a receiving end. The methods only can observe whether packet loss exists or not from the application angle, and do not concern the characteristics of the network; the operation is complicated, and research personnel are required to judge the test items according to the network characteristics.
In an NBIOT network environment, packet size and channel quality have a significant impact on latency and packet loss rate. When a physical layer sends a packet, a large packet is cut into smaller cell packets to be sent, the number of cells cut by different packet lengths is different, the sending condition of a single cell has a decisive influence on the whole packet, namely the packet is lost when the single cell is lost, and the delay of all the cells is the delay of the whole packet. The invention can quickly count the relation between the delay and the packet length according to the characteristics of the NBIOT network, and find the packet length which is easy to lose the packet and the speed of the current network.
Disclosure of Invention
The main objective of the present application is to provide a method for detecting network delay and lost data packet, which includes:
a first device end sends a data packet, and before sending, a serial number and a first time stamp of a current data packet are marked in the data packet;
the second equipment end receives the data packet, and when the serial number and the first timestamp exist in the data packet, the second equipment end adds a second timestamp for receiving the data packet in the data packet and then sends the data packet to the first equipment end;
when the first equipment receives the data packet within preset time, recording the serial number, the first timestamp and the second timestamp counted in the data packet;
the first equipment terminal sends data packets according to the packet length of the data packets for a first preset time, and counts the data packet sending rate;
after receiving the data packet without the sequence number and the timestamp, the second equipment starts to count the speed of the received data packet within the first preset time;
increasing the packet length of the data packet by 10 bytes, and repeating the steps;
and when the packet length is greater than or equal to the maximum packet length, the test is finished, the first equipment end outputs the delay time and the sending rate of different data packet lengths, and the second equipment end outputs the receiving rate of different data packet lengths.
Optionally, the second device end is started first, and then the first device end is started, and the second device end is always in a data packet monitoring state.
Optionally, when the first device end does not receive the data packet within a preset time, it marks that the data packet is not received, and retransmits a new data packet.
Optionally, when the first device re-sends a new data packet, the preset time is increased, the data packet is continuously sent to the second device, if the data packet is not received for n times, the packet length of the data packet is counted, the next round of data packet length test is directly performed, if the data packet is received, a speed test mode is performed, and n is a natural number.
Optionally, the preset time is increased by 1 time.
Optionally, the packet length and the preset time are set, and the maximum packet length is set by the first device end itself or by a person.
According to an aspect of the present application, there is also provided a network delay and lost packet detection system, including:
the sending module is used for sending a data packet by the first equipment terminal, and marking the serial number and the first time stamp of the current data packet in the data packet before sending;
a receiving module, configured to receive the data packet by a second device, and when the data packet has the sequence number and the first timestamp, the second device adds a second timestamp for receiving the data packet in the data packet, and then sends the data packet to the first device;
the recording module is used for recording the sequence number, the first timestamp and the second timestamp counted in the data packet when the first equipment end receives the data packet within preset time;
the first statistical module is used for the first equipment end to transmit data packets according to the packet length of the data packets for a first preset time and to count the data packet transmission rate;
the second counting module is used for counting the speed of the received data packet within the first preset time after the second equipment end receives the data packet without the serial number and the timestamp;
an increasing module, configured to increase a packet length of the data packet by 10 bytes, and repeat the above steps;
and when the packet length is greater than or equal to the maximum packet length, the test is finished, the first equipment end outputs the delay time and the sending rate of different data packet lengths, and the second equipment end outputs the receiving rate of different data packet lengths.
The application also discloses a computer device, data comprising a memory, a processor and a computer program stored in the memory and executable by the processor, the processor implementing the method of any one of the above when executing the computer program.
The application also discloses a computer-readable storage medium, a non-volatile readable storage medium, having stored therein a computer program which, when executed by a processor, implements the method of any of the above.
The present application also discloses a computer program product, data comprising computer readable code which, when executed by a computer device, causes the computer device to perform the method of any of the above.
Compared with the prior art, the method has the following beneficial effects:
the master device and the slave device add timestamps in the UDP packet data section, so that the time of a sending end and the time of a receiving end can be accurately recorded; and the packet sequence number is added in the packet, so that the packet loss sequence can be accurately judged.
And automatically scanning different packet lengths, and counting the influence of different sending speeds and packet lengths on packet loss rate and time delay.
The method is suitable for detecting the communication quality of the Internet of things with the low NBIOT communication speed, and has good reference value for detection results of other types of communication modes.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, serve to provide a further understanding of the application and to enable other features, objects, and advantages of the application to be more apparent. The drawings and their description illustrate the embodiments of the invention and do not limit it. In the drawings:
fig. 1-2 are schematic flow diagrams of a network delay and lost packet detection method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a computer device according to one embodiment of the present application; and
FIG. 4 is a schematic diagram of a computer-readable storage medium according to one embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," as well as any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Referring to fig. 1-2, an embodiment of the present application provides a method for detecting network delay and lost packets, where the data includes:
a first device end sends a data packet, and before sending, a serial number and a first time stamp of a current data packet are marked in the data packet;
the second equipment end receives the data packet, and when the serial number and the first timestamp exist in the data packet, the second equipment end adds a second timestamp for receiving the data packet in the data packet and then sends the data packet to the first equipment end;
when the first equipment receives the data packet within preset time, recording the serial number, the first timestamp and the second timestamp counted in the data packet;
the first equipment terminal sends data packets according to the packet length of the data packets for a first preset time, and counts the data packet sending rate;
after receiving the data packet without the sequence number and the timestamp, the second equipment starts to count the speed of the received data packet within the first preset time;
increasing the packet length of the data packet by 10 bytes, and repeating the steps;
and when the packet length is greater than or equal to the maximum packet length, the test is finished, the first equipment end outputs the delay time and the sending rate of different data packet lengths, and the second equipment end outputs the receiving rate of different data packet lengths.
In an embodiment of the present application, the second device is started first, and then the first device is started, where the second device is always in a data packet monitoring state.
In an embodiment of the present application, when the first device does not receive the data packet within a preset time, the first device marks that the data packet is not received, and retransmits a new data packet.
In an embodiment of the present application, when the first device resends a new data packet, the preset time is increased, and the data packet is sent to the second device continuously, if the data packet is not received for n times, statistics is performed on the packet length of the data packet, which cannot be communicated, and the next round of data packet length test is directly performed, if the data packet is received, a speed test mode is performed, and n is a natural number.
In an embodiment of the present application, the predetermined time is increased by 1 time.
In an embodiment of the present application, the packet length and the preset time are the maximum packet length that is owned or manually set by the first device side.
The application also provides a network delay and lost data packet detection system, the data includes:
the sending module is used for sending a data packet by the first equipment terminal, and marking the serial number and the first time stamp of the current data packet in the data packet before sending;
a receiving module, configured to receive the data packet by a second device, and when the data packet has the sequence number and the first timestamp, the second device adds a second timestamp for receiving the data packet in the data packet, and then sends the data packet to the first device;
the recording module is used for recording the sequence number, the first timestamp and the second timestamp counted in the data packet when the first equipment end receives the data packet within preset time;
the first statistical module is used for the first equipment end to transmit data packets according to the packet length of the data packets for a first preset time and to count the data packet transmission rate;
the second counting module is used for counting the speed of the received data packet within the first preset time after the second equipment end receives the data packet without the serial number and the timestamp;
an increasing module, configured to increase a packet length of the data packet by 10 bytes, and repeat the above steps;
and when the packet length is greater than or equal to the maximum packet length, the test is finished, the first equipment end outputs the delay time and the sending rate of different data packet lengths, and the second equipment end outputs the receiving rate of different data packet lengths.
The application provides a UDP-based NBIOT network delay and packet loss detection method, which can quickly count the relationship between delay and packet length, find the packet length easy to lose the packet and count the communication speed of the current environment. The main flow is as follows.
Starting the slave equipment firstly and then starting the master equipment, wherein the slave equipment is always in a packet monitoring state; (2) the master device has fixed packet length L, timeout time T and maximum packet length, or sets a packet length L, timeout time T and maximum packet length; (3) the main equipment sends a packet, and before sending, the serial number and the timestamp of the current packet are marked in the packet; (4) the slave device receives the data packet sent by the master device, judges that the packet has a sequence number and a time stamp, namely adds the time stamp of the received packet in the packet and sends the packet back to the master device, (5) the master device records the sequence number and the time stamp counted in the packet and enters a speed test mode if receiving the packet sent back to the master device by the slave device in the waiting time T, and marks that the packet with the sequence number is not received and enters a retransmission mode if not receiving the data packet sent back to the master device by the slave device; (6) if the master device enters a speed test mode, the packet length L is used for rapidly and continuously transmitting packets for 30 seconds (ignoring a time interval T), the packet transmitting speed is counted, the slave device starts counting the packet receiving speed within 30 seconds after receiving the data packets without the sequence numbers and the time stamps, and the next round of packet length test is carried out; (7) if the master device enters the retransmission mode, the time T is increased by 1 time, the packet is continuously transmitted to the slave device, if no data packet is received for 10 times, the packet length is counted and the next round of packet length test is directly entered, if the data packet is received, the speed test mode is entered, as in (6); (8) after the test that the packet length is L is finished, the packet length is increased by 10 bytes, and the test from the step (2) is carried out again; (9) if the packet length L is larger than or equal to the maximum packet length, the test is finished, the master device outputs the delay time and the sending rate of different packet lengths, and the slave device outputs the receiving rate of different packet lengths.
Compared with the prior art, the application has the following beneficial effects:
1. the master device and the slave device add timestamps in the UDP packet data section, so that the time of a sending end and the time of a receiving end can be accurately recorded; and the packet sequence number is added in the packet, so that the packet loss sequence can be accurately judged.
2. And automatically scanning different packet lengths, and counting the influence of different sending speeds and packet lengths on packet loss rate and time delay.
3. The mechanism is not only suitable for detecting the communication quality of the Internet of things with low NBIOT communication speed, but also has good reference value for detection results of other types of communication modes.
Referring to fig. 3, the present application further provides a computer device, data including a memory, a processor and a computer program stored in the memory and executable by the processor, the processor implementing the method of any one of the above when executing the computer program.
Referring to fig. 4, a computer-readable storage medium, a non-volatile readable storage medium, having stored therein a computer program which, when executed by a processor, implements any of the methods described above.
A computer program product, data comprising computer readable code which, when executed by a computer device, causes the computer device to perform the method of any of the above.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (6)
1. A network delay and lost data packet detection method is characterized by comprising the following steps:
s1: a first device end sends a data packet, and before sending, a serial number and a first time stamp of a current data packet are marked in the data packet;
s2: the second equipment end receives the data packet, and when the serial number and the first timestamp exist in the data packet, the second equipment end adds a second timestamp for receiving the data packet in the data packet and then sends the data packet to the first equipment end;
s3: when the first equipment end receives the data packet within a first preset time, recording the sequence number, the first timestamp and the second timestamp counted in the data packet;
s4: when the first equipment end does not receive the data packet within a first preset time, marking that the data packet is not received, and retransmitting a new data packet;
when the first equipment terminal retransmits a new data packet, the first preset time is increased, the data packet is continuously transmitted to the second equipment terminal, if the data packet is not received for n times, the packet length of the data packet is counted to be unable to communicate, the next round of data packet length test is directly entered, if the data packet is received, a speed test mode is entered, and n is a natural number;
s5: the first equipment terminal sends data packets according to the packet length of the data packets for a second preset time, and counts the data packet sending rate;
s6: after receiving the data packet without the sequence number and the timestamp, the second equipment starts to count the speed of the received data packet within the second preset time;
s7: increasing the packet length of 10 bytes of the data packet and repeating steps S1-S6;
s8: and when the packet length is greater than or equal to the maximum packet length, the test is finished, the first equipment end outputs the delay time and the sending rate of different data packet lengths, and the second equipment end outputs the receiving rate of different data packet lengths.
2. The method of claim 1, wherein the second device is turned on first and then the first device is turned on, and the second device is always in a packet listening state.
3. The method of claim 1, wherein the first predetermined time is increased by a factor of 1.
4. The method according to claim 3, wherein the packet length and the first predetermined time are the maximum packet length, and the maximum packet length is owned by the first device or manually set.
5. A computer device, data comprising a memory, a processor and a computer program stored in the memory and executable by the processor, characterized in that the processor implements the method according to any of claims 1-4 when executing the computer program.
6. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010011053.9A CN111245675B (en) | 2020-01-06 | 2020-01-06 | Network delay and lost data packet detection method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010011053.9A CN111245675B (en) | 2020-01-06 | 2020-01-06 | Network delay and lost data packet detection method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111245675A CN111245675A (en) | 2020-06-05 |
CN111245675B true CN111245675B (en) | 2021-10-22 |
Family
ID=70872346
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010011053.9A Active CN111245675B (en) | 2020-01-06 | 2020-01-06 | Network delay and lost data packet detection method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111245675B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112383937A (en) * | 2020-08-20 | 2021-02-19 | 佳格科技(浙江)股份有限公司 | Wireless communication quality detection method and system |
CN114466397B (en) * | 2021-07-30 | 2022-12-16 | 荣耀终端有限公司 | TCP communication quality evaluation method and device and electronic equipment |
CN114500330A (en) * | 2021-12-28 | 2022-05-13 | 芯讯通无线科技(上海)有限公司 | Test method, system, equipment and storage medium of Internet of things platform |
CN114584491B (en) * | 2022-04-21 | 2023-09-08 | 腾讯科技(深圳)有限公司 | Detection method, detection device, storage medium and detection equipment |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1881908A (en) * | 2005-06-13 | 2006-12-20 | 华为技术有限公司 | Method for measuring MPLS network performance parameter |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004260658A (en) * | 2003-02-27 | 2004-09-16 | Matsushita Electric Ind Co Ltd | Wireless lan device |
CN1275440C (en) * | 2003-11-19 | 2006-09-13 | 北京邮电大学 | An end-to-end network bottleneck bandwidth measuring method |
CN100356740C (en) * | 2005-12-12 | 2007-12-19 | 史文勇 | System and method for conducting comprehensive measurement and association analysis to time delay and drop |
KR20130091467A (en) * | 2012-02-08 | 2013-08-19 | 주식회사 케이티 | Method for measuring traffic delay in client station using udp packets transmitted from server |
CN103618640B (en) * | 2013-11-19 | 2016-08-31 | 武汉烽火网络有限责任公司 | Ethernet performance method of testing based on point-to-point test and device |
US10616088B2 (en) * | 2017-07-13 | 2020-04-07 | Avago Technologies International Sales Pte. Limited | Apparatus and method for measurements at intermediate nodes in end-to-end performance test |
CN109361566A (en) * | 2018-11-13 | 2019-02-19 | 天津津航计算技术研究所 | Utilize the method for test serial number and message time stamp prediction UDP Congestion Level SPCC |
-
2020
- 2020-01-06 CN CN202010011053.9A patent/CN111245675B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1881908A (en) * | 2005-06-13 | 2006-12-20 | 华为技术有限公司 | Method for measuring MPLS network performance parameter |
Also Published As
Publication number | Publication date |
---|---|
CN111245675A (en) | 2020-06-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111245675B (en) | Network delay and lost data packet detection method and system | |
Kochut et al. | Sniffing out the correct physical layer capture model in 802.11 b | |
CN109194551B (en) | Method, device and system for testing performance of real-time Ethernet equipment | |
CN101572829B (en) | Method for monitoring IPTV video quality, device thereof and system thereof | |
JP4348124B2 (en) | Method and communication device for estimating QoS | |
US20050111487A1 (en) | Method and apparatus for quality of service determination | |
JPH04263536A (en) | Apparatus and system for monitoring of network | |
CN104901851B (en) | A kind of method and system of detection network quality | |
RU2014121393A (en) | METHOD, DEVICE AND SYSTEM FOR NETWORK TESTING AT WORK OF IPSEC MECHANISM | |
CN112073128A (en) | Communication equipment performance test method and device | |
CN102857385B (en) | Packet loss detection method and system in a kind of Packet Transport Network | |
CN115426284A (en) | Network quality detection method, device, terminal equipment and storage medium | |
CN103999396B (en) | The subscriber station of bus system and the method for transmitting data between the subscriber station of bus system | |
CN109005009B (en) | Processing method and system for data packet check error | |
CN109120479B (en) | Network throughput testing method based on network message format | |
CN105611406B (en) | One kind access net service provider monitors user to video server lag characteristic method | |
CN109787861A (en) | Network data delay control method | |
Topor-Kaminski et al. | Selected methods of measuring the delay in data transmission systems with wireless network interfaces | |
CN117221175A (en) | Time delay measuring method and device, storage medium and program product thereof | |
CN108540347B (en) | Network cable two-end signal delay sequence matching generation method for network signal tracing | |
EP2704362A2 (en) | Method, apparatus and system for analyzing network transmission characteristics | |
CN102394773A (en) | Trap message submission method and equipment | |
CN116723133B (en) | Data transmitting and receiving equipment, network state information extraction method and device | |
JP5128556B2 (en) | Traffic information collecting apparatus, traffic information collecting method and program thereof | |
Renal et al. | Practical aspects of testing Phasor Data Concentrators for wide area monitoring systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |