GMRP protocol component test method and system based on OVS

Testing GMRP protocol components in a virtual switch environment based on OVS is solved, and a fast and economical test process is achieved.

CN119484365APending Publication Date: 2025-02-18ZTE SOLUTION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411489823.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

During the product development process of the prior art, due to the characteristics of the GMRP protocol, it is necessary to rely on switches and test equipment to complete the support of the GMRP protocol, resulting in a long test preparation cycle and many dependencies, which increases the development cost.

Method used

The GMRP protocol component testing method based on OVS is adopted. By setting up the basic switching environment and client environment, running the GMRP protocol stack based on the virtual switch instance, and performing join tests and leave tests to obtain the test results.

Benefits of technology

There is no need to add additional hardware equipment, and use pure software to build a test environment, shorten the development cycle, save development costs, and simplify the testing process of GMRP protocol components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484365A_ABST
    Figure CN119484365A_ABST
Patent Text Reader

Abstract

The invention discloses a GMRP protocol component testing method and system based on OVS, and relates to the technical field of GMRP protocol component testing, and the method comprises the steps: setting a basic exchange environment; setting a basic client environment; a GMRP protocol stack is operated; executing a join test and executing a leave test; and obtaining a GMRP protocol component test result. According to the method and the device, the current situation that in the product development process in the prior art, due to the characteristics of the GMRP, the test can be started under the condition that the GMRP protocol needs to be supported by a switch and test equipment, and the technology is long in preparation period and multiple in dependence conditions is solved. According to the invention, the current situation that a GMRP protocol requires both a host and a switch to provide GMRP support to complete a multicast registration function is solved; according to the invention, the GMRP protocol stack is tested without depending on hardware, the development period is shortened, and the development cost is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of GMRP protocol component testing, and more particularly to a GMRP protocol component testing method and system based on OVS. Background Art

[0002] The full name of GMRP is GARP Multicast Registration Protocol, which relies on the general attribute registration function provided by the generic attribute registration protocol (GARP). It completes the dynamic registration of Layer 2 multicast on the switch by using the services provided by GARP. Both GMRP and GARP are industrial standard protocols defined by IEEE802.1D. GMRP is a universal pure Layer 2 protocol that does not rely on routers. It only requires the participation of hosts and switches to complete the multicast registration function. It does not require the participation of routers, so it reduces the burden on routers, has high work efficiency, and can support multicast representing people and protocols, not just IP multicast. GMRP completes the circulation of multicast frames in the local area network and provides more precise control of Layer 2 multicast traffic, thereby optimizing the communication transmission of multicast frames in the local area network. The shortcoming of the GMRP protocol is that it requires both hosts and switches to provide GMRP support to complete the multicast registration function. During the product development process, due to the characteristics of GMRP, it is often necessary to rely on switches. Testing can only be started when all test equipment supports the GMRP protocol. The preparation cycle is long and there are many dependent conditions.

[0003] Therefore, how to propose a GMRP protocol component testing method and system based on OVS, optimize the testing of the GMRP protocol stack, avoid hardware requirements, shorten the development cycle, and save development costs is a problem that technical personnel in this field urgently need to solve. Summary of the invention

[0004] In view of this, the present invention provides a GMRP protocol component testing method and system based on OVS, which optimizes the test of the GMRP protocol stack, avoids hardware requirements, shortens the development cycle, and saves development costs. In order to achieve the above purpose, the present invention adopts the following technical solutions:

[0005] A GMRP protocol component testing method based on OVS, comprising:

[0006] Set up the basic switching environment and create a virtual switch instance based on OVS;

[0007] Set up a basic client environment based on a virtual switch instance;

[0008] Run the GMRP protocol stack according to the basic switching environment and basic client environment;

[0009] Perform join test and leave test on the running GMRP protocol stack;

[0010] Get the GMRP protocol component test results.

[0011] Optionally, the setting of the basic exchange environment includes:

[0012] Create two network namespaces to obtain a first network namespace and a second network namespace;

[0013] Create two pairs of virtual network devices veth-pair, the first pair of network devices is the first primary network device and the first secondary network device, the second pair of network devices is the second primary network device and the second secondary network device;

[0014] Add the first main network device to the first network namespace, and the second main network device to the second network namespace;

[0015] The interface address of the first main network device is configured as the first address in the first network namespace, and the interface address of the second main network device is configured as the second address in the second network namespace;

[0016] Create two virtual switch instances based on OVS, add the first secondary network device of the interface to the first virtual switch instance, add the second secondary network device to the second virtual switch instance, configure the controller address of the first virtual switch instance to the first address, and the controller address of the second virtual switch instance to the second address.

[0017] Optionally, the setting of the basic client environment includes:

[0018] Create two network namespaces to obtain the third network namespace and the fourth network namespace;

[0019] Create two pairs of virtual network devices, namely the third pair of network devices and the fourth pair of network devices, the third pair of network devices is the third primary network device and the third secondary network device, and the fourth pair of network devices is the fourth primary network device and the fourth secondary network device;

[0020] Add the third primary network device to the third network namespace, and the third secondary network device to the first virtual switch instance; add the fourth primary network device to the fourth network namespace, and the fourth secondary network device to the second virtual switch instance;

[0021] A pair of virtual network devices is created, assuming that they are a fifth primary network device and a fifth secondary network device, and are added to the first virtual switch instance and the second virtual switch instance respectively.

[0022] Optionally, running the GMRP protocol stack includes: running the GMRP protocol stack to be tested in the first network namespace and the second network namespace, and monitoring and receiving GMRP messages, that is, Ethernet messages with a preset destination address.

[0023] Optionally, the method further includes: modifying the GMRP protocol stack, and adding / deleting a flow table to the virtual switch instance through a protocol when adding / deleting a multicast table entry.

[0024] Optionally, the executing the join test includes:

[0025] S1: Add flow tables in the first virtual switch instance and the second virtual switch instance respectively, and send Ethernet packets with preset destination addresses to their respective controllers through protocols;

[0026] S2: In the third network namespace, construct a join message, use a tool to set the address in the message carried by the message to the preset address, and send it to the first virtual switch instance through the third main network device. After the first virtual switch instance receives the message, it will hit the flow table set in S1, and the message will be sent to the first network namespace;

[0027] S3: The GMRP protocol stack running in the first network namespace processes the join message. If the GMRP protocol stack logic is correct, it will send a flow table with a preset destination address as the preset address and an outgoing interface as the third secondary network device to the first virtual switch instance of the virtual switch through the protocol. Otherwise, it indicates that there is an error in the GMRP protocol stack logic; at the same time, the first network namespace will propagate the join message and send the join message to the first virtual switch instance through the protocol. The first virtual switch instance will propagate the join message to the second virtual switch instance, and the second virtual switch instance will repeat the above process of S3. Finally, the first virtual switch instance and the second virtual switch instance will generate a flow table with a preset destination address as the preset address;

[0028] S4: In the second network namespace, construct a message with a preset destination address as the preset address, and use the tool to send it through the fourth main network device. If it runs normally, the message hits the flow table generated in the S3 process in the second virtual switch instance and the first virtual switch instance respectively, and finally the message will be forwarded to the first network namespace.

[0029] Optionally, the executing the leave test includes:

[0030] S11: In the third network namespace, a leave message is constructed, and a preset address is set in the message carried by the leave message, and the message is sent to the first virtual switch instance through the third main network device. After the first virtual switch instance receives the message, it hits the flow table set in S1, and the message is sent to the first network namespace;

[0031] S22: The GMRP protocol stack running in the first network namespace processes the leaving message. If the GMRP protocol stack logic is correct, the flow table generated in S3 is deleted and the leaving message is propagated to the second virtual switch instance.

[0032] S33: the second virtual switch instance repeats steps S11 to S22, and eventually, both the first virtual switch instance and the second virtual switch instance delete the flow table generated in S3;

[0033] S44: In the second network namespace, a message with a preset destination address as a preset address is constructed, and a tool is used to send the message through the fourth main network device. The second virtual switch instance cannot hit the forwarding flow table and discards the message.

[0034] Optionally, a GMRP protocol component test system based on OVS includes:

[0035] Basic switching environment setting module: used to set up the basic switching environment and create a virtual switch instance based on OVS;

[0036] Basic client environment setting module: used to set the basic client environment based on the virtual switch instance;

[0037] GMRP protocol stack operation module: used to operate the GMRP protocol stack according to the basic exchange environment and the basic client environment;

[0038] Test module: used to perform join test and leave test on the running GMRP protocol stack;

[0039] Output module: used to obtain GMRP protocol component test results.

[0040] It can be seen from the above technical solution that, compared with the prior art, the present invention discloses a GMRP protocol component testing method and system based on OVS, which has the following beneficial effects:

[0041] The present invention proposes a GMRP protocol component testing method based on OVS, including: setting a basic switching environment, creating a virtual switch instance based on OVS; setting a basic client environment based on the virtual switch instance; running the GMRP protocol stack according to the basic switching environment and the basic client environment; performing a join test and a leave test on the running GMRP protocol stack; and obtaining a GMRP protocol component test result. The present invention solves the problem that in the prior art, due to the characteristics of GMRP, during the product development process, the switch often needs to be relied on, and the test equipment must complete the support for the GMRP protocol before the test can be started. This technology has a long preparation cycle and many dependent conditions. The present invention solves the problem that the GMRP protocol requires both the host and the switch to provide GMRP support in order to complete the registration function of the multicast; the GMRP protocol is a commonly used protocol for industrial switches, and the general development and testing method requires at least two equipment entities, a network tester and a switch. The network tester is generally expensive, and the switch equipment generally requires hardware and basic software systems to complete research and development before it can be used. The present invention uses a pure software method to build a test environment without the need for additional equipment, shortening the development cycle and saving development costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention 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, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0043] Figure 1 A schematic flow chart of a GMRP protocol component testing method based on OVS provided by the present invention.

[0044] Figure 2 A schematic diagram of the basic client environment provided by the present invention.

[0045] Figure 3 A schematic diagram of the GMRP protocol stack provided by the present invention.

[0046] Figure 4 A schematic diagram of the principle of executing a join test provided by the present invention.

[0047] Figure 5 A schematic diagram of the principle of executing the leave test provided by the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] The embodiment of the present invention discloses a GMRP protocol component testing method based on OVS, including:

[0050] Set up the basic switching environment and create a virtual switch instance based on OVS;

[0051] Set up a basic client environment based on a virtual switch instance;

[0052] Run the GMRP protocol stack according to the basic switching environment and basic client environment;

[0053] Perform join test and leave test on the running GMRP protocol stack;

[0054] Get the GMRP protocol component test results.

[0055] Furthermore, the setting of the basic exchange environment includes:

[0056] Create two network namespaces to obtain a first network namespace and a second network namespace;

[0057] Create two pairs of virtual network devices veth-pair, the first pair of network devices is the first primary network device and the first secondary network device, the second pair of network devices is the second primary network device and the second secondary network device;

[0058] Add the first main network device to the first network namespace, and the second main network device to the second network namespace;

[0059] The interface address of the first main network device is configured as the first address in the first network namespace, and the interface address of the second main network device is configured as the second address in the second network namespace;

[0060] Create two virtual switch instances based on OVS, add the first secondary network device of the interface to the first virtual switch instance, add the second secondary network device to the second virtual switch instance, configure the controller address of the first virtual switch instance to the first address, and the controller address of the second virtual switch instance to the second address.

[0061] Furthermore, the setting of the basic client environment includes:

[0062] Create two network namespaces to obtain the third network namespace and the fourth network namespace;

[0063] Create two pairs of virtual network devices, namely the third pair of network devices and the fourth pair of network devices, the third pair of network devices is the third primary network device and the third secondary network device, and the fourth pair of network devices is the fourth primary network device and the fourth secondary network device;

[0064] Add the third primary network device to the third network namespace, and the third secondary network device to the first virtual switch instance; add the fourth primary network device to the fourth network namespace, and the fourth secondary network device to the second virtual switch instance;

[0065] A pair of virtual network devices is created, assuming that they are a fifth primary network device and a fifth secondary network device, and are added to the first virtual switch instance and the second virtual switch instance respectively.

[0066] Further, the running of the GMRP protocol stack includes: running the GMRP protocol stack to be tested in the first network namespace and the second network namespace, and monitoring and receiving GMRP messages, that is, Ethernet messages with a preset destination address.

[0067] Furthermore, the method further includes: modifying the GMRP protocol stack, and adding / deleting a flow table to the virtual switch instance through a protocol when adding / deleting a multicast table entry.

[0068] Further, the execution of the join test includes:

[0069] S1: Add flow tables in the first virtual switch instance and the second virtual switch instance respectively, and send Ethernet packets with preset destination addresses to their respective controllers through protocols;

[0070] S2: In the third network namespace, construct a join message, use a tool to set the address in the message carried by the message to the preset address, and send it to the first virtual switch instance through the third main network device. After the first virtual switch instance receives the message, it will hit the flow table set in S1, and the message will be sent to the first network namespace;

[0071] S3: The GMRP protocol stack running in the first network namespace processes the join message. If the GMRP protocol stack logic is correct, it will send a flow table with a preset destination address as the preset address and an outgoing interface as the third secondary network device to the first virtual switch instance of the virtual switch through the protocol. Otherwise, it indicates that there is an error in the GMRP protocol stack logic; at the same time, the first network namespace will propagate the join message and send the join message to the first virtual switch instance through the protocol. The first virtual switch instance will propagate the join message to the second virtual switch instance, and the second virtual switch instance will repeat the above process of S3. Finally, the first virtual switch instance and the second virtual switch instance will generate a flow table with a preset destination address as the preset address;

[0072] S4: In the second network namespace, construct a message with a preset destination address as the preset address, and use the tool to send it through the fourth main network device. If it runs normally, the message hits the flow table generated in the S3 process in the second virtual switch instance and the first virtual switch instance respectively, and finally the message will be forwarded to the first network namespace.

[0073] Further, the execution of the leave test includes:

[0074] S11: In the third network namespace, a leave message is constructed, and a preset address is set in the message carried by the leave message, and the message is sent to the first virtual switch instance through the third main network device. After the first virtual switch instance receives the message, it hits the flow table set in S1, and the message is sent to the first network namespace;

[0075] S22: The GMRP protocol stack running in the first network namespace processes the leaving message. If the GMRP protocol stack logic is correct, the flow table generated in S3 is deleted and the leaving message is propagated to the second virtual switch instance.

[0076] S33: the second virtual switch instance repeats steps S11 to S22, and eventually, both the first virtual switch instance and the second virtual switch instance delete the flow table generated in S3;

[0077] S44: In the second network namespace, a message with a preset destination address as a preset address is constructed, and a tool is used to send the message through the fourth main network device. The second virtual switch instance cannot hit the forwarding flow table and discards the message.

[0078] In a specific implementation, a GMRP protocol component testing method based on OVS, such as Figure 1 As shown, the specific steps include:

[0079] Step 1: Set up the basic exchange environment:

[0080] The basic environment is based on the standard Linux operating system and is completed using the network components provided by the system and some common third-party components.

[0081] Create two Linux network namespaces, assuming they are NS-A and NS-B;

[0082] Create two pairs of Linux virtual network devices veth-pair. Assume that the first pair of network devices are veth-a1 and veth-a2, and the second pair of network devices are veth-b1 and veth-b2.

[0083] Add veth-a1 to NS-A and veth-b1 to NS-B;

[0084] In network namespace NS-A, configure the address of veth-a1 interface to IP-A, and in network namespace NS-B, configure the address of veth-b1 interface to IP-B;

[0085] Create two virtual switch instances ovs-bridge based on OVS (Software Defined Network (SDN) virtual switch), assuming they are BR-A and BR-B. Add interface veth-a2 to BR-A and veth-b2 to BR-B. Configure the openflow controller address of BR-A to IP-A and the openflow controller address of BR-B to IP-B.

[0086] Step 2: Set up the basic client environment, such as Figure 2 As shown:

[0087] Create two Linux network namespaces, assuming they are NS-CLIENT-A and NS-CLIENT-B;

[0088] Create two pairs of Linux virtual network devices veth-pair, namely veth-client-a1, veth-client-a2 and veth-client-b1, veth-client-b2;

[0089] Add veth-client-a1 to NS-CLIENT-A and veth-client-a2 to BR-A; add veth-client-b1 to NS-CLIENT-B and veth-client-b2 to BR-B;

[0090] Create a pair of Linux virtual network devices veth-pair, assuming they are veth-br-a and veth-br-b, and add them to BR-A and BR-B respectively.

[0091] Step 3: Run the GMRP protocol stack, such as Figure 3 As shown:

[0092] In NS-A and NS-B, the GMRP protocol stack to be tested is run to listen for GMRP messages, that is, Ethernet messages with a destination MAC of 01:80:c2:00:00:20. The GMRP protocol stack has been modified to add / delete flow tables to ovs-bridge through the openflow protocol when adding / deleting multicast MAC table entries.

[0093] Step 4: Execute the join test, such as Figure 4 As shown:

[0094] S1: Add flow tables to the two virtual switches BR-A and BR-B respectively, and send the packets with the destination MAC address 01:80:c2:00:00:20 to their respective openflow controllers through the pack-in message of the openflow protocol;

[0095] S2: In NS-CLIENT-A, construct a GMRP Join message. You can use scapy or other tools, and set the MAC address to MUTICAST_MAC1 in the message. Send it to BR-A through veth-client-a1. After BR-A receives the message, it will hit the flow table set in the above step S1, and the message will be sent to NS-A.

[0096] S3: The GMRP protocol stack running in NS-A processes the GMRP Join message. If the GMRP protocol stack logic is correct, it will send a flow table with the destination MAC as MUTICAST_MAC1 and the outgoing interface as veth-client-a2 to the virtual switch BR-A through the Openflow protocol. Otherwise, it means that the GMRP protocol stack logic is wrong. At the same time, NS-A will propagate the GMRP Join message and send the GMRP Join message to BR-A through the pack_out message of the openflow protocol. BR-A will propagate the GMRP Join message to BR-B, and BR-B will repeat the above process. Finally, BR-A and BR-B will generate a flow table with the destination MAC as MUTICAST_MAC1.

[0097] S4: In NS-B, construct a message with destination MAC MUTICAST_MAC1. You can use scapy or other tools to send it through veth-client-b1. If it runs normally, the message will hit the flow table generated in step S3 in BR-B and BR-A respectively, and finally the message will be forwarded to NS-A.

[0098] Step 5: Execute the leave test, such as Figure 5 As shown:

[0099] In NS-CLIENT-A, construct a GMRP leave message. You can use scapy or other tools, and set the MAC address to MUTICAST_MAC1 in the message. Send it to BR-A through veth-client-a1. After BR-A receives the message, it hits the flow table set in step S1, and the message is sent to NS-A.

[0100] The GMRP protocol stack running in NS-A processes the GMRP leave message. If the GMRP protocol stack logic is correct, it will delete the flow table generated in step S3 and propagate the GMRP leave message to BR-B. BR-B will also repeat the above process. Eventually, both BR-A and BA-B will delete the flow table generated in step S3.

[0101] In NS-B, construct a message with destination MAC as MUTICAST_MAC1. You can use scapy or other tools to send it through veth-client-b1. BR-B will not be able to hit the forwarding flow table and will discard the message.

[0102] In a specific implementation, a GMRP protocol component testing system based on OVS includes:

[0103] Basic switching environment setting module: used to set up the basic switching environment and create a virtual switch instance based on OVS;

[0104] Basic client environment setting module: used to set the basic client environment based on the virtual switch instance;

[0105] GMRP protocol stack operation module: used to operate the GMRP protocol stack according to the basic exchange environment and the basic client environment;

[0106] Test module: used to perform join test and leave test on the running GMRP protocol stack;

[0107] Output module: used to obtain GMRP protocol component test results.

[0108] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0109] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A GMRP protocol component testing method based on OVS, characterized in that: include: Set up the basic switching environment and create a virtual switch instance based on OVS; Set up a basic client environment based on a virtual switch instance; Run the GMRP protocol stack according to the basic switching environment and basic client environment; Perform join test and leave test on the running GMRP protocol stack; Get the GMRP protocol component test results.

2. A GMRP protocol component testing method based on OVS according to claim 1, characterized in that, The setting of the basic exchange environment includes: Create two network namespaces to obtain a first network namespace and a second network namespace; Create two pairs of virtual network devices veth-pair, the first pair of network devices is the first primary network device and the first secondary network device, the second pair of network devices is the second primary network device and the second secondary network device; Add the first main network device to the first network namespace, and the second main network device to the second network namespace; The interface address of the first main network device is configured as the first address in the first network namespace, and the interface address of the second main network device is configured as the second address in the second network namespace; Create two virtual switch instances based on OVS, add the first secondary network device of the interface to the first virtual switch instance, add the second secondary network device to the second virtual switch instance, configure the controller address of the first virtual switch instance to the first address, and the controller address of the second virtual switch instance to the second address.

3. A GMRP protocol component testing method based on OVS according to claim 1, characterized in that, The basic client environment setting includes: Create two network namespaces to obtain the third network namespace and the fourth network namespace; Create two pairs of virtual network devices, namely the third pair of network devices and the fourth pair of network devices, the third pair of network devices is the third primary network device and the third secondary network device, and the fourth pair of network devices is the fourth primary network device and the fourth secondary network device; Add the third primary network device to the third network namespace, and the third secondary network device to the first virtual switch instance; add the fourth primary network device to the fourth network namespace, and the fourth secondary network device to the second virtual switch instance; A pair of virtual network devices is created, assuming that they are a fifth primary network device and a fifth secondary network device, and are added to the first virtual switch instance and the second virtual switch instance respectively.

4. A GMRP protocol component testing method based on OVS according to claim 1, characterized in that, The running of the GMRP protocol stack includes: running the GMRP protocol stack to be tested in the first network namespace and the second network namespace, and monitoring and receiving GMRP messages, that is, Ethernet messages with a preset destination address.

5. A GMRP protocol component testing method based on OVS according to claim 4, characterized in that, Also includes: The GMRP protocol stack is modified to add / delete flow tables to the virtual switch instance through the protocol when adding / deleting multicast entries.

6. A GMRP protocol component testing method based on OVS according to claim 1, characterized in that, The execution of the join test includes: S1: adding flow tables in the first virtual switch instance and the second virtual switch instance respectively, and sending Ethernet packets with preset destination addresses to their respective controllers through protocols; S2: In the third network namespace, construct a join message, use a tool to set the address in the message carried by the message to the preset address, and send it to the first virtual switch instance through the third main network device. After the first virtual switch instance receives the message, it will hit the flow table set in S1, and the message will be sent to the first network namespace; S3: The GMRP protocol stack running in the first network namespace processes the join message. If the GMRP protocol stack logic is correct, it will send a flow table with a preset destination address as the preset address and an outgoing interface as the third secondary network device to the first virtual switch instance through the protocol. Otherwise, it indicates that the GMRP protocol stack logic is wrong. At the same time, the first network namespace will propagate the join message and send the join message to the first virtual switch instance through the protocol. The first virtual switch instance will propagate the join message to the second virtual switch instance. The second virtual switch instance repeats the above process of S3. Finally, the first virtual switch instance and the second virtual switch instance will generate a flow table with a preset destination address as the preset address. S4: In the second network namespace, construct a message with a preset destination address as the preset address, and use the tool to send it through the fourth main network device. If it runs normally, the message hits the flow table generated in the S3 process in the second virtual switch instance and the first virtual switch instance respectively, and finally the message will be forwarded to the first network namespace.

7. A GMRP protocol component testing method based on OVS according to claim 1, characterized in that, The execution of the leave test includes: S11: In the third network namespace, a leave message is constructed, a preset address is set in the message carried by the message using a tool, and the message is sent to the first virtual switch instance through the third main network device. After the first virtual switch instance receives the message, it hits the flow table set in S1, and the message is sent to the first network namespace; S22: The GMRP protocol stack running in the first network namespace processes the leaving message. If the GMRP protocol stack logic is correct, the flow table generated in S3 is deleted and the leaving message is propagated to the second virtual switch instance. S33: the second virtual switch instance repeats steps S11 to S22, and eventually, both the first virtual switch instance and the second virtual switch instance delete the flow table generated in S3; S44: In the second network namespace, a message with a preset destination address as a preset address is constructed, and a tool is used to send the message through the fourth main network device. The second virtual switch instance cannot hit the forwarding flow table and discards the message.

8. A GMRP protocol component testing system based on OVS, characterized in that: include: Basic switching environment setting module: used to set up the basic switching environment and create a virtual switch instance based on OVS; Basic client environment setting module: used to set the basic client environment based on the virtual switch instance; GMRP protocol stack operation module: used to operate the GMRP protocol stack according to the basic exchange environment and the basic client environment; Test module: used to perform join test and leave test on the running GMRP protocol stack; Output module: used to obtain GMRP protocol component test results.