A method, device, equipment and medium for dynamically establishing a tunnel

By dynamically determining and reporting target computing nodes, creating and binding tunnel ports, monitoring state changes and adding them to the bridge, the problem of not being able to dynamically establish tunnels in the existing technology is solved, and interoperability between computing nodes and improvement of OpenStack Overlay network performance is achieved.

CN115834290BActive Publication Date: 2025-04-25JINAN INSPUR DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211378244.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2025-04-25
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

In the prior art, tunnels in Overlay scenarios cannot be dynamically established, resulting in the OpenStack Overlay network performance being unable to fully utilize, and the tunnel terminal only supports notification of tunnel establishment, and the tunnel establishment cannot be completed if it cannot match.

Method used

By determining the target computing node to be established and reporting it to the target network component, the corresponding tunnel port is created, and bound to the target computing node, broadcast and listen to the status change information of the tunnel port to determine whether to establish a tunnel. If established, add the tunnel port to the preset bridge and set to the port available state.

Benefits of technology

The dynamic establishment of tunnels between computing nodes is realized, and the problem of not being able to dynamically establish tunnels in the existing technology is solved, and the interoperability between different computing nodes is further realized, which improves the performance of OpenStack Overlay network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834290B_ABST
    Figure CN115834290B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, and medium for dynamically establishing tunnels, relating to the field of computer technology. The method includes: determining a target computing node to which a tunnel needs to be established, and reporting the target computing node to a target network component so that the target network component can create a corresponding tunnel port; binding the tunnel port to the target computing node through the target network component, broadcasting to the target computing node, and monitoring the status change information of the tunnel port to determine whether to establish a tunnel; if it is determined that a tunnel needs to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to a port-available state. Through the above technical solution, when computing nodes have a need to establish tunnels, the dynamic establishment of tunnels between computing nodes can be realized, further enabling interoperability between different computing nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and medium for dynamically establishing a tunnel. Background Art

[0002] At present, different nodes in the virtualization layer communicate with each other through the tunnel network card in the Overlay tunnel. When there is a communication demand between the source address and the destination address, the user data is forwarded through a virtual tunnel created between the IP networks of the data center. That is, the virtualization layer adopts the Overlay protocol network. The routers directly connected to the two virtual machines can directly establish a virtual link tunnel for communication. The connected routers are called tunnel terminals. All tunnel terminals in the same large second layer need to establish virtual tunnels. The source IP address and destination IP address of each tunnel communicate through the tunnel terminal address of the local virtual machine and the virtual tunnel terminal address of the target virtual machine.

[0003] However, there are currently some Overlay scenarios where tunnels cannot be established dynamically, and the tunnel interfaces at both ends cannot be connected to each other. Instead, the dynamic establishment of tunnels needs to be achieved through manual code modification, which greatly loses the advantages brought by the OpenStack Overlay network performance. As a commonly used network type in OpenStack, it is crucial to develop Overlay network design that supports tunnel establishment. In the prior art, the tunnel only serves as an information receiving device and does not process tunnel reception information. If the tunnel terminal of the network node only supports notification of tunnel establishment, or the deployment mode and tunnel technology of each node are different, the tunnel cannot be established. The control plane design process only reports information through the message channel to notify other nodes to complete the tunnel establishment, but if the two nodes cannot match, the tunnel establishment cannot be completed.

[0004] In summary, how to achieve dynamic tunnel establishment is a problem that needs to be solved at present. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for dynamically establishing a tunnel, which can realize the dynamic establishment of a tunnel. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a method for dynamically establishing a tunnel, comprising:

[0007] Determine a target computing node for a tunnel to be established, and report the target computing node to a target network component so that the target network component creates a corresponding tunnel port;

[0008] Binding the tunnel port to the target computing node through the target network component, broadcasting to the target computing node, and monitoring the status change information of the tunnel port to determine whether to establish a tunnel;

[0009] If it is determined to establish a tunnel, the tunnel port is added to the preset bridge, and the tunnel port is set to a port available state.

[0010] Optionally, monitoring the status change information of the tunnel port to determine whether to establish a tunnel includes:

[0011] Monitor the status change information of the tunnel port to obtain the tunnel port number and the IP address of the remote computing node, and obtain the currently established tunnel information from a preset database;

[0012] Based on the tunnel information, it is determined whether a tunnel corresponding to the tunnel port number and the IP address currently exists; if not, it is determined to establish a tunnel between the target computing node and the remote computing node.

[0013] Optionally, the method for dynamically establishing a tunnel further includes:

[0014] If it is determined to establish a tunnel, the tunnel information including the tunnel port number and the IP address of the remote computing node is stored in the preset database.

[0015] Optionally, the method for dynamically establishing a tunnel further includes:

[0016] When a tunnel deletion command is obtained, target tunnel information corresponding to the tunnel to be deleted is filtered out from the preset database;

[0017] The IP address of the remote computing node in the target tunnel information is extracted, and a deletion operation is performed on the target tunnel information.

[0018] Optionally, the process of monitoring the status change information of the tunnel port to determine whether to establish a tunnel further includes:

[0019] The heartbeat packet information sent by the tunnel port at every preset time interval is obtained, so as to determine whether the target computing node corresponding to the tunnel port is in an online state according to the heartbeat packet information.

[0020] Optionally, the process of adding the tunnel port to the preset bridge further includes:

[0021] The split horizon group numbers of the remaining ports in the preset bridge are determined, and the tunnel ports are configured using the split horizon group numbers.

[0022] Optionally, the process of broadcasting to the target computing node further includes:

[0023] Determine the target network where the tunnel port is located, and search for other target ports in the target network that are in a port available state;

[0024] Obtain computing node information corresponding to the target port.

[0025] In a second aspect, the present application discloses a device for dynamically establishing a tunnel, comprising:

[0026] An information reporting module, used to determine a target computing node for a tunnel to be established, and report the target computing node to a target network component so that the target network component can create a corresponding tunnel port;

[0027] A binding module, configured to bind the tunnel port to the target computing node through the target network component and broadcast to the target computing node;

[0028] A monitoring module, used for monitoring the status change information of the tunnel port to determine whether to establish a tunnel;

[0029] The tunnel establishing module is used to add the tunnel port to the preset bridge if it is determined to establish the tunnel, and set the tunnel port to the port available state.

[0030] In a third aspect, the present application discloses an electronic device, comprising:

[0031] Memory, used to store computer programs;

[0032] The processor is used to execute the computer program to implement the steps of the method for dynamically establishing a tunnel disclosed above.

[0033] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the method for dynamically establishing a tunnel disclosed above are implemented.

[0034] It can be seen that the present application determines the target computing node to be established for the tunnel, and reports the target computing node to the target network component so that the target network component creates a corresponding tunnel port; the tunnel port is bound to the target computing node through the target network component, and the target computing node is broadcast, and the state change information of the tunnel port is monitored to determine whether to establish a tunnel; if it is determined to establish a tunnel, the tunnel port is added to the preset bridge, and the tunnel port is set to the port available state. It can be seen that the present application first determines the target computing node to be established for the tunnel, and reports the target computing node to the target network component, and the target network component creates the corresponding tunnel port, and then binds the tunnel port to the target computing node; then broadcasts the target computing node, and monitors the state change information of the tunnel port to determine whether a tunnel needs to be established. If established, the tunnel port is added to the preset network, and the port is set to the port available state. The above technical solution realizes the dynamic establishment of tunnels between computing nodes, and further realizes the intercommunication between different computing nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0036] Figure 1 A flow chart of a method for dynamically establishing a tunnel disclosed in this application;

[0037] Figure 2 A schematic diagram of a process of dynamically establishing a tunnel disclosed in this application;

[0038] Figure 3 A schematic diagram showing a comparison before and after an improvement disclosed in the present application;

[0039] Figure 4 A schematic diagram of a process of port update and deletion disclosed in this application;

[0040] Figure 5 A flowchart of a specific method for dynamically establishing a tunnel disclosed in this application;

[0041] Figure 6 A schematic diagram of the workflow of a listener disclosed in this application;

[0042] Figure 7 This is a schematic diagram of the structure of a device for dynamically establishing a tunnel disclosed in this application;

[0043] Figure 8 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

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

[0045] At present, there are some Overlay scenarios where tunnels cannot be established dynamically, and the tunnel interfaces at both ends cannot be connected to each other. Instead, it is necessary to manually modify the code to dynamically establish the tunnel, which greatly loses the advantages brought by the OpenStack Overlay network performance. As a commonly used network type in OpenStack, it is crucial to develop Overlay network design that supports the establishment of tunnels. In the prior art, the tunnel is only used as an information receiving device and does not process the tunnel reception information. If the tunnel terminal of the network node only supports notification of tunnel establishment, or the deployment mode and tunnel technology of each node are different, the tunnel cannot be established. The control plane design process only reports the information through the message channel to notify other nodes to complete the tunnel establishment, but if the two nodes cannot match, the tunnel establishment cannot be completed. To this end, the embodiments of the present application disclose a method, device, equipment and medium for dynamically establishing a tunnel, which can realize the dynamic establishment of a tunnel.

[0046] See also Figure 1 and Figure 2 As shown, the embodiment of the present application discloses a method for dynamically establishing a tunnel, the method comprising:

[0047] Step S11: determine a target computing node for a tunnel to be established, and report the target computing node to a target network component so that the target network component creates a corresponding tunnel port.

[0048] In this embodiment, the target computing node of the tunnel to be established is determined, and the target computing node is reported to the target network component, that is, the reporting of node information is realized. Among them, the tunnel to be established is an Overlay tunnel, and the target network component is specifically Neutorn Server. Neutorn Server will create a tunnel port corresponding to the target computing node. The NeutronServer side code mainly realizes the processing of information reported by nodes in different deployment modes, the driving mechanism receives the port reported node information, and realizes port binding and port update to the enabled state. While monitoring the reported node information, it realizes the function of processing the reported information.

[0049] Step S12: Bind the tunnel port to the target computing node through the target network component, broadcast to the target computing node, and monitor the status change information of the tunnel port to determine whether to establish a tunnel.

[0050] In this embodiment, the target network component Neutorn Server binds the tunnel port to the target computing node and monitors the status change information of the tunnel port to determine whether to establish a tunnel. Figure 3 As shown, Neutron Server has the ability to process routing / gateway port binding information. Therefore, on the basis of the original, it can add processing port binding messages, call the original interface to perform port host binding, and write it to the database. In addition, the tunnel is not only an information receiving device, but also can process tunnel information. Therefore, there is no need for the peer nodes to match each other. It is only necessary to send a request to establish a tunnel. The tunnel will process the peer data to establish the tunnel. Optimizing the tunnel communication implementation method is crucial for the data packet sending and receiving process. Improving the data forwarding plane is crucial for the forwarding efficiency in the data processing process. Improving its packet processing process is crucial to better realize tunnel establishment and forwarding. In addition, the network interface provided performs layer 2 and layer 3 forwarding of network data, and optimizes the functional defects of the data plane.

[0051] Furthermore, in the process of monitoring the status change information of the tunnel port to determine whether to establish a tunnel, it also includes: obtaining the heartbeat packet information sent by the tunnel port at preset time intervals, so as to determine whether the target computing node corresponding to the tunnel port is online according to the heartbeat packet information. It is understandable that NeutornServer can establish a tunnel with other nodes only after obtaining the computing node information and port binding information. In addition, it is necessary to monitor the port status changes in ETCD. Any network-related operation layer 2 function is required. It is necessary to implement port heartbeat packet message reporting, and it is possible to refresh whether the target computing node is online every once in a while. Reporting node status information indicates that the service is running, and then it is sent to the routing or gateway interface corresponding to the node, and the routing or gateway port is bound to the target computing node, thereby realizing the enabled state of the port.

[0052] In addition, the above-mentioned process of broadcasting the target computing node also includes: determining the target network where the tunnel port is located, and searching for other target ports in the target network that are in a port available state; and obtaining computing node information corresponding to the target port. That is, by determining the target network where the tunnel port is located, the remaining available target ports can be searched in the network, and computing node information corresponding to the target port can be obtained. Then, the computing node information where these ports are located is notified to the reporting computing node through a broadcast message, and the computing node information is broadcast to all nodes at the same time.

[0053] Step S13: If it is determined to establish a tunnel, the tunnel port is added to the preset bridge, and the tunnel port is set to a port available state.

[0054] In this embodiment, if it is determined to establish a tunnel, the created tunnel port will be inserted into the preset bridge, and the tunnel port will be set to the port available state. In addition, the corresponding service information is searched in the database based on the host name of the computing node scheduled and the node type driven by the mechanism, and then it is inferred whether the network type where the port is located is supported. In addition, Neutron can monitor changes in port status and bind the port to the host. After the binding is completed, the port status is set to enabled, and two different nodes can directly establish a tunnel. There are two possibilities for port changes, one is port update and the other is port deletion. Please refer to the specific details. Figure 4 As shown in . It can be seen that this application modifies the original Overlay scenario tunnel mechanism so that the control plane tunnel mechanism remains native and only changes the data plane. This avoids the problem of being unable to match the two ends of the tunnel and thus unable to complete the tunnel establishment due to the differences between the nodes. The solution of this application can achieve intercommunication between computing nodes in the Overlay network.

[0055] It should be pointed out that the above process of adding the tunnel port to the preset bridge also includes: determining the horizontal segmentation group number of the remaining ports in the preset bridge, and configuring the tunnel port using the horizontal segmentation group number. It is understandable that in order to avoid routing loops and speed up routing convergence, it is also necessary to configure the same and non-zero horizontal segmentation group number for the tunnel ports when adding them to the bridge, that is, to obtain the horizontal segmentation group number of the remaining ports in the preset bridge, and use the horizontal segmentation group number to configure the tunnel port. Otherwise, the Overlay tunnel is fully meshed between the servers, and flooding data packets may circulate between servers with the same network segment. In addition, if the three tunnel endpoints have the need to communicate with each other, there is no need for all three to establish VXLAN tunnels with each other, and tunnels can be established two by two.

[0056] Referring to the above tunnel establishment process, in order to achieve different modes of tunnel establishment connection between nodes. If there is no Layer 2 tunnel communication demand between computing nodes, for example, there is no virtual machine in this computing node and the virtual machine has no communication demand, then there is no need to establish a tunnel. Reduce the establishment of unnecessary tunnels and reduce the number of Layer 2 broadcast messages to improve efficiency. Specifically, the process of dynamically establishing a tunnel is as follows: when the computing node finds that a network card is inserted and identifies it as a network management interface, it calls the relevant network component Neutron Server through the broadcast message call method; after receiving the message, Neutron Server will call the update status function to set the port status to the enabled state, and will call all related drivers to synchronize and update to the enabled state before submission; when the driver updates the port status method, it synchronously calls the update port number, and according to the available port number, finds other available ports in the same network as this port, and then notifies the reporting computing node of the node information through the broadcast message, and broadcasts the computing node information to all nodes at the same time.

[0057] That is, the embodiment of the present application is mainly implemented by sending each node synchronization and maintaining the data table through the plug-in. When the virtual machine created by the specified network is started, the virtual machine is scheduled to the computing node, and the computing-related service of the node will call the interface of the network module to create the port, waiting for the port status to become available, thereby realizing the dynamic establishment of the subsequent tunnel. That is, through the process of dynamically establishing the tunnel, the virtual machines of the Overlay type are connected to each other, which is used for the user interface of the virtual host node. This interface can provide services similar to the DHCP end. The port interface is created to synchronously call all supported network mechanism methods in a loop to bind the port. The port status becomes available only after the binding is successful. The network module needs to add a plug-in to track the configuration resource status. When the port is created and bound to the host, the network module is used to track the configuration status of each port. Before it becomes available, each node needs to complete the call. The original node needs to broadcast to all nodes and establish a tunnel. After the improvement, the broadcast is only sent to the relevant agent through a unicast encapsulation packet and a connection is established.

[0058] It can be seen that the present application determines the target computing node to be established for the tunnel, and reports the target computing node to the target network component so that the target network component creates a corresponding tunnel port; the tunnel port is bound to the target computing node through the target network component, and the target computing node is broadcast, and the state change information of the tunnel port is monitored to determine whether to establish a tunnel; if it is determined to establish a tunnel, the tunnel port is added to the preset bridge, and the tunnel port is set to the port available state. It can be seen that the present application first determines the target computing node to be established for the tunnel, and reports the target computing node to the target network component, and the target network component creates the corresponding tunnel port, and then binds the tunnel port to the target computing node; then broadcasts the target computing node, and monitors the state change information of the tunnel port to determine whether a tunnel needs to be established. If established, the tunnel port is added to the preset network, and the port is set to the port available state. The above technical solution realizes the dynamic establishment of tunnels between computing nodes, and further realizes the intercommunication between different computing nodes.

[0059] See also Figure 5 As shown, the embodiment of the present application discloses a specific method for dynamically establishing a tunnel. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, it includes:

[0060] Step S21: The computing node determines the target point of the tunnel to be established, and reports the target computing node to the target network component so that the target network component creates a corresponding tunnel port.

[0061] Step S22: Bind the tunnel port to the target computing node through the target network component, and broadcast to the target computing node.

[0062] Step S23: monitor the status change information of the tunnel port to obtain the tunnel port number and the IP address of the remote computing node, and obtain the currently established tunnel information from a preset database.

[0063] In this embodiment, the state change information of the monitoring tunnel port is specifically used in the ETCD monitor, that is, this embodiment specifically sets a monitor, as shown in the following example. Figure 6As shown in , it is mainly designed for Overlay tunnels, and is used to process the monitored Overlay tunnel port changes, as well as receive and process messages to create overlay tunnels. Then, the tunnel port number, host name, and port IP are obtained from the ETCD listener to obtain the IP address of the remote computing node, that is, the remote host IP. Then, the currently established tunnel information is obtained from the preset database. It should be noted that it is necessary to further determine whether it is the host name of the local machine. If so, no processing is required; determine whether the tunnel port number has the same routing port on the opposite end on the node. If not, no processing is required.

[0064] Step S24: based on the tunnel information, determine whether there is currently a tunnel corresponding to the tunnel port number and the IP address; if not, determine to establish a tunnel between the target computing node and the remote computing node.

[0065] In this embodiment, based on the tunnel information, it is determined whether there is a tunnel corresponding to the tunnel port number and IP address. Specifically, the interface of the calling node is used to obtain all the tunnels that have been created, and it is determined whether the tunnel corresponding to the tunnel port number + remote host IP exists. If not, it is determined to establish an overlay tunnel between the target computing node and the remote computing node.

[0066] Step S25: If it is determined to establish a tunnel, the tunnel port is added to the preset bridge, and the tunnel port is set to a port available state.

[0067] In this embodiment, if it is determined to establish a tunnel, the tunnel information including the tunnel port number and the IP address of the remote computing node is stored in the preset database. Specifically, the tunnel port number + host name is used as the key value, and the remote host IP + IP address + MAC is used as the vlaue value, which is stored in the database to facilitate the acquisition of all tunnels that have been created in the future. That is, the design of the present invention is intended to provide the function of creating an overlay tunnel port, which can be added to the bridge as a bridge port to participate in Layer 2 forwarding. Through the above design, a tunnel is dynamically established, the control plane remains native, only the data plane is changed, the listening port becomes available, and it is sent to other nodes that need to establish tunnels through ETCD for processing, so as to achieve tunnel intercommunication with other nodes.

[0068] In addition, the above method also includes: when a tunnel deletion command is obtained, the target tunnel information corresponding to the tunnel to be deleted is filtered out from the preset database; the IP address of the remote computing node in the target tunnel information is extracted, and the deletion operation is performed on the target tunnel information. It can be understood that if a tunnel deletion command is obtained, the target tunnel information corresponding to the tunnel to be deleted is filtered out from the preset database, the remote host IP is extracted, and the deletion operation is performed. That is, when the tunnel or related interface needs to be deleted, a pair of key-vlaue values ​​is obtained from the ETCD database, and the remote host IP is taken out. If there is only one piece of data to be deleted in the cache, a call to delete the Overlay tunnel is executed. If there are multiple pieces of data, only the corresponding cache is deleted.

[0069] For more specific processing procedures of the above steps S21 and S22, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.

[0070] It can be seen that the computing node of the embodiment of the present application determines the target point of the tunnel to be established, and reports the target computing node to the target network component so that the target network component creates a corresponding tunnel port; binds the tunnel port to the target computing node through the target network component, and broadcasts the target computing node; monitors the status change information of the tunnel port to obtain the tunnel port number and the IP address of the remote computing node, and obtains the currently established tunnel information from the preset database; monitors the status change information of the tunnel port to obtain the tunnel port number and the IP address of the remote computing node, and obtains the currently established tunnel information from the preset database; if it is determined to establish a tunnel, the tunnel port is added to the preset bridge, and the tunnel port is set to the port available state. It can be seen that this embodiment sets an ETCD listener, which is mainly designed for Overlay tunnels, and is used to process the monitored Overlay tunnel port changes, and then obtains the tunnel port number, host name and port IP from the ETCD listener, thereby obtaining the IP address of the remote computing node, that is, the remote host IP, and then obtains all the tunnels that have been created, and determines whether the tunnel corresponding to the tunnel port number + remote host IP exists. If not, it is determined to establish an overlay tunnel between the target computing node and the remote computing node, and the tunnel information including the tunnel port number and the IP address of the remote computing node is stored in the preset database, thereby realizing the dynamic establishment of tunnels between computing nodes. After the above scheme realizes the process of dynamically establishing tunnels in the Overlay scenario, it can be realized under the Overlay network type, different deployment modes, and different nodes. Even if the peer nodes cannot match each other to establish tunnels, the tunnel logic and tunnel mechanism of the present invention can be used to realize dynamic tunnel establishment, which is supported under the Overlay network type, such as creating / deleting networks, creating / deleting routers, adding / deleting interfaces to routers, etc., and intercommunication can be achieved through dynamic tunnel establishment.

[0071] See also Figure 7 As shown, an embodiment of the present application discloses a device for dynamically establishing a tunnel, the device comprising:

[0072] An information reporting module 11 is used to determine a target computing node for a tunnel to be established, and report the target computing node to a target network component so that the target network component can create a corresponding tunnel port;

[0073] A binding module 12, configured to bind the tunnel port to the target computing node through the target network component and broadcast to the target computing node;

[0074] A monitoring module 13, used for monitoring the status change information of the tunnel port to determine whether to establish a tunnel;

[0075] The tunnel establishing module 14 is used to add the tunnel port to the preset bridge if it is determined to establish the tunnel, and set the tunnel port to a port available state.

[0076] It can be seen that the present application determines the target computing node to be established for the tunnel, and reports the target computing node to the target network component so that the target network component creates a corresponding tunnel port; the tunnel port is bound to the target computing node through the target network component, and the target computing node is broadcast, and the state change information of the tunnel port is monitored to determine whether to establish a tunnel; if it is determined to establish a tunnel, the tunnel port is added to the preset bridge, and the tunnel port is set to the port available state. It can be seen that the present application first determines the target computing node to be established for the tunnel, and reports the target computing node to the target network component, and the target network component creates the corresponding tunnel port, and then binds the tunnel port to the target computing node; then broadcasts the target computing node, and monitors the state change information of the tunnel port to determine whether a tunnel needs to be established. If established, the tunnel port is added to the preset network, and the port is set to the port available state. The above technical solution realizes the dynamic establishment of tunnels between computing nodes, and further realizes the intercommunication between different computing nodes.

[0077] In some specific embodiments, the monitoring module 13 may specifically include:

[0078] An information acquisition unit, used to monitor the state change information of the tunnel port to obtain the tunnel port number and the IP address of the remote computing node, and obtain the currently established tunnel information from a preset database;

[0079] A judging unit is used to judge whether there is a tunnel corresponding to the tunnel port number and the IP address based on the tunnel information, and if not, determine to establish a tunnel between the target computing node and the remote computing node.

[0080] In some specific embodiments, the device for dynamically establishing a tunnel may further include:

[0081] The information storage unit is used to store the tunnel information including the tunnel port number and the IP address of the remote computing node into the preset database if it is determined to establish the tunnel.

[0082] In some specific embodiments, the device for dynamically establishing a tunnel may further include:

[0083] A deletion command acquisition unit, configured to filter out target tunnel information corresponding to the tunnel to be deleted from the preset database when a tunnel deletion command is acquired;

[0084] The deleting unit is used to extract the IP address of the remote computing node in the target tunnel information and perform a deleting operation on the target tunnel information.

[0085] In some specific embodiments, the process of the monitoring module 13 may also include:

[0086] The heartbeat packet monitoring unit is used to obtain the heartbeat packet information sent by the tunnel port at preset time intervals, so as to determine whether the target computing node corresponding to the tunnel port is in an online state according to the heartbeat packet information.

[0087] In some specific embodiments, the process of the tunnel establishment module 14 may also include:

[0088] The information configuration unit is used to determine the horizontal segmentation group numbers of the remaining ports in the preset bridge, and configure the tunnel port using the horizontal segmentation group numbers.

[0089] In some specific embodiments, the process of the binding module 12 may also include:

[0090] A port search unit, used to determine the target network where the tunnel port is located, and search for other target ports in the target network that are in a port available state;

[0091] The node information acquisition unit is used to acquire the computing node information corresponding to the target port.

[0092] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the following steps:

[0093] Determine a target computing node for a tunnel to be established, and report the target computing node to a target network component so that the target network component creates a corresponding tunnel port;

[0094] Binding the tunnel port to the target computing node through the target network component, broadcasting to the target computing node, and monitoring the status change information of the tunnel port to determine whether to establish a tunnel;

[0095] If it is determined to establish a tunnel, the tunnel port is added to the preset bridge, and the tunnel port is set to a port available state.

[0096] In some specific implementations, the processor can implement the following steps by executing the computer program stored in the memory:

[0097] Monitor the status change information of the tunnel port to obtain the tunnel port number and the IP address of the remote computing node, and obtain the currently established tunnel information from a preset database;

[0098] Based on the tunnel information, it is determined whether a tunnel corresponding to the tunnel port number and the IP address currently exists; if not, it is determined to establish a tunnel between the target computing node and the remote computing node.

[0099] In some specific implementations, the processor can implement the following steps by executing the computer program stored in the memory:

[0100] If it is determined to establish a tunnel, the tunnel information including the tunnel port number and the IP address of the remote computing node is stored in the preset database.

[0101] In some specific implementations, the processor can implement the following steps by executing the computer program stored in the memory:

[0102] When a tunnel deletion command is obtained, target tunnel information corresponding to the tunnel to be deleted is filtered out from the preset database;

[0103] The IP address of the remote computing node in the target tunnel information is extracted, and a deletion operation is performed on the target tunnel information.

[0104] In some specific implementations, the processor can implement the following steps by executing the computer program stored in the memory:

[0105] The heartbeat packet information sent by the tunnel port at every preset time interval is obtained, so as to determine whether the target computing node corresponding to the tunnel port is in an online state according to the heartbeat packet information.

[0106] In some specific implementations, the processor can implement the following steps by executing the computer program stored in the memory:

[0107] The split horizon group numbers of the remaining ports in the preset bridge are determined, and the tunnel ports are configured using the split horizon group numbers.

[0108] In some specific implementations, the processor can implement the following steps by executing the computer program stored in the memory:

[0109] Determine the target network where the tunnel port is located, and search for other target ports in the target network that are in a port available state;

[0110] Obtain computing node information corresponding to the target port.

[0111] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0112] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0113] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0114] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the method of dynamically establishing a tunnel performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the electronic device, the data 223 can also include data collected by its own input and output interface 25, etc.

[0115] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the method steps performed in the process of dynamically establishing a tunnel disclosed in any of the aforementioned embodiments are implemented.

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

[0117] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0118] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0119] 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 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 device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0120] The above is a detailed introduction to a method, device, equipment and storage medium for dynamically establishing a tunnel provided by the present invention. 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 a person skilled in the art, 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 method for dynamically establishing a tunnel, characterized in that: include Determine a target computing node for a tunnel to be established, and report the target computing node to a target network component so that the target network component creates a corresponding tunnel port; Binding the tunnel port to the target computing node through the target network component, broadcasting to the target computing node, and monitoring the status change information of the tunnel port to determine whether to establish a tunnel; If it is determined to establish a tunnel, the tunnel port is added to the preset bridge, and the tunnel port is set to a port available state; The monitoring the status change information of the tunnel port to determine whether to establish a tunnel includes: Monitor the status change information of the tunnel port to obtain the tunnel port number and the IP address of the remote computing node, and obtain the currently established tunnel information from a preset database; Based on the tunnel information, it is determined whether a tunnel corresponding to the tunnel port number and the IP address currently exists; if not, it is determined to establish a tunnel between the target computing node and the remote computing node.

2. The method for dynamically establishing a tunnel according to claim 1, characterized in that: Also includes: If it is determined to establish a tunnel, the tunnel information including the tunnel port number and the IP address of the remote computing node is stored in the preset database.

3. The method for dynamically establishing a tunnel according to claim 2, characterized in that: Said When a tunnel deletion command is obtained, target tunnel information corresponding to the tunnel to be deleted is filtered out from the preset database; The IP address of the remote computing node in the target tunnel information is extracted, and a deletion operation is performed on the target tunnel information.

4. The method for dynamically establishing a tunnel according to claim 1, characterized in that: The process of monitoring the status change information of the tunnel port to determine whether to establish a tunnel also includes: The heartbeat packet information sent by the tunnel port at every preset time interval is obtained, so as to determine whether the target computing node corresponding to the tunnel port is in an online state according to the heartbeat packet information.

5. The method for dynamically establishing a tunnel according to claim 1, characterized in that: The process of adding the tunnel port to the preset bridge further includes: The split horizon group numbers of the remaining ports in the preset bridge are determined, and the tunnel ports are configured using the split horizon group numbers.

6. The method for dynamically establishing a tunnel according to any one of claims 1 to 5, characterized in that: The process of broadcasting to the target computing node also includes: Determine the target network where the tunnel port is located, and search for other target ports in the target network that are in a port available state; Obtain computing node information corresponding to the target port.

7. A device for dynamically establishing a tunnel, characterized in that: include An information reporting module, used to determine a target computing node for a tunnel to be established, and report the target computing node to a target network component so that the target network component can create a corresponding tunnel port; A binding module, configured to bind the tunnel port to the target computing node through the target network component and broadcast to the target computing node; A monitoring module, used for monitoring the status change information of the tunnel port to determine whether to establish a tunnel; A tunnel establishment module, configured to add the tunnel port to a preset bridge and set the tunnel port to a port available state if it is determined to establish a tunnel; The monitoring module specifically includes: An information acquisition unit, used to monitor the state change information of the tunnel port to obtain the tunnel port number and the IP address of the remote computing node, and obtain the currently established tunnel information from a preset database; A judging unit is used to judge whether there is a tunnel corresponding to the tunnel port number and the IP address based on the tunnel information, and if not, determine to establish a tunnel between the target computing node and the remote computing node.

8. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the method for dynamically establishing a tunnel as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the steps of the method for dynamically establishing a tunnel as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • OpenStack traffic collection method based on tunneling protocol

    CN108111384A