Switch aging test method, equipment and medium
By configuring aging test parameters in the switch and calling aging test scripts, creating a virtual LAN and configuring an inner loopback state, the problems of high cost and low efficiency of traditional switch aging test methods are solved, and efficient and automated aging tests are achieved, reducing the testing cost.
Patent Information
- Application Number
- CN202411862021.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-12-17
AI Technical Summary
Traditional switch aging testing methods are costly and inefficient, and equipment consumables are aging, which increases the testing cost.
By configuring aging test parameters in the switch, calling an aging test script, creating a virtual local area network (VLAN) and configuring an inner loopback state, using the CPU to send aging test packets, forming continuous test traffic, and achieving automated and efficient aging tests.
Improves testing efficiency, simplifies the testing process, reduces hardware and maintenance costs, and enhances test stability and resource utilization.
Smart Images

Figure CN119676136A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a switch aging test method, device and medium. Background Art
[0002] With the rapid development of information technology, digitization, networking and intelligence have become important forces driving the progress of modern society. In this context, as the cornerstone of information transmission, the stability and reliability of network equipment are particularly important. As the core component of network equipment, switches undertake the key tasks of data transmission, storage and processing, and their performance directly affects the normal operation of the entire network system. Switch aging test is an important means to evaluate the durability and reliability of switch products under long-term use and different environmental conditions. Through aging testing, problems and defects in product design can be discovered in time, thereby improving product design, improving product quality, ensuring the qualified rate of factory products, and improving the stability and reliability of switch products.
[0003] The traditional switch aging test method, in order to verify the stability of the switch working for a long time at different temperatures, not only powers on the device and places it in a high temperature environment, but also requires the switch ports to be connected in a serpentine manner through external network cables (optical modules + optical fibers), and the tester is used to continuously flow and test the full port load. After the test is completed, the number of sent and received messages is compared to determine whether the device has passed the aging test.
[0004] During the switch aging test, test traffic needs to be conducted. When the switch equipment is mass-produced, multiple devices are often aged at the same time, which requires a large number of tester ports. The current switch tester equipment is often expensive, resulting in a sharp increase in testing costs. At the same time, the current switch aging solutions all require a serpentine traffic solution composed of an external Ethernet cable or an optical module + cable. First, the switch port wiring will consume a lot of manpower. Second, in a high temperature environment, long-term traffic testing and module plugging and unplugging will cause the equipment consumables to age rapidly, resulting in losses and increasing testing costs. Summary of the invention
[0005] One or more embodiments of the present specification provide a switch aging test method, device, and medium, which are used to solve the technical problems raised by the background technology.
[0006] One or more embodiments of this specification adopt the following technical solutions:
[0007] One or more embodiments of this specification provide a switch aging test method, the method comprising:
[0008] Configuring aging test parameters for the aging test switch, wherein the aging test parameters include a preset aging test time;
[0009] After the aging test switch is powered on, an aging test script corresponding to the aging test switch is called in the system background;
[0010] When the aging test script is running, one or more virtual local area networks (VLANs) are created based on the number of ports of the aging test switch, each pair of ports in the aging test switch is respectively assigned to the same VLAN, each port in each VLAN is configured to be in an inner loopback state, an aging test message is sent to each port in each VLAN by using a CPU, and the aging test message is cyclically sent and received between ports by using the inner loopback state, so as to form a continuous aging test traffic, and perform a persistent performance test on the aging test switch;
[0011] When the test time of the aging test reaches the preset aging test time, the operation of sending and receiving aging test messages between each pair of ports is terminated, and the aging test result of the aging test switch is generated based on the cyclic sending and receiving of aging test messages between ports in each VLAN.
[0012] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0013] Improve test efficiency: By calling the preset aging test script through the system background, the aging test process is automatically executed, reducing manual operations and thus improving test efficiency.
[0014] Simplify the test process: By creating a virtual local area network (VLAN) and configuring the internal loopback status, the complex operation of traditional snake-like serial connection of external network cables is simplified, making the test process more intuitive and easy to manage.
[0015] Reduce testing costs: Use the switch's own ports to perform internal loopback testing, without the need for additional external network cables, reducing hardware costs. At the same time, it reduces the need for tester ports and reduces the purchase and maintenance costs of testers.
[0016] Enhanced test stability: Through continuous aging test traffic, the actual usage environment can be more comprehensively simulated, enhancing the stability test of the switch under long-term operation.
[0017] Improve resource utilization: By creating a virtual VLAN inside the switch, existing port resources can be effectively utilized, allowing multiple devices to perform aging tests at the same time, improving the utilization of test resources.
[0018] Furthermore, the aging test parameters also include a preset aging test flag, and before the aging test script corresponding to the aging test switch is called in the system background, the method also includes:
[0019] Based on the preset aging test flag and the current aging test flag of the aging test switch, determining whether the aging test flag of the aging test switch is in a set state;
[0020] If so, the aging test script corresponding to the aging test switch is called in the system background.
[0021] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0022] Automatic control: By comparing the preset aging test flag and the current aging test flag, the aging test process is automatically controlled. This method can avoid manual intervention, reduce human errors, and improve the accuracy and consistency of the test.
[0023] Status monitoring: By judging the status of the aging test switch flag, the aging test status of the switch can be monitored in real time. If the flag is set, it means that the switch is ready for aging test, which ensures that the test starts at the right time.
[0024] Flexibility in test initiation: The introduction of preset flags makes test initiation more flexible. Test scripts are executed only when certain conditions are met (such as when a flag is set), which helps avoid unnecessary test initiation and saves resources.
[0025] Further, calling the aging test script corresponding to the aging test switch in the system background includes:
[0026] Calling the aging test script corresponding to the aging test switch in the system background;
[0027] The model information of the aging test switch is obtained, and variable information in the aging test script is initialized based on the model information of the aging test switch, wherein the variable information includes one or more of the number of ports, the port type, and the log file type of the aging test switch.
[0028] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0029] Personalized test script: By obtaining the model information of the aging test switch and initializing the variable information in the test script accordingly, the test script can be optimized for the specific model of switch. This method makes the test more personalized and accurate, and improves the effectiveness of the test.
[0030] Enhanced adaptability: Variable information initialized based on switch model information (such as port number, port type, and log file type) can ensure that the test script is compatible with different models of switches, enhancing the adaptability of the test method.
[0031] Test parameter optimization: By setting different test parameters for different models of switches, actual usage scenarios can be simulated more accurately, thereby optimizing test conditions and improving the reliability of test results.
[0032] Further, the port type includes an electrical port and an optical port, and configuring each port in each VLAN to be in an inner loopback state includes:
[0033] If the port type in the VLAN is an electrical port, configure the physical layer device associated with the port to the internal loopback state;
[0034] If the port type in the VLAN is an optical port, the serializer and deserializer associated with the port are configured to be in an internal loopback state.
[0035] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0036] Compatibility support: By supporting both electrical and optical port types, this method can adapt to different types of network devices and enhance the compatibility of the test.
[0037] Simplified test environment: By configuring the ports in each VLAN to be in the internal loopback state, the complexity of external network connections can be avoided, simplifying the test environment and making the test more direct and controllable.
[0038] Further, the aging test result of the aging test switch is generated based on cyclically sending and receiving aging test messages between ports in each VLAN, including:
[0039] Counting a first number of aging test messages cyclically sent between ports in each VLAN, and a second number of aging test messages cyclically received between ports in each VLAN;
[0040] Comparing whether the first data amount and the second data amount of the port in each VLAN are the same;
[0041] If they are the same, it is determined that the aging test switch passes the aging test.
[0042] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0043] Comprehensive test: By cyclically sending and receiving aging test messages between ports in each VLAN, this method can comprehensively test the data forwarding capability of the switch between different VLANs to ensure that the switch can work stably in various network environments.
[0044] Data accuracy: Counting the number of sent and received messages can accurately measure the data transmission performance of the switch and help identify potential problems in the data transmission process.
[0045] Performance evaluation: By comparing the amount of data sent and received, you can evaluate whether the performance of the switch is consistent, thereby determining whether the switch can continuously and stably handle data traffic.
[0046] Further, configuring each port in each VLAN to be in an internal loopback state includes:
[0047] By calling the underlying software development kit SDK interface, each port in each VLAN is configured to be in an internal loopback state.
[0048] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0049] Simplified configuration process: By calling the underlying software development kit (SDK) interface to configure the port, the configuration process of network devices is simplified, reducing manual configuration errors and the time required.
[0050] Furthermore, before using the CPU to send an aging test message to each port in each VLAN, the method further includes:
[0051] Clear the statistics of each port in each VLAN.
[0052] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0053] Initial state consistency: By clearing the statistics of each port, it ensures that the initial state of all ports is consistent before sending the aging test message. This helps to obtain more accurate test results because the test will not be affected by previous data transmission activities.
[0054] Furthermore, the aging test script is an aging test script generated based on Python.
[0055] One or more embodiments of this specification provide a switch aging test device, including:
[0056] at least one processor; and,
[0057] a memory communicatively connected to the at least one processor; wherein,
[0058] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0059] Configuring aging test parameters for the aging test switch, wherein the aging test parameters include a preset aging test time;
[0060] After the aging test switch is powered on, an aging test script corresponding to the aging test switch is called in the system background;
[0061] When the aging test script is running, one or more virtual local area networks (VLANs) are created based on the number of ports of the aging test switch, each pair of ports in the aging test switch is respectively assigned to the same VLAN, each port in each VLAN is configured to be in an inner loopback state, an aging test message is sent to each port in each VLAN by using a CPU, and the aging test message is cyclically sent and received between ports by using the inner loopback state, so as to form a continuous aging test traffic, and perform a persistent performance test on the aging test switch;
[0062] When the test time of the aging test reaches the preset aging test time, the operation of sending and receiving aging test messages between each pair of ports is terminated, and the aging test result of the aging test switch is generated based on the cyclic sending and receiving of aging test messages between ports in each VLAN.
[0063] One or more embodiments of this specification provide a non-volatile computer storage medium storing computer executable instructions, which can achieve the following when executed by a computer:
[0064] Configuring aging test parameters for the aging test switch, wherein the aging test parameters include a preset aging test time;
[0065] After the aging test switch is powered on, an aging test script corresponding to the aging test switch is called in the system background;
[0066] When the aging test script is running, one or more virtual local area networks (VLANs) are created based on the number of ports of the aging test switch, each pair of ports in the aging test switch is respectively assigned to the same VLAN, each port in each VLAN is configured to be in an inner loopback state, an aging test message is sent to each port in each VLAN by using a CPU, and the aging test message is cyclically sent and received between ports by using the inner loopback state, so as to form a continuous aging test traffic, and perform a persistent performance test on the aging test switch;
[0067] When the test time of the aging test reaches the preset aging test time, the operation of sending and receiving aging test messages between each pair of ports is terminated, and the aging test result of the aging test switch is generated based on the cyclic sending and receiving of aging test messages between ports in each VLAN.
[0068] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:
[0069] Improve test efficiency: By calling the preset aging test script through the system background, the aging test process is automatically executed, reducing manual operations and thus improving test efficiency.
[0070] Simplify the test process: By creating a virtual local area network (VLAN) and configuring the internal loopback status, the complex operation of traditional snake-like serial connection of external network cables is simplified, making the test process more intuitive and easy to manage.
[0071] Reduce testing costs: Use the switch's own ports to perform internal loopback testing, without the need for additional external network cables, reducing hardware costs. At the same time, it reduces the need for tester ports and reduces the purchase and maintenance costs of testers.
[0072] Enhanced test stability: Through continuous aging test traffic, the actual usage environment can be more comprehensively simulated, enhancing the stability test of the switch under long-term operation.
[0073] Improve resource utilization: By creating a virtual VLAN inside the switch, existing port resources can be effectively utilized, allowing multiple devices to perform aging tests at the same time, improving the utilization of test resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0075] Figure 1 A schematic diagram of a flow chart of a switch aging test method provided in one or more embodiments of this specification;
[0076] Figure 2 A schematic flow chart of a low-cost, fully automatic Ethernet switch aging test method provided for one or more embodiments of this specification;
[0077] Figure 3A schematic diagram of the structure of a switch aging test device provided in one or more embodiments of this specification. DETAILED DESCRIPTION
[0078] The embodiments of this specification provide a switch aging test method, device and medium.
[0079] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0080] Figure 1 This is a flow chart of a switch aging test method provided in one or more embodiments of this specification, and the flow can be executed by a switch aging test system. Certain input parameters or intermediate results in the flow allow manual intervention and adjustment to help improve accuracy.
[0081] The method steps of the embodiment of this specification are as follows:
[0082] S101, configuring aging test parameters for an aging test switch, wherein the aging test parameters include a preset aging test time.
[0083] In the embodiments of this specification, the purpose of the aging test can be first clarified, such as verifying the long-term operation stability of the switch, detecting potential performance degradation, etc. According to the purpose of the aging test, a reasonable preset aging test time is set. For example, it can be set to 24 hours, 48 hours or longer.
[0084] S102, after the aging test switch is powered on, calling an aging test script corresponding to the aging test switch in the system background.
[0085] In the embodiment of the present specification, it is ensured that the aging test script corresponding to the aging test switch has been prepared and can be run in the background of the switch aging test system.
[0086] S103, when the aging test script is running, one or more virtual local area networks (VLANs) are created based on the number of ports of the aging test switch, each pair of ports in the aging test switch is respectively assigned to the same VLAN, each port in each VLAN is configured to be in an inner loopback state, an aging test message is sent to each port in each VLAN by using the CPU, and the aging test message is cyclically sent and received between ports by using the inner loopback state, so as to form continuous aging test traffic, and perform a persistent performance test on the aging test switch.
[0087] In the embodiments of the present specification, the number of ports of the aging test switch can be confirmed first. According to the number of ports of the switch, create a corresponding number of VLANs in the switch management interface. Assign each pair of ports to the same VLAN. For example, if the switch has 8 ports, 4 VLANs can be created, each containing 2 ports. Configure the ports in each VLAN to an internal loopback state. This can be achieved by setting the link mode of the port to "loopback". At the same time, the aging test script can run continuously to perform persistent testing of the performance of the switch. Performance testing can be used to collect performance indicators such as throughput, latency, packet loss rate, etc., in order to evaluate the performance of the switch.
[0088] S104, when the test time of the aging test reaches the preset aging test time, the operation of sending and receiving aging test messages between each pair of ports is terminated, and based on the cyclic sending and receiving of aging test messages between ports in each VLAN, an aging test result of the aging test switch is generated.
[0089] Furthermore, the aging test parameters also include a preset aging test flag. Before the aging test script corresponding to the aging test switch is called in the system background, it can be determined whether the aging test flag of the aging test switch is in a set state based on the preset aging test flag and the current aging test flag of the aging test switch; if so, the aging test script corresponding to the aging test switch called in the system background is executed.
[0090] It should be noted that the above content can be implemented through the following specific implementation plans:
[0091] Define a flag: Define a preset aging test flag, which can be an environment variable, a parameter in a configuration file, a system variable, or an entry in a database.
[0092] Monitor flag: In the system background, set up a monitoring program or service to regularly check the status of the current aging test flag.
[0093] Comparison logic: Write logic to compare the preset aging test flag with the current aging test flag. If they are consistent and the current flag is in the set state (for example, the value is 1 or turned on), continue to execute the subsequent script.
[0094] Execute script: If the current flag is in the set state, execute the command to call the aging test script corresponding to the aging test switch in the system background.
[0095] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0096] Automatic control: By comparing the preset aging test flag and the current aging test flag, the aging test process is automatically controlled. This method can avoid manual intervention, reduce human errors, and improve the accuracy and consistency of the test.
[0097] Status monitoring: By judging the status of the aging test switch flag, the aging test status of the switch can be monitored in real time. If the flag is set, it means that the switch is ready for aging test, which ensures that the test starts at the right time.
[0098] Flexibility in test initiation: The introduction of preset flags makes test initiation more flexible. Test scripts are executed only when certain conditions are met (such as when a flag is set), which helps avoid unnecessary test initiation and saves resources.
[0099] Furthermore, when the aging test script corresponding to the aging test switch is called in the system background, the aging test script corresponding to the aging test switch can be called in the system background; the model information of the aging test switch is obtained, and the variable information in the aging test script is initialized based on the model information of the aging test switch, and the variable information includes one or more of the number of ports, port type and log file type of the aging test switch.
[0100] It should be noted that the above content can be implemented through the following specific implementation plans:
[0101] Model identification: Develop or use existing system commands or tools to obtain the model information of the burn-in test switch. This may require accessing the switch's management interface or querying through a network management protocol such as SNMP.
[0102] Variable definition: Define variables in the aging test script, including port number, port type, and log file type.
[0103] Model information association: Set the corresponding variable value according to the obtained switch model information.
[0104] Background execution: Ensure that the aging test script can be executed in the system background. You may need to set it as a system service or use a cron job.
[0105] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0106] Personalized test script: By obtaining the model information of the aging test switch and initializing the variable information in the test script accordingly, the test script can be optimized for the specific model of switch. This method makes the test more personalized and accurate, and improves the effectiveness of the test.
[0107] Enhanced adaptability: Variable information initialized based on switch model information (such as port number, port type, and log file type) can ensure that the test script is compatible with different models of switches, enhancing the adaptability of the test method.
[0108] Test parameter optimization: By setting different test parameters for different models of switches, actual usage scenarios can be simulated more accurately, thereby optimizing test conditions and improving the reliability of test results.
[0109] Furthermore, the port types include electrical ports and optical ports. When each port in each VLAN is configured as an inner loopback state, if the port type in the VLAN is an electrical port, the physical layer device (PHY) associated with the port is configured as an inner loopback state; if the port type in the VLAN is an optical port, the serializer and deserializer (serdes) associated with the port are configured as an inner loopback state.
[0110] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0111] Compatibility support: By supporting both electrical and optical port types, this method can adapt to different types of network devices and enhance the compatibility of the test.
[0112] Simplified test environment: By configuring the ports in each VLAN to be in the internal loopback state, the complexity of external network connections can be avoided, simplifying the test environment and making the test more direct and controllable.
[0113] Further, when generating the aging test result of the aging test switch based on the cyclic sending and receiving of aging test messages between ports in each VLAN, a first number of aging test messages cyclically sent between ports in each VLAN and a second number of aging test messages cyclically received between ports in each VLAN can be counted; and the first data volume and the second volume of the ports in each VLAN are compared to see whether they are the same; if they are the same, it is determined that the aging test switch has passed the aging test.
[0114] In the embodiments of the present specification, starting from one port in each VLAN, aging test messages can be cyclically sent to other ports in the same VLAN, and each port in the same VLAN can be configured to receive messages from the sending port. The first number of cyclic transmissions between ports in each VLAN is counted, that is, the number of times the sending end sends messages. The second number of cyclic receptions between ports in each VLAN is counted, that is, the number of messages received by the receiving end. The first data volume (number of transmissions) and the second volume (number of receptions) of the ports in each VLAN are compared to check whether they are completely consistent. If the first data volume and the second volume of the ports in all VLANs are the same, the aging test switch is determined to have passed the test; if there is an inconsistency, the test is determined to have failed.
[0115] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0116] Comprehensive test: By cyclically sending and receiving aging test messages between ports in each VLAN, this method can comprehensively test the data forwarding capability of the switch between different VLANs to ensure that the switch can work stably in various network environments.
[0117] Data accuracy: Counting the number of sent and received messages can accurately measure the data transmission performance of the switch and help identify potential problems in the data transmission process.
[0118] Performance evaluation: By comparing the amount of data sent and received, you can evaluate whether the performance of the switch is consistent, thereby determining whether the switch can continuously and stably handle data traffic.
[0119] Further, when configuring each port in each VLAN to be in the inner loop state, the underlying software development kit SDK interface can be called to configure each port in each VLAN to be in the inner loop state. The port is configured by calling the underlying SDK (Software Development Kit) interface, and the SDK provides an interface for interacting with the underlying hardware.
[0120] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0121] Simplified configuration process: By calling the underlying software development kit (SDK) interface to configure the port, the configuration process of network devices is simplified, reducing manual configuration errors and the time required.
[0122] Furthermore, before using the CPU to send the aging test message to each port in each VLAN, the statistical data of each port in each VLAN may be cleared to ensure that the test data is accurate.
[0123] It should be noted that the embodiments of this specification have the following beneficial effects through the above scheme:
[0124] Initial state consistency: By clearing the statistics of each port, it ensures that the initial state of all ports is consistent before sending the aging test message. This helps to obtain more accurate test results because the test will not be affected by previous data transmission activities.
[0125] Further, the aging test script is an aging test script generated based on Python. Python is an interpreted scripting language, originally designed to write automated scripts (Shell). With the continuous iteration of versions and the addition of new language features, it is increasingly used for independent large-scale project development, covering many fields such as Web application development, data capture, scientific computing and statistics, artificial intelligence and big data, system operation and maintenance, and graphical interface development. Python syntax and dynamic typing, as well as the nature of interpreted languages, make it a programming language for writing scripts and rapidly developing applications on most platforms. With the continuous updating of versions and the addition of new language functions, it is gradually used for the development of independent, large-scale projects. The embodiment of this specification can use python scripts to develop automated aging programs.
[0126] The problem to be solved by the embodiments of this specification is:
[0127] 1. The switch aging program is integrated into the switch network operating system to realize fully automatic processing of the aging process: loading aging configuration, realizing automatic port settings, CPU packet processing, and aging sending and receiving message results statistics and judgment.
[0128] 2. The switch aging flow is transmitted through the internal switching chip SDK interface to control the CPU to send test messages, saving external test equipment resources
[0129] 3. The switch device configures VLAN isolation domains for each test port and sets port self-loop to implement long-term loopback testing of test messages, ensuring the aging test effect. At the same time, it simplifies the aging process and saves the cost of network cables and optical modules.
[0130] In view of the above problems, an object of the present invention is to provide a low-cost fully automatic Ethernet switch aging test method.
[0131] The technical solution adopted by the present invention is to integrate the Python operating environment in the network operating system of the switch, run the aging automation test script, use the script for automatic configuration, use the virtual LAN technology and the CPU to control the switching chip to send the specified message, and realize the aging continuous flow test. After the test is completed, the test demerits are automatically judged and recorded. Figure 2A flow chart of a low-cost, fully automatic Ethernet switch aging test method provided by the embodiment of this specification. Step 1: The switch device is started normally at the corresponding production and testing station. After the aging flag and aging test time are enabled through the CLI command line configuration, the device is powered off. Step 2: The switch device is placed in the aging room, powered on normally, and the software program is loaded and configured normally. After obtaining the aging flag, the Python script of the aging test is automatically called. Step 3: The Python script runs automatically, performs initialization configuration of the device aging according to the device model, divides the switch device ports into twos to form an independent loop, and controls the bottom layer of the switch chip to configure, sets the port PHY / Serdes self-loop, and after the configuration is completed, the CPU controls the sending of aging test messages at each port, and controls the messages to form continuous traffic between the two ports through self-loop and VLAN isolation. Step 4: After the Python script determines that the aging time has arrived, it stops the loopback sending of the aging message through the bottom layer of the chip control. The automated test script obtains the aging test result by comparing the number of messages received by each interface, and records it in the test result file, while clearing the aging test flag and related configuration.
[0132] Most current switches use network operating systems that can easily integrate Python runtime environment support.
[0133] Step 1: After the switch device is started at the production test station, set the aging test time and set the aging test flag through the CLI (Comman Line Interface) aging configuration command line. The relevant configuration is saved in FLASH (non-volatile storage medium).
[0134] Step 2: After that, the switch equipment will be placed in the aging room. After the switch equipment is powered on and the hardware self-test is completed, the bootrom (basic input and output system) starts working and loads the network operating system from the FLASH. The network operating system is loaded into the RAM and runs, and the network operating system is started (the system is in an executable state at this time). The system will load the configuration to the current running environment running-config according to the configuration file of the current switch equipment. In this process, you can judge whether the device is started normally according to the status of the relevant indicator lights of the device, and complete the judgment of whether the relevant device components are normal. After the network operating system is loaded and the various management processes are started normally, the switch device will judge the setting status of the aging test flag. If it is set, the python script of the aging test is called in the system background; otherwise, the switch enters the normal use state.
[0135] Step 3: The corresponding test process will be specified in the aging test script. First, it will obtain the switch device model information to initialize the variable information in the script (number of ports, port type, log file path, etc.). After that, the script will start the relevant background service process, simulate the user logging into the switch CLI interface, and perform basic switch configuration. It includes creating a test VLAN based on the number of ports to isolate and manage test traffic. The test ports are added to the same isolated VLAN in pairs to ensure that they do not communicate directly, but can receive broadcast and multicast traffic from other ports. Before starting the flow test, clear the port statistics.
[0136] Then, by calling the underlying SDK interface, configure the port type. If it is an electrical port, configure the corresponding PHY of the port to loopback inner ring mode. If it is an optical port, configure the corresponding port serdes to loopback inner ring mode. Traverse all ports of the switch and complete the relevant configuration, specifically:
[0137] Call SDK interface: The script configures the port by calling the underlying SDK (Software Development Kit) interface. SDK provides an interface for interacting with the underlying hardware.
[0138] Electrical port configuration: For electrical ports, configure the PHY (physical layer device) corresponding to the port to loopback mode. This mode allows the port to receive the traffic it sends, so as to perform the test.
[0139] Optical port configuration: For optical ports, configure the serdes (serializer-deserializer) corresponding to the port to loopback inner ring mode. Again, this is to achieve local traffic reception.
[0140] Traverse all ports: The script traverses all ports of the switch and completes the above configuration for each port.
[0141] Finally, the SDK is controlled through the central processing unit (CPU) interface to send a specified number of aging test messages at the specified port. Since the ports of the switch device are assigned to an isolated VLAN in pairs, flooding and loopback ensure that the aging test messages are looped back between the specified ports to form a continuous test controllable flow. Specifically:
[0142] The CPU of the switch is responsible for control, and aging test messages are sent on the designated port to perform aging test. After the aging test message is sent from the designated port, the test message will be looped back to the same port because the loopback is set on the port. After the port receives the message, the switch chip will send the data packet to all ports in the same VLAN except the source port through flooding. Since the ports of the switch are configured in groups of two, they are assigned to an isolated VLAN. This means that ports in different VLANs are isolated from each other, and data packets will only be transmitted between ports in the same VLAN. After the message is sent out on another port, the above process is repeated. Through the flooding and loopback mechanisms, the aging test message can be sent cyclically between the designated ports to form a closed-loop test traffic, which means that the message is sent out between the two ports, looped back for reception, processed by the switch chip, and sent again, and so on. Aging tests usually need to run for a long time to ensure the stability of the device or link under long-term operation. In this way, the size of the test traffic can be controlled, making the test results more reliable and repeatable.
[0143] Step 4: The python script runs in the background. When the aging time is reached, the sending and receiving of loopback messages is stopped by breaking the VLAN isolation domain of each port. The automated test script will automatically collect the statistics of the number of messages sent and received on all ports, and obtain the aging test results by comparison. According to the test message sending and receiving technology controlled by the current script, the number of sent messages and the number of received messages in the current message statistics are completely equal to pass the aging test.
[0144] After the aging test is completed, the relevant statistics and analysis results will be recorded in the aging log file for subsequent production test machines to read the information. At the same time, the aging test flag will be automatically cleared. The performance of the device that has completed the aging test is the same as that of a normal device after subsequent startup.
[0145] It should be noted that the aging program in the embodiment of the present specification is integrated in the switch and runs automatically without human intervention, which is convenient for aging of large-scale devices; the aging test flow in the embodiment of the present specification is implemented by self-looping and CPU packet sending, saving the cost of testing instruments and equipment; the embodiment of the present specification uses port self-looping technology, which does not require external cables and optical modules, simplifies the aging test process, and also avoids the expenses of related equipment consumables, reducing costs.
[0146] Figure 3 A schematic diagram of the structure of a switch aging test device provided for one or more embodiments of this specification includes:
[0147] at least one processor; and,
[0148] a memory communicatively connected to the at least one processor; wherein,
[0149] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0150] Configuring aging test parameters for the aging test switch, wherein the aging test parameters include a preset aging test time;
[0151] After the aging test switch is powered on, an aging test script corresponding to the aging test switch is called in the system background;
[0152] When the aging test script is running, one or more virtual local area networks (VLANs) are created based on the number of ports of the aging test switch, each pair of ports in the aging test switch is respectively assigned to the same VLAN, each port in each VLAN is configured to be in an inner loopback state, an aging test message is sent to each port in each VLAN by using a CPU, and the aging test message is cyclically sent and received between ports by using the inner loopback state, so as to form a continuous aging test traffic, and perform a persistent performance test on the aging test switch;
[0153] When the test time of the aging test reaches the preset aging test time, the operation of sending and receiving aging test messages between each pair of ports is terminated, and the aging test result of the aging test switch is generated based on the cyclic sending and receiving of aging test messages between ports in each VLAN.
[0154] One or more embodiments of this specification provide a non-volatile computer storage medium storing computer executable instructions, which can achieve the following when executed by a computer:
[0155] Configuring aging test parameters for the aging test switch, wherein the aging test parameters include a preset aging test time;
[0156] After the aging test switch is powered on, an aging test script corresponding to the aging test switch is called in the system background;
[0157] When the aging test script is running, one or more virtual local area networks (VLANs) are created based on the number of ports of the aging test switch, each pair of ports in the aging test switch is respectively assigned to the same VLAN, each port in each VLAN is configured to be in an inner loopback state, an aging test message is sent to each port in each VLAN by using a CPU, and the aging test message is cyclically sent and received between ports by using the inner loopback state, so as to form a continuous aging test traffic, and perform a persistent performance test on the aging test switch;
[0158] When the test time of the aging test reaches the preset aging test time, the operation of sending and receiving aging test messages between each pair of ports is terminated, and the aging test result of the aging test switch is generated based on the cyclic sending and receiving of aging test messages between ports in each VLAN.
[0159] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
Claims
1. A switch aging test method, characterized in that: include: Configuring aging test parameters for the aging test switch, wherein the aging test parameters include a preset aging test time; After the aging test switch is powered on, an aging test script corresponding to the aging test switch is called in the system background; When the aging test script is running, one or more virtual local area networks (VLANs) are created based on the number of ports of the aging test switch, each pair of ports in the aging test switch is respectively assigned to the same VLAN, each port in each VLAN is configured to be in an inner loopback state, an aging test message is sent to each port in each VLAN by using a CPU, and the aging test message is cyclically sent and received between ports by using the inner loopback state, so as to form a continuous aging test traffic, and perform a persistent performance test on the aging test switch; When the test time of the aging test reaches the preset aging test time, the operation of sending and receiving aging test messages between each pair of ports is terminated, and the aging test result of the aging test switch is generated based on the cyclic sending and receiving of aging test messages between ports in each VLAN.
2. The method according to claim 1, characterized in that The aging test parameters also include a preset aging test flag. Before the aging test script corresponding to the aging test switch is called in the system background, the method also includes: Based on the preset aging test flag and the current aging test flag of the aging test switch, determining whether the aging test flag of the aging test switch is in a set state; If so, the aging test script corresponding to the aging test switch is called in the system background.
3. The method according to claim 1, characterized in that The calling of the aging test script corresponding to the aging test switch in the system background includes: Calling the aging test script corresponding to the aging test switch in the system background; The model information of the aging test switch is obtained, and variable information in the aging test script is initialized based on the model information of the aging test switch, wherein the variable information includes one or more of the number of ports, the port type, and the log file type of the aging test switch.
4. The method according to claim 1, characterized in that: The port types include electrical ports and optical ports, and configuring each port in each VLAN to be in an internal loopback state includes: If the port type in the VLAN is an electrical port, configure the physical layer device associated with the port to the internal loopback state; If the port type in the VLAN is an optical port, the serializer and deserializer associated with the port are configured to be in an internal loopback state.
5. The method according to claim 1, characterized in that The step of generating the aging test result of the aging test switch based on cyclically sending and receiving aging test messages between ports in each VLAN includes: Counting a first number of aging test messages cyclically sent between ports in each VLAN, and a second number of aging test messages cyclically received between ports in each VLAN; Comparing whether the first data amount and the second data amount of the port in each VLAN are the same; If they are the same, it is determined that the aging test switch passes the aging test.
6. The method according to claim 1, characterized in that The step of configuring each port in each VLAN to be in an internal loopback state includes: By calling the underlying software development kit SDK interface, each port in each VLAN is configured to be in the internal loopback state.
7. The method according to claim 1, characterized in that Before using the CPU to send an aging test message to each port in each VLAN, the method further includes: Clear the statistics of each port in each VLAN.
8. The method according to claim 1, characterized in that The aging test script is an aging test script generated based on Python.
9. A switch aging test device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Configuring aging test parameters for the aging test switch, wherein the aging test parameters include a preset aging test time; After the aging test switch is powered on, an aging test script corresponding to the aging test switch is called in the system background; When the aging test script is running, one or more virtual local area networks (VLANs) are created based on the number of ports of the aging test switch, each pair of ports in the aging test switch is respectively assigned to the same VLAN, each port in each VLAN is configured to be in an inner loopback state, an aging test message is sent to each port in each VLAN by using a CPU, and the aging test message is cyclically sent and received between ports by using the inner loopback state, so as to form a continuous aging test traffic, and perform a persistent performance test on the aging test switch; When the test time of the aging test reaches the preset aging test time, the operation of sending and receiving aging test messages between each pair of ports is terminated, and the aging test result of the aging test switch is generated based on the cyclic sending and receiving of aging test messages between ports in each VLAN.
10. A non-volatile computer storage medium, characterized in that: Computer executable instructions are stored, and when the computer executable instructions are executed by a computer, the following can be achieved: Configuring aging test parameters for the aging test switch, wherein the aging test parameters include a preset aging test time; After the aging test switch is powered on, an aging test script corresponding to the aging test switch is called in the system background; When the aging test script is running, one or more virtual local area networks (VLANs) are created based on the number of ports of the aging test switch, each pair of ports in the aging test switch is respectively assigned to the same VLAN, each port in each VLAN is configured to be in an inner loopback state, an aging test message is sent to each port in each VLAN by using a CPU, and the aging test message is cyclically sent and received between ports by using the inner loopback state, so as to form a continuous aging test traffic, and perform a persistent performance test on the aging test switch; When the test time of the aging test reaches the preset aging test time, the operation of sending and receiving aging test messages between each pair of ports is terminated, and the aging test result of the aging test switch is generated based on the cyclic sending and receiving of aging test messages between ports in each VLAN.
Citation Information
Patent Citations
Method for port line-speed transmitting test data frame and Ethernet switchboard
CN101272289A
Aging testing method and device
CN106468747A
Switch port self-checking method and system, terminal and storage medium
CN110278126A
Loopback test method, device, circuit and equipment of communication equipment network port and medium
CN111669255A
Switch port test method, electronic equipment and system
CN113676380A