A virtual switch deployment, testing method and apparatus

By deploying virtual switches based on network topology information in an embedded platform, the problem of large virtual switch footprint is solved, enabling miniaturized and cost-effective virtual switch deployment, and improving the utilization of computing resources and the flexibility of the virtualization environment.

CN121239653BActive Publication Date: 2026-05-26CHENGDU CELIS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU CELIS TECH CO LTD
Filing Date
2025-12-04
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing virtual switches occupy a large amount of space when deployed on mainframe platforms, and lack effective space optimization and cost control.

Method used

By acquiring the network topology information of the embedded platform, virtual network ports and virtual switches are deployed in the software and logical areas according to the binding relationship, and then bound to each other, so as to achieve precise positioning and isolation of virtual switches and reduce the need for physical switches.

Benefits of technology

Deploying virtual switches in miniaturized embedded platforms reduces space footprint and cost, improves computing resource utilization, and supports multi-domain virtualization and flexible application scenario deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121239653B_ABST
    Figure CN121239653B_ABST
Patent Text Reader

Abstract

This application relates to a method and apparatus for deploying and testing virtual switches. The method includes: acquiring network topology information of an embedded platform to be deployed; wherein the network topology information includes a first binding relationship between virtual network ports and virtual switches, and a second binding relationship between the virtual switches and the Ethernet interfaces of the device under test; deploying virtual network ports in the software area and virtual switches in the logical area of ​​the embedded platform to be deployed, based on the number of virtual network ports and virtual switches in the network topology information; binding the deployed virtual network ports and virtual switches according to the first binding relationship, and binding the Ethernet interfaces and deployed virtual switches according to the second binding relationship. This method can reduce the space occupied by virtual switches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method and apparatus for deploying and testing a virtual switch. Background Technology

[0002] A virtual switch (vSwitch) is open-source network software running on the Linux platform. It operates at Layer 2 data networking and is used to forward, isolate, and manage virtual network traffic in a virtualized environment. Open vSwitch (OVS) is a typical implementation of a virtual switch. OVS is a production-grade multilayer virtual switch, with its core architecture consisting of the ovs-vswitchd daemon (the core daemon of Open vSwitch), kernel modules, and a database server. Forwarding performance can be accelerated and improved using the DPDK (Data Plane Development Kit).

[0003] In related technologies, multiple virtual switches are generated through software. However, most of these virtual switches are deployed on mainframe platforms, which take up a lot of space. Summary of the Invention

[0004] Therefore, it is necessary to provide a method and apparatus for deploying and testing virtual switches that can reduce the space occupied by virtual switches, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a method for deploying a virtual switch, including:

[0006] Obtain the network topology information of the embedded platform to be deployed; the network topology information includes the first binding relationship between virtual network ports and virtual switches, and the second binding relationship between virtual switches and the Ethernet interfaces of the device under test;

[0007] Based on the number of virtual ports and virtual switches in the network topology information, deploy virtual ports in the software area of ​​the embedded platform to be deployed and deploy virtual switches in the logical area of ​​the embedded platform to be deployed.

[0008] Based on the first binding relationship, the deployed virtual network ports and virtual switches are bound together, and based on the second binding relationship, the Ethernet interfaces and the deployed virtual switches are bound together.

[0009] In one embodiment, the method further includes:

[0010] Obtain the configuration information of the embedded platform to be deployed; the configuration information includes the first correspondence between virtual network interfaces and service identifiers;

[0011] Based on the first correspondence, configure the corresponding service identifier for the deployed virtual network interface.

[0012] In one embodiment, the configuration information further includes Ethernet interface switch lookup information, which includes a second correspondence between the interface parameters of the Ethernet interface and the set of Ethernet interfaces to which it belongs. The interface parameters are determined based on the Ethernet interface's virtual LAN identifier, network domain identifier, and Ethernet address. The method further includes:

[0013] Configure the switch lookup information for the bound Ethernet interfaces of the deployed virtual switch.

[0014] In one embodiment, the network topology information further includes a third binding relationship between system access port groups and virtual ports, and a fourth binding relationship between system access port groups and virtual switches, wherein each system access port group includes a first system access port and a second system access port; the method further includes:

[0015] For each system access network port group, according to the third binding relationship, a first system access network port bound to the deployed virtual network port is deployed in the software area, and according to the fourth binding relationship, a second system access network port bound to the deployed virtual switch is deployed in the logical area; wherein, the virtual network port bound to the first system access network port and the virtual switch bound to the second system access network port have a first binding relationship.

[0016] In one embodiment, the network topology information further includes a fifth binding relationship between the Ethernet controller and the virtual switch, and a sixth binding relationship between the Ethernet controller and the Ethernet interface; the method further includes:

[0017] Based on the number of Ethernet controllers in the network topology information, deploy Ethernet controllers in the logical area;

[0018] The deployed Ethernet controller and virtual switch are bound according to the fifth binding relationship, and the deployed Ethernet controller and Ethernet interface are bound according to the sixth binding relationship; wherein, virtual switches and Ethernet interfaces bound to the same Ethernet controller have a second binding relationship.

[0019] Secondly, this application also provides a testing method applied to a computer device, the computer device including an embedded platform deployed with virtual network ports and virtual switches; the virtual network ports and virtual switches are deployed in the embedded platform according to any embodiment of the method of the first aspect, and the testing method includes:

[0020] Upon receiving a test request, the embedded platform forwards the test request to the corresponding target virtual network interface;

[0021] The test message is generated based on the test request through the target virtual network interface, and then sent to the target virtual switch bound to the target virtual network interface.

[0022] The test message is sent to the target Ethernet interface bound to the target virtual switch through the target virtual switch, so that the device under test can receive the test message through the target Ethernet interface and send the response result generated in response to the test message back to the target virtual switch through the target Ethernet interface.

[0023] Receive the response from the target virtual switch via the target virtual network port;

[0024] Based on the response, determine the test result of the test request.

[0025] In one embodiment, the virtual network interface is configured with a corresponding service identifier, and the test request includes the service identifier;

[0026] Send the test request to the corresponding target virtual network interface, including:

[0027] The test request is sent to the target virtual network interface corresponding to the service identifier.

[0028] In one embodiment, the virtual switch is also configured with switch lookup information for the bound Ethernet interface; the test request includes the target VLAN identifier, the target network domain identifier, and the target Ethernet address;

[0029] The test message is sent to the target Ethernet interface bound to the target virtual switch via the target virtual switch, including:

[0030] The target interface parameters are determined by the target virtual switch based on the target virtual LAN identifier, the target network domain identifier, and the target Ethernet address.

[0031] The target set of Ethernet interfaces corresponding to the target interface parameters is determined by using the target virtual switch to find the information from the switch.

[0032] The target Ethernet interface is determined from the target Ethernet set by the target virtual switch, matching the target VLAN ID, target network domain ID, and target Ethernet address, and the test message is sent to the target Ethernet interface.

[0033] Thirdly, this application also provides a virtual switch deployment apparatus, the apparatus comprising:

[0034] The acquisition module is used to acquire the network topology information of the embedded platform to be deployed; wherein, the network topology information includes the first binding relationship between virtual network ports and virtual switches, and the second binding relationship between virtual switches and the Ethernet interface of the device under test;

[0035] The deployment module is used to deploy virtual network ports in the software area of ​​the embedded platform to be deployed and virtual switches in the logical area of ​​the embedded platform to be deployed, based on the number of virtual network ports and virtual switches in the network topology information.

[0036] The binding module is used to bind the deployed virtual network ports and virtual switches according to the first binding relationship, and to bind the Ethernet interfaces and the deployed virtual switches according to the second binding relationship.

[0037] Fourthly, this application also provides a testing apparatus, which is an embedded platform deployed with virtual network ports and virtual switches; the virtual network ports and virtual switches are deployed in the embedded platform according to any embodiment of the method of the first aspect, and the apparatus includes:

[0038] The first determining module is used to send the test request to the corresponding target virtual network interface when the embedded platform receives the test request;

[0039] The second determining module is used to generate a test message based on the test request through the target virtual network interface, and send the test message to the target virtual switch bound to the target virtual network interface;

[0040] The third determination module is used to send test messages to the target Ethernet interface bound to the target virtual switch through the target virtual switch, so that the device under test can receive test messages through the target Ethernet interface and send back the response results generated in response to the test messages to the target virtual switch through the target Ethernet interface.

[0041] The test feedback module is used to receive the response results from the target virtual switch through the target virtual network port;

[0042] The result determination module is used to determine the test result of the test request based on the response result.

[0043] Fifthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0044] Obtain the network topology information of the embedded platform to be deployed; the network topology information includes the first binding relationship between virtual network ports and virtual switches, and the second binding relationship between virtual switches and the Ethernet interfaces of the device under test;

[0045] Based on the number of virtual ports and virtual switches in the network topology information, deploy virtual ports in the software area of ​​the embedded platform to be deployed and deploy virtual switches in the logical area of ​​the embedded platform to be deployed.

[0046] Based on the first binding relationship, the deployed virtual network ports and virtual switches are bound together, and based on the second binding relationship, the Ethernet interfaces and the deployed virtual switches are bound together.

[0047] Sixthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0048] Obtain the network topology information of the embedded platform to be deployed; the network topology information includes the first binding relationship between virtual network ports and virtual switches, and the second binding relationship between virtual switches and the Ethernet interfaces of the device under test;

[0049] Based on the number of virtual ports and virtual switches in the network topology information, deploy virtual ports in the software area of ​​the embedded platform to be deployed and deploy virtual switches in the logical area of ​​the embedded platform to be deployed.

[0050] Based on the first binding relationship, the deployed virtual network ports and virtual switches are bound together, and based on the second binding relationship, the Ethernet interfaces and the deployed virtual switches are bound together.

[0051] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0052] Obtain the network topology information of the embedded platform to be deployed; the network topology information includes the first binding relationship between virtual network ports and virtual switches, and the second binding relationship between virtual switches and the Ethernet interfaces of the device under test;

[0053] Based on the number of virtual ports and virtual switches in the network topology information, deploy virtual ports in the software area of ​​the embedded platform to be deployed and deploy virtual switches in the logical area of ​​the embedded platform to be deployed.

[0054] Based on the first binding relationship, the deployed virtual network ports and virtual switches are bound together, and based on the second binding relationship, the Ethernet interfaces and the deployed virtual switches are bound together.

[0055] The aforementioned virtual switch deployment and testing method and apparatus, based on the number of virtual network ports and virtual switches in the network topology information of the embedded platform to be deployed, deploys virtual network ports in the software area and virtual switches in the logical area of ​​the embedded platform to be deployed. It binds the deployed virtual network ports and virtual switches according to the first binding relationship between the virtual network ports and virtual switches in the network topology information, and binds the Ethernet interfaces to the deployed virtual switches according to the second binding relationship between the virtual switches and the Ethernet interfaces of the device under test in the network topology information. This enables the deployment of virtual switches in a miniaturized embedded platform, which occupies less space and is less costly compared to large network testing instruments and network testing environments constructed with "host + acquisition card". The virtual switches are deployed in the logical area of ​​the embedded platform to be deployed, realizing virtual switching based on logic, resulting in a lower occupancy rate in the software area of ​​the embedded platform to be deployed, allowing more computing resources in the software area to be used for business testing. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 This is a flowchart illustrating a virtual switch deployment method in one embodiment;

[0058] Figure 2 This is a schematic diagram of an embedded platform after deployment in one embodiment;

[0059] Figure 3 This is a flowchart illustrating a testing method in one embodiment;

[0060] Figure 4 This is a schematic diagram illustrating the process of adding table entries and performing secondary table lookups in one embodiment.

[0061] Figure 5 This is a structural block diagram of a virtual switch deployment device in one embodiment;

[0062] Figure 6 This is a structural block diagram of the test apparatus in one embodiment;

[0063] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0065] It should be noted that the terms "first," "second," etc., used in this application may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion.

[0066] In one exemplary embodiment, such as Figure 1 As shown, a method for deploying a virtual switch is provided. This embodiment illustrates the method by applying it to a computer device, which can be a server or a terminal. The computer device includes an embedded platform to be deployed. In this embodiment, the method includes the following steps:

[0067] Step 102: Obtain the network topology information of the embedded platform to be deployed; wherein, the network topology information includes the first binding relationship between the virtual network port and the virtual switch, and the second binding relationship between the virtual switch and the Ethernet interface of the device under test.

[0068] The embedded platform to be deployed is a small embedded platform, which can be a SOC (System on Chip). The network topology information of the embedded platform to be deployed refers to the set of information used to describe the communication relationships within the embedded platform or the communication relationships between the embedded platform and the outside world.

[0069] In some implementations, the computer device acquires network topology information of the embedded platform to be deployed, sent by the terminal. This network topology information includes a first binding relationship between a virtual network port and a virtual switch, and a second binding relationship between the virtual switch and the Ethernet interface of the device under test (DUT). The virtual network port refers to a network port running on software or an operating system, not a physical network port, used to implement virtualized communication connections within the embedded platform or between the embedded platform and an external network. The virtual switch connects the virtual network port and the Ethernet interface of the DUT, enabling data forwarding between them. For example, the virtual switch is a Layer 2 (L2) switch, operating at the data link layer (L2). The Ethernet interface of the DUT is a physical interface used to exchange real network packets with the DUT.

[0070] For example, network topology information may be, but is not limited to, graphs (such as network topology diagrams), tables, and text data.

[0071] Step 104: Based on the number of virtual network ports and virtual switches in the network topology information, deploy virtual network ports in the software area of ​​the embedded platform to be deployed and deploy virtual switches in the logical area of ​​the embedded platform to be deployed.

[0072] The embedded platform to be deployed includes a software area and a logic area. The software area refers to the part of the embedded platform that runs software, stores programs and configurations, executes the protocol stack, and controls the logic. The logic area refers to the hardware logic units within the embedded platform used for high-speed data processing, forwarding, and accelerated computing.

[0073] In some implementations, the network topology information also includes the number of virtual network ports and virtual switches to be deployed to the embedded platform. The number of virtual network ports and virtual switches can be determined based on the first binding relationship between the virtual network ports and virtual switches included in the network topology information, and the second binding relationship between the virtual switches and the Ethernet interfaces of the device under test. The number of virtual network ports is determined based on the number of services handled by the Ethernet interfaces of the device under test; that is, the number of services corresponding to the Ethernet interfaces is the same as the number of virtual network ports. The number of virtual switches is determined based on the number of network domains to which the services handled by the Ethernet interfaces belong; that is, the number of virtual switches is the same as the number of network domains. A network domain refers to the logical boundary of the network switching scope. For example, a vehicle network domain may include a power domain, a body domain, a test domain, an infotainment domain, etc. Virtual network ports are deployed in the software area of ​​the embedded platform based on the number of virtual network ports in the network topology information; the number of virtual network ports in the network topology information determines the number of virtual network ports deployed in the software area. Similarly, virtual switches are deployed in the logical area of ​​the embedded platform based on the number of virtual switches in the network topology information; the number of virtual switches in the network topology information determines the number of virtual switches deployed in the logical area.

[0074] For example, a System-on-Chip (SOC) includes a software region (PS) (Processing System) and a logic region (PL) (Programmable Logic). The logic region can be a programmable logic component.

[0075] Furthermore, the logical area where the embedded platform is to be deployed can be configured with up to 8 virtual switches. The virtual switches are isolated from each other, and broadcast, multicast, and unicast packets within a virtual switch can only be forwarded within that virtual switch and will not be forwarded to other virtual switches.

[0076] Step 106: Bind the deployed virtual network port and virtual switch according to the first binding relationship, and bind the Ethernet interface and the deployed virtual switch according to the second binding relationship.

[0077] Based on the first binding relationship, the deployed virtual network ports and virtual switches are bound together. This binding relationship can be one-to-one or many-to-one. Based on the second binding relationship, Ethernet interfaces are bound to the deployed virtual switches. Again, this binding relationship can be one-to-one or many-to-one. Binding the deployed virtual network ports and virtual switches based on the first binding relationship determines the network domain to which each virtual network port belongs, enabling data isolation between virtual network ports in different network domains. Binding the Ethernet interfaces and deployed virtual switches based on the second binding relationship maps the virtual switches to actual external physical Ethernet interfaces, allowing the virtual switches to access external networks.

[0078] In the above-described virtual switch deployment method, based on the number of virtual ports and virtual switches in the network topology information of the embedded platform to be deployed, virtual ports are deployed in the software area and virtual switches are deployed in the logical area of ​​the embedded platform to be deployed. The deployed virtual ports and virtual switches are bound according to the first binding relationship between the virtual ports and virtual switches in the network topology information, and the Ethernet interfaces are bound to the deployed virtual switches according to the second binding relationship between the virtual switches and the Ethernet interfaces of the device under test in the network topology information. This allows for the deployment of virtual switches in a miniaturized embedded platform, which occupies less space and is less costly compared to large network testing instruments and network testing environments built with "host + acquisition card". The virtual switches are deployed in the logical area of ​​the embedded platform to be deployed, enabling virtual switching based on logic, resulting in lower occupancy in the software area of ​​the embedded platform and allowing more computing resources to be used for business testing. Multiple virtual switches corresponding to network domains can be deployed simultaneously in the logical area, and the virtual switches are isolated from each other, eliminating the need to deploy independent physical switches for each network domain. This not only saves costs but also allows for dynamic addition / removal of virtual switches based on application scenarios, improving flexibility and operational efficiency.

[0079] In an exemplary embodiment, the method further includes: obtaining configuration information of the embedded platform to be deployed; wherein the configuration information includes a first correspondence between virtual network interfaces and service identifiers; and configuring a corresponding service identifier for the deployed virtual network interface according to the first correspondence.

[0080] The computer equipment can also obtain configuration information of the embedded platform to be deployed. This configuration information includes a primary correspondence between virtual network interfaces and service identifiers. The service identifier identifies the specific service type carried by the virtual network interface, such as performance testing or stability / reliability testing. There is a one-to-one correspondence between virtual network interfaces and service identifiers. Based on this primary correspondence, corresponding service identifiers are configured for the deployed virtual network interfaces so that the appropriate virtual network interface can be determined during testing.

[0081] Furthermore, the service identifier can be a service identifier under a network domain, that is, the service identifier contains the network domain to which the service identifier belongs, thereby distinguishing virtual network ports under different network domains.

[0082] In this embodiment of the application, the virtual network interface can be automatically configured for services based on the first correspondence between the virtual network interface and the service identifier during the deployment process of the embedded platform, thereby avoiding manual configuration errors and improving deployment efficiency and reliability.

[0083] In an exemplary embodiment, the configuration information further includes Ethernet interface switch lookup information, which includes a second correspondence between the interface parameters of the Ethernet interface and the set of Ethernet interfaces to which it belongs. The interface parameters are determined based on the virtual LAN identifier, network domain identifier, and Ethernet address of the Ethernet interface. The method further includes configuring the switch lookup information of the bound Ethernet interface for the deployed virtual switch.

[0084] During virtual switch deployment, Ethernet interface lookup information can also be obtained. The virtual switch can locate Ethernet interfaces based on this lookup information. The lookup information includes the Ethernet interface parameters and a second correspondence between the interface parameters and the set of Ethernet interfaces to which they belong. The interface parameters are determined based on the Ethernet interface's VLAN ID, network domain ID, and Ethernet address. The interface parameters can be hash values. The VLAN ID (Virtual Local Area Network Identifier) ​​is used to distinguish the local area network to which the Ethernet interface belongs, ensuring that broadcast traffic between different local area networks does not interfere with each other. The network domain ID is a unique identifier used to distinguish different network domains. The Ethernet address is a MAC address (Media Access Control Address), used to uniquely identify the Ethernet interface at Layer 2 (Data Link Layer). For example, the lookup information can be a lookup table, as shown below:

[0085] Table 1 Exchange Lookup Table

[0086]

[0087] Since a virtual switch can be bound to multiple Ethernet interfaces, the final Ethernet interface to be used must be determined through the Ethernet interface lookup information. After obtaining the Ethernet interface lookup information, the virtual switch is configured with the lookup information for the bound Ethernet interfaces. The deployed virtual switch can then determine the final Ethernet interface to use based on the interface parameters and the Ethernet set to which those parameters belong, using the lookup information.

[0088] Furthermore, the Ethernet interface lookup information can be stored in the memory of the logical area, such as random access memory. When the deployed virtual switch looks up the Ethernet interface, it can search for it in the lookup information in the memory.

[0089] In this embodiment, since the exchange lookup information includes the interface parameters of the Ethernet interface and the second correspondence of the set of Ethernet interfaces to which it belongs, and the interface parameters are determined based on the virtual LAN identifier, network domain identifier and Ethernet address of the Ethernet interface, by configuring the exchange lookup information of the bound Ethernet interface for the deployed virtual switch, a three-dimensional exchange lookup structure based on the virtual LAN identifier, network domain identifier and Ethernet address can be established at the virtual switch level, so as to uniquely determine the Ethernet interface and realize packet isolation and accurate forwarding in multi-domain and multi-virtual LAN environments, thereby improving the communication efficiency of the virtual switch.

[0090] In an exemplary embodiment, the network topology information further includes a third binding relationship between system access port groups and virtual ports, and a fourth binding relationship between system access port groups and virtual switches. Each system access port group includes a first system access port and a second system access port. The method further includes: for each system access port group, according to the third binding relationship, deploying a first system access port bound to the deployed virtual port in the software area, and according to the fourth binding relationship, deploying a second system access port bound to the deployed virtual switch in the logical area; wherein the virtual port bound to the first system access port and the virtual switch bound to the second system access port have a first binding relationship.

[0091] Computer equipment can also deploy system access network port groups in the embedded platform to be deployed. A system access network port group refers to the channel connecting virtual network ports and virtual switches. Each system access network port group includes a first system access network port and a second system access network port, and the first and second system access network ports in each group are bound together. The first system access network port is used to communicate with the virtual network port, and the second system access network port is used to communicate with the virtual switch. For each system access network port group, based on the third binding relationship between the system access network port group and the virtual network port, a first system access network port bound to the deployed virtual network port is deployed in the software area. Based on the fourth binding relationship between the system access network port group and the virtual switch, a second system access network port bound to the deployed virtual switch is deployed in the logical area. The virtual network port and the first system access network port can have a one-to-one or many-to-one binding relationship. The virtual switch and the second system interface network port have a one-to-one binding relationship. In each group of system access network ports, the virtual network port bound to the first system access network port and the virtual switch bound to the second system access network port should be bound together, having the aforementioned first binding relationship.

[0092] Furthermore, for each system access network interface group, based on the third binding relationship between the system access network interface group and the virtual network interface, a first system access network interface bound to the deployed virtual network interface is deployed in the kernel of the software area. For example, the first system access network interface is AXI-ETH (Advanced eXtensible Interface-Ethernet Interface, an Ethernet interface core based on the Advanced eXtensible Interface Bus standard), and the second system access network interface is AXI-DMA (Advanced eXtensible Interface Direct Memory Access, a direct memory access controller based on the Advanced eXtensible Interface Bus standard).

[0093] Furthermore, for each system access network port group, based on the third binding relationship between the system access network port group and the virtual network port, the first system access network port bound to the virtual network port is deployed in the software area using Linux binding technology.

[0094] Each primary system access port can be bound to any number of virtual ports, enabling communication and exchange between virtual ports and between virtual ports and Ethernet interfaces. Exchange between virtual ports bound to the same system access port can be performed using either the bridging mode of a virtual LAN based on Ethernet addresses (MAC VLAN bridge mode) or a virtual switch.

[0095] A virtual switch can achieve full-bandwidth network switching of 8+8. That is, it can switch between 8 external Ethernet interfaces and 8 internal system access network ports.

[0096] In this embodiment, for each system access network port group, a first system access network port bound to the deployed virtual network port is deployed in the software area according to a third binding relationship, and a second system access network port bound to the deployed virtual switch is deployed in the logical area according to a fourth binding relationship. The first system access network port and the second system access network port enable efficient collaboration between the software area and the logical area, achieving low-latency, high-throughput data exchange.

[0097] In an exemplary embodiment, the network topology information further includes a fifth binding relationship between the Ethernet controller and the virtual switch, and a sixth binding relationship between the Ethernet controller and the Ethernet interface; the method further includes: deploying Ethernet controllers in a logical area according to the number of Ethernet controllers in the network topology information; binding the deployed Ethernet controllers and virtual switches according to the fifth binding relationship, and binding the deployed Ethernet controllers and Ethernet interfaces according to the sixth binding relationship; wherein, virtual switches and Ethernet interfaces bound to the same Ethernet controller have a second binding relationship.

[0098] During the deployment of virtual switches, Ethernet controllers can also be deployed. These Ethernet controllers enable communication between the virtual switches in the embedded platform and the external device under test. Specifically, Ethernet controllers are deployed in the logical area based on the number of Ethernet controllers specified in the network topology information. The number of Ethernet controllers is determined by the number of virtual switches; that is, the number of Ethernet controllers is the same as the number of virtual switches.

[0099] Based on the fifth binding relationship between the Ethernet controller and the virtual switch, the deployed Ethernet controller and the virtual switch are bound together. Similarly, based on the sixth binding relationship between the Ethernet controller and the Ethernet interface, the deployed Ethernet controller and the Ethernet interface are bound together. Virtual switches and Ethernet interfaces bound to the same Ethernet controller have a second binding relationship. A schematic diagram of the deployed embedded platform is shown below. Figure 2 As shown, MAC0 to MAC7 represent Ethernet controllers, and T1#1 to T1#8 represent Ethernet interfaces.

[0100] In this embodiment, since each virtual switch requires an Ethernet controller to send and receive frames, by deploying an Ethernet controller in the logical area and binding it to the virtual switch and Ethernet interface, hardware-level network frame transmission and reception and virtual switch data channels can be provided, realizing high-speed and reliable collaboration between the virtualized network and the Ethernet interface.

[0101] In one exemplary embodiment, such as Figure 3 As shown, a testing method is provided. This embodiment illustrates the application of this method to a computer device, which includes an embedded platform with a virtual network port and a virtual switch deployed thereon. The virtual network port and virtual switch are deployed in the embedded platform according to any of the above-described virtual switch deployment method embodiments. In this embodiment, the method includes the following steps:

[0102] Step 302: When the embedded platform receives a test request, it sends the test request to the corresponding target virtual network port.

[0103] Step 304: Generate a test message based on the test request through the target virtual network interface, and send the test message to the target virtual switch bound to the target virtual network interface.

[0104] Step 306: Send the test message to the target Ethernet interface bound to the target virtual switch through the target virtual switch, so that the device under test can receive the test message through the target Ethernet interface and send the response result generated in response to the test message back to the target virtual switch through the target Ethernet interface.

[0105] Step 308: Receive the response from the target virtual switch via the target virtual network port.

[0106] Step 310: Determine the test result of the test request based on the response result.

[0107] A test request is an instruction or data packet initiated by a terminal or test system to instruct the embedded platform to perform tests on the device under test (DUT). A test message is a data packet generated based on the test request and used to test the DUT. A response result is the response message generated by the DUT after completing the test.

[0108] In some implementations, an embedded platform in a computer device receives a test request and forwards it to the corresponding target virtual network interface. The test request includes the interface identifier (Virtual LAN identifier, network domain identifier, and Ethernet address) of the target Ethernet interface, a test message template, and test data. The test message template refers to the structured format and field layout used to generate the test message, defining the rules for the composition of the message header, payload, and checksum fields. The test data refers to the data content used to generate the test message.

[0109] The test request is parsed through the target virtual network interface to obtain the interface identifier, test message template and test data of the target Ethernet interface. A test message is generated based on the interface identifier, test message template and test data of the target Ethernet interface, and the test message is sent to the target virtual switch bound to the target virtual network interface.

[0110] The test message is sent to the target Ethernet interface bound to the target virtual switch via the target virtual switch, so that the device under test (DUT) receives the test message through the target Ethernet interface, executes the corresponding service according to the test message, and obtains the response result. The DUT then sends the response result back to the target virtual switch through the target Ethernet interface.

[0111] Receive the response from the target virtual switch via the target virtual network port. Based on the response, determine the test result of the test request through the target virtual network port or embedded platform. Specifically, obtain the packet sequence number and data integrity information from the response result and verify whether the packet sequence number and data integrity in the response result are consistent with those in the test request. If they are consistent, it indicates that the device under test correctly received and processed the test packet, and the test result of the test request is determined to be a pass. If they are inconsistent, it indicates that the device under test did not correctly receive and process the test packet, and the test result of the test request is determined to be a failure.

[0112] In this embodiment, the computer device includes an embedded platform with a virtual network port and a virtual switch. After receiving a test request, the embedded platform generates a test message and forwards the test message to the device under test through the virtual network port and the virtual switch to test the device under test. This enables testing using a miniaturized embedded platform, which reduces space occupation and lowers testing costs.

[0113] In an exemplary embodiment, the virtual network interface is configured with a corresponding service identifier, and the test request includes the service identifier; sending the test request to the corresponding target virtual network interface includes: sending the test request to the target virtual network interface corresponding to the service identifier.

[0114] In some implementations, the test request also includes a service identifier, since the virtual network interface is configured with a corresponding service identifier, meaning the virtual network interface is used to carry data corresponding to the service identifier. After receiving the test request, the embedded platform can forward the test request to the target virtual network interface corresponding to the service identifier.

[0115] In this embodiment, since each virtual network interface is bound to a service identifier, and the test request also includes the service identifier, the test request can be accurately sent to the corresponding target virtual network interface, avoiding sending it to irrelevant virtual network interfaces. It also supports parallel testing of multiple services, maintaining isolation between services and preventing test interference.

[0116] In an exemplary embodiment, the virtual switch is also configured with switch lookup information for the bound Ethernet interface; the test request includes a target VLAN identifier, a target network domain identifier, and a target Ethernet address; step 306 involves sending a test message to the target Ethernet interface bound to the target virtual switch via the target virtual switch, including: determining target interface parameters based on the target VLAN identifier, target network domain identifier, and target Ethernet address via the target virtual switch; determining the target Ethernet interface set corresponding to the target interface parameters based on the switch lookup information via the target virtual switch; determining the target Ethernet interface matching the target VLAN identifier, target network domain identifier, and target Ethernet address from the target Ethernet set via the target virtual switch, and sending the test message to the target Ethernet interface.

[0117] In some implementations, the virtual switch forwards test packets by exchanging lookup information. Specifically, the virtual switch forwards test packets through a two-stage lookup exchange. This lookup exchange includes a first-level hash table and a second-level linked list. The first-level hash table stores the interface parameters of the Ethernet interfaces. The second-level linked list stores the set of Ethernet interfaces corresponding to the interface parameters. The set of Ethernet interfaces includes the virtual LAN identifier, network domain identifier, and Ethernet address corresponding to the Ethernet interface.

[0118] The first lookup involves searching the first-level hash table. The target virtual switch determines the target interface parameters based on the target VLAN identifier, target network domain identifier, and target Ethernet address, and then searches the first-level hash table for these parameters. Here, the target interface parameter refers to the hash value corresponding to the target Ethernet interface. The second lookup involves searching the second-level linked list. The target virtual switch determines the set of target Ethernet interfaces corresponding to the target interface parameters within the second-level linked list. Here, the target Ethernet interface set refers to the set of all Ethernet interfaces corresponding to the same target interface parameter. The target virtual switch then identifies the target Ethernet interface from this set that matches the target VLAN identifier, target network domain identifier, and target Ethernet address. After completing the two lookups, a test packet is sent to the target Ethernet interface.

[0119] For example, the exchange lookup information can be an exchange lookup table. The virtual switch first looks up the first-level hash table. After calculating the hash value based on the target VLAN identifier, target network domain identifier, and target Ethernet address, it takes bits [13:0], that is, the lower 14 bits of the hash value, to perform a lookup in the first-level hash table, achieving a hash value lookup depth of 16K (16384). The second lookup is a lookup in the second-level linked list, which is a linked list lookup when the same hash value is matched. The entries in the second-level linked list store the VLAN identifier, network domain identifier, and Ethernet address corresponding to the Ethernet interface. The double lookup speed can be improved by using a double lookup table.

[0120] With MAC address hashing, almost one lookup of the first-level hash table and one lookup of the second-level linked list is sufficient to obtain the matching target VLAN identifier, target network domain identifier, and target Ethernet interface corresponding to the target Ethernet address. If the first entry in the second-level linked list does not match, the next entry is retrieved using the next_pointer, and so on, until the end of the linked list is reached. The depth of the second-level linked list is not fixed; it dynamically adds entries based on whether the actual hash results match.

[0121] Furthermore, the total depth of the second-level linked list is 512, and the entries in the second-level linked list are aged and updated in real time by a self-learning algorithm. To accelerate the speed of table lookup and swapping, the hash calculation for adding entries is separated from the hash calculation for swapping and looking up the table. Specifically, all tables are stored within the logical area as dual-port BRAM (Block Random Access Memory). Operations for adding, deleting, and modifying entries are performed on BRAM port A, while the table lookup module operates on BRAM port DP. The two ports work simultaneously without interfering with each other, executing in parallel. This ensures that the speed of swapping and looking up the table is not affected by adding entries, and also achieves maximum table lookup efficiency.

[0122] The process of adding table entries and performing secondary table lookups is as follows: Figure 4 As shown, the virtual LAN identifier, network domain identifier, and Ethernet address (VLAN+DM+MAC) are hashed to obtain a hash value. The lower 14 bits of the hash value are used as the address adr_t1 of the first-level hash table, and the result of the table lookup is dou_t1.

[0123] If the enable bit of `dout_t1` is 0, it means there is no second-level linked list. A new free address A is read from the free address FIFO and assigned to `adr_t2` (hash table lookup), with the value `din_t2` written (EN (enable bit) set to 1, next_pointer (next pointer) set to FFFF). Then, the entry in `adr_t1` is updated to `din_t1` (EN is 1, next_pointer is A). A success message is returned.

[0124] If the enable bit of dou_t1 is 1, it indicates that the second-level linked list is enabled. Based on the next_pointer in dou_t1, the address of adr_t2 in the second-level linked list is read. The result of the table lookup is dou_t2. It is compared with the VLAN+DM+MAC in the table lookup. If they match, it returns that it has been added.

[0125] If they are inconsistent, and next_pointer is FFFF, then read a new free address B from the free address FIFO, assign it to adr_t2, write the value to din_t2 (EN is set to 1, next_pointer is FFFF), then update the content of the previous adr_t2 address to din_t2 (next_pointer is updated to B), and return that the addition was successful.

[0126] If they don't match, and next_pointer is not FFFF, then assign next_pointer to adr_t2, read dou_t2, and compare it with the VLAN+DM+MAC lookup table. If they match, return "added". If they don't match, return to the step of reading the adr_t2 address of the second-level linked list based on next_pointer in dou_t1, and continue reading the next entry until a matching entry is found or the end of the linked list is reached.

[0127] When deleting a table entry, after retrieving the corresponding entry through the above table lookup, the next_pointer of the parent linked list index is directly set to the next_pointer of the current entry, and the enable bit of the current linked list entry is cleared to 0. If the next_pointer of the entry to be deleted is FFFF, then the next_pointer of the parent list is set to FFFF. If the parent list is a first-level hash table, then the enable bit of the corresponding entry in the hash table is cleared to zero.

[0128] The secondary table lookup process is similar to the add / delete table process. First, a hash calculation is performed on the target VLAN identifier, target network domain identifier, and target Ethernet address (VLAN+DM+MAC) to obtain a hash value. The lower 14 bits of this hash value are used as the address adr_dp_t1 of the first-level hash table. The first-level hash table is then searched, and dou_dp_t1 is output. If the EN value of dou_dp_t1 is 0, a mismatch is output. If the EN value of dou_dp_t1 is 1, the next_pointer is retrieved as the lookup address adr_dp_t2 of the second-level linked list, and dou_dp_t2 is output.

[0129] Based on `dout_dp_t2`, match the interface identifier in the corresponding target Ethernet interface set. If a match is found, output the PORT (target Ethernet interface). If a match is found, take the `next_pointer` of the current entry as the new `adr_dp_t2` address and output `dout_dp_t2`. If no matching entry is found at the end of the linked list, output "No Match".

[0130] In this embodiment, a two-step lookup method is employed. The first lookup is used to quickly locate the target Ethernet interface set based on the target interface parameters, i.e., the hash result. The second lookup is used to match the target VLAN identifier, target network domain identifier, and target Ethernet address item by item in the target Ethernet interface set. This method can accelerate the query speed, effectively resolve hash collision issues, achieve multi-dimensional accurate matching, improve packet forwarding accuracy, and thus significantly enhance the data processing throughput and real-time performance of the virtual switch.

[0131] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0132] Based on the same inventive concept, this application also provides a virtual switch deployment apparatus for implementing the virtual switch deployment method described above. The solution provided by this apparatus is similar to the implementation scheme described in the virtual switch deployment method above. Therefore, the specific limitations in one or more virtual switch deployment apparatus embodiments provided below can be found in the limitations of the virtual switch deployment method described above, and will not be repeated here.

[0133] In one exemplary embodiment, such as Figure 5 As shown, a virtual switch deployment device is provided, including: an acquisition module 502, a deployment module 504, and a binding module 506, wherein:

[0134] The acquisition module 502 is used to acquire the network topology information of the embedded platform to be deployed; wherein, the network topology information includes the first binding relationship between the virtual network port and the virtual switch, and the second binding relationship between the virtual switch and the Ethernet interface of the device under test.

[0135] The deployment module 504 is used to deploy virtual network ports in the software area of ​​the embedded platform to be deployed and virtual switches in the logical area of ​​the embedded platform to be deployed, based on the number of virtual network ports and virtual switches in the network topology information.

[0136] The binding module 506 is used to bind the deployed virtual network port and virtual switch according to the first binding relationship, and to bind the Ethernet interface and the deployed virtual switch according to the second binding relationship.

[0137] In one exemplary embodiment, the above-described apparatus further includes:

[0138] The acquisition module 502 is also used to acquire the configuration information of the embedded platform to be deployed; wherein, the configuration information includes the first correspondence between the virtual network interface and the service identifier.

[0139] The configuration module is used to configure the corresponding service identifier for the deployed virtual network interface according to the first correspondence.

[0140] In an exemplary embodiment, the configuration information further includes Ethernet interface switch lookup information, which includes a second correspondence between the interface parameters of the Ethernet interface and the set of Ethernet interfaces to which it belongs. The interface parameters are determined based on the virtual LAN identifier, network domain identifier, and Ethernet address of the Ethernet interface. The configuration module is also used to configure the switch lookup information of the bound Ethernet interfaces for the deployed virtual switch.

[0141] In an exemplary embodiment, the network topology information further includes a third binding relationship between system access port groups and virtual ports, and a fourth binding relationship between system access port groups and virtual switches. Each system access port group includes a first system access port and a second system access port. The deployment module 504 is further configured to, for each system access port group, according to the third binding relationship, deploy a first system access port bound to the deployed virtual port in the software area, and according to the fourth binding relationship, deploy a second system access port bound to the deployed virtual switch in the logical area. The virtual port bound to the first system access port and the virtual switch bound to the second system access port have a first binding relationship.

[0142] In an exemplary embodiment, the network topology information further includes a fifth binding relationship between the Ethernet controller and the virtual switch, and a sixth binding relationship between the Ethernet controller and the Ethernet interface; the deployment module 504 is used to deploy Ethernet controllers in the logical area according to the number of Ethernet controllers in the network topology information; the binding module 506 is further used to bind the deployed Ethernet controllers and virtual switches according to the fifth binding relationship, and to bind the deployed Ethernet controllers and Ethernet interfaces according to the sixth binding relationship; wherein, virtual switches and Ethernet interfaces bound to the same Ethernet controller have a second binding relationship.

[0143] Based on the same inventive concept, this application also provides a testing apparatus for implementing the testing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the testing method above; therefore, the specific limitations in one or more testing apparatus embodiments provided below can be found in the limitations of the testing method described above, and will not be repeated here.

[0144] In one exemplary embodiment, such as Figure 6 As shown, a testing apparatus is provided, which is an embedded platform deployed with virtual network ports and virtual switches; the virtual network ports and virtual switches are deployed in the embedded platform according to any embodiment of the method of the first aspect, and the apparatus includes: a first determining module 602, a second determining module 604, a third determining module 606, a test feedback module 608, and a result determining module 610, wherein:

[0145] The first determining module 602 is used to send the test request to the corresponding target virtual network port when the embedded platform receives the test request.

[0146] The second determining module 604 is used to generate a test message based on the test request through the target virtual network port, and send the test message to the target virtual switch bound to the target virtual network port.

[0147] The third determining module 606 is used to send test messages to the target Ethernet interface bound to the target virtual switch through the target virtual switch, so that the device under test can receive the test messages through the target Ethernet interface and send back the response results generated in response to the test messages to the target virtual switch through the target Ethernet interface.

[0148] The test feedback module 608 is used to receive the response results from the target virtual switch through the target virtual network port.

[0149] The result determination module 610 is used to determine the test result of the test request based on the response result.

[0150] In an exemplary embodiment, the virtual network interface is configured with a corresponding service identifier, and the test request includes the service identifier; the first determining module 602 is further configured to send the test request to the target virtual network interface corresponding to the service identifier.

[0151] In one exemplary embodiment, the virtual switch is also configured with switch lookup information for the bound Ethernet interface; the test request includes a target VLAN identifier, a target network domain identifier, and a target Ethernet address;

[0152] The third determining module 606 is also used to determine the target interface parameters through the target virtual switch based on the target virtual LAN identifier, the target network domain identifier, and the target Ethernet address; determine the target Ethernet interface set corresponding to the target interface parameters through the target virtual switch based on the switch lookup information; determine the target Ethernet interface that matches the target virtual LAN identifier, the target network domain identifier, and the target Ethernet address from the target Ethernet set through the target virtual switch, and send the test message to the target Ethernet interface.

[0153] Each module in the aforementioned virtual switch deployment or testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0154] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores network topology information, configuration information, and other data for the embedded platform to be deployed. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a virtual switch deployment method or a testing method.

[0155] Those skilled in the art will understand that Figure 7The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0156] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0157] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0158] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0159] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0160] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0161] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0162] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for deploying a virtual switch, characterized in that, The method includes: Obtain the network topology information of the embedded platform to be deployed; wherein, the network topology information includes a first binding relationship between virtual network ports and virtual switches, a second binding relationship between the virtual switches and the Ethernet interfaces of the device under test, a third binding relationship between the system access network port group and the virtual network ports, and a fourth binding relationship between the system access network port group and the virtual switches, each system access network port group including a first system access network port and a second system access network port, and each virtual switch is isolated from each other; Based on the number of virtual ports and virtual switches in the network topology information, deploy virtual ports in the software area of ​​the embedded platform to be deployed and deploy virtual switches in the logical area of ​​the embedded platform to be deployed. Based on the first binding relationship, the deployed virtual network port and virtual switch are bound together, and based on the second binding relationship, the Ethernet interface and the deployed virtual switch are bound together. For each system access network port group, according to the third binding relationship, a first system access network port bound to the deployed virtual network port is deployed in the software area, and according to the fourth binding relationship, a second system access network port bound to the deployed virtual switch is deployed in the logical area; wherein, the virtual network port bound to the first system access network port and the virtual switch bound to the second system access network port have the first binding relationship.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the configuration information of the embedded platform to be deployed; wherein, the configuration information includes a first correspondence between the virtual network interface and the service identifier; Based on the first correspondence, configure the corresponding service identifier for the deployed virtual network interface.

3. The method according to claim 2, characterized in that, The configuration information also includes switch lookup information for the Ethernet interface, which includes a second correspondence between the interface parameters of the Ethernet interface and the set of Ethernet interfaces to which it belongs. The interface parameters are determined based on the virtual LAN identifier, network domain identifier, and Ethernet address of the Ethernet interface. The method further includes: Configure the switch lookup information for the bound Ethernet interfaces of the deployed virtual switch.

4. The method according to claim 1, characterized in that, The network topology information also includes a fifth binding relationship between the Ethernet controller and the virtual switch, and a sixth binding relationship between the Ethernet controller and the Ethernet interface; the method further includes: Based on the number of Ethernet controllers in the network topology information, deploy Ethernet controllers in the logical area; The deployed Ethernet controller and virtual switch are bound according to the fifth binding relationship, and the deployed Ethernet controller and the Ethernet interface are bound according to the sixth binding relationship; wherein the virtual switch and the Ethernet interface bound to the same Ethernet controller have the second binding relationship.

5. The method according to claim 1, characterized in that, The step of deploying a first system access network port bound to the virtual network port in the software area according to the third binding relationship includes: deploying a first system access network port bound to the virtual network port in the software area according to the third binding relationship using Linux binding technology.

6. A testing method, characterized in that, The method is applied to computer equipment, the computer equipment including an embedded platform with virtual network ports and virtual switches deployed thereon; the virtual network ports and the virtual switches are deployed in the embedded platform according to any one of claims 1-5, the method comprising: Upon receiving a test request, the embedded platform forwards the test request to the corresponding target virtual network port. The test message is generated through the target virtual network port according to the test request, and the test message is sent to the target virtual switch bound to the target virtual network port. The test message is sent to the target Ethernet interface bound to the target virtual switch through the target virtual switch, so that the device under test can receive the test message through the target Ethernet interface and send the response result generated in response to the test message back to the target virtual switch through the target Ethernet interface. Receive the response result fed back by the target virtual switch through the target virtual network port; Based on the response, the test result of the test request is determined.

7. The method according to claim 6, characterized in that, The virtual network interface is configured with a corresponding service identifier, and the test request includes the service identifier. Sending the test request to the corresponding target virtual network interface includes: The test request is sent to the target virtual network port corresponding to the service identifier.

8. The method according to claim 6, characterized in that, The virtual switch is also configured with switch lookup information for the bound Ethernet interface; the test request includes the target VLAN identifier, the target network domain identifier, and the target Ethernet address; The step of sending the test message to the target Ethernet interface bound to the target virtual switch via the target virtual switch includes: The target interface parameters are determined by the target virtual switch based on the target virtual LAN identifier, the target network domain identifier, and the target Ethernet address; The target virtual switch determines the target Ethernet interface set corresponding to the target interface parameters based on the switch lookup information. The target virtual switch determines the target Ethernet interface that matches the target virtual LAN identifier, the target network domain identifier, and the target Ethernet address from the target Ethernet set, and sends the test message to the target Ethernet interface.

9. A virtual switch deployment device, characterized in that, The device includes: The acquisition module is used to acquire network topology information of the embedded platform to be deployed; wherein, the network topology information includes a first binding relationship between virtual network ports and virtual switches, a second binding relationship between the virtual switches and the Ethernet interfaces of the device under test, a third binding relationship between system access network port groups and virtual network ports, and a fourth binding relationship between system access network port groups and virtual switches, each system access network port group includes a first system access network port and a second system access network port, and the virtual switches are isolated from each other; The deployment module is used to deploy virtual network ports in the software area of ​​the embedded platform to be deployed and virtual switches in the logical area of ​​the embedded platform to be deployed, based on the number of virtual network ports and virtual switches in the network topology information. A binding module is used to bind deployed virtual network ports and virtual switches according to the first binding relationship, and to bind the Ethernet interface and deployed virtual switches according to the second binding relationship. For each system access network port group, according to the third binding relationship, a first system access network port bound to the deployed virtual network port is deployed in the software area, and according to the fourth binding relationship, a second system access network port bound to the deployed virtual switch is deployed in the logical area; wherein the virtual network port bound to the first system access network port and the virtual switch bound to the second system access network port have the first binding relationship.

10. A testing apparatus, characterized in that, The testing device includes an embedded platform with virtual network ports and virtual switches deployed. The virtual network port and the virtual switch are deployed in the embedded platform according to the method described in any one of claims 1-5, and the device includes: The first determining module is used to send the test request to the corresponding target virtual network port when the embedded platform receives the test request; The second determining module is used to generate a test message according to the test request through the target virtual network port, and send the test message to the target virtual switch bound to the target virtual network port; The third determining module is used to send the test message to the target Ethernet interface bound to the target virtual switch through the target virtual switch, so that the device under test can receive the test message through the target Ethernet interface and send the response result generated in response to the test message back to the target virtual switch through the target Ethernet interface; The test feedback module is used to receive the response result fed back by the target virtual switch through the target virtual network port; The result determination module is used to determine the test result of the test request based on the response result.

Citation Information

Patent Citations

  • Testing method and device based on virtual network element, testing method and device based on multiple virtual network elements, equipment and readable storage medium

    CN120281635A

  • Data processing method, programmable network card device, physical server, and storage medium

    US20240370282A1