CN-122027515-A - Method and system for testing ring network link switching time
Abstract
The invention discloses a method and a system for testing ring network link switching time, wherein the method comprises the steps of setting up a testing environment, controlling all network cards of a testing terminal to send data messages, judging that communication is normal without packet loss, issuing configuration instructions to tested network equipment, creating and configuring an ERPS ring network, confirming that the ring state and the ring port state are normal, controlling the network cards connected with the ring port and the non-ring port in a blocking state to send known unicast data messages mutually, judging the type of target faults, and carrying out corresponding link fault operation. Stopping sending the message, and calculating the link switching time corresponding to the target fault type based on the packet loss number and the sending rate of the message. According to the invention, other node equipment in the looped network is simulated through the test terminal, loop network protocol messages are constructed and sent to simulate various loop network link faults, and only one tested equipment and one test terminal are used, so that the rapid, quick and comprehensive loop network link switching time test is realized, the test resources are reduced, and the cost is reduced.
Inventors
- Fang Haiqin
- LUO XIONGHUI
Assignees
- 深圳市厚石网络科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260105
Claims (10)
- 1. The method for testing the ring network link switching time is characterized by comprising the following steps of: step S1, a test environment is built, and three network cards of a test terminal are respectively connected with three ports of tested network equipment; Step S2, controlling each network card of the test terminal to send a test data message, and judging that communication is normal if no packet is lost; step S3, a configuration instruction is sent to the tested network equipment to create an ERPS ring network, three ports for configuring the tested network equipment to connect with a network card are an RPL ring port, a non-RPL ring port and a non-ring port respectively, and the ERPS ring network is confirmed to be in an Idle state according to a ring network normal state message and a issuing ring checking state instruction; Step S4, controlling the network cards connecting the RPL ring port and the non-ring port to mutually send known unicast data messages at the speed of 1000 pps; S5, judging a target fault type, if the target fault type is a local link fault, closing the non-RPL ring port, and if the target fault type is a remote link fault, constructing and sending a ring network fault state message through the test terminal, and confirming that the ERPS ring network is switched to a Protection state; and S6, stopping sending the known unicast data message, and calculating the link switching time corresponding to the target fault type based on the packet loss number and the sending rate of the message.
- 2. The method for testing the ring network link switching time according to claim 1, wherein in step S1, when a testing environment is set up, the first network card, the second network card and the third network card of the testing terminal are respectively connected with the first port, the second port and the third port of the network device to be tested; In step S2, the test terminal controls each network card to send a test data message to the tested network device, counts the packet receiving condition of each network card, and determines that the communication is normal if no packet is lost; In step S3, a configuration instruction is sent to the tested network equipment through the test terminal, so that the tested network equipment creates the ERPS ring network, the first port is configured as an RPL ring port, the second port is configured as a non-RPL ring port, the third port is configured as a non-ring port, and after the test terminal receives a ring network normal state message sent by the network equipment, a ring state checking instruction is issued, and the ERPS ring network is confirmed to be in an idle state.
- 3. The method according to claim 2, wherein in step S4, the first network card and the third network card are controlled by the test terminal to send the known unicast data message at a rate of 1000 pps; In step S5, judging a target fault type according to a test requirement, if the target fault type is a local link fault, configuring the second port to be in a closed state through the test terminal, after receiving a ring network fault state message sent by the tested network equipment, issuing a ring state checking instruction to confirm that the ERPS ring network is in a Protection state, if the target fault type is a remote node link fault, simulating a remote node to construct a ring network fault state message through the test terminal, and sending the ring network fault state message to the tested network equipment through a second network card; in step S6, the test terminal controls the first network card and the third network card to stop sending the known unicast data message, and calculates the link switching time corresponding to the target failure type based on the packet loss number and the sending rate of the message.
- 4. The method for testing ring network link switching time according to claim 3, wherein in step S3, when the test terminal reads and confirms that the ERPS ring network is in an Idle state, the first port is in a blocking state, and the second port is in a forwarding state; In step S5, if the target failure type is a local link failure and the ERPS ring network is confirmed to be in a Protection state, the first port is switched to a forwarding state, and the second port is switched to a blocking state, and if the target failure type is a remote link failure and the ERPS ring network is confirmed to be in a Protection state, the first port is switched to a forwarding state, and the second port is kept in the forwarding state.
- 5. The method for testing ring network link switching time according to claim 3, wherein the formula for calculating the link switching time corresponding to the target failure type is: t= (Tx 3-Rx2-Rx 1)/message transmission rate; wherein T is the link switching time, tx3 is the number of messages sent by the third network card, rx2 is the number of messages received by the second network card, and Rx1 is the number of messages received by the first network card.
- 6. The method of claim 1, wherein the local link failure comprises local link failover and local link switching, and the remote link failure comprises remote link failover and remote link switching.
- 7. The method for testing the ring network link switching time according to claim 1, wherein the test terminal is a PC, and the network device to be tested is a switch.
- 8. The method for testing ring network link switching time according to claim 1, wherein the test data message and the known unicast data message are two-layer data messages, and the ring network failure state message and the ring network normal state message are ring network protocol messages.
- 9. A test system for ring network link switching time, configured to execute the test method for ring network link switching time according to any one of claims 1 to 8, including a test terminal and a network device under test, where three network cards of the test terminal are respectively connected to three ports of the network device under test.
- 10. The system for testing the ring network link switching time according to claim 9, wherein the test terminal is internally provided with an automation control module, a message construction module, a state analysis module and a calculation module; The automatic control module is used for controlling a test flow, and comprises environment verification, ring network configuration, port state control and message sending start and stop; The message construction module is used for constructing a test data message, a known unicast data message, a ring network normal state message and a ring network fault state message; The state analysis module is used for receiving a protocol message returned by the network equipment to be tested and analyzing the working state and the port state of the ERPS ring network; The calculation module is used for recording the packet loss number and the sending rate of the message and calculating the link switching time according to a preset formula.
Description
Method and system for testing ring network link switching time Technical Field The invention relates to the technical field of automatic testing, in particular to a method and a system for testing ring network link switching time. Background ERPS (ETHERNET RING Protection Switching) is used as an Ethernet ring network protection technology, can provide millisecond-level link redundancy protection for a ring network topology network, and meets the severe requirements of two-layer Ethernet on the fault switching time. In the ERPS ring network, the nodes are divided into a main node, a neighbor node and a common node, RPL (Ring Protection Link) links between the main node and the neighbor node are in a blocking state in a normal state, the rest links are in a forwarding state, and when the links fail, the main node switches the RPL port into the forwarding state, so that the ring network communication is ensured to be recovered to be normal. In order to verify the millisecond link switching time of the ERPS ring network, the existing test method generally needs a plurality of switches to build a test environment, and cooperates with a professional network tester to connect the ring network nodes for packet sending test, and the switching time is calculated based on a message statistical result by disconnecting and connecting each node link. However, the method has the obvious defects that a large amount of switch resources are occupied, networking cost is high, the test cost is further increased by relying on a professional network tester, the test flow is complicated, the link disconnection and connection are required to be manually interfered, the test efficiency is low, and the coverage scene is limited. Disclosure of Invention In order to solve the problems of the prior art that the switch resources are occupied more, the testing cost is high, the operation is complicated and the coverage scene is limited in the ring network link switching time test, the invention provides a ring network link switching time test method and system, and the ring network link switching time test is realized conveniently, rapidly and comprehensively on the premise of reducing the testing resource consumption and the cost. The technical scheme of the invention is as follows: in a first aspect, the present invention provides a method for testing ring network link switching time, including: step S1, a test environment is built, and three network cards of a test terminal are respectively connected with three ports of tested network equipment; Step S2, controlling each network card of the test terminal to send a test data message, and judging that communication is normal if no packet is lost; step S3, a configuration instruction is sent to the tested network equipment to create an ERPS ring network, three ports for configuring the tested network equipment to connect with a network card are an RPL ring port, a non-RPL ring port and a non-ring port respectively, and the ERPS ring network is confirmed to be in an Idle state according to a ring network normal state message and a issuing ring checking state instruction; Step S4, controlling the network cards connecting the RPL ring port and the non-ring port to mutually send known unicast data messages at the speed of 1000 pps; S5, judging a target fault type, if the target fault type is a local link fault, closing the non-RPL ring port, and if the target fault type is a remote link fault, constructing and sending a ring network fault state message through the test terminal, and confirming that the ERPS ring network is switched to a Protection state; and S6, stopping sending the known unicast data message, and calculating the link switching time corresponding to the target fault type based on the packet loss number and the sending rate of the message. In step S1, when a test environment is set up, the first network card, the second network card and the third network card of the test terminal are respectively connected with the first port, the second port and the third port of the network device to be tested; In step S2, the test terminal controls each network card to send a test data message to the tested network device, counts the packet receiving condition of each network card, and determines that the communication is normal if no packet is lost; In step S3, a configuration instruction is sent to the tested network equipment through the test terminal, so that the tested network equipment creates the ERPS ring network, the first port is configured as an RPL ring port, the second port is configured as a non-RPL ring port, the third port is configured as a non-ring port, and after the test terminal receives a ring network normal state message sent by the network equipment, a ring state checking instruction is issued, and the ERPS ring network is confirmed to be in an idle state. As a preferred scheme of the present invention, in step S4, the test terminal controls the first network card