CN111478821B - Network performance test method and system - Google Patents

Network performance test method and system Download PDF

Info

Publication number
CN111478821B
CN111478821B CN201910068423.XA CN201910068423A CN111478821B CN 111478821 B CN111478821 B CN 111478821B CN 201910068423 A CN201910068423 A CN 201910068423A CN 111478821 B CN111478821 B CN 111478821B
Authority
CN
China
Prior art keywords
udp packet
udp
packet
nat
equipment
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
Application number
CN201910068423.XA
Other languages
Chinese (zh)
Other versions
CN111478821A (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.)
China Academy of Information and Communications Technology CAICT
Original Assignee
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 China Academy of Information and Communications Technology CAICT filed Critical China Academy of Information and Communications Technology CAICT
Priority to CN201910068423.XA priority Critical patent/CN111478821B/en
Publication of CN111478821A publication Critical patent/CN111478821A/en
Application granted granted Critical
Publication of CN111478821B publication Critical patent/CN111478821B/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/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • H04L43/106Active monitoring, e.g. heartbeat, ping or trace-route using time related information in packets, e.g. by adding timestamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a network performance test method and a system, wherein the method comprises the following steps: the first equipment constructs a first UDP packet and sends the first UDP packet to the second equipment through the NAT equipment; when receiving the first UDP packet, the NAT equipment modifies the packet header of the first UDP packet to be used as a second UDP packet and sends the second UDP packet to the second equipment; when the second device receives a second UDP packet sent by the NAT device, modifying the packet header of the second UDP packet to be used as a third UDP packet, and sending the third UDP packet to the first device; when receiving the third UDP packet, the NAT device modifies the packet header of the third UDP packet to serve as a fourth UDP packet, and sends the fourth UDP packet to the first device; and when the first device receives the fourth UDP packet, recording the time for receiving the fourth UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the fourth UDP packet. The method can realize the test of the network performance between the NAT private network side and the NAT public network side.

Description

Network performance test method and system
Technical Field
The invention relates to the technical field of computer networks, in particular to a network performance testing method and system.
Background
It is important in network performance test to test the indexes such as time delay, jitter, packet loss rate, etc., and the tool usually used for testing is ping. Ping has many limitations in the actual scenario, which are as follows:
since Ping uses an Internet Group Management Protocol (ICMP) Protocol to send ICMP packets, many times firewalls filter packets, and thus cannot test network performance.
In an actual Network, if a sending end is on the Network Address Translation (NAT) private Network side, a pinged device is on the NAT public Network side, and a returned ICMP packet cannot necessarily penetrate the NAT, resulting in test failure.
Disclosure of Invention
In view of this, the present application provides a method and a system for testing network performance, which can implement testing of network performance between the NAT private network and the public network.
In order to solve the technical problem, the technical scheme of the application is realized as follows:
a network performance test method is applied to a network system comprising a first device, NAT equipment and a second device, wherein the first device is arranged at the NAT private network side, and the second device is arranged at the public network side; the method comprises the following steps:
the first equipment constructs a first UDP packet and sends the first UDP packet to the second equipment through the NAT equipment; wherein a payload portion of the first UDP packet carries a timestamp for transmitting the first UDP packet;
when receiving the first UDP packet, the NAT equipment modifies the packet header of the first UDP packet as a second UDP packet through NAT mapping and sends the second UDP packet to the second equipment;
when the second device receives a second UDP packet sent by the NAT device, modifying the packet header of the second UDP packet to be used as a third UDP packet, and sending the third UDP packet to the first device through the NAT device;
when receiving the third UDP packet, the NAT device modifies the packet header of the third UDP packet through NAT mapping to serve as a fourth UDP packet, and sends the fourth UDP packet to the first device;
and when the first device receives the fourth UDP packet, recording the time for receiving the fourth UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the fourth UDP packet.
A network performance test method is applied to a network system comprising a third device, a Network Address Translation (NAT) device and a fourth device, wherein the third device is arranged at the NAT private network side, and the fourth device is arranged at the public network side; the method comprises the following steps:
the third device constructs a fifth UDP packet for registering in the NAT device;
when the NAT equipment receives a fifth UDP packet sent by the third equipment, establishing a mapping relation between an internal network address and an internal network UDP port number of the third equipment and an external network address and an external network UDP port number of the second equipment of the external network;
the fourth device constructs a sixth UDP packet and sends the sixth UDP packet to the third device through the NAT device; wherein a payload portion of the fifth UDP packet carries a timestamp for transmitting a sixth UDP packet;
when receiving the sixth UDP packet, the NAT device modifies the packet header of the sixth UDP packet to serve as a seventh UDP packet, and sends the seventh UDP packet to the third device;
when the third device receives a seventh UDP packet sent by the NAT device, modifying the packet header of the seventh UDP packet, taking the modified packet header as an eighth UDP packet, and sending the eighth UDP packet to the fourth device;
when receiving the eighth UDP packet, the NAT device modifies the packet header of the eighth UDP packet to serve as a ninth UDP packet, and sends the ninth UDP packet to the fourth device;
and when the fourth device receives the ninth UDP packet, recording the time for receiving the ninth UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the ninth UDP packet.
A network performance testing system, the system comprising: the system comprises a first device, NAT equipment and a second device, wherein the first device is arranged on the NAT private network side, and the second device is arranged on the public network side;
the first equipment constructs a first UDP packet and sends the first UDP packet to the second equipment through the NAT equipment; wherein a payload portion of the first UDP packet carries a timestamp for transmitting the first UDP packet; when a fourth UDP packet sent by the second equipment is received, recording the time for receiving the fourth UDP packet, and calculating the network delay according to the recorded time and a timestamp carried in the fourth UDP packet;
the NAT equipment modifies the packet header of the first UDP packet as a second UDP packet through NAT mapping when receiving the first UDP packet, and sends the second UDP packet to the second equipment; when the third UDP packet is received, modifying the packet header of the third UDP packet as a fourth UDP packet through NAT mapping, and sending the fourth UDP packet to the first equipment;
and the second device modifies the packet header of the second UDP packet to be used as a third UDP packet when receiving the second UDP packet, and sends the third UDP packet to the first device through the NAT device.
A network performance testing system, the system comprising: in a network system of a third device, a Network Address Translation (NAT) device and a fourth device, wherein the third device is on the NAT private network side, and the fourth device is on the public network side;
the third equipment constructs a fifth UDP packet for registering in the NAT equipment; when a seventh UDP packet sent by the NAT equipment is received, modifying the packet header of the seventh UDP packet to be used as an eighth UDP packet, and sending the eighth UDP packet to the fourth equipment;
the NAT equipment establishes a mapping relation between an internal network address and an internal network UDP port number of the third equipment and an external network address and an external network UDP port number of the second equipment of the external network when receiving a fifth UDP packet sent by the third equipment; when the sixth UDP packet is received, modifying the packet header of the sixth UDP packet to be used as a seventh UDP packet, and sending the seventh UDP packet to the third equipment; when the eighth UDP packet is received, modifying the packet header of the eighth UDP packet to be used as a ninth UDP packet, and sending the ninth UDP packet to the fourth device;
the fourth device constructs a sixth UDP packet and sends the sixth UDP packet to the third device through the NAT device; wherein a payload portion of the fifth UDP packet carries a timestamp for transmitting a sixth UDP packet; and when the ninth UDP packet is received, recording the time for receiving the ninth UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the ninth UDP packet.
According to the technical scheme, the UDP protocol is introduced, so that the UDP packet successfully penetrates the NAT from the private network to the public network and from the public network to the private network, and the test of the network performance between the NAT private network side and the public network side can be realized on the premise of no configuration.
Drawings
Fig. 1 is a schematic diagram of a network performance testing system according to an embodiment of the present application;
FIG. 2 is a diagram illustrating NAT translation in an embodiment of the present application;
fig. 3 is a schematic diagram of a network performance testing system according to a second embodiment of the present application;
FIG. 4 is a schematic diagram of a network performance testing process applied in the first embodiment;
fig. 5 is a schematic diagram of a network performance testing process applied in the second embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the technical solutions of the present invention are described in detail below with reference to the accompanying drawings and examples.
The embodiment of the application provides a network performance testing system. The method can be applied to the scene with the NAT, and can also be applied to the scene without the NAT.
The application is in the scene with NAT:
example one
Referring to fig. 1, fig. 1 is a schematic diagram of a network performance testing system according to an embodiment of the present application. The system comprises: the system comprises a first device, NAT equipment and a second device, wherein the first device is arranged on the NAT private network side, and the second device is arranged on the public network side;
the first equipment constructs a first User Datagram Protocol (UDP) packet and sends the packet to the second equipment through the NAT equipment; wherein a payload portion of the first UDP packet carries a timestamp for transmitting the first UDP packet;
the header of the first UDP packet constructed here includes: a source port number and a destination port number, and a source address and a destination address; the source address is an internal network address of the first device, the source port number is a self-defined port number of the first device, the destination address is a public network address of the second device, and the destination port is a port number of the second device for receiving the UDP packet.
Referring to fig. 2, fig. 2 is a schematic diagram of NAT translation in the embodiment of the present application.
In fig. 2, the source port number of the first UDP is 3000, the destination port number is 6900, and the source address is 172.24.20.233 and the destination address is 219.239.97.10.
The payload portion of the first UDP packet at least includes a timestamp for the first device to send the first UDP packet, and as to whether the payload portion includes other information, this is not limited in this embodiment of the application.
The NAT equipment modifies the packet header of the first UDP packet as a second UDP packet through NAT mapping when receiving the first UDP packet, and sends the second UDP packet to the second equipment;
the second UDP packet constitutes: the source address is the address of the first device mapped to the external network through the NAT device, the source port number is the UDP port number of the first device mapped to the external network through the NAT device, the destination address is the destination address of the first UDP packet, and the destination port number is the destination port number of the first UDP packet. The payload of the packet is consistent with the first UDP packet.
The mapping rule of the NAT equipment is as follows: private network UDP: 172.24.20.233:3000 corresponds to the public network UDP: 210.25.159.186: 5000.
when receiving the first UDP packet, the NAT device modifies the packet header of the first UDP packet, that is, the packet header of the second UDP is:
source port number 5000, destination port number 6900, and source address 210.25.159.186, destination address 219.239.97.10.
The payload portion of the second UDP packet is identical to the payload portion of the first UDP packet only with the above-described changes in the contents of the packet header.
And the second device modifies the packet header of the second UDP packet to be used as a third UDP packet when receiving the second UDP packet sent by the NAT device, and sends the third UDP packet to the first device through the NAT device.
The third UDP packet constitutes: the source address is a destination address of the second UDP packet, the destination address is a source address of the second UDP packet, the source port number is a destination port number of the second UDP packet, and the destination port number is a source port number of the second UDP packet; the negative payload portion of the packet is consistent with the second UDP packet.
When the second device modifies the header of the second UDP packet, since the second device only reflects the packet, the modified header, that is, the header of the third UDP packet and the header of the second UDP packet only exchange positions of the source port and the destination port, and exchange positions of the source address and the destination address.
The packet header of the third UDP packet specifically is:
source port number 6900, destination port number 5000, and source address 219.239.97.10, destination address 210.25.159.186.
And when receiving the third UDP packet, the NAT device modifies the packet header of the third UDP packet as a fourth UDP packet through NAT mapping and sends the fourth UDP packet to the first device.
The NTA device modifies the packet header of the third UDP packet by using a local mapping relationship, where the modified packet header, that is, the packet header of the fourth UDP packet includes:
the fourth UDP packet constitutes: the source address is a third UDP packet source address, the source port number is a third UDP packet source port number, the destination address is a first device intranet address, and the destination port number is consistent with the first UDP packet source port number.
The fourth UDP packet is payload-aligned with the third UDP packet.
With reference to fig. 2, the details are as follows:
source port number 6900, destination port number 3000, and source address 219.239.97.10, destination address 172.24.20.233.
And when the first device receives the fourth UDP packet sent by the second device, recording the time for receiving the fourth UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the fourth UDP packet.
The method for calculating the network time delay is not improved, and the mode that the time delay is determined by two time points in the existing implementation is used.
In the embodiment of the application, in order to further prevent the UDP packet from being blocked by the firewall when the network performance test is performed, the destination port number of the first UDP packet may be 53; the source port number of the fourth UDP packet is 53. I.e. all port numbers 6900 in fig. 2 are replaced with 53.
In the embodiment of the application, due to the adoption of the UDP protocol, the second equipment can start a plurality of processes or threads, open a plurality of UDP ports and distribute processing tasks to a plurality of CPUs, so that the processing capacity of the whole machine is improved, and the test flow can be improved. The specific implementation process is as follows:
and the second device is further used for starting a plurality of processes or threads and distributing the task of reflecting the UDP packet to a plurality of CPUs for processing.
And the second equipment is further used for configuring a plurality of UDP ports, and the data packets are reflected to the first equipment by using the corresponding UDP ports through the scheduling of the CPU.
That is, the tasks reflected by the data packets are scheduled to different CPUs by multiple threads or multiple processes corresponding to multiple CPUs, and after the processing by the CPUs is finished, the tasks can be sent to the first device through different or the same UDP ports. Compared with the ping test in which only a single CPU is used, the efficiency is greatly improved.
Example two
In this embodiment, the reflecting device is placed on the NAT public network side.
Referring to fig. 3, fig. 3 is a schematic diagram of a network performance testing system according to a second embodiment of the present application. The system comprises: in a network system of a third device, a Network Address Translation (NAT) device and a fourth device, wherein the third device is on the NAT private network side, and the fourth device is on the public network side;
the third device constructs a fifth UDP packet for registration with the NAT device.
And the source address of the fifth UDP packet is an intranet address of the first equipment, the source port is set as a port for receiving the data packet by the equipment, the destination address is an arbitrary address, and the destination port is an arbitrary port number.
When the NAT equipment receives a fifth UDP packet sent by the third equipment, establishing a mapping relation between an internal network address and an internal network UDP port number of the third equipment and an external network address and an external network UDP port number of the second equipment of the external network; that is, a translation record of the intranet address and the intranet source UDP port number of the first device mapped to the extranet address and the extranet source UDP port number of the first device of the extranet is left in the NAT device.
The fourth device constructs a sixth UDP packet and sends the sixth UDP packet to the third device through the NAT device; wherein a payload portion of the fifth UDP packet carries a timestamp for transmitting a sixth UDP packet;
the sixth UDP packet constitutes: the source address is a fourth device address, the source UDP port is a fourth device self-defined port, the destination address is a third device extranet address mapped to the extranet, and the destination port is a third device extranet UDP port number mapped to the extranet.
And when receiving the sixth UDP packet, the NAT device modifies the packet header of the sixth UDP packet to be used as a seventh UDP packet and sends the seventh UDP packet to the third device.
The seventh UDP packet constitutes: the source address is a sixth UDP packet source address, the source port number is a sixth UDP packet source port number, the destination address is a third device intranet address converted into an intranet address by NAT, and the destination port is a third device intranet UDP port number converted by NAT. The payload of the sixth UDP packet and the seventh UDP packet are the same.
And when receiving the seventh UDP packet sent by the NAT device, the third device modifies the packet header of the seventh UDP packet, uses the modified packet header as an eighth UDP packet, and sends the eighth UDP packet to the fourth device.
The eighth UDP packet constitutes: the source address is the destination address of the seventh UDP packet, the source port number is the destination port number of the seventh UDP packet, the destination address is the source address of the seventh UDP packet, and the destination port is the source port number of the seventh UDP packet. The payload of the eighth UDP packet and the seventh UDP packet are the same.
And when receiving the eighth UDP packet, the NAT device modifies the packet header of the eighth UDP packet to serve as a ninth UDP packet, and sends the ninth UDP packet to the fourth device.
The ninth UDP packet is configured to: the source address is the third device external network address mapped to the external network by the third device, the source port number is the third device external network UDP port number mapped to the external network, the destination address is the eighth UDP packet destination address, and the destination port is the eighth UDP packet destination port number. The ninth UDP packet has the same payload as the eighth UDP packet.
And when the fourth device receives the ninth UDP packet, recording the time for receiving the ninth UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the ninth UDP packet.
The fourth device further starts a plurality of processes or threads and distributes the tasks of reflecting the UDP packets to a plurality of CPUs for processing; and configuring a plurality of UDP ports, and using the corresponding UDP ports to reflect the data packets to the third equipment through CPU scheduling.
For scenarios where NAT does not exist:
the network performance test system comprises: a fifth device and a sixth device.
The fifth sending device constructs a tenth UDP packet and sends the tenth UDP packet to the sixth device; the tenth UDP packet carries a timestamp for sending the tenth UDP packet;
when the sixth device receives the tenth UDP packet, the sixth device modifies the packet header of the tenth UDP packet to obtain an eleventh UDP packet, and sends the eleventh UDP packet to the tenth device.
The eleventh UDP packet constitutes: the source address is a tenth UDP packet destination address, the destination address is a tenth UDP packet source address, the source port number is a tenth UDP packet destination port number, and the destination port number is an eleventh UDP packet source port number; the tenth UDP packet has the same payload as the eleventh UDP packet.
And when the fifth device receives the eleventh UDP packet, recording the time for receiving the eleventh UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the eleventh UDP packet.
Based on the same inventive concept, the embodiment of the present application further provides a network performance testing method, which is applied to a network system including a first device, a NAT device, and a second device, where the first device is on a NAT private network side, and the second device is on a public network side. Referring to fig. 4, fig. 4 is a schematic diagram of a network performance testing process applied in the first embodiment. The method comprises the following specific steps:
step 401, a first device constructs a first UDP packet and sends the first UDP packet to a second device through an NAT device; wherein the payload portion of the first UDP packet carries a timestamp for transmitting the first UDP packet.
Step 402, when receiving the first UDP packet, the NAT device modifies the packet header of the first UDP packet through NAT mapping to serve as a second UDP packet, and sends the second UDP packet to the second device.
Step 403, when the second device receives the second UDP packet sent by the NAT device, modifying the packet header of the second UDP packet to be a third UDP packet, and sending the third UDP packet to the first device through the NAT device.
And step 404, when receiving the third UDP packet, the NAT device modifies the packet header of the third UDP packet as a fourth UDP packet through NAT mapping, and sends the fourth UDP packet to the first device.
Step 405, when the first device receives the fourth UDP packet, recording a time for receiving the fourth UDP packet, and calculating a network delay according to the recorded time and a timestamp carried in the fourth UDP packet.
In the embodiment of the application, in order to further prevent the UDP packet from being blocked by the firewall when the network performance test is performed, the destination port number of the first UDP packet may be 53; the source port number of the fourth UDP packet is 53. I.e. all port numbers 6900 in fig. 2 are replaced with 53.
In the embodiment of the application, due to the adoption of the UDP protocol, the second equipment can start a plurality of processes or threads, open a plurality of UDP ports and distribute processing tasks to a plurality of CPUs, so that the processing capacity of the whole machine is improved, and the test flow can be improved. The specific implementation process is as follows:
and the second device is further used for starting a plurality of processes or threads and distributing the task of reflecting the UDP packet to a plurality of CPUs for processing.
And the second equipment is further used for configuring a plurality of UDP ports, and the data packets are reflected to the first equipment by using the corresponding UDP ports through the scheduling of the CPU.
That is, the tasks reflected by the data packets are scheduled to different CPUs by multiple threads or multiple processes corresponding to multiple CPUs, and after the processing by the CPUs is finished, the tasks can be sent to the first device through different or the same UDP ports. Compared with the ping test in which only a single CPU is used, the efficiency is greatly improved.
Based on the same inventive concept, the embodiment of the application also provides a network performance testing method. The method is applied to a network system comprising third equipment, Network Address Translation (NAT) equipment and fourth equipment, wherein the third equipment is arranged on a NAT private network side, and the fourth equipment is arranged on a public network side. Referring to fig. 5, fig. 5 is a schematic diagram illustrating a network performance testing process applied in the second embodiment of the present application. The method comprises the following specific steps:
step 501, the third device constructs a fifth UDP packet for registering in the NAT device.
Step 502, when the NAT device receives the fifth UDP packet sent by the third device, a mapping relationship between the intranet address and the intranet UDP port number of the third device and the extranet address and the extranet UDP port number of the second device in the extranet is established.
Step 503, the fourth device constructs a sixth UDP packet and sends the sixth UDP packet to the third device through the NAT device; wherein the payload part of the fifth UDP packet carries a timestamp for transmitting a sixth UDP packet.
In step 504, when receiving the sixth UDP packet, the NAT device modifies the packet header of the sixth UDP packet to serve as a seventh UDP packet, and sends the seventh UDP packet to the third device.
Step 505, when the third device receives the seventh UDP packet sent by the NAT device, the third device modifies the packet header of the seventh UDP packet, and sends the eighth UDP packet to the fourth device as the modified eighth UDP packet.
Step 506, when receiving the eighth UDP packet, the NAT device modifies the packet header of the eighth UDP packet to serve as a ninth UDP packet, and sends the ninth UDP packet to the fourth device.
Step 507, when the fourth device receives the ninth UDP packet, recording a time for receiving the ninth UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the ninth UDP packet.
The fourth device starts a plurality of processes or threads and distributes the tasks reflecting the UDP packets to a plurality of CPUs for processing;
and configuring a plurality of UDP ports, and using the corresponding UDP ports to reflect the data packets to the third equipment through CPU scheduling.
In summary, the UDP protocol is introduced to enable the UDP packet to successfully pass through the NAT from the private network to the public network and from the public network to the private network, so that the network performance between the private network and the public network side of the NAT can be tested without configuration.
And starting multiple processes or threads on the reflection equipment, namely the second equipment, and scheduling tasks to different CPUs to improve the processing capacity of the whole machine and improve the testing speed.
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 performance test method is characterized in that the method is applied to a network system comprising a first device, a Network Address Translation (NAT) device and a second device, wherein the first device is arranged at the NAT private network side, and the second device is arranged at the public network side; the method comprises the following steps:
the first device constructs a first User Datagram Protocol (UDP) packet and sends the first user datagram protocol packet to the second device through the NAT device; wherein a payload portion of the first UDP packet carries a timestamp for transmitting the first UDP packet;
when receiving the first UDP packet, the NAT equipment modifies the packet header of the first UDP packet as a second UDP packet through NAT mapping and sends the second UDP packet to the second equipment;
when the second device receives a second UDP packet sent by the NAT device, modifying the packet header of the second UDP packet to be used as a third UDP packet, and sending the third UDP packet to the first device through the NAT device;
when receiving the third UDP packet, the NAT device modifies the packet header of the third UDP packet through NAT mapping to serve as a fourth UDP packet, and sends the fourth UDP packet to the first device;
and when the first device receives the fourth UDP packet, recording the time for receiving the fourth UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the fourth UDP packet.
2. The method of claim 1,
the destination port number of the first UDP packet is 53;
the source port number of the fourth UDP packet is 53.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
the second equipment starts a plurality of processes or threads and distributes the tasks reflecting the UDP packets to a plurality of CPUs for processing;
and configuring a plurality of UDP ports, and using the corresponding UDP ports to reflect the data packets to the first equipment through CPU scheduling.
4. A network performance test method is characterized in that the method is applied to a network system comprising third equipment, Network Address Translation (NAT) equipment and fourth equipment, wherein the third equipment is arranged at the NAT private network side, and the fourth equipment is arranged at the public network side; the method comprises the following steps:
the third device constructs a fifth UDP packet for registering in the NAT device;
when the NAT equipment receives a fifth UDP packet sent by the third equipment, establishing a mapping relation between an internal network address and an internal network UDP port number of the third equipment and an external network address and an external network UDP port number of the second equipment of the external network;
the fourth device constructs a sixth UDP packet and sends the sixth UDP packet to the third device through the NAT device; wherein a payload portion of the fifth UDP packet carries a timestamp for transmitting a sixth UDP packet;
when receiving the sixth UDP packet, the NAT device modifies the packet header of the sixth UDP packet to serve as a seventh UDP packet, and sends the seventh UDP packet to the third device;
when the third device receives a seventh UDP packet sent by the NAT device, modifying the packet header of the seventh UDP packet, taking the modified packet header as an eighth UDP packet, and sending the eighth UDP packet to the fourth device;
when receiving the eighth UDP packet, the NAT device modifies the packet header of the eighth UDP packet to serve as a ninth UDP packet, and sends the ninth UDP packet to the fourth device;
and when the fourth device receives the ninth UDP packet, recording the time for receiving the ninth UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the ninth UDP packet.
5. The method of claim 4, further comprising:
the fourth device starts a plurality of processes or threads and distributes the tasks reflecting the UDP packets to a plurality of CPUs for processing;
and configuring a plurality of UDP ports, and using the corresponding UDP ports to reflect the data packets to the third equipment through CPU scheduling.
6. A network performance testing system, the system comprising: the system comprises a first device, a Network Address Translation (NAT) device and a second device, wherein the first device is arranged on a NAT private network side, and the second device is arranged on a public network side;
the first device constructs a first User Datagram Protocol (UDP) packet and sends the first user datagram protocol packet to the second device through the NAT device; wherein a payload portion of the first UDP packet carries a timestamp for transmitting the first UDP packet; when a fourth UDP packet sent by the second equipment is received, recording the time for receiving the fourth UDP packet, and calculating the network delay according to the recorded time and a timestamp carried in the fourth UDP packet;
the NAT equipment modifies the packet header of the first UDP packet as a second UDP packet through NAT mapping when receiving the first UDP packet, and sends the second UDP packet to the second equipment; when the third UDP packet is received, modifying the packet header of the third UDP packet as a fourth UDP packet through NAT mapping, and sending the fourth UDP packet to the first equipment;
and the second device modifies the packet header of the second UDP packet to be used as a third UDP packet when receiving the second UDP packet, and sends the third UDP packet to the first device through the NAT device.
7. The system of claim 6,
the destination port number of the first UDP packet is 53;
the source port number of the fourth UDP packet is 53.
8. The system of claim 6 or 7,
the second device is further used for starting a plurality of processes or threads and distributing the tasks reflecting the UDP packets to a plurality of CPUs for processing;
and configuring a plurality of UDP ports, and using the corresponding UDP ports to reflect the data packets to the first equipment through CPU scheduling.
9. A network performance testing system, the system comprising: in a network system of a third device, a Network Address Translation (NAT) device and a fourth device, wherein the third device is on the NAT private network side, and the fourth device is on the public network side;
the third equipment constructs a fifth UDP packet for registering in the NAT equipment; when a seventh UDP packet sent by the NAT equipment is received, modifying the packet header of the seventh UDP packet to be used as an eighth UDP packet, and sending the eighth UDP packet to the fourth equipment;
the NAT equipment establishes a mapping relation between an internal network address and an internal network UDP port number of the third equipment and an external network address and an external network UDP port number of the second equipment of the external network when receiving a fifth UDP packet sent by the third equipment; when the sixth UDP packet is received, modifying the packet header of the sixth UDP packet to be used as a seventh UDP packet, and sending the seventh UDP packet to the third equipment; when the eighth UDP packet is received, modifying the packet header of the eighth UDP packet to be used as a ninth UDP packet, and sending the ninth UDP packet to the fourth device;
the fourth device constructs a sixth UDP packet and sends the sixth UDP packet to the third device through the NAT device; wherein a payload portion of the fifth UDP packet carries a timestamp for transmitting a sixth UDP packet; and when the ninth UDP packet is received, recording the time for receiving the ninth UDP packet, and calculating the network delay according to the recorded time and the timestamp carried in the ninth UDP packet.
10. The system of claim 9,
the fourth device further starts a plurality of processes or threads and distributes the tasks of reflecting the UDP packets to a plurality of CPUs for processing; and configuring a plurality of UDP ports, and using the corresponding UDP ports to reflect the data packets to the third equipment through CPU scheduling.
CN201910068423.XA 2019-01-24 2019-01-24 Network performance test method and system Active CN111478821B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910068423.XA CN111478821B (en) 2019-01-24 2019-01-24 Network performance test method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910068423.XA CN111478821B (en) 2019-01-24 2019-01-24 Network performance test method and system

Publications (2)

Publication Number Publication Date
CN111478821A CN111478821A (en) 2020-07-31
CN111478821B true CN111478821B (en) 2022-02-22

Family

ID=71743542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910068423.XA Active CN111478821B (en) 2019-01-24 2019-01-24 Network performance test method and system

Country Status (1)

Country Link
CN (1) CN111478821B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866059B (en) * 2021-01-18 2022-07-15 中国信息通信研究院 Lossless network performance testing method and device based on artificial intelligence application
CN117155832A (en) * 2023-08-30 2023-12-01 广州工程技术职业学院 Multi-terminal non-invasive recording playback test method and system for UDP transmission protocol

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179506A (en) * 2007-11-26 2008-05-14 中兴通讯股份有限公司 Method for private network terminal to detect public network terminal
CN103108054A (en) * 2011-11-11 2013-05-15 中国移动通信集团公司 Method for penetrating through transit server and corresponding server and terminal and system
CN105376254A (en) * 2015-12-08 2016-03-02 尹绍华 Method for detecting whether UPNP (Universal Plug and Play) successfully passes through NAT (Network Address Translators)
CN109067608A (en) * 2018-07-06 2018-12-21 杭州涂鸦信息技术有限公司 A method of measuring and calculating IP packet is from equipment to hop count public network gateway

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7133368B2 (en) * 2002-02-01 2006-11-07 Microsoft Corporation Peer-to-peer method of quality of service (QoS) probing and analysis and infrastructure employing same
CN101159955B (en) * 2007-10-19 2010-12-08 中兴通讯股份有限公司 Service quality measuring method and system based on media gateway control protocol network
GB201101723D0 (en) * 2011-02-01 2011-03-16 Roke Manor Research A method and apparatus for identifier correlation
CN103067301A (en) * 2013-01-17 2013-04-24 广东石油化工学院 Fast and reliable congestion control improved algorithm based on user datagram protocol (UDP)
CN107508732A (en) * 2017-10-18 2017-12-22 盛科网络(苏州)有限公司 The method that flexibly all kinds of OAM messages are carried out with sequence number detection and timestamp detection
CN107682260B (en) * 2017-10-23 2018-10-19 深圳智多豚物联技术有限公司 A kind of fast and reliable network communication method of multipath

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179506A (en) * 2007-11-26 2008-05-14 中兴通讯股份有限公司 Method for private network terminal to detect public network terminal
CN103108054A (en) * 2011-11-11 2013-05-15 中国移动通信集团公司 Method for penetrating through transit server and corresponding server and terminal and system
CN105376254A (en) * 2015-12-08 2016-03-02 尹绍华 Method for detecting whether UPNP (Universal Plug and Play) successfully passes through NAT (Network Address Translators)
CN109067608A (en) * 2018-07-06 2018-12-21 杭州涂鸦信息技术有限公司 A method of measuring and calculating IP packet is from equipment to hop count public network gateway

Also Published As

Publication number Publication date
CN111478821A (en) 2020-07-31

Similar Documents

Publication Publication Date Title
US7738383B2 (en) Traceroute using address request messages
CN101164287A (en) File transfer protocol service performance testing method
CN107579869B (en) Network performance detection method and network equipment
KR20040107424A (en) Method and apparatus for determination of network topology
CN108075949B (en) Method and equipment for realizing RFC2544 in VPWS environment
CN101707617A (en) Message filtering method, device and network device
CN110381071B (en) Message transmission method and device and sender equipment
CN110891285A (en) Transmitting equipment, reflecting equipment, network performance testing method and system
GB2505288A (en) Identifying address translations
CN111478821B (en) Network performance test method and system
CN114389792B (en) WEB log NAT (network Address translation) front-back association method and system
CN1917512B (en) Method for establishing direct connected peer-to-peer channel
US10178015B2 (en) Methods, systems, and computer readable media for testing network equipment devices using connectionless protocols
US20150264141A1 (en) Communication apparatus, information processor, communication method, and computer-readable storage medium
US20050283639A1 (en) Path analysis tool and method in a data transmission network including several internet autonomous systems
CN108093041A (en) Single channel VDI proxy servers and implementation method
CN105991442B (en) Message forwarding method and device
US9804899B2 (en) Communications using the common object request broker architecture (CORBA)
US20230327983A1 (en) Performance measurement in a segment routing network
CN112532468B (en) Network measurement system, method, device and storage medium
CN115022281B (en) NAT penetration method, client and system
CN111158864A (en) Data processing method, device, system, medium, and program
CN109600277A (en) Ipsec tunnel keepalive method and device based on NAT device
CN114205218A (en) Method and system for diagnosing container network fault
WO2016184079A1 (en) Method and device for processing system log message

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