Automatic testing method and device for service quality field, equipment, storage medium and computer program product
By establishing remote management sessions and automated configuration, the problem of low efficiency in service quality field testing was solved, and an efficient automated testing process was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-07
AI Technical Summary
Existing service quality field testing is inefficient, relies on cumbersome manual operations, and is prone to omissions.
By acquiring the management access information of the network device under test, a remote management session is established, and preset configuration commands are issued to determine the output queue and enable queue congestion management. The traffic generation device is controlled to generate packet capture files, and the actual values of the congestion notification subfield are automatically compared.
It automates the testing of service quality fields, reduces manual operations and repetitive steps, and improves testing efficiency and result consistency.
Smart Images

Figure CN121814686A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of field testing, in particular to a quality of service field automatic testing method, device, equipment, storage medium and computer program product. BACKGROUND
[0002] The quality of service (QoS) mechanism is usually used to control the forwarding priority and congestion handling strategy of different service packets in the network device. In actual deployment, the network device often needs to classify the packets based on the service classification field in the packet header, and map the packets to the corresponding output queue according to the preset queue validation rule; when the queue is congested, the congestion notification subfield in the packet header may also be marked to meet the verification needs of the congestion handling process. The existing test and verification of QoS related fields (such as the service classification field and the congestion notification subfield contained therein) are usually completed manually: the tester needs to complete the configuration of the traffic generation device and the network device under test respectively, and after the flow is started, the packet is captured at the receiving end, and then the target packet in the captured file is analyzed one by one to check the actual value of the congestion notification subfield, and compared with the field value set before the flow is started. This kind of process often involves multiple device logins, command issuing, packet capturing starting and stopping, and field checking operations, which are multiple and dependent on manual judgment, and the test process is tedious, repetitive and prone to omissions, making the efficiency of the quality of service field test suboptimal. Therefore, how to improve the efficiency of the quality of service field test has become a technical problem to be solved. SUMMARY
[0003] The main purpose of the present application is to provide a quality of service field automatic testing method, device, equipment, storage medium and computer program product, which aims to solve the technical problem of how to improve the efficiency of the quality of service field test.
[0004] To achieve the above-mentioned purpose, the present application provides a quality of service field automatic testing method, which comprises the following steps: Obtain the management access information of the network device under test, and establish a remote management session with the network device under test based on the management access information; Issue a preset first configuration instruction to the network device under test through the remote management session, so that the network device under test determines the output queue based on a preset first queue validation rule, and enables the queue congestion management associated with the congestion notification subfield for the output queue; Control the traffic generation device to create at least two test flows pointing to the receiving port, set the initial value of the packet header field for the test flow, start the packet capturing of the receiving port and send the test flow to generate a captured file; parsing the packet capture file to obtain an actual value of the congestion notification subfield corresponding to the test traffic, and comparing the actual value with the initial value of the packet header field to obtain a first verification result; under the remote management session, issuing a preset second configuration instruction to the network device under test to switch to a preset second queue validation rule, and repeatedly performing the packet capturing and comparison based on the second configuration instruction to obtain a second verification result, and generating a target test result according to the first verification result and the second verification result.
[0005] In an embodiment, the step of obtaining management access information of the network device under test and establishing a remote management session with the network device under test based on the management access information comprises: obtaining a management parameter set corresponding to the network device under test, the management parameter set at least including device identification information, management address information, management interface identification information, and authentication information, and taking the management parameter set as the management access information; generating a remote management connection parameter based on the management access information, and selecting a remote management protocol matching the remote management connection parameter according to the management interface identification information to create a connection object, controlling the connection object to initiate a connection request to the management address information and submit the authentication information; obtaining a session handle corresponding to the connection object after the connection request completes authentication, and maintaining session validity based on the session handle to establish a remote management session with the network device under test.
[0006] In an embodiment, the step of issuing a preset first configuration instruction to the network device under test through the remote management session to enable the network device under test to determine an output queue based on a preset first queue validation rule, and enable queue congestion management associated with a congestion notification subfield for the output queue comprises: issuing a first sub-configuration related to port forwarding to the network device under test through the remote management session to enable at least one port related to the test traffic forwarding to retain packet header information including the packet header field when forwarding a packet; after the first sub-configuration takes effect, issuing a second sub-configuration related to queue validation rules to the network device under test through the remote management session to enable the network device under test to determine an output queue based on service classification information in the packet header field and in combination with a link layer priority identifier; after the preset first queue validation rule takes effect, issuing a third sub-configuration related to queue congestion management to the network device under test through the remote management session to enable the network device under test to enable queue congestion management associated with the congestion notification subfield for the output queue.
[0007] In an embodiment, the step of creating at least two paths of test traffic directed to the receiving port by the control traffic generation device, setting initial values of the message header fields for the test traffic, starting packet capturing of the receiving port, and sending the test traffic to generate a packet capture file, comprises: controlling the traffic generation device to create test port objects corresponding to the sending side port of the network device under test and the receiving port, and respectively generating at least two paths of test traffic with different source port identifiers and the same receiving port identifier based on the test port objects; based on the test traffic, respectively configuring initial values of the message header fields corresponding to each test traffic, and associating the initial values of the message header fields with corresponding flow identifiers; after completing the configuration of the initial values of the message header fields, controlling the traffic generation device to start packet capturing at the receiving port and generate a packet capture identifier, sending the at least two paths of test traffic based on the packet capture identifier and stopping packet capturing after sending to save a packet capture file, thereby starting packet capturing of the receiving port and sending the test traffic to generate a packet capture file.
[0008] In an embodiment, the step of analyzing the packet capture file to obtain actual values of the congestion notification sub-fields corresponding to the test traffic, and comparing the actual values with the initial values of the message header fields to obtain a first verification result, comprises: obtaining the packet capture file and filtering messages in the packet capture file based on the flow identifiers corresponding to the test traffic to obtain a target message set corresponding to the test traffic; performing network layer header analysis on each target message in the target message set to extract the congestion notification sub-fields in the message header fields, and generating a set of actual values of the congestion notification sub-fields corresponding to the flow identifiers; based on the flow identifiers, matching the set of actual values of the congestion notification sub-fields with the initial values of the message header fields and performing field consistency comparison, and summarizing the comparison results to obtain a first verification result corresponding to the preset first queue validation rule.
[0009] In an embodiment, the step of issuing a preset second configuration instruction to the network device under test under the remote management session to switch to a preset second queue validation rule, and repeatedly performing the packet capturing and comparison based on the second configuration instruction to obtain a second verification result, and generating a target test result according to the first verification result and the second verification result, comprises: The preset second configuration instruction related to the queue validation mode switching is issued to the network device under test under the remote management session, so that the network device under test is switched from the preset first queue validation rule to the preset second queue validation rule, and a plurality of interfaces related to the test traffic forwarding are configured and validated based on an interface support configuration associated with the preset second queue validation rule. After the preset second queue validation rule is validated, the traffic generation device is controlled to perform packet capturing and generate a second packet capturing file using the at least two paths of test traffic and the corresponding initial values of the packet header fields, and field extraction and field consistency comparison are performed on the second packet capturing file, so that the packet capturing and comparison are repeatedly performed to obtain a second verification result corresponding to the preset second queue validation rule. The first verification result and the second verification result are obtained and associated and summarized to generate a target test result.
[0010] In addition, in order to achieve the above-mentioned purpose, the application further provides a service quality field automatic testing device, which comprises: A session establishment module is configured to obtain management access information of a network device under test, and establish a remote management session with the network device under test based on the management access information. A queue congestion module is configured to issue a preset first configuration instruction to the network device under test through the remote management session, so that the network device under test determines an output queue based on a preset first queue validation rule, and enables queue congestion management associated with a congestion notification subfield for the output queue. A packet capturing and generating module is configured to control a traffic generation device to create at least two paths of test traffic directed to a receiving port, set initial values of packet header fields for the test traffic, start packet capturing of the receiving port, and send the test traffic to generate a packet capturing file. An comparison and verification module is configured to analyze the packet capturing file to obtain actual values of the congestion notification subfield corresponding to the test traffic, and compare the actual values with the initial values of the packet header fields to obtain a first verification result. A target module is configured to issue a preset second configuration instruction to the network device under test under the remote management session to switch to a preset second queue validation rule, and repeatedly perform the packet capturing and comparison based on the second configuration instruction to obtain a second verification result, and generate a target test result according to the first verification result and the second verification result.
[0011] In addition, to achieve the above object, the application further provides a service quality field automatic testing device, which comprises a memory, a processor and a service quality field automatic testing program stored in the memory and executable on the processor, and the service quality field automatic testing program is configured to implement the steps of the service quality field automatic testing method according to any one of the above embodiments.
[0012] In addition, to achieve the above object, the application further provides a storage medium, which stores a service quality field automatic testing program, and the service quality field automatic testing program implements the steps of the service quality field automatic testing method when executed by a processor.
[0013] In addition, to achieve the above object, the application further provides a computer program product, which comprises a computer program, and the computer program implements the steps of the service quality field automatic testing method when executed by a processor.
[0014] The application obtains the management access information of the network device to be tested, establishes a remote management session with the network device to be tested based on the management access information, issues a preset first configuration instruction to the network device to be tested through the remote management session, so that the network device to be tested determines the output queue based on a preset first queue validation rule, and enables the queue congestion management associated with the congestion notification subfield for the output queue; controls the traffic generation device to create at least two test traffics directed to the receiving port, sets the initial value of the packet header field for the test traffics, starts the packet capturing of the receiving port, and sends the test traffics to generate a packet capturing file; parses the packet capturing file to obtain the actual value of the congestion notification subfield corresponding to the test traffics, and compares the actual value with the initial value of the packet header field to obtain a first verification result; issues a preset second configuration instruction to the network device to be tested under the remote management session to switch to a preset second queue validation rule, and repeats the packet capturing and comparison based on the second configuration instruction to obtain a second verification result, and generates a target test result according to the first verification result and the second verification result. The application establishes a remote management session with the network device to be tested and automatically issues the first / second configuration instruction under the session, realizes the unified configuration and rule switching of the queue validation rule and the queue congestion management, controls the traffic generation device to create at least two test traffics at one time and write the initial value of the packet header field, automatically parses the actual value of the congestion notification subfield after the packet capturing file is generated at the receiving port, compares the initial value to output the first / second verification result, and finally summarizes the two verification results to generate the target test result, so that the originally scattered and repeated "configuration-flowing-packet capturing-packet checking and comparison-switching and retesting" process is connected into a closed-loop automatic execution process, the manual operation and repeated testing steps are reduced, and the service quality field testing efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0015] Figure 1 Flowchart of the first embodiment of the service quality field automatic testing method of the present application; Figure 2 Sub-flowchart of the second embodiment of the service quality field automatic testing method of the present application; Figure 3 Sub-flowchart of the third embodiment of the service quality field automatic testing method of the present application; Figure 4 Networking diagram of the automatic testing module in the embodiment of the service quality field automatic testing method of the present application; Figure 5 Module structure diagram of the service quality field automatic testing device of the embodiment of the present application; Figure 6 Device structure diagram of the hardware running environment involved in the service quality field automatic testing method of the embodiment of the present application.
[0016] The implementation, functional features and advantages of the present application will be further explained with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0017] It should be understood that the specific embodiments described herein are merely intended to explain the present application and not to limit the present application.
[0018] In order to better understand the technical solutions of the present application, the following will be described in detail in combination with the accompanying drawings and specific embodiments.
[0019] It should be noted that a quality of service (QoS) mechanism is usually used to control the forwarding priority and congestion handling strategy of different service packets in a network device. In actual deployment, the network device often needs to classify the packets based on the service classification field in the packet header, and map the packets to the corresponding output queue according to the preset queue validation rule; when the queue is congested, the congestion notification subfield in the packet header may also be marked to meet the verification needs of the congestion handling process. The existing test verification of QoS related fields (such as the service classification field and the congestion notification subfield contained therein) is usually completed manually: the tester needs to complete the configuration of the traffic generation device and the network device under test respectively, and after the flow is started, the packet is captured at the receiving end, and then the target packet in the captured file is parsed one by one to view the actual value of the congestion notification subfield, and compared with the field value set before the flow is started. This type of process often involves multiple device logins, command issuing, packet capturing starting and stopping, and field checking operations, which are multiple and dependent on manual judgment, and the test process is tedious, repetitive and prone to omissions, making the efficiency of the quality of service field test suboptimal. Therefore, how to improve the efficiency of the quality of service field test has become a technical problem to be solved.
[0020] The main solution of the present application is: obtaining the management access information of the network device under test, and establishing a remote management session with the network device under test based on the management access information; issuing a preset first configuration instruction to the network device under test through the remote management session, so that the network device under test determines the output queue based on the preset first queue validation rule, and enables the queue congestion management associated with the congestion notification subfield for the output queue; control the traffic generation device to create at least two test flows pointing to the receiving port, set the initial value of the packet header field for the test flow, start the packet capturing of the receiving port and send the test flow to generate the captured file; parse the captured file to obtain the actual value of the congestion notification subfield corresponding to the test flow, and compare the actual value with the initial value of the packet header field to obtain a first verification result; issue a preset second configuration instruction to the network device under test under the remote management session to switch to a preset second queue validation rule, and repeat the packet capturing and comparison based on the second configuration instruction to obtain a second verification result, and generate a target test result according to the first verification result and the second verification result.
[0021] The application establishes a remote management session with a to-be-tested network device and automatically issues first / second configuration instructions under the session, realizes unified configuration and rule switching of queue taking effect rules and queue congestion management, controls a traffic generation device to create at least two test traffics and write initial values of message header fields at one time, automatically analyzes actual values of congestion notification sub-fields after a capture file is generated by capturing packets at a receiving port, compares the actual values with the initial values to output first / second verification results, and finally generates target test results by summarizing the two verification results, so that the originally scattered and repeated "configuration-flow generation-packet capturing-packet checking-switching and retesting" process is connected into a closed-loop automatic execution process, manual operation and repeated testing steps are reduced, and service quality field testing efficiency is improved.
[0022] It should be noted that the execution subject of the method of the embodiment can be a computing service device with data processing, network communication and program running functions, or a service quality field automatic testing device with the same or similar functions. The embodiment and the following embodiments will be described taking the service quality field automatic testing device as an example.
[0023] Based on this, the first embodiment of the service quality field automatic testing method of the application is proposed, please refer to Figure 1 , Figure 1 The flowchart of the first embodiment of the service quality field automatic testing method of the application is shown in the figure.
[0024] In the embodiment, the service quality field automatic testing method comprises the following steps: S1: Obtain management access information of a to-be-tested network device, and establish a remote management session with the to-be-tested network device based on the management access information; It should be noted that the to-be-tested network device refers to a network device whose service quality related forwarding and queue processing behavior is tested. The management access information refers to a set of parameters required for accessing and managing the to-be-tested network device. The remote management session refers to a session connection established between the test control side and the to-be-tested network device for continuously sending management requests and receiving responses.
[0025] Specifically, first, the management access information corresponding to the to-be-tested network device is obtained, and the management access information is structured and arranged so that it can be used to initiate a remote management connection. The management access information can include the management address of the to-be-tested network device, the interface identifier for distinguishing the management channel, the authentication information for completing identity verification, and the identification information corresponding to the device; the test control device can generate connection parameters based on these information and determine a remote management mode matched with the connection parameters, thereby preparing for subsequent management connection.
[0026] Furthermore, based on management access information, a remote connection request is initiated to the network device under test (DUT), and authentication information is submitted during the connection establishment process to complete identity verification. After successful verification, the test control device obtains the session handle or session identifier corresponding to the connection and maintains the connection in an available state by maintaining session validity, such as maintaining heartbeats, state synchronization, or session renewal. Thus, the test control device can perform continuous management operations on the DUT within the same session context, thereby establishing a remote management session with the DUT.
[0027] Because this step first acquires and organizes management access information, and then establishes a reusable remote management session based on this information, multiple configurations and status acquisitions of the network device under test can be completed continuously within the same session context. This reduces the operational overhead caused by repeatedly initiating connections, repeated authentication, and switching management channels multiple times. At the same time, the session handle establishes a stable association between the network device under test and subsequent configuration actions, making it easier to connect configuration execution with the testing process. This provides upfront support for the subsequent automated closed loop of "configuration—flow capture—packet capture—parsing—comparison—switchover and retesting", thereby improving the execution efficiency and consistency of the overall testing process.
[0028] S2: Send a preset first configuration instruction to the network device under test through the remote management session, so that the network device under test determines the output queue based on the preset first queue activation rule, and enables queue congestion management associated with the congestion notification subfield for the output queue; It should be noted that the preset first configuration instruction is a set of management instructions pre-defined to enable the network device under test (DUT) to enter the first test configuration state. The preset first queue activation rule is the first queue determination rule used by the DUT to map service packets to the output queue. The output queue is the queue entity in the DUT used to buffer, schedule, and output service packets. The congestion notification subfield is a subfield related to congestion notification located in the packet header fields. Queue congestion management is a set of management policies for the congestion status of the output queue.
[0029] Specifically, the preset first configuration command is organized and issued under the remote management session, enabling the network device under test (DUT) to enter the configuration state required for the first round of verification. The preset first configuration command includes configuration content related to queue determination, enabling the DUT to determine the output queue according to the preset first queue activation rules when processing service packets of subsequent test traffic. To this end, the preset first configuration command can be used to establish a mapping relationship between "classification-related information in the service packet header field" and "output queue," and this mapping relationship can be used by the DUT for queue selection.
[0030] Further, after the output queue is determined according to the preset first queue validation rule, the congestion management related configuration content in the preset first configuration instruction is continued to be issued under the remote management session, so as to enable the queue congestion management associated with the congestion notification subfield for the output queue. Specifically, the network device under test introduces the processing logic for the congestion notification subfield in the congestion management strategy of the output queue, so that after the service packet of the subsequent test flow enters the output queue determined by the preset first queue validation rule, the congestion notification subfield can be associated and processed in the congestion management process of the output queue, thereby realizing the determination of the output queue based on the preset first queue validation rule and the enablement of the queue congestion management associated with the congestion notification subfield for the output queue.
[0031] Since this step issues the preset first configuration instruction under the remote management session, the determination of the queue validation rule and the enablement of the congestion management of the output queue are completed in the same configuration link, and the corresponding relationship between the congestion management and the congestion notification subfield can be verified and utilized subsequently, so that consistent and reusable device-side running conditions can be provided for the packet capture and analysis of the subsequent test flow: after the test flow enters the output queue determined by the preset first queue validation rule, the congestion notification subfield thereof is within the associated processing range of the queue congestion management, and then the subsequent packet capture-analysis- comparison can be directly carried out around the subfield, reducing repeated configuration and verification caused by inconsistent device configuration or rule invalidation, and improving the execution efficiency and consistency of the service quality field test from the process.
[0032] S3: The control flow generation device creates at least two paths of test flow pointing to the receiving port, sets initial values of the packet header field for the test flow, starts packet capture of the receiving port, and sends the test flow to generate a packet capture file; It should be noted that the flow generation device is a device or system for generating and sending test packets according to a preset flow model. The receiving port is a port for receiving test packets corresponding to the test flow. The test flow is a set of packet flows generated by the flow generation device for triggering and verifying the processing logic of the network device under test. The initial value of the packet header field refers to the reference value written into the packet header field before sending the test packet. Packet capture is a process of capturing and recording the received test packet at the receiving port.
[0033] Specifically, the flow generating device is controlled to create a test port object corresponding to the sending-side port and the receiving port, and to generate at least two test flows directed to the receiving port based on the test port object; each test flow has a distinguishable flow identifier, so that the packets of different test flows can be associated and identified in a subsequent capture file. Then, the test control device configures an initial value of a packet header field for each of the at least two test flows, and associates the initial value of the packet header field with the corresponding flow identifier, to form reference data for subsequent field checking.
[0034] Further, after the test flows and the initial values of the packet header fields are configured, the flow generating device is controlled to start packet capturing at the receiving port, and to generate a capture identifier corresponding to the current packet capturing; while the packet capturing is in the on state, the flow generating device is controlled to send the at least two test flows, so that the test packets arrive at the receiving port and are recorded; after a preset packet capturing end condition is met, the packet capturing is stopped, and a capture file is saved based on the capture identifier, so that the packet capturing at the receiving port is started, and the test flows are sent to generate a capture file.
[0035] Since this step completes the series of "creation of multiple test flows—writing of initial values of fields—packet capturing at the receiving port—packet sending to generate a capture file" in the same process, and each test flow and the initial value of the corresponding packet header field are associated and traceable through the flow identifier, the target packet can be directly located according to the flow identifier when the capture file is analyzed subsequently, and the actual value of the field is extracted for comparison, so that the operation costs such as scattered flow building, repeated packet capturing, and manual recording of field reference values in traditional tests are reduced; meanwhile, the multiple test flows form a sample set that can be uniformly analyzed in the same capture file, the number of repeated flow building and packet capturing is reduced, and thus the execution efficiency and result consistency of the service quality field test are improved.
[0036] S4: analyzing the capture file to obtain an actual value of the congestion notification subfield corresponding to the test flow, and comparing the actual value with the initial value of the packet header field to obtain a first verification result; It should be noted that the actual value refers to a field value corresponding to the congestion notification subfield obtained by analyzing a target packet in the capture file. The first verification result refers to verification conclusion data generated according to the comparison relationship between the actual value and the initial value of the packet header field for a test round corresponding to a preset first configuration instruction.
[0037] Specifically, after obtaining the packet capture file, the packets in the capture file are parsed and prepared. The packets are then filtered based on the flow identifier, source / destination address information, or port association information associated with the test traffic to obtain a target packet set corresponding to the test traffic. This target packet set is used to limit the parsing objects for subsequent field extraction, ensuring that the field values extracted from the packet capture file correspond to the test traffic. Subsequently, the test control device performs network layer packet header parsing on each target packet in the target packet set, locating the congestion notification sub-field from the packet header fields and extracting it to form a set of actual values for the congestion notification sub-field corresponding to the flow identifier. This achieves the goal of "parsing the packet capture file to obtain the actual values of the congestion notification sub-field corresponding to the test traffic."
[0038] Furthermore, after obtaining the actual value set of the congestion notification subfield, the actual values are matched with the initial values of the packet header fields based on the flow identifier, and a field consistency comparison is performed. This comparison may include generating field consistency judgment information for each test traffic stream and summarizing the judgment information from multiple test traffic streams to form verification conclusion data corresponding to this round of testing. Thus, the test control device can output a first verification result based on the comparison result between the actual values and the initial values of the packet header fields.
[0039] Because this step uses packet capture files as a unified data carrier, it directly parses the congestion notification subfield after filtering the target packet set corresponding to the test traffic to form the actual value set. Then, based on the flow identifier, it matches and compares the actual values with the initial values of the packet header fields and outputs the first verification result. This allows field extraction, benchmark comparison, and result generation to be completed in a closed loop within the same parsing link, thus reducing the steps of manually locating fields packet by packet, manually transcribing values, and manually comparing and judging. At the same time, the flow identifier is used to realize the automatic attribution and summary judgment of field values of multiple traffic, reducing the risk of duplicate verification and missed judgment, thereby improving the processing efficiency and result consistency of service quality field testing.
[0040] S5: In the remote management session, a preset second configuration instruction is sent to the network device under test to switch to the preset second queue effective rule, and the packet capture and comparison are repeatedly executed based on the second configuration instruction to obtain the second verification result. The target test result is generated based on the first verification result and the second verification result.
[0041] It should be noted that the preset second configuration command is a set of management commands pre-defined to switch the network device under test from the first test configuration state to the second test configuration state. The preset second queue activation rule is a different output queue determination rule from the preset first queue activation rule, used to determine the output queue in the second round of verification. The second verification result refers to the verification conclusion data obtained by repeatedly executing packet capture and comparison under the condition that the preset second queue activation rule is in effect. The target test result is the test result data generated after associating and summarizing the first and second verification results.
[0042] Specifically, under the remote management session, a preset second configuration command is organized and sent to the network device under test (DUT), causing the DUT to switch from a preset first queue activation rule to a preset second queue activation rule. The preset second configuration command adjusts the queue determination criteria for the DUT, ensuring that subsequent service packets entering the device follow the preset second queue activation rule during queue selection. To ensure the switched rule takes effect on forwarding paths related to the test traffic, the test control device can configure the activation conditions associated with the rule within the remote management session and complete the configuration distribution and state transition within the same session context, enabling the DUT to enter the operating state required for the second round of verification.
[0043] Furthermore, after the preset second queue activation rule takes effect, the retest process is triggered based on the second configuration command, repeatedly executing the "packet capture and comparison" operation corresponding to the first round of verification: the control traffic generation device starts packet capture on the receiving port and sends the test traffic to generate a second round packet capture file, parses the second round packet capture file to extract the actual value of the congestion notification subfield, and compares the actual value with the initial value of the packet header field to obtain the second verification result. Subsequently, the test control device obtains the first verification result and the second verification result, performs result association and summarization, and generates a target test result containing the two rounds of verification results and their corresponding conclusion identifiers.
[0044] Because this step completes the switching of queue activation rules under the same remote management session, and reuses the existing packet capture and comparison links to generate a second verification result after the switch, and then summarizes the first and second verification results to generate the target test result, the verification under the two queue activation rules can be completed continuously within the same test framework. This reduces the operational overhead of establishing test processes for different rules, repetitive configuration, and repetitive result processing. At the same time, the retest uses the same initial field values and comparison logic, making the results of the two rounds comparable and easy to automatically summarize, thereby improving the execution efficiency and result consistency of service quality field testing in rule switching scenarios.
[0045] This embodiment acquires the management access information of the network device under test (DUT) and establishes a remote management session with the DUT based on the management access information. A preset first configuration command is sent to the DUT through the remote management session, enabling the DUT to determine the output queue based on a preset first queue activation rule and enable queue congestion management associated with the congestion notification subfield for the output queue. A traffic generation device is controlled to create at least two test traffic streams pointing to the receiving port, and initial values are set for the packet header fields of the test traffic. Packet capture is initiated at the receiving port, and the test traffic is sent to generate a packet capture file. The packet capture file is parsed to obtain the actual value of the congestion notification subfield corresponding to the test traffic, and the actual value is compared with the initial value of the packet header field to obtain a first verification result. A preset second configuration command is sent to the DUT under the remote management session to switch to a preset second queue activation rule, and packet capture and comparison are repeatedly executed based on the second configuration command to obtain a second verification result. A target test result is generated based on the first and second verification results. This embodiment establishes a remote management session with the network device under test and automatically issues first / second configuration commands within the session to achieve unified configuration and rule switching for queue activation rules and queue congestion management. Simultaneously, it controls the traffic generation device to create at least two test traffic streams at once and writes initial values to the header fields. After capturing packets at the receiving port and generating a packet capture file, it automatically parses the actual value of the congestion notification subfield and compares it with the initial value to output the first / second verification results. Finally, it summarizes the two verification results to generate the target test result. This transforms the originally scattered and repetitive "configuration-traffic generation-packet capture-packet verification-switch retest" process into a closed-loop automated execution process, reducing manual operation and repetitive testing steps to improve the efficiency of service quality field testing.
[0046] Based on the first embodiment described above, a second embodiment of the automated testing method for the service quality field of this application is proposed. Please refer to... Figure 2 , Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the automated testing method for the service quality field of this application.
[0047] like Figure 2 As shown, in this embodiment, step S1 includes: S11: Obtain the management parameter set corresponding to the network device under test. The management parameter set includes at least device identification information, management address information, management interface identification information, and authentication information. The management parameter set is used as the management access information. S12: Generate remote management connection parameters based on the management access information, and select a remote management protocol that matches the remote management connection parameters according to the management interface identification information to create a connection object, and control the connection object to initiate a connection request to the management address information and submit the authentication information; S13: After the connection request is authenticated, obtain the session handle corresponding to the connection object, and maintain the session validity based on the session handle to establish a remote management session with the network device under test.
[0048] It should be noted that device identification information is a type of identification information used to uniquely or distinguishably point to the network device under test. Management address information is an address type of address used to locate the management entry point of the network device under test. Management interface identification information is identification data used to indicate the type of management channel / management interface used. Session handle refers to the session identifier or reference obtained after the connection request has been authenticated, used to locate and use the established session context in subsequent operations.
[0049] Specifically, firstly, a set of management parameters corresponding to the network device under test is obtained, and this set is organized into a structured data object. The set of management parameters includes at least device identification information, management address information, management interface identification information, and authentication information. The test control device completes the binding confirmation of the target device based on the device identification information, and associates and organizes the management address information, management interface identification information, and authentication information, thereby using the set of management parameters as the management access information to support the continuous use of the same set of input data in subsequent connection establishment processes.
[0050] Furthermore, remote management connection parameters are generated based on management access information, and a remote management protocol matching the remote management connection parameters is selected according to the management interface identification information to create a connection object. The test control device controls the connection object to initiate a connection request to the management address information, and submits the authentication information during the connection request process to complete the authentication interaction. After the connection request completes authentication, the test control device obtains the session handle corresponding to the connection object, and performs session persistence processing based on the session handle to maintain session validity, thereby establishing a remote management session with the network device under test.
[0051] Because this step uses a set of management parameters to form unified management access information, and further generates remote management connection parameters, selects a matching remote management protocol to create a connection object to complete the connection request and authentication, and then obtains a session handle and performs session persistence processing after successful authentication, subsequent management operations can reuse the same session context without repeatedly organizing connection input, repeatedly initiating connection requests, and repeatedly authenticating. At the same time, by driving protocol matching and connection object creation through management interface identification information, the connection path under different management channels has a consistent organization method, and the session handle maintains session validity to reduce the number of reconnections caused by session interruption, thereby providing a stable entry point for the subsequent continuous issuance of configuration commands and improving the execution efficiency and continuity of the overall testing process.
[0052] Based on the first embodiment described above, in this embodiment, step S2 includes: S21: Send a first sub-configuration related to port forwarding to the network device under test through the remote management session, so that at least one port related to the forwarding of the test traffic retains the packet header information containing the packet header field when forwarding packets; S22: After the first sub-configuration takes effect, the second sub-configuration related to the queue activation rule is sent to the network device under test through the remote management session, so that the network device under test can determine the output queue based on the service classification information in the packet header field and in combination with the link layer priority identifier. S23: After the preset first queue activation rule takes effect, the third sub-configuration related to queue congestion management is sent to the network device under test through the remote management session, so that the network device under test enables queue congestion management associated with the congestion notification sub-field for the output queue.
[0053] It should be noted that the first sub-configuration is a portion of the configuration content in the preset first configuration instruction. Packet header information refers to the field information in the protocol headers of the packet at the network layer / link layer, etc. Service classification information is the field information located in the packet header used to characterize the packet's service category / classification attribute. Link layer priority identifier is priority identifier information located in the link layer header, used to characterize the link layer forwarding priority attribute. The second / third sub-configuration is another portion of the configuration content in the preset first configuration instruction.
[0054] Specifically, firstly, under a remote management session, a first sub-configuration related to port forwarding is issued to the network device under test. This first sub-configuration is then applied to at least one port related to the forwarding of test traffic. This causes the port to encapsulate / parse and control forwarding packets according to the processing rules of the first sub-configuration during forwarding, thereby preserving packet header information containing the aforementioned packet header fields during the forwarding process. The test control device can obtain execution feedback information related to the first sub-configuration through the remote management session to confirm that the first sub-configuration has been applied to the target port and is in effect.
[0055] Furthermore, after confirming the effectiveness of the first sub-configuration, the test control device continues to issue a second sub-configuration related to the queue activation rule to the network device under test (DUT) under the remote management session. This enables the DUT to read the service classification information in the packet header when selecting a queue for subsequent incoming packets, and to determine the output queue in conjunction with the link layer priority identifier, thereby forming and activating the preset first queue activation rule. After the preset first queue activation rule takes effect, the test control device further issues a third sub-configuration related to queue congestion management through the remote management session. This enables the DUT to enable queue congestion management associated with the congestion notification sub-field for the output queue determined by the preset first queue activation rule, thereby completing the congestion management policy configuration link for the output queue.
[0056] Because this step establishes configuration dependencies in the order of "first sub-configuration → second sub-configuration → third sub-configuration": first, the forwarding path retains the packet header information containing the packet header field through port forwarding-related configuration; then, the queue activation rules are configured based on the reliably obtainable packet header information to determine the output queue; and finally, queue congestion management associated with the congestion notification sub-field is enabled on the determined output queue. Therefore, the preconditions of "field retention → queue determination → congestion management enablement" can form a consistent processing link on the device side, so that the field values obtained by subsequent packet capture and parsing have a traceable correspondence with the queue rules and congestion management configuration. At the same time, it reduces repeated adjustments and repeated verifications in the configuration process, thereby improving the coherence and execution efficiency of the service quality field testing process.
[0057] This embodiment acquires the management access information of the network device under test (DUT) and establishes a remote management session with the DUT based on the management access information. A preset first configuration command is sent to the DUT through the remote management session, enabling the DUT to determine the output queue based on a preset first queue activation rule and enable queue congestion management associated with the congestion notification subfield for the output queue. A traffic generation device is controlled to create at least two test traffic streams pointing to the receiving port, and initial values are set for the packet header fields of the test traffic. Packet capture is initiated at the receiving port, and the test traffic is sent to generate a packet capture file. The packet capture file is parsed to obtain the actual value of the congestion notification subfield corresponding to the test traffic, and the actual value is compared with the initial value of the packet header field to obtain a first verification result. A preset second configuration command is sent to the DUT under the remote management session to switch to a preset second queue activation rule, and packet capture and comparison are repeatedly executed based on the second configuration command to obtain a second verification result. A target test result is generated based on the first and second verification results. This embodiment establishes a remote management session with the network device under test and automatically issues first / second configuration commands within the session to achieve unified configuration and rule switching for queue activation rules and queue congestion management. Simultaneously, it controls the traffic generation device to create at least two test traffic streams at once and writes initial values to the header fields. After capturing packets at the receiving port and generating a packet capture file, it automatically parses the actual value of the congestion notification subfield and compares it with the initial value to output the first / second verification results. Finally, it summarizes the two verification results to generate the target test result. This transforms the originally scattered and repetitive "configuration-traffic generation-packet capture-packet verification-switch retest" process into a closed-loop automated execution process, reducing manual operation and repetitive testing steps to improve the efficiency of service quality field testing.
[0058] Based on the second embodiment described above, a third embodiment of the automated testing method for the service quality field of this application is proposed. Please refer to... Figure 3 , Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the automated testing method for the service quality field of this application.
[0059] In this embodiment, step S3 includes: S31: Control the traffic generation device to create test port objects corresponding to the sending side port and the receiving port of the network device under test, and generate at least two test traffic streams with different source port identifiers and the same receiving port identifier based on the test port objects; S32: Based on the test traffic, configure the initial value of the packet header field corresponding to each test traffic, and associate the initial value of the packet header field with the corresponding flow identifier; S33: After completing the initial value configuration of the message header field, control the traffic generation device to start packet capture on the receiving port and generate a packet capture identifier, send the at least two test traffic streams based on the packet capture identifier, and stop packet capture after sending to save the packet capture file, thereby starting packet capture on the receiving port and sending the test traffic to generate a packet capture file.
[0060] It should be noted that the sending-side port is the port corresponding to the traffic input side of the network device under test. The test port object is a callable / configurable port instance created for the port on the traffic generation device side. The source port identifier is identification information used to distinguish different sending-side ports or different transmission paths. The receiving port identifier is identification information used to mark the receiving-side port that the test traffic commonly points to. The flow identifier is identification information used to uniquely identify each path of test traffic. The packet capture identifier is identification information used to mark a packet capture task / packet capture process. The transmission end condition is the condition information used to determine the completion of test traffic transmission.
[0061] Specifically, the traffic generation device first creates test port objects corresponding to the sending and receiving ports of the network device under test, enabling the traffic generation device to use these test port objects as the control carrier for subsequent flow establishment and packet transmission. After the test port objects are created, the test control device generates at least two test traffic streams based on these test port objects. Each test traffic stream has a different source port identifier to indicate that it comes from a different sending port or a different sending path, and shares the same receiving port identifier to indicate that it points to the same receiving port, thus forming a test input set that satisfies the requirement of "multiple traffic streams pointing to the same receiving port".
[0062] Furthermore, after the generation of at least two test traffic streams, initial values for the header fields are configured for each test traffic stream, and these initial values are associated with the corresponding flow identifiers to form the baseline data and association relationships required for subsequent field comparisons. After completing the initial value configuration, the test control device controls the traffic generation device to start packet capture at the receiving port and generate a packet capture identifier, enabling the receiving port to enter a state where packets can be recorded. Subsequently, based on the packet capture identifier, the at least two test traffic streams are sent, allowing the test packets to be captured and recorded by the receiving port during packet capture. After the sending end condition is met, packet capture is stopped and the packet capture file is saved, thereby starting packet capture at the receiving port and sending the test traffic to generate a packet capture file.
[0063] This step first establishes a controllable mapping between the sending port and the receiving port on the traffic generation device side using the test port object, then generates at least two test traffic streams with different source port identifiers and the same receiving port identifier, and establishes a traceable association between each test traffic stream and the initial value of its packet header field through the flow identifier. At the same time, it completes the closed loop of "starting packet capture - sending multiple traffic streams - stopping packet capture - saving packet capture file" under the packet capture task corresponding to the same packet capture identifier. Therefore, when parsing the packet capture file later, the actual value of the field can be quickly assigned according to the flow identifier and a consistency comparison can be performed. This reduces the operational overhead of capturing packets separately for multiple verifications, recording baseline values separately, and repeatedly organizing tests, thereby improving the execution efficiency and result consistency of service quality field testing in multi-traffic scenarios.
[0064] Based on the second embodiment described above, in this embodiment, step S4 includes: S41: Obtain the packet capture file and filter the packets in the packet capture file based on the flow identifier corresponding to the test traffic to obtain the target packet set corresponding to the test traffic; S42: Perform network layer header parsing on each target packet in the target packet set, extract the congestion notification sub-field from the packet header fields, and generate a set of actual values for the congestion notification sub-field corresponding to the flow identifier. S43: Based on the flow identifier, match the actual set of values of the congestion notification subfield with the initial value of the packet header field and perform a field consistency comparison. Summarize the comparison results to obtain the first verification result corresponding to the preset first queue effective rule.
[0065] It should be noted that the target packet set is a set of packets corresponding to the test traffic, selected from the packet capture file. Network layer header parsing is the process of performing structured parsing of the network layer protocol header of the target packets. Field consistency comparison refers to the process of comparing the actual values of the congestion notification subfields with the initial values of the corresponding packet header fields to verify consistency. Summarizing the comparison results is the process of integrating the comparison conclusions corresponding to different flow identifiers to form an overall verification conclusion.
[0066] Specifically, the packet capture file is first obtained, and the packets in the capture file are filtered using the flow identifier corresponding to the test traffic to remove packets unrelated to the test traffic, thus obtaining the target packet set corresponding to the test traffic. The flow identifier can be used as a filtering key to establish the correspondence between "packet - test traffic", so that the target packet set can cover packet samples captured by at least two test traffic streams at the receiving port, and provide a definite parsing range for subsequent field parsing.
[0067] Furthermore, after obtaining the target packet set, network layer header parsing is performed on each target packet in the set to locate the packet header fields and extract the congestion notification subfield, forming a set of actual values for the congestion notification subfield corresponding to the flow identifier. Subsequently, the test control device matches the actual value set with the initial values of the packet header fields based on the flow identifier to establish a correspondence between the actual value of each test traffic stream and its baseline value, and performs field consistency comparison on this basis; finally, the comparison results under each flow identifier are summarized to obtain the first verification result corresponding to the preset first queue effective rule.
[0068] This step first filters packets in the captured file based on flow identifiers to form a target packet set. Then, it automatically extracts the congestion notification subfield through network layer header parsing and generates a set of actual values corresponding to the flow identifier. Finally, it matches the actual values with the initial values of the fields using the flow identifier as the association key, performs a consistency comparison, and summarizes and outputs the first verification result. Therefore, it can connect the process of "locating target packets - extracting fields - establishing correspondence - completing comparison - forming conclusions" into an automated parsing link. This reduces the steps of manually searching for packets in the captured file, manually reading fields, manually matching baseline values, and manually summarizing conclusions. At the same time, it ensures that the comparison criteria of multiple test traffic under the same rule conditions are consistent, thereby improving the processing efficiency and conclusion consistency of the service quality field verification process.
[0069] Based on the second embodiment described above, in this embodiment, step S5 includes: S51: In the remote management session, a preset second configuration instruction related to the queue activation mode switching is sent to the network device under test, so that the network device under test is switched from the preset first queue activation rule to the preset second queue activation rule, and the configuration of multiple interfaces related to the test traffic forwarding is enabled based on the interface support configuration associated with the preset second queue activation rule. S52: After the preset second queue activation rule takes effect, the traffic generation device is controlled to perform a packet capture process using the at least two test traffic streams and the corresponding initial values of the packet header fields and generate a second packet capture file. Field extraction and field consistency comparison are performed on the second packet capture file to repeatedly execute the packet capture and comparison to obtain a second verification result corresponding to the preset second queue activation rule. S53: Obtain the first verification result and the second verification result, correlate and summarize the results, and generate the target test result.
[0070] It should be noted that queue activation method switching refers to the configuration behavior where the criteria used by the network device under test to determine the output queue are changed. The interface supports configuration on the interface side to make the preset second queue activation rule available on the forwarding path related to the test traffic. The second packet capture file is a packet capture file generated through the packet capture process under the condition that the preset second queue activation rule is in effect. Result correlation is the process used to establish the correspondence between the first verification result and the second verification result.
[0071] Specifically, firstly, under the remote management session, a preset second configuration command related to switching the queue activation method is issued to the network device under test, causing the network device under test to switch from the preset first queue activation rule to the preset second queue activation rule. To ensure that the queue activation rule after the switch can take effect on the forwarding path related to the test traffic, the interface support configuration associated with the preset second queue activation rule is further issued, and the interface support configuration is applied to multiple interfaces related to the forwarding of test traffic, so that multiple interfaces enter the configuration state that supports the preset second queue activation rule, thereby completing the configuration activation link of the preset second queue activation rule.
[0072] Furthermore, after confirming that the preset second queue activation rule is in effect, the control traffic generation device uses at least two test traffic streams and their corresponding initial values of the packet header fields to execute the packet capture process, generating a second packet capture file. Based on the second packet capture file, field extraction and field consistency comparison are performed to repeatedly execute packet capture and comparison to obtain a second verification result corresponding to the preset second queue activation rule. Subsequently, the first verification result and the second verification result are obtained, and the two results are correlated to form a comparable result structure. On this result structure, the results are summarized, and the target test result containing the two rounds of verification results is output.
[0073] Because this step completes the queue activation method switch under the same remote management session and ensures that the preset second queue activation rule takes effect on the relevant interface through interface support configuration, and then, under the switched rule conditions, the existing test traffic and packet header field initial values are reused to generate the second verification result by reusing the packet capture and comparison process, and then the first verification result and the second verification result are correlated and summarized to output the target test result, the "verification under two queue activation rules" can be organized into a continuous retest link, reducing the operational overhead of rebuilding the flow, resetting the field baseline value and reorganizing the judgment criteria for different rules; at the same time, by associating and summarizing the results, the two rounds of verification can be compared and integrated in the same output structure, thereby improving the execution efficiency and result consistency of service quality field testing in the rule switching scenario.
[0074] This embodiment acquires the management access information of the network device under test (DUT) and establishes a remote management session with the DUT based on the management access information. A preset first configuration command is sent to the DUT through the remote management session, enabling the DUT to determine the output queue based on a preset first queue activation rule and enable queue congestion management associated with the congestion notification subfield for the output queue. A traffic generation device is controlled to create at least two test traffic streams pointing to the receiving port, and initial values are set for the packet header fields of the test traffic. Packet capture is initiated at the receiving port, and the test traffic is sent to generate a packet capture file. The packet capture file is parsed to obtain the actual value of the congestion notification subfield corresponding to the test traffic, and the actual value is compared with the initial value of the packet header field to obtain a first verification result. A preset second configuration command is sent to the DUT under the remote management session to switch to a preset second queue activation rule, and packet capture and comparison are repeatedly executed based on the second configuration command to obtain a second verification result. A target test result is generated based on the first and second verification results. This embodiment establishes a remote management session with the network device under test and automatically issues first / second configuration commands within the session to achieve unified configuration and rule switching for queue activation rules and queue congestion management. Simultaneously, it controls the traffic generation device to create at least two test traffic streams at once and writes initial values to the header fields. After capturing packets at the receiving port and generating a packet capture file, it automatically parses the actual value of the congestion notification subfield and compares it with the initial value to output the first / second verification results. Finally, it summarizes the two verification results to generate the target test result. This transforms the originally scattered and repetitive "configuration-traffic generation-packet capture-packet verification-switch retest" process into a closed-loop automated execution process, reducing manual operation and repetitive testing steps to improve the efficiency of service quality field testing.
[0075] Please see Figure 4 , Figure 4This is a network diagram of the automated testing module in one embodiment of the automated testing method for the quality of service field of this application. In this embodiment, Python is used, and the modules employed include paramiko, scapy, time, openpyxl, renix_py_api, and a network interface card (NIC) connected to a switch. Hardware requirements include a Xintai instrument and a 40G or 100G 1-to-4 optical splitter module. The specific test steps include: (1) Connect to the switch command line through the paramiko module, configure all ports in trunk mode to allow the corresponding VLAN headers to prevent the ECN label from being stripped, configure the switch's QoS congestion management, and the default queue activation method is TOS / COS (values 0-7, 0 corresponds to queue 0, each digit corresponds to a queue, the queues increase sequentially, a total of 8 queues), the queues are managed using ECN (when the queue is congested, as long as a packet has been processed, it will be marked with ECN and eventually reach the receiving end); (2) Adapt and call the API interface of Xintai Instrument through the renix_py_api module to realize the Layer 2 and Layer 3 ports, create traffic, create two traffic, the first flow 1 / 4 is the source port and 3 / 4 is the receiving port, the second flow 2 / 4 is the source port and 3 / 4 is the receiving port, the load of both traffic is 100% (that is, each traffic fills the port bandwidth to create a congested environment); (3) Add two flows carrying the TOS / ECN field as 0 1. Start the packet capture function of the instrument, capture packets at the destination port, and then send a full load of traffic to the destination port. After sending, stop packet capture and save it to the current directory; (4) Use the scapy module to parse the packets that match the source and destination addresses to get the ECN field in the IP header. Determine whether the field is consistent with the field added before the traffic is captured. If it is consistent, the ECN management configured in the congestion has not processed the packet. If there is a change, it means that it has been processed. Record the final result; (5) Modify the queue activation mode to tos / dscp (0-63 queues, 0-7 correspond to queue 0, every 8 digits correspond to one queue, the queues increase sequentially, a total of 8 queues), and configure all interfaces to support this mode. Continue to start packet capture, capture two traffic packets to cause congestion, stop packet capture, use the scapy module to determine the change of the ECN field of the packet, and record the final result; (6) If all the above expectations are met, the test is passed. Use the openpyxl module to write the information into excel and save it. If it fails, write "failed".
[0076] This application also provides an automated testing device for the service quality field. Please refer to... Figure 5 , Figure 5 This is a schematic diagram of the module structure of the automated service quality field testing device according to an embodiment of this application. The automated service quality field testing device includes: The session establishment module 501 is used to obtain the management access information of the network device under test, and establish a remote management session with the network device under test based on the management access information. The queue congestion module 502 is used to send a preset first configuration instruction to the network device under test through the remote management session, so that the network device under test determines the output queue based on the preset first queue activation rule and enables queue congestion management associated with the congestion notification subfield for the output queue. The packet capture generation module 503 is used to control the traffic generation device to create at least two test traffic streams pointing to the receiving port, set the initial value of the packet header field for the test traffic, start packet capture at the receiving port, and send the test traffic to generate a packet capture file. The comparison and verification module 504 is used to parse the packet capture file to obtain the actual value of the congestion notification subfield corresponding to the test traffic, and compare the actual value with the initial value of the packet header field to obtain the first verification result; The target module 505 is used to send a preset second configuration instruction to the network device under test in the remote management session to switch to the preset second queue effective rule, and repeatedly execute the packet capture and comparison based on the second configuration instruction to obtain a second verification result, and generate a target test result based on the first verification result and the second verification result.
[0077] The automated service quality field testing apparatus provided in this application, employing the automated service quality field testing method described in the above embodiments, can solve the technical problem of how to improve the efficiency of service quality field testing. Compared with the prior art, the beneficial effects of the automated service quality field testing apparatus provided in this application are the same as those of the automated service quality field testing method described in the above embodiments, and other technical features in the automated service quality field testing apparatus are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0078] This application provides an automated testing device for service quality fields, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the automated testing method for service quality fields described above.
[0079] The following is for reference. Figure 6 , Figure 6 This is a schematic diagram of the hardware operating environment involved in the automated testing method for service quality fields in the embodiments of this application. It shows a schematic diagram of the structure of the equipment suitable for implementing the automated testing device for service quality fields in the embodiments of this application.Figure 6 The automated testing equipment for service quality fields shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0080] like Figure 6 As shown, the automated service quality field testing equipment may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the automated service quality field testing equipment. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the Automated Service Quality Field Testing Equipment to communicate wirelessly or wiredly with other devices to exchange data. While the figure shows Automated Service Quality Field Testing Equipment with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0081] In particular, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. When the computer program is executed by the processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0082] The automated service quality field testing device provided in this application, employing the automated service quality field testing method described in the above embodiments, can solve the technical problem of how to improve the efficiency of service quality field testing. Compared with the prior art, the beneficial effects of the automated service quality field testing device provided in this application are the same as those of the automated service quality field testing method described in the above embodiments, and other technical features of this automated service quality field testing device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0083] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0084] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0085] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the automated testing method for the quality of service field in the above embodiments.
[0086] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the automated service quality field testing device, the automated service quality field testing device performs the following actions: acquires management access information of the network device under test (DUT), and establishes a remote management session with the DUT based on the management access information; issues a preset first configuration instruction to the DUT through the remote management session, enabling the DUT to determine the output queue based on a preset first queue activation rule and enable queue congestion management associated with the congestion notification subfield for the output queue; controls a traffic generation device to create at least two test traffic streams pointing to the receiving port, sets initial values for the packet header fields of the test traffic, starts packet capture on the receiving port, and sends the test traffic to generate a packet capture file; parses the packet capture file to obtain the actual value of the congestion notification subfield corresponding to the test traffic, and compares the actual value with the initial value of the packet header field to obtain a first verification result; issues a preset second configuration instruction to the DUT under the remote management session to switch to a preset second queue activation rule, and repeatedly executes packet capture and comparison based on the second configuration instruction to obtain a second verification result; and generates a target test result based on the first verification result and the second verification result. Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0087] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0088] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0089] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described automated testing method for service quality fields, thereby solving the technical problem of how to improve the efficiency of service quality field testing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the automated testing method for service quality fields provided in the above embodiments, and will not be repeated here.
[0090] This application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the automated testing method for the service quality field as described above.
[0091] The computer program product provided in this application solves the technical problem of how to improve the efficiency of service quality field testing. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the automated service quality field testing method provided in the above embodiments, and will not be repeated here.
[0092] The above are merely preferred embodiments of this application and do not limit the scope of protection of this application. Any equivalent structural or procedural transformations made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of this application.
Claims
1. An automated testing method for service quality fields, characterized in that, The method includes: Obtain management access information of the network device under test, and establish a remote management session with the network device under test based on the management access information; The remote management session sends a preset first configuration instruction to the network device under test, so that the network device under test determines the output queue based on the preset first queue activation rule and enables queue congestion management associated with the congestion notification subfield for the output queue. The control flow generating device creates at least two test flows pointing to the receiving port, sets initial values for the packet header fields of the test flows, starts packet capture on the receiving port, and sends the test flows to generate a packet capture file; The packet capture file is parsed to obtain the actual value of the congestion notification subfield corresponding to the test traffic, and the actual value is compared with the initial value of the packet header field to obtain the first verification result; In the remote management session, a preset second configuration command is sent to the network device under test to switch to the preset second queue effective rule, and the packet capture and comparison are repeatedly executed based on the second configuration command to obtain a second verification result. The target test result is generated based on the first verification result and the second verification result.
2. The method as described in claim 1, characterized in that, The step of obtaining management access information of the network device under test and establishing a remote management session with the network device under test based on the management access information includes: Obtain a set of management parameters corresponding to the network device under test. The set of management parameters includes at least device identification information, management address information, management interface identification information, and authentication information. Use the set of management parameters as the management access information. Based on the management access information, remote management connection parameters are generated, and a remote management protocol matching the remote management connection parameters is selected according to the management interface identification information to create a connection object. The connection object is then controlled to initiate a connection request to the management address information and submit the authentication information. After the connection request is authenticated, a session handle corresponding to the connection object is obtained, and the session validity is maintained based on the session handle to establish a remote management session with the network device under test.
3. The method as described in claim 1, characterized in that, The step of issuing a preset first configuration command to the network device under test through the remote management session, so that the network device under test determines the output queue based on the preset first queue activation rule, and enables queue congestion management associated with the congestion notification subfield for the output queue, includes: The remote management session sends a first sub-configuration related to port forwarding to the network device under test, so that at least one port related to the forwarding of the test traffic retains the packet header information containing the packet header field when forwarding packets. After the first sub-configuration takes effect, the second sub-configuration related to the queue activation rule is sent to the network device under test through the remote management session, so that the network device under test can determine the output queue based on the service classification information in the packet header field and in combination with the link layer priority identifier. After the preset first queue activation rule takes effect, the third sub-configuration related to queue congestion management is sent to the network device under test through the remote management session, so that the network device under test enables queue congestion management associated with the congestion notification sub-field for the output queue.
4. The method as described in claim 1, characterized in that, The steps of the control flow generating device creating at least two test flows pointing to the receiving port, setting initial values for the packet header fields of the test flows, starting packet capture at the receiving port, and sending the test flows to generate a packet capture file include: The traffic generation device is controlled to create test port objects corresponding to the sending port and receiving port of the network device under test, and at least two test traffic streams with different source port identifiers and the same receiving port identifier are generated based on the test port objects. Based on the test traffic, configure the initial value of the packet header field corresponding to each test traffic, and associate the initial value of the packet header field with the corresponding flow identifier; After completing the initial value configuration of the packet header field, the traffic generation device is controlled to start packet capture on the receiving port and generate a packet capture identifier. Based on the packet capture identifier, at least two test traffic streams are sent, and packet capture is stopped after the sending is completed to save the packet capture file, thereby starting packet capture on the receiving port and sending the test traffic to generate a packet capture file.
5. The method as described in claim 1, characterized in that, The step of parsing the packet capture file to obtain the actual value of the congestion notification subfield corresponding to the test traffic, and comparing the actual value with the initial value of the packet header field to obtain the first verification result includes: The packet capture file is obtained and the packets in the packet capture file are filtered based on the flow identifier corresponding to the test traffic to obtain the target packet set corresponding to the test traffic; For each target packet in the target packet set, perform network layer header parsing, extract the congestion notification subfield from the packet header fields, and generate a set of actual values for the congestion notification subfield corresponding to the flow identifier. Based on the flow identifier, the actual set of values of the congestion notification subfield is matched with the initial value of the packet header field, and a field consistency comparison is performed. The comparison results are summarized to obtain the first verification result corresponding to the preset first queue effective rule.
6. The method as described in claim 1, characterized in that, The steps of sending a preset second configuration command to the network device under test in the remote management session to switch to the preset second queue activation rule, and repeatedly executing the packet capture and comparison based on the second configuration command to obtain a second verification result, and generating a target test result based on the first verification result and the second verification result, include: In the remote management session, a preset second configuration instruction related to switching the queue activation mode is issued to the network device under test, so that the network device under test is switched from the preset first queue activation rule to the preset second queue activation rule, and the configuration of multiple interfaces related to the test traffic forwarding is enabled based on the interface associated with the preset second queue activation rule. After the preset second queue activation rule takes effect, the traffic generation device is controlled to perform a packet capture process using the at least two test traffic streams and the corresponding initial values of the packet header fields, and generate a second packet capture file. Field extraction and field consistency comparison are performed on the second packet capture file to repeatedly execute the packet capture and comparison to obtain a second verification result corresponding to the preset second queue activation rule. Obtain the first verification result and the second verification result, correlate and summarize the results, and generate the target test result.
7. An automated testing device for service quality fields, characterized in that, The device includes: The session establishment module is used to obtain the management access information of the network device under test, and establish a remote management session with the network device under test based on the management access information; The queue congestion module is used to send a preset first configuration instruction to the network device under test through the remote management session, so that the network device under test determines the output queue based on the preset first queue activation rule and enables queue congestion management associated with the congestion notification subfield for the output queue. The packet capture generation module is used to control the traffic generation device to create at least two test traffic streams pointing to the receiving port, set initial values for the packet header fields of the test traffic, start packet capture on the receiving port, and send the test traffic to generate a packet capture file. The comparison and verification module is used to parse the packet capture file to obtain the actual value of the congestion notification subfield corresponding to the test traffic, and compare the actual value with the initial value of the packet header field to obtain the first verification result; The target module is used to send a preset second configuration instruction to the network device under test in the remote management session to switch to the preset second queue effective rule, and repeatedly execute the packet capture and comparison based on the second configuration instruction to obtain a second verification result, and generate a target test result based on the first verification result and the second verification result.
8. An automated testing device for service quality fields, characterized in that, The device includes: a memory, a processor, and a service quality field automated testing program stored in the memory and executable on the processor, the service quality field automated testing program being configured to implement the steps of the service quality field automated testing method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores an automated testing program for quality of service fields, which, when executed by a processor, implements the steps of the automated testing method for quality of service fields as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the service quality field automated testing method as described in any one of claims 1 to 6.