QinQ functional testing method, device, equipment, storage medium and product

Through thread pool management, QinQ functional testing is carried out based on the address resolution protocol package, which solves the problems of inefficiency and error-prone manual testing, and realizes efficient and reliable QinQ functional testing.

CN119071189BActive Publication Date: 2025-02-18SHENZHEN FENGRUNDA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411547207.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-18
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

Manually testing QinQ function requires the use of two computers and the package tool to send corresponding data packets, resulting in inefficient testing, prone to errors, and easy to miss potential defects.

Method used

Multi-threaded concurrent processing is realized through thread pool management, and testing is carried out based on the address resolution protocol package, including capturing the address resolution protocol package of the preset source physical address through the first thread, and returning the capture result within the preset time. After receiving the capture result, , construct the broadcast packet of the address resolution protocol packet through the second thread, and set its inner layer virtual LAN tag to perform QinQ function testing of the switch.

Benefits of technology

The performance and stability of QinQ function are accurately evaluated, ensuring test accuracy and reliability, and improving testing efficiency and credibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071189B_ABST
    Figure CN119071189B_ABST
Patent Text Reader

Abstract

The present application relates to the field of network communication technology, and discloses a QinQ function test method, device, equipment, storage medium and product, the method comprising: creating a thread pool according to test requirements and thread pool parameter configuration, applying for a first thread from the thread pool, capturing an address resolution protocol packet of a preset source physical address through the first thread, and returning the capture result within a preset time, after receiving the capture result, applying for a second thread from the thread pool, constructing a broadcast packet of the address resolution protocol packet through the second thread, and setting an inner virtual LAN label of the broadcast packet, sending the broadcast packet through the second thread, and testing the QinQ function of the switch based on the inner virtual LAN label set in the broadcast packet. Since the present application realizes multi-thread concurrent processing through thread pool management and tests based on address resolution protocol packets, it can accurately evaluate the performance and stability of the QinQ function, ensuring the accuracy and reliability of the test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication technology, and in particular to a QinQ function testing method, device, equipment, storage medium and product. Background Art

[0002] Currently, testing QinQ functions requires a series of specific equipment and tools to simulate and verify its working effect. The process usually includes using two computers and a packet sending tool to send and receive packets with corresponding double-layer virtual LAN labels. However, this manual testing method may lead to inefficient testing, error-prone, and easy to miss potential defects. Summary of the invention

[0003] The main purpose of this application is to provide a QinQ function testing method, device, equipment, readable storage medium and computer program product, aiming to solve the technical problem that manual testing of QinQ function requires the use of two computers and a packet sending tool to send corresponding data packets for testing.

[0004] To achieve the above objectives, the present application proposes a QinQ function testing method, the method comprising:

[0005] Create a thread pool according to the test requirements and thread pool parameter configuration, apply for a first thread from the thread pool, capture the address resolution protocol packet of a preset source physical address through the first thread, and return the capture result within a preset time;

[0006] After receiving the capture result, applying for a second thread from the thread pool, constructing a broadcast packet of the address resolution protocol packet through the second thread, and setting an inner virtual local area network label of the broadcast packet;

[0007] The broadcast packet is sent through the second thread, and the QinQ function of the switch is tested based on the inner virtual LAN label set in the broadcast packet.

[0008] In one embodiment, the step of sending the broadcast packet through the second thread and testing the QinQ function of the switch based on the inner virtual LAN label set in the broadcast packet includes:

[0009] Sending the broadcast packet through the second thread, and obtaining a virtual local area network field of the broadcast packet based on a data parsing module after the first thread captures the broadcast packet;

[0010] The virtual local area network field is matched with the inner virtual local area network tag and the preset virtual local area network tag information to obtain the QinQ function test result of the switch.

[0011] In one embodiment, after the step of matching the virtual LAN field with the inner virtual LAN tag and the preset virtual LAN tag information to obtain the QinQ function test result of the switch, the step further includes:

[0012] If the QinQ function test result is that the test fails, the mismatch item is recorded;

[0013] According to the mismatched items, the switch and the test-related items are adjusted to obtain adjusted test-related items;

[0014] The QinQ function is tested according to the thread pool and the adjusted test related items.

[0015] In one embodiment, the step of matching the virtual LAN field with the inner virtual LAN tag and the preset virtual LAN tag information to obtain the QinQ function test result of the switch includes:

[0016] When the virtual local area network field includes two virtual local area network labels, matching the virtual local area network field with the inner virtual local area network label;

[0017] The virtual local area network field is matched with the outer virtual local area network label in the preset virtual local area network label information to obtain the QinQ function test result of the switch.

[0018] In one embodiment, after the steps of creating a thread pool according to the test requirements and thread pool parameter configuration, applying for a first thread from the thread pool, capturing the address resolution protocol packet of a preset source physical address through the first thread, and returning the capture result within a preset time, the method further includes:

[0019] Capturing network data packets through the first thread to verify the network environment and obtain a network verification result;

[0020] The network environment is adjusted according to the network verification result.

[0021] In one embodiment, before the steps of creating a thread pool according to the test requirements and thread pool parameter configuration, applying for a first thread from the thread pool, capturing the address resolution protocol packet of a preset source physical address through the first thread, and returning the capture result within a preset time, the steps further include:

[0022] Set the switch interface mode and virtual LAN information according to the preset configuration requirements, and obtain the configuration execution results through the data receiving function;

[0023] Based on the log module, record the configuration execution result;

[0024] Configure the QinQ function of the switch according to the preset configuration information;

[0025] Generate an address resolution protocol packet through the thread pool based on the configuration result and the test requirement;

[0026] The address resolution protocol packet is stored in a preset storage space, and a preset source physical address corresponding to the preset storage space is generated.

[0027] In addition, to achieve the above purpose, the present application also proposes a QinQ function test device, the QinQ function test device comprising:

[0028] A data packet capture module, used to create a thread pool according to the test requirements and thread pool parameter configuration, apply for a first thread from the thread pool, capture the address resolution protocol packet of a preset source physical address through the first thread, and return the capture result within a preset time;

[0029] A data packet sending module, configured to apply for a second thread from the thread pool after receiving the capture result, construct a broadcast packet of the address resolution protocol packet through the second thread, and set an inner virtual local area network label of the broadcast packet;

[0030] The function testing module is used to send the broadcast packet through the second thread, and test the QinQ function of the switch based on the inner virtual LAN label set in the broadcast packet.

[0031] In addition, to achieve the above objectives, the present application also proposes a QinQ functional testing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the QinQ functional testing method described above.

[0032] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and stores a computer program on the storage medium. When the computer program is executed by a processor, the steps of the QinQ functional testing method described above are implemented.

[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the QinQ function testing method described above are implemented.

[0034] The technical solution proposed in this application is to create a thread pool according to the test requirements and thread pool parameter configuration, apply for the first thread from the thread pool, capture the address resolution protocol packet of the preset source physical address through the first thread, and return the capture result within the preset time. After receiving the capture result, apply for the second thread from the thread pool, construct the broadcast packet of the address resolution protocol packet through the second thread, and set the inner virtual LAN label of the broadcast packet, send the broadcast packet through the second thread, and test the QinQ function of the switch based on the inner virtual LAN label set in the broadcast packet. Since this application realizes multi-threaded concurrent processing through thread pool management and tests based on address resolution protocol packets, it can accurately evaluate the performance and stability of the QinQ function, ensuring the accuracy and reliability of the test. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0037] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the QinQ function testing method of the present application;

[0038] Figure 2 This is a flowchart of the QinQ function test method for this application;

[0039] Figure 3 A schematic diagram of the process flow provided for the second embodiment of the QinQ function testing method of the present application;

[0040] Figure 4 A schematic diagram of the process flow provided for the third embodiment of the QinQ function testing method of the present application;

[0041] Figure 5 This is a schematic diagram of the module structure of the QinQ functional testing device according to an embodiment of the present application;

[0042] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the QinQ function testing method in the embodiment of the present application.

[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0046] The current manual testing method of QinQ functions may produce complex behaviors under different network devices and different configurations, and it is easy to miss potential defects, resulting in a lack of representativeness and credibility of the test results. At the same time, manual testing cannot accurately quantify and evaluate the test process.

[0047] Therefore, in order to overcome the above-mentioned defects, the present application provides a solution, which realizes multi-threaded concurrent processing through thread pool management, and performs testing based on the address resolution protocol package, which can accurately evaluate the performance and stability of the QinQ function and ensure the accuracy and reliability of the test.

[0048] It should be noted that the execution subject of each embodiment of the present application can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a QinQ function test device, etc. The following embodiments are described below using the QinQ function test device as an example.

[0049] Based on this, the present application embodiment provides a QinQ function test method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the QinQ function testing method of the present application.

[0050] In this embodiment, the QinQ function testing method includes steps S10 to S30:

[0051] Step S10, creating a thread pool according to the test requirements and thread pool parameter configuration, applying for a first thread from the thread pool, capturing the address resolution protocol packet of a preset source physical address through the first thread, and returning the capture result within a preset time.

[0052] It should be noted that the QinQ function of the switch is a technology that expands the virtual local area network (VLAN) space by embedding another layer of 802.1Q tag on the basis of the original 802.1Q tag message to achieve two layers of virtual LAN tag encapsulation. Each data packet carries two virtual LAN identifiers, including the outer virtual LAN tag and the inner virtual LAN tag, so as to expand the available number of virtual LANs.

[0053] It is understandable that testing the QinQ function can ensure that the switch can correctly identify, process and forward data packets with double labels, which is of great significance for ensuring the correctness of network functions, performance, security, scalability, business adaptability, as well as troubleshooting and performance optimization.

[0054] In addition, it should be noted that the thread pool is a concurrent programming technology used to manage and reuse thread resources. Threads in the thread pool can be reused, reducing the overhead of creating and destroying threads. Thread pool parameter configuration refers to the various parameters that need to be set when creating a thread pool, such as the number of threads, thread priority, thread waiting time, etc. The preset source physical address refers to the pre-set physical address of the network device that needs to capture data packets. The address resolution protocol packet refers to a protocol data packet used for address resolution, which is usually used to resolve the Internet Protocol address of the network layer into the physical address of the link layer.

[0055] It should be understood that according to the test requirements and thread pool parameter configuration, a thread pool is created, and a thread is requested from the thread pool to capture the address resolution protocol packet at the preset source physical address, and then the capture result is returned within a preset time.

[0056] It can be understood that by configuring different thread pool parameters and test requirements, the concurrency and execution strategy of the test task can be flexibly adjusted, and by capturing the address resolution protocol packets on the preset source physical address, the communication behavior of the network device can be accurately located and analyzed.

[0057] It should be understood that in order to ensure the timeliness and accuracy of the test results, a preset time is set and the capture results are returned within the preset time.

[0058] Exemplarily, if an ARP packet is captured within the specified 10 seconds or if it is not captured after 10 seconds, the process will stop and return the capture result.

[0059] Step S20, after receiving the capture result, applying for a second thread from the thread pool, constructing a broadcast packet of the address resolution protocol packet through the second thread, and setting an inner virtual LAN tag of the broadcast packet.

[0060] It should be noted that a broadcast packet is a network data packet whose destination address is set to the broadcast address so that all devices in the same network can receive the data packet.

[0061] It is understandable that after receiving the capture result, a new thread (second thread) is requested from the thread pool, a broadcast packet of an address resolution protocol packet is constructed through the thread, and an inner virtual LAN label is set for it.

[0062] It should be noted that when constructing a broadcast packet of an address resolution protocol packet, an inner virtual LAN label can be specified. The outer virtual LAN label is usually added by a network device (such as a switch or router) when the data packet passes through it to meet the requirements of the QinQ protocol.

[0063] Step S30: sending the broadcast packet through the second thread, and testing the QinQ function of the switch based on the inner virtual LAN label set in the broadcast packet.

[0064] It can be understood that the QinQ function of the switch is tested by sending a broadcast packet with an inner virtual LAN label through the second thread.

[0065] For ease of understanding, the following references Figure 2 This invention is provided for illustration, but is not intended to limit the present application. Figure 2 This is a schematic diagram of the QinQ function test process for this application. The specific steps of the QinQ function test are as follows:

[0066] The network cards A and B of the automated computer are connected to the switch respectively, and the QinQ function of the switch is tested using the paramiko module, scapy module, re module, openpyxl module, logging module, and threading module in the Python library.

[0067] 1. Log in to the switch and configure QinQ

[0068] Use the paramiko module to automatically log in to the switch through the Secure Shell (SSH) protocol. Write an automated configuration script to send commands to enable the QinQ function and set it according to the parameterized configuration. Configure the interface mode of the network card A to be Trunk, the port attribute pvid to 1, and the virtual LAN tag tag to 5. Similarly, configure the interface mode of the network card B to be Trunk, pvid to 5, and tag to 1. Use the recv function to return the execution result of the send function, and synchronously use the logging module to record the execution result to the console and log file.

[0069] 2. Generate and send data packets

[0070] Use the threading module to open the thread pool, apply for the first thread from the thread pool, use the scapy module on the interface of network card B to capture the address resolution protocol packet with the source physical address sent by network card A through the first thread, and then continue to apply for the second thread. Network card A joins the second thread to construct a broadcast packet of the address resolution protocol packet, and adds a layer of VLAN5 tag with type 88a8. First, start the first thread to capture the broadcast packet. If the broadcast packet is captured within the specified 10 seconds or if it is not captured after 10 seconds, it will stop and return the result, and then start the second thread to send the broadcast packet.

[0071] Expected result: NIC B successfully captures the broadcast packet and prints all the information carried by the packet. The virtual LAN field is filtered by the re module. It must be satisfied that there are two virtual LAN tags in the packet information, the outer one is VLAN1 (the tag added by QinQ itself), and the inner one is VLAN5.

[0072] 3. Verify test results

[0073] If all the above expectations are met, the test passes, and the openyxl module is used to write all expected results into a spreadsheet for storage. There are three types of check items in the expected results of step 2. If any one of them is not met, the specific check item that failed will be written into the spreadsheet to facilitate the subsequent location of specific problems. If all check items pass, they will be directly written as passed.

[0074] This embodiment creates a thread pool according to the test requirements and thread pool parameter configuration, and uses the first thread of the thread pool to capture the address resolution protocol packet of a specific source physical address. Once the capture result is returned, the second thread is immediately applied to construct and send a broadcast packet with an inner virtual LAN label, so as to test the QinQ function of the switch, which can comprehensively and accurately evaluate the performance and stability of the QinQ function, ensuring the accuracy and reliability of the test.

[0075] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , the step S30 may include steps S301-S302:

[0076] Step S301: sending the broadcast packet through the second thread, and obtaining the virtual local area network field of the broadcast packet based on the data parsing module after the first thread captures the broadcast packet.

[0077] It should be noted that the data parsing module may be a component for parsing the content of a data packet, which can read various fields in the data packet and extract, convert or process the data as required.

[0078] It is understandable that the broadcast packet is sent through the second thread, and after the first thread captures the broadcast packet, the data parsing module is used to parse the data packet content, thereby obtaining the virtual local area network field in the broadcast packet. The virtual local area network field may include a virtual local area network tag, a virtual local area network name, a type or other extended fields.

[0079] Step S302, matching the virtual LAN field with the inner virtual LAN tag and the preset virtual LAN tag information to obtain a QinQ function test result of the switch.

[0080] It should be noted that the preset virtual local area network tag information may include outer virtual local area network tag information, type, priority, and matching rule or logic.

[0081] It is understandable that QinQ allows two virtual LAN labels to be carried in one Ethernet frame: an inner label and an outer label. In order to ensure the accuracy and comprehensiveness of the test results, first check whether the virtual LAN field of the broadcast packet contains the inner virtual LAN label and the outer virtual LAN label, and then match the two labels based on the inner virtual LAN label and the preset virtual LAN label information set in the above steps to obtain the test results.

[0082] Therefore, the step S302 may include: when the virtual LAN field contains two virtual LAN tags, matching the virtual LAN field with the inner virtual LAN tag; matching the virtual LAN field with the outer virtual LAN tag in the preset virtual LAN tag information to obtain the QinQ function test result of the switch.

[0083] Furthermore, in order to improve the comprehensiveness of the QinQ function test, after step S302, the following steps are further included:

[0084] If the QinQ function test result is that the test fails, the mismatch item is recorded;

[0085] According to the mismatched items, the switch and the test-related items are adjusted to obtain adjusted test-related items;

[0086] The QinQ function is tested according to the thread pool and the adjusted test related items.

[0087] It is understandable that in order to identify the problem and make targeted adjustments later, when performing QinQ functional testing, if the test results show that the functional test fails (that is, the inner and outer virtual LAN labels of the data packet do not match the preset information, or there are other unexpected situations), these mismatches need to be recorded. These mismatches may include incorrect labels or missing label information, incorrect priority settings, etc.

[0088] It should be understood that after recording the mismatches, adjustments need to be made based on this information, which may involve modifying the switch configuration (such as virtual LAN settings, priority configuration, etc.), or adjusting the test tools, test environment, or test parameters.

[0089] In this embodiment, a broadcast packet is sent through the second thread. After the first thread captures the broadcast packet, the virtual LAN field of the broadcast packet is extracted using the data parsing module. When the virtual LAN field contains two virtual LAN tags, the two tags are matched with the inner virtual LAN tag and the preset virtual LAN tag information respectively to verify whether the QinQ function of the switch is normal. If the test result fails, that is, there are mismatches, these mismatches are recorded, and the switch and test-related items are adjusted based on this information, and then the test is performed again. Through multi-threaded concurrent execution, the test speed can be accelerated, the test cycle can be shortened, the accuracy of the test results is ensured, and it is helpful to quickly locate and solve problems.

[0090] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 After step S10, steps S11 to S12 may also be included:

[0091] Step S11, capturing network data packets through the first thread to verify the network environment and obtain a network verification result.

[0092] It should be noted that network data packets are large blocks of data divided into small blocks, each of which is encapsulated in an independent data packet and carries some necessary control information. These data packets are transmitted in the network through routers, switches and other network devices.

[0093] It should be understood that the network environment is the entire network topology and configuration status of the switch and its connected devices, which can include: 1) Physical connection, including the physical link connection status between the switch and other network devices (such as routers, servers, terminal devices, etc.), such as whether the optical fiber, network cable, etc. are connected normally. 2) Network topology: refers to the connection relationship and hierarchy between various devices in the network, including the location of the switch, the connection path with other devices, etc. 3) Network performance: network bandwidth, delay, packet loss rate and other performance indicators.

[0094] It is understandable that in order to ensure that the QinQ function test can be performed in a stable and reliable network environment, the network environment can be verified by capturing network data packets to check network connectivity, security, etc.

[0095] Step S12: adjusting the network environment according to the network verification result.

[0096] It is understandable that adjustments to the network environment can be made by optimizing the physical layout, adjusting network performance (bandwidth optimization, delay and packet loss rate control, load balancing, etc.), enhancing security, etc.

[0097] This embodiment verifies the network environment, so that potential problems can be discovered and solved in advance, ensuring that the QinQ function test can be performed in a healthy, stable and expected network environment, thereby improving the accuracy and effectiveness of the test.

[0098] In the third embodiment, before step S10, the following steps may also be included:

[0099] Set the switch's interface mode and virtual LAN information according to the preset configuration requirements, and obtain the configuration execution result through the data receiving function.

[0100] Based on the log module, record the configuration execution result;

[0101] Configure the QinQ function of the switch according to the preset configuration information;

[0102] Generate an address resolution protocol packet through the thread pool based on the configuration result and the test requirement;

[0103] The address resolution protocol packet is stored in a preset storage space, and a preset source physical address corresponding to the preset storage space is generated.

[0104] It is understandable that setting according to the preset configuration requirements is the initial configuration stage before the QinQ function test of the switch. The preset configuration requirements can be set based on factors such as network architecture, security policy, performance requirements, etc., and the interface mode (such as Access mode, Trunk mode, etc.) and virtual LAN information of the switch can be set according to the preset configuration requirements. After the configuration is completed, the configuration execution result is obtained through the data receiving function to confirm whether the configuration is successfully applied.

[0105] It should be noted that the virtual local area network information may include a virtual local area network unique identifier, a virtual local area network name, virtual local area network members, and the like.

[0106] In addition, it should be noted that the log module is a component used to record system events, errors, warnings, etc. After configuring the switch, the configuration execution results (success or failure, and possible error codes or descriptions) are recorded in the log.

[0107] It is understandable that according to the QinQ function configuration result of the switch and the test requirements (such as the specific scenario of testing the QinQ function, data packet size, transmission rate, etc.), the address resolution protocol packet is generated through the thread pool. In addition, the transmission control protocol data packet, the user datagram protocol data packet or other specific application data packets can also be generated.

[0108] This embodiment sets the interface mode and virtual LAN information of the switch according to the preset configuration requirements, obtains the results of the configuration execution through the data receiving function, uses the log module to record the results of these configuration executions, configures the QinQ function according to the preset configuration information, and generates an address resolution protocol packet through the thread pool based on the configuration results and test requirements, thereby achieving precise control and testing of the switch configuration, avoiding human configuration errors, and improving test efficiency.

[0109] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the QinQ function testing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0110] This application also provides a QinQ function test device, please refer to Figure 5 , the QinQ function test adjustment device comprises:

[0111] The data packet capture module 10 is used to create a thread pool according to the test requirements and the thread pool parameter configuration, apply for a first thread from the thread pool, capture the address resolution protocol packet of the preset source physical address through the first thread, and return the capture result within a preset time;

[0112] The data packet sending module 20 is used for applying for a second thread from the thread pool after receiving the capture result, constructing a broadcast packet of the address resolution protocol packet through the second thread, and setting an inner virtual local area network label of the broadcast packet;

[0113] The function testing module 30 is used to send the broadcast packet through the second thread, and test the QinQ function of the switch based on the inner virtual LAN label set in the broadcast packet.

[0114] The QinQ function test device provided by the present application adopts the QinQ function test method in the above embodiment, which can solve the technical problem that the manual test of the QinQ function requires the use of two computers and a packet sending tool to send corresponding data packets for testing. Compared with the prior art, the beneficial effects of the QinQ function test device provided by the present application are the same as the beneficial effects of the QinQ function test method provided by the above embodiment, and the other technical features in the QinQ function test device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0115] The present application provides a QinQ functional testing device, 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, and the instructions are executed by the at least one processor so that the at least one processor can execute the QinQ functional testing method in the above-mentioned embodiment one.

[0116] Reference below Figure 6 , which shows a schematic diagram of the structure of a QinQ functional test device suitable for implementing an embodiment of the present application. The QinQ functional test device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions: tablet computers), PMPs (Portable Media Players: portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The QinQ functional testing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0117] like Figure 6As shown, the QinQ functional test device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the QinQ functional test device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the QinQ functional test device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a QinQ functional test device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0118] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0119] The QinQ function test device provided by the present application adopts the QinQ function test method in the above embodiment, which can solve the technical problem that the manual test of the QinQ function requires the use of two computers and a packet sending tool to send corresponding data packets for testing. Compared with the prior art, the beneficial effects of the QinQ function test device provided by the present application are the same as the beneficial effects of the QinQ function test method provided by the above embodiment, and the other technical features in the QinQ function test device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0120] It should be understood that the various parts disclosed in this application can be implemented by 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 one or more embodiments or examples in a suitable manner.

[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0122] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the QinQ function testing method in the above-mentioned embodiment.

[0123] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0124] The computer-readable storage medium may be included in the QinQ functional test device; or may exist independently without being assembled into the QinQ functional test device.

[0125] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the QinQ functional testing device, the QinQ functional testing device: creates a thread pool according to the test requirements and thread pool parameter configuration, applies for a first thread from the thread pool, captures the address resolution protocol packet of a preset source physical address through the first thread, and returns the capture result within a preset time. After receiving the capture result, applies for a second thread from the thread pool, constructs a broadcast packet of the address resolution protocol packet through the second thread, and sets the inner virtual LAN label of the broadcast packet, sends the broadcast packet through the second thread, and tests the QinQ function of the switch based on the inner virtual LAN label set in the broadcast packet.

[0126] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0127] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0128] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0129] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned QinQ function test method, and can solve the technical problem that the manual test of the QinQ function requires the use of two computers and a packet sending tool to send corresponding data packets for testing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the QinQ function test method provided in the above-mentioned embodiment, and will not be repeated here.

[0130] The present application also provides a computer program product, including a computer program, which implements the steps of the QinQ function testing method as described above when executed by a processor.

[0131] The computer program product provided by the present application can solve the technical problem that the manual testing of QinQ function requires the use of two computers and a packet sending tool to send corresponding data packets for testing. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the QinQ function testing method provided in the above embodiment, which will not be repeated here.

[0132] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A QinQ function testing method, characterized in that: The method comprises the following steps: Create a thread pool according to the test requirements and thread pool parameter configuration, apply for a first thread from the thread pool, capture an address resolution protocol packet of a preset source physical address through the first thread, and return the capture result within a preset time; After receiving the capture result, applying for a second thread from the thread pool, constructing a broadcast packet of the address resolution protocol packet through the second thread, and setting an inner virtual local area network label of the broadcast packet; Sending the broadcast packet through the second thread, and testing the QinQ function of the switch based on the inner virtual LAN label set in the broadcast packet; The step of sending the broadcast packet through the second thread and testing the QinQ function of the switch based on the inner virtual LAN label set in the broadcast packet includes: Sending the broadcast packet through the second thread, and obtaining a virtual local area network field of the broadcast packet based on a data parsing module after the first thread captures the broadcast packet; The virtual local area network field is matched with the inner virtual local area network tag and the preset virtual local area network tag information to obtain the QinQ function test result of the switch.

2. The QinQ function testing method according to claim 1, characterized in that: After the step of matching the virtual LAN field with the inner virtual LAN tag and the preset virtual LAN tag information to obtain the QinQ function test result of the switch, the method further includes: If the QinQ function test result is that the test fails, the mismatch item is recorded; According to the mismatched items, the switch and the test-related items are adjusted to obtain adjusted test-related items; The QinQ function is tested according to the thread pool and the adjusted test related items.

3. The QinQ function testing method according to claim 1, characterized in that: The step of matching the virtual LAN field with the inner virtual LAN tag and the preset virtual LAN tag information to obtain the QinQ function test result of the switch includes: When the virtual local area network field includes two virtual local area network labels, matching the virtual local area network field with the inner virtual local area network label; The virtual local area network field is matched with the outer virtual local area network label in the preset virtual local area network label information to obtain the QinQ function test result of the switch.

4. The QinQ function testing method according to any one of claims 1 to 3, characterized in that: After the steps of creating a thread pool according to the test requirements and thread pool parameter configuration, applying for a first thread from the thread pool, capturing the address resolution protocol packet of a preset source physical address through the first thread, and returning the capture result within a preset time, the method further includes: Capturing network data packets through the first thread to verify the network environment and obtain a network verification result; The network environment is adjusted according to the network verification result.

5. The QinQ function testing method according to any one of claims 1 to 3, characterized in that: Before the steps of creating a thread pool according to the test requirements and thread pool parameter configuration, applying for a first thread from the thread pool, capturing the address resolution protocol packet of a preset source physical address through the first thread, and returning the capture result within a preset time, the method further includes: Set the switch interface mode and virtual LAN information according to the preset configuration requirements, and obtain the configuration execution results through the data receiving function; Based on the log module, record the configuration execution result; Configure the QinQ function of the switch according to the preset configuration information to obtain the configuration result; Generate an address resolution protocol packet through the thread pool based on the configuration result and the test requirement; The address resolution protocol packet is stored in a preset storage space, and a preset source physical address corresponding to the preset storage space is generated.

6. A QinQ function test device, characterized in that: The QinQ functional testing device comprises: A data packet capture module, used to create a thread pool according to the test requirements and thread pool parameter configuration, apply for a first thread from the thread pool, capture an address resolution protocol packet of a preset source physical address through the first thread, and return the capture result within a preset time; A data packet sending module, configured to apply for a second thread from the thread pool after receiving the capture result, construct a broadcast packet of the address resolution protocol packet through the second thread, and set an inner virtual local area network label of the broadcast packet; A function testing module, used for sending the broadcast packet through the second thread, and testing the QinQ function of the switch based on the inner virtual LAN label set in the broadcast packet; The functional testing module is further configured to send the broadcast packet through the second thread, and obtain the virtual local area network field of the broadcast packet based on the data parsing module after the first thread captures the broadcast packet; The virtual local area network field is matched with the inner virtual local area network tag and the preset virtual local area network tag information to obtain the QinQ function test result of the switch.

7. A QinQ functional testing device, characterized in that: The QinQ functional testing device comprises: a memory, a processor, and a QinQ functional testing program stored in the memory and executable on the processor. When the QinQ functional testing program is executed by the processor, the QinQ functional testing method according to any one of claims 1 to 5 is implemented.

8. A storage medium, characterized in that: The storage medium stores a QinQ function test program, and when the QinQ function test program is executed by the processor, the QinQ function test method according to any one of claims 1 to 5 is implemented.

9. A computer program product, characterized in that The computer program product comprises a QinQ functional testing program, and when the QinQ functional testing program is executed by a processor, the QinQ functional testing method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Method and system for automatically testing Qinq function

    CN105306302A

  • Message transmission method and device, processing node and storage medium

    CN111800326A

  • Pim multicast test method, device, equipment and medium

    CN118784514A