CN112134750A - Network time protocol pressure test method and device - Google Patents

Network time protocol pressure test method and device Download PDF

Info

Publication number
CN112134750A
CN112134750A CN202010909632.5A CN202010909632A CN112134750A CN 112134750 A CN112134750 A CN 112134750A CN 202010909632 A CN202010909632 A CN 202010909632A CN 112134750 A CN112134750 A CN 112134750A
Authority
CN
China
Prior art keywords
ntp
request message
unit
message
server
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.)
Granted
Application number
CN202010909632.5A
Other languages
Chinese (zh)
Other versions
CN112134750B (en
Inventor
缪新育
胡昌军
李曙方
吕博
乔耀军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
China Academy of Information and Communications Technology CAICT
Original Assignee
Beijing University of Posts and Telecommunications
China Academy of Information and Communications Technology CAICT
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing University of Posts and Telecommunications, China Academy of Information and Communications Technology CAICT filed Critical Beijing University of Posts and Telecommunications
Priority to CN202010909632.5A priority Critical patent/CN112134750B/en
Publication of CN112134750A publication Critical patent/CN112134750A/en
Application granted granted Critical
Publication of CN112134750B publication Critical patent/CN112134750B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays

Abstract

The application provides a network time protocol stress test method and a device, wherein the method comprises the following steps: acquiring an NTP request message sent by a client to an NTP server; constructing an NTP simulation request message according to the NTP request message through control software, and sending the constructed NTP simulation request message to a tested NTP server through a hardware mode according to a set message sending rate N; receiving an NTP response message responded by the detected NTP server, and calculating the speed M of the received NTP response message; and determining the response capability of the tested NTP server according to the N and the M. The method can realize the high-speed NTP server pressure test.

Description

Network time protocol pressure test method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for testing network time protocol pressure.
Background
The Network Time Protocol (NTP) is currently the most common way of time synchronization on the Internet. The NTP protocol can synchronize the time of a computer to certain time standard and is suitable for the Internet environments with various scales, speeds and connection channel conditions, so that the NTP protocol is widely applied to the Internet as a time synchronization tool.
However, as NTP service demands increase, higher demands are placed on the performance of NTP servers, and reasonable evaluations of NTP server response capabilities are also required.
At present, software simulation and a method for simulating an NTP request message by an NTP time comprehensive analyzer cannot meet the requirement of processing capacity test of an NTP server.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for network time protocol pressure testing, which can implement high-rate NTP server pressure testing.
In order to solve the technical problem, the technical scheme of the application is realized as follows:
in one embodiment, a network time protocol stress test method is provided, the method comprising:
acquiring an NTP request message sent by a client to a network time protocol NTP server;
constructing an NTP simulation request message according to the NTP request message through control software;
sending the constructed NTP simulation request message to a tested NTP server in a hardware mode according to the set message sending rate N;
receiving an NTP response message responded by the detected NTP server, and calculating the speed M of the received NTP response message;
and determining the response capability of the tested NTP server according to the N and the M.
In another embodiment, there is provided a network time protocol stress testing apparatus, the apparatus comprising: the device comprises a configuration unit, an acquisition unit, a construction unit, a sending unit, a receiving unit, a calculation unit and a determination unit;
the configuration unit is used for configuring the message sending rate;
the acquiring unit is used for acquiring an NTP request message sent by a client to a network time protocol NTP server;
the construction unit is used for constructing an NTP simulation request message according to the NTP request message acquired by the acquisition unit through control software;
the sending unit is used for sending the NTP simulation request message constructed by the construction unit to a tested NTP server in a hardware mode according to the message sending rate N set by the configuration unit;
the receiving unit is used for receiving NTP response messages;
the calculating unit is configured to calculate a rate M of the NTP response packet received by the receiving unit and responded by the measured NTP server;
and the determining unit is used for determining the response capability of the measured NTP server according to the N configured by the configuration unit and the M calculated by the calculating unit.
In another embodiment, an electronic device is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the network time protocol stress testing method when executing the program.
In another embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the network time protocol stress testing method.
According to the technical scheme, in the embodiment, according to the NTP request message sent to the NTP server by the acquisition client, the NTP simulation request message is constructed again according to the NTP request message through the control software, and the NTP simulation request message is sent to the tested NTP server through a hardware mode according to the set message sending rate. The scheme can realize high-speed NTP server pressure test.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Figure 1 is a schematic diagram of NTP protocol synchronization principles;
FIG. 2 is a schematic diagram of a network time protocol stress test process in an embodiment of the present application;
fig. 3 is a schematic diagram of a system for acquiring an NTP request packet in the embodiment of the present application;
fig. 4 is a schematic flow chart illustrating a process of constructing an NTP simulation request packet in the embodiment of the present application;
fig. 5 is a schematic structural diagram of an NTP request message;
fig. 6 is a schematic structural diagram of an NTP simulation request packet constructed in the embodiment of the present application;
FIG. 7 is a schematic diagram of an Ethernet analyzer self-loop test topology;
figure 8 is a schematic diagram of a single-port based NTP server response capability test topology;
figure 9 is a schematic diagram of a multi-port based NTP server response capability velocity measurement topology;
FIG. 10 is a schematic diagram of an embodiment of the present application;
fig. 11 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
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 a part of the embodiments of the present application, and not all of the 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.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, article, or apparatus.
The technical solution of the present invention will be described in detail with specific examples. Several of the following embodiments may be combined with each other and some details of the same or similar concepts or processes may not be repeated in some embodiments.
The embodiment of the application provides a network time protocol pressure testing method, which is applied to an Ethernet analyzer, according to an NTP request message sent to an NTP server by an acquisition client, an NTP simulation request message is built again according to the NTP request message through control software, and the NTP simulation request message is sent to a tested NTP server through a hardware mode according to a set message sending rate. The scheme can realize high-speed NTP server pressure test.
In the embodiment of the present application, the type of the ethernet analyzer is not limited, and for example, the ethernet analyzer may be a TestCenter type ethernet analyzer.
The NTP basic flow involved in the embodiments of the present application is as follows:
the Slave Clock and the Master Clock are connected through a network, both have independent system clocks, and automatic synchronization of the respective system clocks needs to be realized through NTP. Assuming that the client Slave Clock requests a time service from the server Master Clock, referring to fig. 1, fig. 1 is a schematic diagram of the NTP protocol synchronization principle. The method comprises the following specific steps:
the Slave Clock sends an NTP request Message (NTP Message (T)1) To Master Clock, the message carries the timestamp of when it left the Slave Clock, which is T1
2. When the NTP request message reaches the Master Clock, the Master Clock records the time stamp of the message arrival, and the time stamp is T2
3, after receiving the NTP request Message, the Master Clock returns the NTP response Message (NTP Message (T)1、T2、T3) When the NTP response message leaves the Master Clock, the Master Clock adds its own timestamp, which is T3
4. When the Slave Clock receives the response message, the Slave Clock records a time stamp of the arrival of the message, wherein the time stamp is T4
5. Under the condition that the round-trip delay of the network is consistent, the Slave Clock can calculate the time deviation Δ T and the link delay L of the master Clock and the Slave Clock by the formulas (1) and (2):
Figure BDA0002662766190000051
Figure BDA0002662766190000052
the following steps are given for the client to send the NTP request and the NTP server to respond:
first, the client connects to the NTP server.
The NTP client generally needs to establish an Address Resolution Protocol (ARP) connection with an IP port of the server.
And secondly, sending an NTP request message.
Through message analysis and CPU processing, the client sends a request message to the server, and the request message is composed of parts such as a universal frame format, a client identifier, client time information and the like.
And thirdly, the NTP server receives the NTP request message and returns an NTP response message.
The server parses the request, locates the requested resource, and writes a copy of the resource to the message response field. The response message consists of a general frame format, a server identifier, the corresponding time of the server and the like.
And fourthly, the client analyzes the NTP response message content.
The client processor firstly analyzes the response message and checks the time information in the message. And then, combining the receiving time of the server response message, and calculating the master-slave time difference according to the NTP master-slave time difference principle.
The following describes in detail a process of implementing network time protocol stress test in the embodiment of the present application with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is a schematic diagram of a network time protocol stress test flow in the embodiment of the present application. The method comprises the following specific steps:
step 201, acquiring an NTP request message sent by a client to an NTP server.
The NTP request message sent by the client to the NTP server in the embodiment of the present application is an NTP request message in a conventional protocol standard, where the NTP server may be a measured NTP server or other NTP servers, and the embodiment of the present application is not limited.
The method for acquiring the NTP request message is not limited, and in a specific implementation, for example, a pre-stored NTP request message may be used, or an NTP request message sent by a client to an NTP server may be acquired when the client is communicating with the NTP server, and for this method, the following acquisition methods may be used, but are not limited to:
referring to fig. 3, fig. 3 is a schematic diagram of a system for acquiring an NTP request message in the embodiment of the present application. And the router is accessed between the Ethernet channels passed by the NTP client and the NTP server and is used for shunting the NTP request message sent to the NTP server by the client.
The packet capturing device captures NTP request messages sent by the client to the NTP server by using a packet capturing tool, namely captures NTP request messages branched by the router.
In the embodiment of the present application, the bale plucking tool is not limited, for example, wireshark or the like may be used.
The packet capturing device can be a device for installing the packet capturing tool, such as a server, a PC and the like, and can also be an Ethernet analyzer for installing the packet capturing tool.
And 202, constructing an NTP simulation request message according to the NTP request message mode through control software.
Referring to fig. 4, fig. 4 is a schematic flow chart illustrating a process of constructing an NTP simulation request message in the embodiment of the present application. The method comprises the following specific steps:
step 401, analyzing the NTP request message, and acquiring a frame structure of the NTP request message.
When analyzing the NTP request packet, the method may specifically include: analyzing the field structure of the message, removing the Ethernet message header and extracting the NTP protocol content.
And 402, setting a corresponding field of the NTP simulation request message according to the frame structure.
Step 403, copying the content corresponding to the field of the NTP simulation request message in the NTP request message to the field to generate an NTP simulation request message.
When the method is concretely realized, the field of the NTP simulation request message is constructed through the message construction function of the Ethernet analyzer, and the specific content of the filling field is copied.
Wherein the field includes: ethernet frame type, IP protocol, UDP protocol, and request data content.
The NTP protocol version number is included in the data request content.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an NTP request message. The content corresponding to the respective fields (ethernet frame type, IP protocol, UDP protocol and requested data content) is given in fig. 5.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an NTP simulation request message constructed in the embodiment of the present application. The corresponding fields are ethernet frame type (ethernet ii), IP protocol (IPv4), UDP protocol (UDP) and request data content (Custom Header), respectively.
In specific implementation, physical layer parameters are also set through ethernet analyzer control software, including transmission media types: copper/fiber cable, transmission rate, full/half duplex.
And 203, sending the constructed NTP simulation request message to the tested NTP server in a hardware mode according to the set message sending rate N.
In this embodiment, the sending of the packet is realized in a hardware-based manner, and buffering is not required to be performed as in software implementation, so that a delay-free effect can be achieved.
The Ethernet analyzer controls the bottom hardware through the control software, for example, the Ethernet analyzer sends an instruction to the hardware, so that the hardware sends a message according to the instruction, and the Ethernet analyzer can reach the specified message sending rate when sending the message and is not influenced by the multithreading of the CPU.
The hardware here may be a programmable logic device, such as an FPGA.
The message sending rate N set in the embodiment of the application is not more than any rate of the following rate K:
K=D/(A+B+C);
wherein, D is port bandwidth, A is message length, B is preamble length, and C is frame interval.
In the embodiment of the application, the message sending rate can completely reach the set message sending rate by the self-loop test of the Ethernet analyzer.
In the embodiment of the application, the message is sent without calling an instruction through the CPU, and the constructed message can be directly sent out from the physical port according to the set message sending rate.
Referring to fig. 7, fig. 7 is a schematic diagram of an ethernet analyzer self-loop test topology. During testing, the Tx/Rx1 port of the Ethernet analyzer sends NTP request message, and the Tx/Rx2 port carries out receiving measurement.
The test procedure was as follows:
the receiving and transmitting ports all select a 100M rate Ethernet module, the load of the transmitting port is 10%, and the maximum transmission rate of the transmitting port is 10M. The message sent by the sending port is measured by the receiving port, and finally the test result is read according to the frame sending rate displayed by the sending end and the frame receiving rate of the receiving end. The result shows that the numerical values of the two are the same and are 10965 frames/second, and meanwhile, the received messages are confirmed to be NTP request messages through the analysis of the received messages.
Taking the example that the message length is 94 bytes, the preamble of the ethernet frame is 8 bytes, and the minimum frame interval is 12 bytes, the port rate obtained by calculation is 10000080bit/s, which is consistent with the set nominal rate of 10M, which indicates that the set message sending rate can be completely reached, and zero delay is achieved.
And step 204, receiving the NTP response message responded by the detected NTP server, and calculating the speed M of the received NTP response message.
The NTP server receives the NTP simulation request message and carries out message response in the same format, and the response content comprises the set content and time information of the NTP server.
And step 205, determining the response capability of the tested NTP server according to N and M.
During specific implementation, the port setting function and the message editing function of the Ethernet analyzer can be used for setting the speed, the IP address and the output port of the message, so that the pressure test of various scenes can be flexibly realized. Such as NTP server pressure tests that simulate multi-client multi-port, multi-client single-port, single-client multi-port scenarios, etc.
The method specifically comprises the following steps:
and sending NTP simulation request messages with the same or different IP addresses to the tested NTP server through one port.
Or the like, or, alternatively,
and sending NTP simulation request messages with the same or different IP addresses to the tested NTP server through a plurality of ports.
The rate of sending packets at each port may be any rate not greater than K.
In order to further verify the actual testing effect of the method, an ethernet analyzer is used to actually measure the NTP response capability of the NTP server, and referring to fig. 8, fig. 8 is a topological diagram illustrating a single-port-based NTP server response capability test. The testing scheme is as follows, namely the Ethernet analyzer sends NTP request message to the Rx/Tx port of the tested device through the Tx/Rx port, after the device receives the NTP request message, the original port sends NTP response message back to the Ethernet analyzer, and the Ethernet analyzer carries out message detection and calculation.
The test procedure was as follows:
a 100M rate ethernet module is selected with a port load of 10%, i.e. a maximum transmission rate of 10M. The Ethernet analyzer firstly performs ARP handshake with the equipment and then sends NTP request message. The test results showed that the meter had a frame transmission rate of 10965 frames/second and a reception rate of 1071 frames/second. And continuously adjusting the message sending rate, wherein the response message rate received by the Ethernet analyzer is 1071 frames/second as long as the message sending rate is greater than 1071 frames/second, and the received messages are confirmed to be NTP response messages through message analysis.
Through the above processes, the maximum NTP response capability of the tested device can be judged to be 1071 frames/second, which shows that the response capability of the NTP server can be effectively measured by the method.
In order to verify the message sending capability of the method at different port rates, a port module with a different rate is selected to perform pressure test on another device. A 1000M rate ethernet module is selected with a port load of 70%, i.e. a maximum transmission rate of 700M. The test result shows that the frame sending rate of the instrument is 767544 frames/second, the receiving rate is 531916 frames/second, and the instrument is easy to verify to reach the theoretical maximum frame sending rate. And continuously adjusting the message sending rate, wherein the message rate received by the Ethernet analyzer is 53196 frames/second as long as the message rate is greater than 53196 frames/second, and the received messages are confirmed to be NTP response messages through message analysis.
Through the above processes, it is described that the message sending capability of the method is irrelevant to the port rate, and the theoretical maximum rate can be achieved no matter what rate, so that the method can meet the arbitrary rate response capability of the NTP server.
And further setting the same message sending flow at other ports of the Ethernet analyzer. Referring to fig. 9, fig. 9 is a schematic diagram of a multi-port-based NTP server response capability speed measurement topology.
Since the processing power of the same device is typically determined by the CPU, the sum of the processing power of all ports is equal to the CPU processing power. The test result shows that the quantity of the NTP response messages received by the two ports of the Ethernet analyzer are 1378 frames/second and 323 frames/second respectively, the quantity of the messages of the two ports changes along with time, but the sum of the quantities of the messages of the two ports is 1701 frames/second, and the total quantity of the messages of the two ports is the same as that of the single port. Through the process, the processing capability of the unified CPU is verified to be irrelevant to the equipment port, and the method can meet the response capability test of the NTP server under the condition of multiple clients and multiple ports. For a multi-CPU device, similar processing may be performed in blocks.
According to the embodiment of the application, the NTP request message rate is increased to the maximum message sending rate allowed by the bandwidth, and the response capability test capability of the NTP server with higher rate and more stability can be provided; compared with a software simulation method, the method can get rid of the limitation of the processing capability of a CPU and a peripheral circuit, can achieve the maximum message sending rate allowed by the bandwidth, and improves the upper limit of message sending. Meanwhile, the message sending method based on hardware can get rid of the influence of a protocol stack on message processing, so that the message sending rate is more stable.
The method realizes the NTP message request method with multiple IP addresses and multiple ports, and can provide the response capability test of the NTP server with multiple clients and multiple ports in any scene. After the NTP request message is constructed, parameters such as the rate and the IP address of the message and multi-port output can be set by utilizing the port setting and message editing functions of the Ethernet analyzer, and an NTP message request scene with multiple IP addresses and multiple ports is realized.
The testing efficiency of testers can be effectively improved. The NTP server response capability test simulating any scene of multiple clients and multiple ports is completed in one time, and the scenes of different ports of different clients do not need to be simulated for multiple times. Simultaneously, the method and the device are simple to operate, can start and directly read results by one key, do not need extra professional knowledge, can enable testers to complete the pressure test of the NTP server in a short time, and improve the test efficiency.
Based on the same inventive concept, the embodiment of the application also provides a network time protocol pressure testing device. Referring to fig. 10, fig. 10 is a schematic structural diagram of the present application in an embodiment of the present application. The device comprises: a configuration unit 1001, an acquisition unit 1002, a construction unit 1003, a transmission unit 1004, a reception unit 1005, a calculation unit 1006, and a determination unit 1007;
a configuration unit 1001, configured to configure a message sending rate N;
an obtaining unit 1002, configured to obtain an NTP request message sent by a client to an NTP server;
a constructing unit 1003, configured to construct, by using control software, an NTP simulation request message according to the NTP request message acquired by the acquiring unit 1002;
a sending unit 1004, configured to send the NTP simulation request message constructed by the construction unit 1003 to the tested NTP server in a hardware manner according to the message sending rate N set by the configuration unit 1001;
a receiving unit 1005, configured to receive an NTP response packet;
a calculating unit 1006, configured to calculate a rate M of an NTP response packet responded by the measured NTP server and received by the receiving unit 1005;
a determining unit 1007, configured to determine the response capability of the measured NTP server according to N configured by the configuring unit 1001 and M calculated by the calculating unit 1007.
Preferably, the first and second electrodes are formed of a metal,
the obtaining unit 1002 is specifically configured to use a packet capturing tool to capture an NTP request packet sent by a client to an NTP server.
Preferably, the first and second electrodes are formed of a metal,
the constructing unit 1003 is specifically configured to, when constructing the NTP simulation request message according to the NTP request message, include: analyzing an NTP request message to obtain a frame structure of the NTP request message; setting a corresponding field of the NTP simulation request message according to the frame structure; wherein the field includes: ethernet frame type, IP protocol, UDP protocol, and request data content; and copying the content corresponding to the field of the NTP simulation request message in the NTP request message to the field to generate an NTP simulation request message.
Preferably, the first and second electrodes are formed of a metal,
the configuration unit 1001 is specifically configured to configure the message sending rate N to be any rate not greater than the following rate K:
K=D/(A+B+C);
wherein, D is port bandwidth, A is message length, B is preamble length, and C is frame interval.
Preferably, the first and second electrodes are formed of a metal,
a constructing unit 1003, further configured to construct NTP simulation request messages with the same or different IP addresses;
a sending unit 1004, further configured to send NTP simulation request messages with the same or different IP addresses to the measured NTP server through one port.
Preferably, the first and second electrodes are formed of a metal,
a constructing unit 1003, further configured to construct NTP simulation request messages with the same or different IP addresses;
a sending unit 1004, further configured to send NTP simulation request messages with the same or different IP addresses to the tested NTP server through multiple ports.
The units of the above embodiments may be integrated into one body, or may be separately deployed; may be combined into one unit or further divided into a plurality of sub-units.
In another embodiment, an electronic device is also provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the network time protocol stress testing method when executing the program.
In another embodiment, a computer readable storage medium is also provided, having stored thereon computer instructions, which when executed by a processor, may implement the steps in the network time protocol stress testing method.
Fig. 11 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 11, the electronic device may include: a Processor (Processor)1110, a communication Interface (Communications Interface)1120, a Memory (Memory)1130, and a communication bus 1140, wherein the Processor 1110, the communication Interface 1120, and the Memory 1130 communicate with each other via the communication bus 1140. Processor 1110 may call logic instructions in memory 1130 to perform the following method:
acquiring an NTP request message sent by a client to an NTP server;
constructing an NTP simulation request message according to the NTP request message through control software;
sending the constructed NTP simulation request message to a tested NTP server in a hardware mode according to the set message sending rate N;
receiving an NTP response message responded by the detected NTP server, and calculating the speed M of the received NTP response message;
and determining the response capability of the tested NTP server according to the N and the M.
In addition, the logic instructions in the memory 1130 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly, the embodiments can also be implemented by software plus a necessary general hardware platform. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A network time protocol stress testing method, the method comprising:
acquiring an NTP request message sent by a client to a network time protocol NTP server;
constructing an NTP simulation request message according to the NTP request message through control software;
sending the constructed NTP simulation request message to a tested NTP server in a hardware mode according to the set message sending rate N;
receiving an NTP response message responded by the detected NTP server, and calculating the speed M of the received NTP response message;
and determining the response capability of the tested NTP server according to the N and the M.
2. The method according to claim 1, wherein said obtaining the NTP request message sent by the client to the NTP server comprises:
and grabbing the NTP request message sent to the NTP server by the client by using a packet grabbing tool.
3. The method according to claim 1, wherein said constructing an NTP simulation request message from said NTP request message comprises:
analyzing an NTP request message to obtain a frame structure of the NTP request message;
setting a corresponding field of the NTP simulation request message according to the frame structure; wherein the field includes: ethernet frame type, IP protocol, UDP protocol, and request data content;
and copying the content corresponding to the field of the NTP simulation request message in the NTP request message to the field to generate an NTP simulation request message.
4. The method of claim 1, wherein the messaging rate N is any rate not greater than the following rate K:
K=D/(A+B+C);
wherein, D is port bandwidth, A is message length, B is preamble length, and C is frame interval.
5. The method of claim 1, further comprising:
and sending NTP simulation request messages with the same or different IP addresses to the tested NTP server through one port.
6. The method of claim 1, further comprising:
and sending NTP simulation request messages with the same or different IP addresses to the tested NTP server through a plurality of ports.
7. A network time protocol stress testing apparatus, the apparatus comprising: the device comprises a configuration unit, an acquisition unit, a construction unit, a sending unit, a receiving unit, a calculation unit and a determination unit;
the configuration unit is used for configuring the message sending rate;
the acquiring unit is used for acquiring an NTP request message sent by a client to a network time protocol NTP server;
the construction unit is used for constructing an NTP simulation request message according to the NTP request message acquired by the acquisition unit through control software;
the sending unit is used for sending the NTP simulation request message constructed by the construction unit to a tested NTP server in a hardware mode according to the message sending rate N set by the configuration unit;
the receiving unit is used for receiving NTP response messages;
the calculating unit is configured to calculate a rate M of the NTP response packet received by the receiving unit and responded by the measured NTP server;
and the determining unit is used for determining the response capability of the measured NTP server according to the N configured by the configuration unit and the M calculated by the calculating unit.
8. The apparatus of claim 7,
the constructing unit is specifically configured to, when constructing an NTP simulation request packet according to the NTP request packet, include: analyzing an NTP request message to obtain a frame structure of the NTP request message; setting a corresponding field of the NTP simulation request message according to the frame structure; wherein the field includes: ethernet frame type, IP protocol, UDP protocol, and request data content; and copying the content corresponding to the field of the NTP simulation request message in the NTP request message to the field to generate an NTP simulation request message.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-6 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 6.
CN202010909632.5A 2020-09-02 2020-09-02 Network time protocol pressure test method and device Active CN112134750B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010909632.5A CN112134750B (en) 2020-09-02 2020-09-02 Network time protocol pressure test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010909632.5A CN112134750B (en) 2020-09-02 2020-09-02 Network time protocol pressure test method and device

Publications (2)

Publication Number Publication Date
CN112134750A true CN112134750A (en) 2020-12-25
CN112134750B CN112134750B (en) 2022-06-03

Family

ID=73848968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010909632.5A Active CN112134750B (en) 2020-09-02 2020-09-02 Network time protocol pressure test method and device

Country Status (1)

Country Link
CN (1) CN112134750B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115514681A (en) * 2022-09-16 2022-12-23 北京天融信网络安全技术有限公司 Method, device, system, equipment and medium for testing equipment stability

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000050974A2 (en) * 1999-02-26 2000-08-31 Reveo, Inc. Globally time-synchronized systems, devices and methods
KR20010026386A (en) * 1999-09-06 2001-04-06 박종섭 NTP Performance and Capacity Measuring System and Measuring Method of Service Switching Point
US20040062278A1 (en) * 2002-09-30 2004-04-01 Lucent Technologies, Inc. Systems and methods for synchronization in asynchronous transport networks
WO2012012723A2 (en) * 2010-07-23 2012-01-26 Saudi Arabian Oil Company Machines, computer program products, and computer-implemented methods providing an integrated node for data acquisition and control
CN105827476A (en) * 2016-01-21 2016-08-03 北京荣达千里科技有限公司 High-speed PING implementation method and PING testing method
CN106375139A (en) * 2015-07-23 2017-02-01 腾讯科技(北京)有限公司 Request copying method, apparatus and system
CN106506107A (en) * 2016-11-25 2017-03-15 中国科学院武汉物理与数学研究所 A kind of ntp server time service implementation method based on hardware timestamping
CN106549822A (en) * 2015-09-16 2017-03-29 中国移动通信集团公司 The method of the response time of testing time sync message, device and test equipment
CN106788836A (en) * 2016-04-06 2017-05-31 新华三技术有限公司 The synchronous method and device of a kind of system time
CN108667547A (en) * 2018-08-10 2018-10-16 电信科学技术第五研究所有限公司 A kind of Network Time Protocol conversion method and system
CN109995600A (en) * 2017-12-29 2019-07-09 浙江宇视科技有限公司 A kind of big pressure service test method and system based on SDN
KR20190094499A (en) * 2018-02-05 2019-08-14 맥슨씨아이씨 주식회사 apparatus for testing load capacity of ptp/ntp server

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000050974A2 (en) * 1999-02-26 2000-08-31 Reveo, Inc. Globally time-synchronized systems, devices and methods
KR20010026386A (en) * 1999-09-06 2001-04-06 박종섭 NTP Performance and Capacity Measuring System and Measuring Method of Service Switching Point
US20040062278A1 (en) * 2002-09-30 2004-04-01 Lucent Technologies, Inc. Systems and methods for synchronization in asynchronous transport networks
WO2012012723A2 (en) * 2010-07-23 2012-01-26 Saudi Arabian Oil Company Machines, computer program products, and computer-implemented methods providing an integrated node for data acquisition and control
CN106375139A (en) * 2015-07-23 2017-02-01 腾讯科技(北京)有限公司 Request copying method, apparatus and system
CN106549822A (en) * 2015-09-16 2017-03-29 中国移动通信集团公司 The method of the response time of testing time sync message, device and test equipment
CN105827476A (en) * 2016-01-21 2016-08-03 北京荣达千里科技有限公司 High-speed PING implementation method and PING testing method
CN106788836A (en) * 2016-04-06 2017-05-31 新华三技术有限公司 The synchronous method and device of a kind of system time
CN106506107A (en) * 2016-11-25 2017-03-15 中国科学院武汉物理与数学研究所 A kind of ntp server time service implementation method based on hardware timestamping
CN109995600A (en) * 2017-12-29 2019-07-09 浙江宇视科技有限公司 A kind of big pressure service test method and system based on SDN
KR20190094499A (en) * 2018-02-05 2019-08-14 맥슨씨아이씨 주식회사 apparatus for testing load capacity of ptp/ntp server
CN108667547A (en) * 2018-08-10 2018-10-16 电信科学技术第五研究所有限公司 A kind of Network Time Protocol conversion method and system

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
ANDRZEJ DOBROGOWSKI等: "Results of evaluation of time signals received from NTP servers in Poland", 《EFTF-2010 24TH EUROPEAN FREQUENCY AND TIME FORUM》 *
吴鹏: "NTP授时服务性能监测及状态评估", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *
吴鹏等: "NTP服务器的响应阈值测试软件设计", 《时间频率学报》 *
李贞妮等: "基于VxWorks的NTP服务器的设计与实现", 《计算机工程与设计》 *
胥婕等: "基于NTP协议的网络时间同步系统的设计与实现", 《上海计量测试》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115514681A (en) * 2022-09-16 2022-12-23 北京天融信网络安全技术有限公司 Method, device, system, equipment and medium for testing equipment stability

Also Published As

Publication number Publication date
CN112134750B (en) 2022-06-03

Similar Documents

Publication Publication Date Title
US7523198B2 (en) Integrated testing approach for publish/subscribe network systems
US9172647B2 (en) Distributed network test system
US8233399B2 (en) Generic packet generator and method
CN107579869B (en) Network performance detection method and network equipment
CN103117900B (en) Configurable industrial Ethernet data parsing system and parsing method
CN108092854B (en) Test method and device for train-level Ethernet equipment based on IEC61375 protocol
CN101164287A (en) File transfer protocol service performance testing method
Kundel et al. P4STA: High performance packet timestamping with programmable packet processors
CN111327478A (en) Network measurement method and device, equipment and storage medium
CN109639534A (en) A kind of method, apparatus and computer storage medium of test network transmission performance
CN112134750B (en) Network time protocol pressure test method and device
CN111385163A (en) Flow analysis and detection method and device
US9985864B2 (en) High precision packet generation in software using a hardware time stamp counter
CN114390578A (en) Network performance testing method and device, electronic equipment and medium
Pásztor Accurate active measurement in the Internet and its applications
CN114024598B (en) Forwarding interface test method and device
Topor-Kaminski et al. Selected methods of measuring the delay in data transmission systems with wireless network interfaces
US11677651B2 (en) UDPING—continuous one-way monitoring of multiple network links
JP2003283564A (en) Ip traffic generating apparatus, method therefor, traffic generation program, and recording medium
CN114884605A (en) Method for realizing time synchronization of network nodes based on FPGA
Plakalovic et al. High-speed FPGA-based Ethernet traffic generator
Flatt et al. Reliable synchronization accuracy in ieee 1588 networks using device qualification with standard test patterns
CN203522776U (en) Configurable industrial Ethernet data parsing system
Van den Broeck et al. Validation of router models in OPNET
Toll et al. IoTreeplay: Synchronous Distributed Traffic Replay in IoT Environments

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