Data transmission method and device based on virtual switch

By setting and updating neighbor tables in the virtual switch, the problem of packet forwarding in VXLAN is solved, the risk of ovs transformation is avoided, and efficient data transmission is achieved.

CN119835203AActive Publication Date: 2025-04-15CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411744412.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-30
Publication Date
2025-04-15
Estimated Expiration
2044-11-30

AI Technical Summary

Technical Problem

The prior art adds cache function in VXLAN by transforming ovs to ensure that packets are not lost, but the transformation is difficult and may affect the ovs capabilities. It also challenges the cache capability during instantaneous large data packet transmission, resulting in idle and wasted resources.

Method used

By setting up a neighbor table in a virtual switch, confirm the LAN range and gateway IP address based on the IP address, subnet segment and routing information of the target tunnel endpoint, obtain the IP address list of the same subnet segment from the stream table to update the neighbor table, find the MAC address corresponding to the target IP address and forward the packet, avoiding the transformation of ovs.

Benefits of technology

It realizes the acquisition of the MAC address corresponding to the target IP address through the neighbor table, ensuring that normal packet forwarding is not lost, avoiding the risks brought about by the transformation of the virtual switch itself, and reducing resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835203A_ABST
    Figure CN119835203A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data transmission method and device based on a virtual switch, and the method comprises the steps: determining a subnet segment range of a local area network where a target tunnel endpoint is located and an IP address of a gateway according to the IP address of the target tunnel endpoint, a subnet segment and routing information, and obtaining a first IP address list which is in the same subnet segment range as the target tunnel endpoint from the flow table, thereby updating the neighbor table, determining a target IP address, searching a target MAC address corresponding to the target IP address in the neighbor table, forwarding the message to be forwarded to the target MAC address through the virtual switch, and forwarding the message to be forwarded to the target MAC address through the virtual switch. The MAC address corresponding to the target IP address is obtained through the neighbor table, so that forwarding of a normal message is not lost, and the risk that the capacity of the virtual switch is possibly influenced due to the fact that the virtual switch is transformed to increase a cache function is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud network technology, and in particular to a data transmission method and device based on a virtual switch. Background Art

[0002] In VXLAN (Virtual eXtensible Local Area Network), the existing technical solution can add a cache feature to ovs (Open vSwitch) itself, so that when the MAC (Media Access Control) address corresponding to the IP (Internet Protocol) address of the other end vtep (VXLAN Virtual Tunnel Endpoint) cannot be found, the message is first cached, and then the MAC address of the other end vtep IP address is queried. After obtaining the MAC address, the cached message is encapsulated and sent out, relying on the cache capability to ensure that normal messages are not lost.

[0003] However, in the prior art solution, it is necessary to transform the ability of ovs itself, to increase the cache function, and it is relatively difficult to transform ovs itself, and there is a certain risk that affects the ability of ovs itself. Moreover, by means of caching, in the case of a large number of data packets being transmitted in an instant, if the MAC address of the opposite end vtep IP address is not obtained, a large number of data packets need to be cached in an instant, which is very challenging to the ability of caching, and the upper limit of the amount of data to be cached will be very high, and the resources required to be reserved for cache occupancy will also be very large, which may cause idle waste of this part of resources in most cases. Summary of the invention

[0004] In view of the above problems, a data transmission method and device based on a virtual switch is proposed to overcome the above problems or at least partially solve the above problems, including:

[0005] A data transmission method based on a virtual switch, wherein a neighbor table is provided in the virtual switch, the virtual switch is located in a local area network, and the local area network includes a gateway and multiple tunnel endpoints, the method comprising:

[0006] According to the IP address, subnet segment and routing information of the target tunnel endpoint, confirm the subnet segment range of the local area network where the target tunnel endpoint is located and the IP address of the gateway; wherein the target tunnel endpoint is the tunnel endpoint that forwards the message to be forwarded through the virtual switch;

[0007] Acquire a first IP address list in the same subnet segment range as the target tunnel endpoint from the flow table; wherein the flow table is used to determine the path for message forwarding in the local area network;

[0008] According to the first IP address list and the IP address of the gateway, the neighbor table is updated; wherein the neighbor table includes a correspondence between IP addresses and MAC addresses;

[0009] Determine the target IP address according to the message to be forwarded in the virtual switch, and search the target MAC address corresponding to the target IP address in the neighbor table;

[0010] The message to be forwarded is forwarded to the target MAC address through the virtual switch.

[0011] Optionally, when the target IP address is not within the subnet segment range, searching the neighbor table for a target MAC address corresponding to the target IP address includes:

[0012] The MAC address of the gateway is obtained from the neighbor table as the target MAC address.

[0013] Optionally, it also includes:

[0014] The neighbor table maintenance operation is performed once every preset maintenance time period.

[0015] Optionally, the operation of maintaining the neighbor table includes:

[0016] Acquire a second IP address list in the same subnet segment range as the target tunnel endpoint from the flow table;

[0017] The neighbor table is updated according to the second IP address list and the IP address of the gateway.

[0018] Optionally, it also includes:

[0019] After each preset update time period, a verification operation is performed to determine whether other tunnel endpoints within the same subnet segment as the target tunnel endpoint have changed, and the neighbor table is updated based on the verification result.

[0020] Optionally, the operation of verifying whether the IP addresses of the multiple tunnel endpoints have changed includes:

[0021] Acquire a third IP address list in the same subnet segment range as the target tunnel endpoint from the flow table;

[0022] Verify whether the third IP address list is consistent with the IP address in the neighbor table, and obtain a verification result.

[0023] Optionally, updating the neighbor table according to the verification result includes:

[0024] When the verification result is inconsistent, updating the neighbor table according to the third IP address list;

[0025] When the verification result is consistent, the neighbor table is not updated.

[0026] A data transmission device based on a virtual switch, wherein a neighbor table is provided in the virtual switch, the virtual switch is located in a local area network, the local area network includes a gateway and a plurality of tunnel endpoints, and the device includes:

[0027] A network segment range and gateway address acquisition module, used to confirm the subnet segment range of the local area network where the target tunnel endpoint is located and the IP address of the gateway according to the IP address, subnet segment and routing information of the target tunnel endpoint; wherein the target tunnel endpoint is the tunnel endpoint that forwards the message to be forwarded through the virtual switch;

[0028] An IP list acquisition module, used to acquire a first IP address list in the same subnet segment range as the target tunnel endpoint from a flow table; wherein the flow table is used to determine a path for message forwarding in the local area network;

[0029] A neighbor table updating module, configured to update the neighbor table according to the first IP address list and the IP address of the gateway; wherein the neighbor table includes a correspondence between IP addresses and MAC addresses;

[0030] A target MAC address determination module, used to determine a target IP address according to the message to be forwarded in the virtual switch, and search the target MAC address corresponding to the target IP address in the neighbor table;

[0031] A message forwarding module, used to forward the message to be forwarded to the target MAC address through the virtual switch

[0032] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the data transmission method based on a virtual switch as described above when executed by the processor.

[0033] A readable storage medium stores a computer program, and when the computer program is executed by a processor, the data transmission method based on a virtual switch as described above is implemented.

[0034] The embodiments of the present invention have the following advantages:

[0035] In an embodiment of the present invention, the subnet segment range of the local area network where the target tunnel endpoint is located and the IP address of the gateway are confirmed according to the IP address, subnet segment and routing information of the target tunnel endpoint, the target tunnel endpoint is the tunnel endpoint that forwards the message to be forwarded through the virtual switch, and a first IP address list in the same subnet segment range as the target tunnel endpoint is obtained from the flow table, the flow table is used to determine the path for message forwarding in the local area network, and the neighbor table is updated according to the first IP address list and the IP address of the gateway, the neighbor table includes the correspondence between IP addresses and MAC addresses, the target IP address is determined according to the message to be forwarded in the virtual switch, and the target MAC address corresponding to the target IP address is searched in the neighbor table, and the message to be forwarded is forwarded to the target MAC address through the virtual switch, so that the MAC address corresponding to the target IP address is obtained through the neighbor table, thereby ensuring that the forwarding of normal messages is not lost, and avoiding the risk that the virtual switch itself is modified to increase the cache function, which may affect the capacity of the virtual switch itself. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0037] Figure 1 is a flowchart of a data transmission method based on a virtual switch provided by some embodiments of the present invention;

[0038] Figure 2 is a flowchart of steps for updating a neighbor table provided by some embodiments of the present invention;

[0039] Figure 3 It is a structural block diagram of a data transmission device based on a virtual switch provided in some embodiments of the present invention. DETAILED DESCRIPTION

[0040] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all 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.

[0041] An embodiment of the present application provides a method for identifying fraudulent numbers. A neighbor table is provided in the virtual switch. The virtual switch is located in a local area network. The local area network includes a gateway and multiple tunnel endpoints.

[0042] In actual applications, VXLAN (Virtual Extensible Local Area Network) includes ovs (virtual switch), multiple vtep (VXLAN tunnel endpoints) and gateways, and the ovs is set with a corresponding neighbor table.

[0043] Among them, VXLAN is a virtualized tunnel communication technology, which is an Overlay technology that builds a virtual Layer 2 network through a three-layer network; OVS is an open source virtual switch based on software implementation, which supports protocols such as OpenFlow and is mainly used in virtual machine environments. As a virtual switch, it supports multiple virtualization technologies; OpenFlow is a network communication protocol used for communication between controllers and forwarders in the SDN (Software-Defined Networking) architecture to achieve message forwarding and control separation; VTEP (VXLAN Tunnel Endpoints) is responsible for the encapsulation and decapsulation of VXLAN messages.

[0044] like Figure 1 As shown, a flowchart of a data transmission method based on a virtual switch provided by some embodiments of the present invention is shown, which may specifically include the following steps:

[0045] Step 101, confirm the subnet segment range of the local area network where the target tunnel endpoint is located and the IP address of the gateway according to the IP address, subnet segment and routing information of the target tunnel endpoint; wherein the target tunnel endpoint is the tunnel endpoint that forwards the message to be forwarded through the virtual switch.

[0046] The subnet segment range of the LAN where the target tunnel endpoint is located and the IP address of the LAN gateway can be confirmed based on the IP address, subnet segment, and routing information of the target tunnel endpoint.

[0047] Specifically, the target vtep forwards the message to be forwarded through ovs, and can determine the subnet segment range of the LAN where the target vtep is located and the IP address of the LAN gateway through the IP address, subnet segment and route information (routing information) of the target vtep.

[0048] Step 102, obtaining from the flow table a list of first IP addresses in the same subnet segment range as the target tunnel endpoint; wherein the flow table is used to determine a path for forwarding messages in the local area network.

[0049] After obtaining the subnet segment range of the local area network where the target tunnel endpoint is located, a first IP address list in the same subnet segment range as the target tunnel endpoint can be obtained from the flow table.

[0050] Specifically, after obtaining the subnet segment range of the VXLAN where the target vtep is located, the IP address list of the peer vtep whose IP address is in the same subnet segment range as the target vtep can be obtained from the openflow flow table through the subnet segment range, that is, the first IP address list.

[0051] The openflow flow table is a key component in the openflow protocol, which is used to define and manage how network devices (such as switches and routers) process data packets. The openflow flow table consists of multiple flow entries, each of which defines how to process data packets that match specific conditions, i.e., messages.

[0052] Step 103: Update the neighbor table according to the first IP address list and the IP address of the gateway; wherein the neighbor table includes a correspondence between IP addresses and MAC addresses.

[0053] After obtaining the first IP address list in the same subnet segment range as the target tunnel endpoint from the flow table, the neighbor table corresponding to ovs can be updated through the network diagnostic tool in combination with the IP address of the LAN gateway obtained previously. Among them, the neighbor table is also called the ARP table (Address Resolution Protocol Table), which is a data structure used to store the correspondence between IP addresses and MAC addresses in network devices (such as routers, switches, and hosts). It can be used to resolve IP addresses to corresponding MAC addresses in VXLAN for forwarding messages.

[0054] Specifically, after obtaining the first IP address list of vtep whose IP address is in the same subnet segment range as the target vtep's IP address from the openflow flow table, the IP addresses in the first IP address list and the IP address of the gateway in the VXLAN can be pinged in turn to obtain the MAC addresses corresponding to the IP addresses in the first IP address list and the IP address of the gateway in the VXLAN, and then the IP addresses in the first IP address list, the IP address of the gateway in the VXLAN, and the corresponding MAC addresses are updated and recorded in the neighbor table.

[0055] Ping is a network diagnostic tool used to test the reachability and latency of a network connection. By sending an ICMP (Internet Control Message Protocol) echo request message to a target host and waiting for an echo reply, it is possible to determine whether the target host is online and the quality of the network connection. In the present invention, the ping method can be used to obtain the MAC address corresponding to the IP address through the IP address.

[0056] Step 104: determine a target IP address according to the message to be forwarded in the virtual switch, and search the neighbor table for a target MAC address corresponding to the target IP address.

[0057] The target IP address can be determined according to the message to be forwarded in the virtual switch, and then the target MAC address corresponding to the target IP address can be searched in the neighbor table corresponding to the virtual switch.

[0058] When the target vtep forwards the message through ovs, the target IP address can be determined according to the message, and then the corresponding MAC address, that is, the target MAC address, can be found from the switch corresponding to ovs through the target IP address.

[0059] In some embodiments of the present invention, when the target IP address is not within the subnet segment, searching the neighbor table for a target MAC address corresponding to the target IP address includes:

[0060] The MAC address of the gateway is obtained from the neighbor table as the target MAC address.

[0061] After determining the target IP address according to the message to be forwarded in the virtual switch, if the target IP address is not within the LAN subnet segment, the MAC address of the LAN gateway is obtained from the neighbor table as the target MAC address.

[0062] Specifically, after determining the target IP address of the message to be forwarded by the target vtep through ovs, if the target IP address is the IP address of a vtep that is not in the same subnet segment as the IP address of the target vtep, the MAC address of the gateway in the VXLAN is obtained from the neighbor table corresponding to ovs as the target MAC address.

[0063] In VXLAN, a gateway is a key network device that acts as a bridge between different VXLANs, allowing packets to be transmitted from one network to another. A gateway is usually used to connect a VXLAN with an external network and is responsible for processing network address translation, routing, packet forwarding, and other functions.

[0064] Step 105: forward the message to be forwarded to the target MAC address through the virtual switch.

[0065] After obtaining the target MAC address, the virtual switch can forward the message to be forwarded to the target MAC address, which can correspond to the opposite tunnel endpoint or the LAN gateway.

[0066] Specifically, after ovs obtains the target MAC address of the message to be sent, it forwards the message to be sent to the target MAC address, which may correspond to the opposite end vtep or the gateway in the VXLAN.

[0067] In some embodiments of the present invention, the scheme further comprises:

[0068] The neighbor table maintenance operation is performed once every preset maintenance time period.

[0069] According to the aging time of the neighbor table of OVS, the neighbor table needs to be maintained regularly within the aging time. For example, the neighbor table corresponding to OVS needs to be maintained once every 10 minutes.

[0070] In some embodiments of the present invention, the operation of maintaining the neighbor table includes:

[0071] Sub-step 11, obtaining from the flow table a second IP address list that is in the same subnet segment range as the target tunnel endpoint.

[0072] When maintaining the neighbor table corresponding to the virtual switch, the second IP address list in the same subnet segment range as the target tunnel endpoint may be first obtained from the flow table.

[0073] Specifically, when maintaining the neighbor table corresponding to ovs, the same method as mentioned above can be used to obtain the IP address list of the peer vtep whose IP address is in the same subnet segment range as the target vtep from the openflow flow table through the subnet segment range, that is, the second IP address list.

[0074] Sub-step 12: updating the neighbor table according to the second IP address list and the IP address of the gateway.

[0075] After obtaining the second IP address list, the neighbor table corresponding to the virtual switch may be updated through a network diagnostic tool.

[0076] Specifically, after obtaining the second IP address list, the IP addresses in the second IP address list and the IP address of the gateway in the VXLAN can be pinged in turn to obtain the MAC addresses corresponding to the IP addresses in the second IP address list and the IP address of the gateway in the VXLAN, and then the neighbor table can be updated through the IP addresses in the second IP address list, the IP address of the gateway in the VXLAN, and the corresponding MAC addresses.

[0077] In some embodiments of the present invention, the method further comprises:

[0078] After each preset update time period, a verification operation is performed to determine whether other tunnel endpoints within the same subnet segment as the target tunnel endpoint have changed, and the neighbor table is updated based on the verification result.

[0079] Based on the scenario where the peer vtep IP address is increased, such as a newly created virtual switch or a virtual switch is migrated, the virtual switch may fall to a vtep IP address that does not exist in the openflow flow table temporarily. The interval from the openflow flow table being sent to the virtual switch being actually running and accessible may need to be counted in minutes. Therefore, a preset update time period within the minute level is selected to perform a verification operation to see whether other tunnel endpoints in the same subnet segment range as the target tunnel endpoint have changed.

[0080] In actual applications, based on the real-time changes of the openflow flow table, in order to obtain the IP address column of the peer vtep in the openflow flow table whose IP address is in the same subnet segment as the target vtep in a more timely manner, and update it to the neighbor table corresponding to ovs in a timely manner, the preset update time period can be every 30 seconds, to perform a verification operation to check whether the peer vtep whose IP address is in the same subnet segment as the target vtep has changed, and update the neighbor table according to the verification result.

[0081] In some embodiments of the present invention, the operation of verifying whether the IP addresses of the multiple tunnel endpoints have changed includes:

[0082] Sub-step 31, obtaining from the flow table a third IP address list that is in the same subnet segment range as the target tunnel endpoint.

[0083] A third IP address list that is in the same subnet segment range as the IP address of the target tunnel endpoint may be obtained from the flow table.

[0084] Specifically, the IP address list of the peer vtep within the same subnet segment as the IP address of the target vtep, ie, the third IP address list, can be obtained from the openflow flow table.

[0085] Sub-step 32, verifying whether the third IP address list is consistent with the IP address in the neighbor table, and obtaining a verification result.

[0086] After obtaining the third IP address list, it is possible to verify whether the third IP address list is consistent with the IP address in the neighbor table corresponding to ovs, thereby obtaining a verification result.

[0087] In some embodiments of the present invention, updating the neighbor table according to the verification result includes:

[0088] When the verification result is inconsistent, the neighbor table is updated according to the third IP address list.

[0089] When the verification result is inconsistent, the neighbor table corresponding to the virtual switch can be updated according to the third IP address list through the network diagnostic tool.

[0090] Specifically, when the verification result is inconsistent, the IP addresses in the third IP address list can be pinged in turn to obtain the MAC addresses corresponding to the IP addresses in the third IP address list, and then the neighbor table can be updated through the IP addresses in the third IP address list and the corresponding MAC addresses.

[0091] When the verification result is consistent, the neighbor table is not updated.

[0092] If the verification result is consistent, it means that the peer vtep with the same subnet segment as the target vtep's IP address has not changed, so the neighbor table corresponding to ovs is not updated.

[0093] It should be noted that if there is a change, the neighbor corresponding to ovs will be updated, and if there is no change, it will not be updated. That is, every 30S preset update time period, the IP address list of the peer vtep in the same subnet segment as the target vtep's IP address will be obtained from the openflow flow table, that is, the third IP address list, and compared with the one obtained from the openflow flow table corresponding to the previous preset update time period.

[0094] In an embodiment of the present invention, the subnet segment range of the local area network where the target tunnel endpoint is located and the IP address of the gateway are confirmed according to the IP address, subnet segment and routing information of the target tunnel endpoint, the target tunnel endpoint is the tunnel endpoint that forwards the message to be forwarded through the virtual switch, and a first IP address list in the same subnet segment range as the target tunnel endpoint is obtained from the flow table, the flow table is used to determine the path for message forwarding in the local area network, and the neighbor table is updated according to the first IP address list and the IP address of the gateway, the neighbor table includes the correspondence between IP addresses and MAC addresses, the target IP address is determined according to the message to be forwarded in the virtual switch, and the target MAC address corresponding to the target IP address is searched in the neighbor table, and the message to be forwarded is forwarded to the target MAC address through the virtual switch, so that the MAC address corresponding to the target IP address is obtained through the neighbor table, thereby ensuring that the forwarding of normal messages is not lost, and avoiding the risk that the virtual switch itself is modified to increase the cache function, which may affect the capacity of the virtual switch itself.

[0095] Reference Figure 2 , shows a flowchart of the steps of updating a neighbor table provided by some embodiments of the present invention, which may specifically include the following steps:

[0096] 1. Get the subnet segment range where the target vetp IP address is located and the gateway address of its next hop (i.e. the IP address of the LAN gateway);

[0097] 2. Obtain the IP address list of the peer vtep in the same subnet segment as the target vtep's IP address from the openflow flow table;

[0098] 3. Verify whether the IP address list obtained this time is consistent with the IP address list obtained last time;

[0099] 4. If the data are consistent, proceed to step 5. If the data are inconsistent, proceed to step 6.

[0100] 5. Do not update the neighbor table;

[0101] 6. Use the ping method to update the MAC address corresponding to the IP address of the peer vtep through the obtained IP address list (that is, update the neighbor table of ovs);

[0102] 7. Update the IP address list of the peer vtep in the same subnet segment as the target vtep's IP address within the period, as well as the MAC address corresponding to the IP address of the gateway (i.e., LAN gateway) in the VXLAN (i.e., perform maintenance on the neighbor table corresponding to ovs at every preset maintenance time period).

[0103] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0104] Reference Figure 3 , shows a schematic diagram of the structure of a data transmission device based on a virtual switch provided by some embodiments of the present invention, wherein a neighbor table is provided in the virtual switch, and the virtual switch is located in a local area network, and the local area network includes a gateway and multiple tunnel endpoints, and specifically may include the following modules:

[0105] The network segment range and gateway address acquisition module 301 is used to confirm the subnet segment range of the local area network where the target tunnel endpoint is located and the IP address of the gateway according to the IP address, subnet segment and routing information of the target tunnel endpoint; wherein the target tunnel endpoint is the tunnel endpoint that forwards the message to be forwarded through the virtual switch;

[0106] An IP list acquisition module 302 is used to acquire a first IP address list in the same subnet segment range as the target tunnel endpoint from a flow table; wherein the flow table is used to determine a path for message forwarding in the local area network;

[0107] A neighbor table updating module 303, configured to update the neighbor table according to the first IP address list and the IP address of the gateway; wherein the neighbor table includes a correspondence between IP addresses and MAC addresses;

[0108] A target MAC address determination module 304 is used to determine a target IP address according to the message to be forwarded in the virtual switch, and search the neighbor table for a target MAC address corresponding to the target IP address;

[0109] The message forwarding module 305 is used to forward the message to be forwarded to the target MAC address through the virtual switch.

[0110] In one embodiment of the present invention, when the target IP address is not within the subnet segment range, searching the neighbor table for a target MAC address corresponding to the target IP address includes:

[0111] The target MAC address determination submodule is used to obtain the MAC address of the gateway from the neighbor table as the target MAC address.

[0112] In one embodiment of the present invention, it further includes:

[0113] The neighbor table maintenance module is used to perform a maintenance operation on the neighbor table once every preset maintenance time period.

[0114] In one embodiment of the present invention, the neighbor table maintenance module includes:

[0115] A second IP list acquisition submodule is used to acquire from the flow table a second IP address list that is in the same subnet segment range as the target tunnel endpoint;

[0116] The second neighbor table updating submodule is used to update the neighbor table according to the second IP address list and the IP address of the gateway.

[0117] In one embodiment of the present invention, it further includes:

[0118] The neighbor table real-time update module is used to perform a verification operation on whether other tunnel endpoints in the same subnet segment as the target tunnel endpoint have changed every preset update time period, and update the neighbor table according to the verification result.

[0119] In one embodiment of the present invention, the neighbor table real-time update module includes:

[0120] A third IP list acquisition submodule is used to acquire a third IP address list in the same subnet segment range as the target tunnel endpoint from the flow table;

[0121] The verification result acquisition submodule is used to verify whether the third IP address list is consistent with the IP address in the neighbor table, and obtain the verification result.

[0122] In one embodiment of the present invention, the neighbor table real-time update module includes:

[0123] A third neighbor table updating submodule, configured to update the neighbor table according to the third IP address list when the verification result is inconsistent;

[0124] The neighbor table data maintenance submodule is used for not updating the neighbor table when the verification result is consistent.

[0125] In an embodiment of the present invention, the subnet segment range of the local area network where the target tunnel endpoint is located and the IP address of the gateway are confirmed according to the IP address, subnet segment and routing information of the target tunnel endpoint, the target tunnel endpoint is the tunnel endpoint that forwards the message to be forwarded through the virtual switch, and a first IP address list in the same subnet segment range as the target tunnel endpoint is obtained from the flow table, the flow table is used to determine the path for message forwarding in the local area network, and the neighbor table is updated according to the first IP address list and the IP address of the gateway, the neighbor table includes the correspondence between IP addresses and MAC addresses, the target IP address is determined according to the message to be forwarded in the virtual switch, and the target MAC address corresponding to the target IP address is searched in the neighbor table, and the message to be forwarded is forwarded to the target MAC address through the virtual switch, so that the MAC address corresponding to the target IP address is obtained through the neighbor table, thereby ensuring that the forwarding of normal messages is not lost, and avoiding the risk that the virtual switch itself is modified to increase the cache function, which may affect the capacity of the virtual switch itself.

[0126] Some embodiments of the present invention further provide an electronic device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the above method is implemented when the computer program is executed by the processor.

[0127] Some embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, and the computer program implements the above method when executed by a processor.

[0128] Some embodiments of the present invention further provide a computer program product, including a computer program, which implements the above method when executed by a processor.

[0129] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0130] 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, stored data, displayed data, 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 relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0131] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0132] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0133] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0134] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0136] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0137] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.

[0138] The above is a detailed introduction to a data transmission method and device based on a virtual switch. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A data transmission method based on a virtual switch, characterized in that: The virtual switch is provided with a neighbor table, the virtual switch is located in a local area network, the local area network includes a gateway and a plurality of tunnel endpoints, and the method includes: According to the IP address, subnet segment and routing information of the target tunnel endpoint, confirm the subnet segment range of the local area network where the target tunnel endpoint is located and the IP address of the gateway; wherein the target tunnel endpoint is the tunnel endpoint that forwards the message to be forwarded through the virtual switch; Acquire a first IP address list in the same subnet segment range as the target tunnel endpoint from the flow table; wherein the flow table is used to determine the path for message forwarding in the local area network; According to the first IP address list and the IP address of the gateway, the neighbor table is updated; wherein the neighbor table includes a correspondence between IP addresses and MAC addresses; Determine the target IP address according to the message to be forwarded in the virtual switch, and search the target MAC address corresponding to the target IP address in the neighbor table; The message to be forwarded is forwarded to the target MAC address through the virtual switch.

2. The method according to claim 1, characterized in that When the target IP address is not within the subnet segment, searching the neighbor table for a target MAC address corresponding to the target IP address includes: The MAC address of the gateway is obtained from the neighbor table as the target MAC address.

3. The method according to any one of claims 1 to 2, characterized in that: Also includes: The neighbor table maintenance operation is performed once every preset maintenance time period.

4. The method according to claim 3, characterized in that: The operation of maintaining the neighbor table includes: Acquire a second IP address list in the same subnet segment range as the target tunnel endpoint from the flow table; The neighbor table is updated according to the second IP address list and the IP address of the gateway.

5. The method according to any one of claims 1-2, characterized in that: Also includes: After each preset update time period, a verification operation is performed to determine whether other tunnel endpoints within the same subnet segment as the target tunnel endpoint have changed, and the neighbor table is updated based on the verification result.

6. The method according to claim 5, characterized in that The operation of verifying whether the IP addresses of the multiple tunnel endpoints have changed includes: Acquire a third IP address list in the same subnet segment range as the target tunnel endpoint from the flow table; Verify whether the third IP address list is consistent with the IP addresses in the neighbor table, and obtain a verification result.

7. The method according to claim 6, characterized in that The updating of the neighbor table according to the verification result includes: When the verification result is inconsistent, updating the neighbor table according to the third IP address list; When the verification result is consistent, the neighbor table is not updated.

8. A data transmission device based on a virtual switch, characterized in that: The virtual switch is provided with a neighbor table, the virtual switch is located in a local area network, the local area network includes a gateway and a plurality of tunnel endpoints, and the device includes: A network segment range and gateway address acquisition module, used to confirm the subnet segment range of the local area network where the target tunnel endpoint is located and the IP address of the gateway according to the IP address, subnet segment and routing information of the target tunnel endpoint; wherein the target tunnel endpoint is the tunnel endpoint that forwards the message to be forwarded through the virtual switch; An IP list acquisition module, used to acquire a first IP address list in the same subnet segment range as the target tunnel endpoint from a flow table; wherein the flow table is used to determine a path for message forwarding in the local area network; A neighbor table updating module, configured to update the neighbor table according to the first IP address list and the IP address of the gateway; wherein the neighbor table includes a correspondence between IP addresses and MAC addresses; A target MAC address determination module, used to determine a target IP address according to the message to be forwarded in the virtual switch, and search the target MAC address corresponding to the target IP address in the neighbor table; The message forwarding module is used to forward the message to be forwarded to the target MAC address through the virtual switch.

9. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the method for data transmission based on a virtual switch as claimed in any one of claims 1 to 7 is implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the data transmission method based on a virtual switch as claimed in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and device for sending and receiving message

    CN107770072A

  • System and method for dynamic tuning of neighbor aging

    US20220224626A1