CN115834290A - Method, device, equipment and medium for dynamically establishing tunnel - Google Patents

Method, device, equipment and medium for dynamically establishing tunnel Download PDF

Info

Publication number
CN115834290A
CN115834290A CN202211378244.4A CN202211378244A CN115834290A CN 115834290 A CN115834290 A CN 115834290A CN 202211378244 A CN202211378244 A CN 202211378244A CN 115834290 A CN115834290 A CN 115834290A
Authority
CN
China
Prior art keywords
tunnel
port
target
computing node
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211378244.4A
Other languages
Chinese (zh)
Inventor
朱梦瑶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202211378244.4A priority Critical patent/CN115834290A/en
Publication of CN115834290A publication Critical patent/CN115834290A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a method, a device, equipment and a medium for dynamically establishing a tunnel, which relate to the technical field of computers and comprise the following steps: determining a target computing node of a tunnel to be established, and reporting the target computing node to a target network component so that the target network component establishes a corresponding tunnel port; binding the tunnel port with the target computing node through the target network component, broadcasting the target computing node, and monitoring state change information of the tunnel port to determine whether to establish a tunnel; and if the tunnel is determined to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to be in a port available state. By the technical scheme, when the computing nodes have the requirement of establishing the tunnel, the dynamic establishment of the tunnel among the computing nodes can be realized, and the intercommunication among different computing nodes is further realized.

Description

Method, device, equipment and medium for dynamically establishing tunnel
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for dynamically establishing a tunnel.
Background
At present, different nodes of a virtualization layer are communicated with each other through a tunnel network card in an Overlay tunnel, when a communication requirement exists between a source address and a destination address, user data is forwarded through a virtual tunnel established between data center IP networks, namely, the virtualization layer adopts an Overlay protocol network, two virtual machines are directly connected with a router, a virtual link tunnel can be directly established for communication, and the connected router is called a tunnel terminal. The tunnel terminals in the same two layers need to establish virtual tunnels, and the source IP address and the destination IP address of each tunnel are communicated through the tunnel terminal address of the local virtual machine and the virtual tunnel terminal address of the target virtual machine.
However, in some Overlay scenes, tunnels cannot be dynamically established, interfaces of tunnels at two ends cannot be connected with each other, and dynamic establishment of tunnels needs to be realized in ways of manually changing codes and the like, so that advantages brought by network performance of OpenStack Overlay are greatly lost. The Overlay is used as a common network type of OpenStack, and it is important to develop an adaptation for supporting the Overlay network design and establish a tunnel. In the prior art, a tunnel is only used as an information receiving device and does not process tunnel receiving information, and if a tunnel terminal of a network node only supports notification of tunnel establishment or deployment modes and tunnel technologies of all nodes are different, the tunnel cannot be established. The control plane design flow only reports the information through the message channel and informs other nodes to complete the establishment of the tunnel, but if the two nodes cannot be matched, the establishment of the tunnel cannot be completed.
In summary, how to implement dynamic establishment of tunnels is a problem to be solved at present.
Disclosure of Invention
In view of this, an object of the present invention is to provide a method, an apparatus, a device and a medium for dynamically establishing a tunnel, which can implement dynamic establishment of the tunnel. The specific scheme is as follows:
in a first aspect, the present application discloses a method for dynamically establishing a tunnel, including:
determining a target computing node of a tunnel to be established, and reporting the target computing node to a target network component so that the target network component establishes a corresponding tunnel port;
binding the tunnel port with the target computing node through the target network component, broadcasting the target computing node, and monitoring state change information of the tunnel port to determine whether to establish a tunnel;
and if the tunnel is determined to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to be in a port available state.
Optionally, the monitoring state change information of the tunnel port to determine whether to establish a tunnel includes:
monitoring state change information of the tunnel port to acquire a tunnel port number and an IP address of a remote computing node, and acquiring currently established tunnel information from a preset database;
and judging whether a tunnel corresponding to the tunnel port number and the IP address exists at present or not based on the tunnel information, and if not, determining to establish the tunnel between the target computing node and the far-end computing node.
Optionally, the method for dynamically establishing a tunnel further includes:
and if the tunnel is determined to be established, storing tunnel information comprising the tunnel port number and the IP address of the remote computing node into the preset database.
Optionally, the method for dynamically establishing a tunnel further includes:
when a tunnel deleting command is acquired, screening target tunnel information corresponding to a tunnel to be deleted from the preset database;
and extracting the IP address of the remote computing node in the target tunnel information, and executing deletion operation on the target tunnel information.
Optionally, in the process of monitoring the state change information of the tunnel port to determine whether to establish a tunnel, the method further includes:
and acquiring heartbeat packet information sent by the tunnel port at preset time intervals so as to judge whether a target computing node corresponding to the tunnel port is in an online state or not according to the heartbeat packet information.
Optionally, in the process of adding the tunnel port to the preset bridge, the method further includes:
and determining the horizontal division group numbers of the other ports in the preset network bridge, and configuring the tunnel port by using the horizontal division group numbers.
Optionally, in the process of broadcasting the target computing node, the method further includes:
determining a target network where the tunnel port is located, and searching other target ports in a port available state in the target network;
and acquiring the computing node information corresponding to the target port.
In a second aspect, the present application discloses an apparatus for dynamically establishing a tunnel, including:
the information reporting module is used for determining a target computing node of a tunnel to be established and reporting the target computing node to a target network component so as to facilitate the target network component to establish a corresponding tunnel port;
a binding module, configured to bind the tunnel port with the target computing node through the target network component, and broadcast the target computing node;
the monitoring module is used for monitoring the state change information of the tunnel port to determine whether to establish a tunnel;
and the tunnel establishing module is used for adding the tunnel port to a preset bridge if the tunnel is determined to be established, and setting the tunnel port to be in a port available state.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the method for dynamically establishing a tunnel disclosed in the foregoing.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the steps of the method of dynamically establishing tunnels as disclosed above.
Therefore, the target computing node of the tunnel to be established is determined, and the target computing node is reported to the target network component, so that the target network component can establish a corresponding tunnel port; binding the tunnel port with the target computing node through the target network component, broadcasting the target computing node, and monitoring state change information of the tunnel port to determine whether to establish a tunnel; and if the tunnel is determined to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to be in a port available state. Therefore, the method comprises the steps that firstly, a target computing node of a tunnel to be established is determined, the target computing node is reported to a target network component, a corresponding tunnel port is established by the target network component, and then the tunnel port is bound with the target computing node; and then broadcasting the target computing node, monitoring state change information of the tunnel port to determine whether a tunnel needs to be established, if so, adding the tunnel port to a preset network, and setting the port to be in a port available state. The technical scheme realizes the dynamic establishment of the tunnel between the computing nodes and further realizes the intercommunication between different computing nodes.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a method for dynamically establishing a tunnel according to the present disclosure;
fig. 2 is a schematic flow chart of dynamically establishing a tunnel according to the present disclosure;
FIG. 3 is a schematic diagram of an improved front-to-back comparison of the present disclosure;
FIG. 4 is a schematic flow chart of port update and deletion disclosed herein;
FIG. 5 is a flowchart of a specific method for dynamically establishing a tunnel according to the present disclosure;
FIG. 6 is a schematic flow chart of a listener disclosed herein;
fig. 7 is a schematic structural diagram of an apparatus for dynamically establishing a tunnel according to the present disclosure;
fig. 8 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, tunnels cannot be dynamically established in an Overlay scene, interfaces of the tunnels at two ends cannot be connected with each other, and the tunnels need to be dynamically established in a manner of manually changing codes and the like, so that the advantages brought by the network performance of the OpenStack Overlay are greatly lost. The Overlay is used as a common network type of OpenStack, and development of adaptation for supporting Overlay network design is important for establishing a tunnel. In the prior art, a tunnel is only used as an information receiving device and does not process tunnel receiving information, and if a tunnel terminal of a network node only supports notification of tunnel establishment or deployment modes and tunnel technologies of all nodes are different, the tunnel cannot be established. The control plane design process only reports the information through the message channel and informs other nodes of completing the establishment of the tunnel, but if the two nodes cannot be matched, the establishment of the tunnel cannot be completed. Therefore, the embodiment of the application discloses a method, a device, equipment and a medium for dynamically establishing a tunnel, which can realize the dynamic establishment of the tunnel.
Referring to fig. 1 and fig. 2, an embodiment of the present application discloses a method for dynamically establishing a tunnel, where the method includes:
step S11: and determining a target computing node of a tunnel to be established, and reporting the target computing node to a target network component so that the target network component establishes a corresponding tunnel port.
In this embodiment, a target computing node of a tunnel to be established is determined, and the target computing node is reported to a target network component, that is, the reporting of node information is realized. The target network component of the tunnel Overlay tunnel to be established is a neural Server, and the neural Server establishes a tunnel port corresponding to the target computing node. The Neutron Server side code mainly realizes the processing of information reported by nodes with different deployment modes, the drive mechanism receives the port reported node information, realizes the binding of the port and the updating of the port to the starting state, realizes the function of processing the reported information while monitoring the reported node information,
step S12: and binding the tunnel port with the target computing node through the target network component, broadcasting the target computing node, and monitoring the state change information of the tunnel port to determine whether to establish a tunnel.
In this embodiment, the target network component router Server binds the tunnel port and the target computing node, and monitors the state change information of the tunnel port to determine whether to establish a tunnel. It can be understood that, as shown in fig. 3, the Neutron Server has the capability of processing the binding information of the routing/gateway port, so that the binding information of the processing port can be newly added on the original basis, the original interface is called to perform the port host binding, and the port host binding is written into the database. In addition, the tunnel not only serves as an information receiving device, but also can process tunnel information, so that the nodes of the opposite end do not need to be matched with each other, only a request for establishing the tunnel needs to be sent, and the tunnel can process data of the opposite end to realize tunnel establishment. Optimizing the tunnel communication implementation mode is crucial to the receiving and sending processes of data packets, improving the data forwarding plane is crucial to the forwarding efficiency in the data processing process, and improving the packet processing process so as to better implement tunnel establishment and forwarding. In addition, the provided network interface transmits network data in two layers and three layers, and optimizes the functional defects of the data plane.
Further, in the monitoring of the state change information of the tunnel port to determine whether to establish the tunnel, the method further includes: and acquiring heartbeat packet information sent by the tunnel port at preset time intervals so as to judge whether a target computing node corresponding to the tunnel port is in an online state or not according to the heartbeat packet information. It can be understood that the neuron Server can establish a tunnel with other nodes after acquiring the computing node information and the port binding information, and in addition, the state change of the port needs to be monitored in the ETCD, any network-related operation two-layer function is optional, the port heartbeat packet message reporting needs to be realized, and whether the target computing node is in an online state or not can be refreshed at intervals. Reporting node state information to indicate that the service is running, then issuing the node state information to a route or gateway interface corresponding to the node, and binding a route or gateway port to a target computing node so as to realize the starting state of the port.
In addition, the above process of broadcasting the target computing node further includes: determining a target network where the tunnel port is located, and searching other target ports in a port available state in the target network; and acquiring the 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 the computing node information corresponding to the target ports is obtained. And then, the information of the computing nodes where the ports are located is notified to the reported computing nodes through a broadcast message, and the information of the computing nodes is broadcast to all the nodes.
Step S13: and if the tunnel is determined to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to be in a port available state.
In this embodiment, if it is determined that a tunnel is established, the established tunnel port is inserted into the preset bridge, and the tunnel port is set to the port available state. In addition, the corresponding service information is searched in the database according to the host name scheduled to the computing node and the node type driven by the mechanism, and then whether the network type of the port is supported or not is deduced. And Neutron can monitor the state change of the port and bind the port to the host, the state of the port is set to be started after the binding is finished, and the establishment of the tunnel can be directly realized by two different nodes. There are two possibilities for port changes, one is port update and one is port delete, see in particular fig. 4. Therefore, the original Overlay scene tunnel mechanism is modified, so that the tunnel mechanism of the control plane is kept native, and only the data plane is changed. The problem that due to the differentiation of each node, the two ends of the tunnel cannot be matched, and then the tunnel can not be built is solved. The scheme of the application can realize the intercommunication among the computing nodes in the Overlay network.
It should be noted that, in the process of adding the tunnel port to the preset bridge, the method further includes: and determining horizontal division group numbers of other ports in the preset bridge, and configuring the tunnel port by using the horizontal division group numbers. It can be understood that, in order to avoid routing loops and accelerate route aggregation, when tunnel ports are added to bridges, they are also configured with the same and non-zero horizontal split group number, that is, the horizontal split group numbers of the rest of ports in the preset bridges are obtained, and the tunnel ports are configured by using the horizontal split group numbers, otherwise, the Overlay tunnel is completely meshed between servers, and flooding packets may circulate between servers with the same network segment. In addition, if the three tunnel endpoints have the requirement of mutual communication, the three tunnel endpoints do not need to establish VXLAN tunnels, and every two tunnels can be established.
Referring to the above tunnel establishment process, a connection is established for tunnels of different modes between nodes. If no two-layer tunnel communication requirement exists between the computing nodes, for example, the computing nodes do not have virtual machines, and the virtual machines do not have communication requirements, no tunnel needs to be established. The establishment of unnecessary tunnels is reduced, and the number of two-layer broadcast messages is reduced, so that the efficiency is improved. Specifically, the process of dynamically establishing the tunnel is as follows: when the computing node finds that the network card is inserted and identifies the network card as an interface for network management, calling a relative network component Neutron Server through a broadcast message calling method; after receiving the message, the Neutron Server calls an update state function to set the state of the port as a starting state, and calls all related drivers to synchronously update the port to the starting state before submitting the port; when the method for driving the update port state is used for processing, the update port number is synchronously called, other available ports of the same network with the update port number are searched according to the available port number in the state, then the node information of the port is notified to the reported computing node through the broadcast message, and the computing node information is broadcast to all nodes.
That is, the embodiment of the present application is mainly implemented by issuing each node synchronization and maintaining the data table through the plug-in. When the virtual machine created by the designated network is started, the virtual machine is dispatched to the computing node, and the computing related service of the node can call the interface of the created port of the network module, wait for the state of the port to become available, and further realize the dynamic establishment of the subsequent tunnel. That is, through the process of dynamically establishing the tunnel, the interconnection of the Overlay type virtual machines is completed for the user interface of the virtual host node, and the interface can provide service for the end similar to the DHCP. And creating a port interface synchronous cycle and calling all supported network mechanism methods to perform port binding, wherein the port state becomes available after the binding is successful. The network module needs to add a plug-in for tracking the state of the configured resource, when the port is created and bound to the host, the network module is used for tracking the configuration state of each port, and each node needs to complete the calling work before the port is converted into the available state. The original node needs to broadcast to all nodes and establish a tunnel, and after improvement, the broadcast is sent to a related agent and establishes connection only through a unicast encapsulation packet.
Therefore, the target computing node of the tunnel to be established is determined, and the target computing node is reported to the target network component, so that the target network component can establish a corresponding tunnel port; binding the tunnel port with the target computing node through the target network component, broadcasting the target computing node, and monitoring state change information of the tunnel port to determine whether to establish a tunnel; and if the tunnel is determined to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to be in a port available state. Therefore, the target computing node of the tunnel to be established is determined, the target computing node is reported to the target network component, the corresponding tunnel port is established by the target network component, and then the tunnel port and the target computing node are bound; and then broadcasting the target computing node, monitoring state change information of the tunnel port to determine whether a tunnel needs to be established, if so, adding the tunnel port to a preset network, and setting the port to be in a port available state. The technical scheme realizes the dynamic establishment of the tunnel between the computing nodes and further realizes the intercommunication between different computing nodes.
Referring to fig. 5, the embodiment of the present application discloses a specific method for dynamically establishing a tunnel, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution. The method specifically comprises the following steps:
step S21: and the computing node determines a target point of the tunnel to be established and reports the target computing node to the target network component so as to facilitate the target network component to establish a corresponding tunnel port.
Step S22: and binding the tunnel port with the target computing node through the target network component, and broadcasting the target computing node.
Step S23: and monitoring the state change information of the tunnel port to acquire the tunnel port number and the IP address of the remote computing node, and acquiring the currently established tunnel information from a preset database.
In this embodiment, monitoring the state change information of the tunnel port is specifically used in the ETCD listener, that is, a listener is specifically provided in this embodiment, and specifically, as shown in fig. 6, the listener is mainly designed for an Overlay tunnel and is configured to process the monitored change of the Overlay tunnel port and receive and process a message for creating the Overlay tunnel. And then acquiring the tunnel port number, the host name and the port IP from the ETCD listener so as to acquire the IP address of the remote computing node, namely the remote host IP. And then acquiring the current tunnel information to be established from a preset database. It should be noted that, it is necessary to further determine whether the host name is the host name of the local computer, and if so, no processing is needed; and judging whether the tunnel port number has a routing port of the same opposite end on the node, and if not, processing is not needed.
Step S24: and judging whether a tunnel corresponding to the tunnel port number and the IP address exists at present or not based on the tunnel information, and if not, determining to establish the tunnel between the target computing node and the far-end computing node.
In this embodiment, it is determined whether a tunnel corresponding to the tunnel port number and the IP address, specifically, an interface of the call node, exists at present based on the tunnel information, and acquires all tunnels that have been created at present, and determines whether a tunnel corresponding to the tunnel port number + the remote host IP exists, and if not, determines to establish an overlay tunnel between the target computing node and the remote computing node.
Step S25: and if the tunnel is determined to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to be in a port available state.
In this embodiment, if it is determined that a tunnel is to be established, the tunnel information including the tunnel port number and the IP address of the remote computing node is stored in the preset database. Specifically, tunnel port number + host name is used as a key value, and a remote host IP + IP address + MAC is used as a vlaue value and stored in a database, so that all created tunnels can be acquired later. That is, the present design is directed to providing functionality for creating an overlay tunnel port that may be added to a bridge as a bridge port to participate in layer two forwarding. The tunnel is dynamically established through the design, the control plane keeps native, only the data plane is changed, the monitoring port becomes available time, the monitoring port is sent to other nodes needing to establish the tunnel through the ETCD to be processed, and the tunnel intercommunication with other nodes is realized.
In addition, the method further comprises: when a tunnel deleting command is acquired, screening target tunnel information corresponding to a tunnel to be deleted from the preset database; and extracting the IP address of the remote computing node in the target tunnel information, and executing deletion operation on the target tunnel information. It can be understood that, if the tunnel deletion command is obtained, the target tunnel information corresponding to the tunnel to be deleted is screened from the preset database, the remote host IP is extracted, and the deletion operation is executed. That is, when a tunnel or a related interface needs to be deleted, a pair of key-vlaue values is obtained from the ETCD database, the remote host IP is taken out, if only one piece of data needing to be deleted remains in the cache, the invocation is performed to delete the Overlay tunnel, and if a plurality of pieces of data exist, only the corresponding cache is deleted.
For more specific processing procedures of the steps S21 and S22, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
As can be seen, the computation node of the embodiment of the present application determines a target point of a tunnel to be established, and reports the target computation node to a target network component, so that the target network component establishes a corresponding tunnel port; binding the tunnel port with the target computing node through the target network component, and broadcasting the target computing node; monitoring state change information of the tunnel port to acquire a tunnel port number and an IP address of a remote computing node, and acquiring currently established tunnel information from a preset database; monitoring state change information of the tunnel port to acquire a tunnel port number and an IP address of a remote computing node, and acquiring currently established tunnel information from a preset database; and if the tunnel is determined to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to be in a port available state. Therefore, in the embodiment, an ETCD listener is arranged, mainly aiming at the design of an Overlay tunnel, and is used for processing the monitored change of an Overlay tunnel port, and then acquiring a tunnel port number, a host name and a port IP from the ETCD listener, so as to acquire the IP address of a remote computing node, namely a remote host IP, and then acquiring all the currently-created tunnels, judging whether the tunnel corresponding to the tunnel port number + the remote host IP exists, if not, determining to establish the Overlay tunnel between a target computing node and the remote computing node, and storing tunnel information including the tunnel port number and the IP address of the remote computing node into a preset database, so as to realize the dynamic establishment of the tunnel between the computing nodes. According to the scheme, after the tunnel is dynamically established in the Overlay scene, even if the opposite end nodes cannot be matched with each other to establish the tunnel in the Overlay network type, different deployment modes and different nodes, the tunnel can be dynamically established through the tunnel logic and the tunnel mechanism, and the tunnel can be dynamically established under the Overlay network type, such as network creation/deletion, router creation/deletion, interface addition/deletion for the router and the like.
Referring to fig. 7, an embodiment of the present application discloses an apparatus for dynamically establishing a tunnel, where the apparatus includes:
an information reporting module 11, configured to determine a target computing node of 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;
a binding module 12, configured to bind the tunnel port with the target computing node through the target network component, and broadcast the target computing node;
a monitoring module 13, configured to monitor state change information of the tunnel port to determine whether to establish a tunnel;
and a tunnel establishing module 14, configured to add the tunnel port to a preset bridge if it is determined that a tunnel is established, and set the tunnel port in a port available state.
Therefore, the target computing node of the tunnel to be established is determined, and the target computing node is reported to the target network component, so that the target network component can establish a corresponding tunnel port; binding the tunnel port with the target computing node through the target network component, broadcasting the target computing node, and monitoring state change information of the tunnel port to determine whether to establish a tunnel; and if the tunnel is determined to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to be in a port available state. Therefore, the target computing node of the tunnel to be established is determined, the target computing node is reported to the target network component, the corresponding tunnel port is established by the target network component, and then the tunnel port and the target computing node are bound; and then broadcasting the target computing node, monitoring state change information of the tunnel port to determine whether a tunnel needs to be established, if so, adding the tunnel port to a preset network, and setting the port to be in a port available state. The technical scheme realizes the dynamic establishment of the tunnel between the computing nodes and further realizes the intercommunication between different computing nodes.
In some specific embodiments, the monitoring module 13 may specifically include:
the information acquisition unit is used for monitoring state change information of the tunnel port to acquire a tunnel port number and an IP address of a remote computing node and acquiring currently established tunnel information from a preset database;
and the judging unit is used for judging whether a tunnel corresponding to the tunnel port number and the IP address exists at present or not based on the tunnel information, and if not, determining to establish the tunnel between the target computing node and the far-end computing node.
In some specific embodiments, the apparatus for dynamically establishing a tunnel may further include:
and the information storage unit is used for storing the tunnel information comprising the tunnel port number and the IP address of the remote computing node into the preset database if the tunnel is determined to be established.
In some specific embodiments, the apparatus for dynamically establishing a tunnel may further include:
the deleting command acquiring unit is used for screening out target tunnel information corresponding to the tunnel to be deleted from the preset database when the tunnel deleting command is acquired;
and the deleting unit is used for extracting the IP address of the remote computing node in the target tunnel information and executing deleting operation on the target tunnel information.
In some specific embodiments, in the process of the monitoring module 13, the method may further include:
and the heartbeat packet monitoring unit is used for acquiring heartbeat packet information sent by the tunnel port at preset time intervals so as to judge whether a target computing node corresponding to the tunnel port is in an online state or not according to the heartbeat packet information.
In some specific embodiments, in the process of the tunnel establishing module 14, the method may further include:
and the information configuration unit is used for determining the horizontal division group numbers of the other ports in the preset bridge and configuring the tunnel port by using the horizontal division group numbers.
In some specific embodiments, the binding module 12 may further include:
a port searching unit, configured to determine a target network where the tunnel port is located, and search for the remaining target ports in a port available state in the target network;
and the node information acquisition unit is used for acquiring the computing node information corresponding to the target port.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The method specifically comprises the following steps: 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. Wherein the memory 22 is adapted to store a computer program, which is loaded and executed by the processor 21, to implement the steps of:
determining a target computing node of a tunnel to be established, and reporting the target computing node to a target network component so that the target network component establishes a corresponding tunnel port;
binding the tunnel port with the target computing node through the target network component, broadcasting the target computing node, and monitoring state change information of the tunnel port to determine whether to establish a tunnel;
and if the tunnel is determined to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to be in a port available state.
In some embodiments, the processor, by executing the computer program stored in the memory, may specifically implement the following steps:
monitoring state change information of the tunnel port to acquire a tunnel port number and an IP address of a remote computing node, and acquiring currently established tunnel information from a preset database;
and judging whether a tunnel corresponding to the tunnel port number and the IP address exists at present or not based on the tunnel information, and if not, determining to establish the tunnel between the target computing node and the far-end computing node.
In some embodiments, the processor, by executing the computer program stored in the memory, may specifically implement the following steps:
and if the tunnel is determined to be established, storing tunnel information comprising the tunnel port number and the IP address of the remote computing node into the preset database.
In some embodiments, the processor, by executing the computer program stored in the memory, may specifically implement the following steps:
when a tunnel deleting command is acquired, screening target tunnel information corresponding to a tunnel to be deleted from the preset database;
and extracting the IP address of the remote computing node in the target tunnel information, and executing deletion operation on the target tunnel information.
In some embodiments, the processor, by executing the computer program stored in the memory, may specifically implement the following steps:
and acquiring heartbeat packet information sent by the tunnel port at a preset time interval so as to judge whether a target computing node corresponding to the tunnel port is in an online state or not according to the heartbeat packet information.
In some embodiments, the processor, by executing the computer program stored in the memory, may specifically implement the following steps:
and determining horizontal division group numbers of other ports in the preset bridge, and configuring the tunnel port by using the horizontal division group numbers.
In some embodiments, the processor, by executing the computer program stored in the memory, may specifically implement the following steps:
determining a target network where the tunnel port is located, and searching other target ports in a port available state in the target network;
and acquiring the computing node information corresponding to the target port.
In this embodiment, the power supply 23 is configured to provide an operating 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 an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a 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 required to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor for processing a calculation operation related to machine learning.
In addition, the storage 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., the resources stored thereon include an operating system 221, a computer program 222, data 223, etc., and the storage may be a transient storage or a permanent storage.
The operating system 221 is used for managing and controlling each hardware device on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the mass data 223 in the memory 22 by the processor 21, which may be Windows, unix, linux, or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the method for dynamically establishing a tunnel performed by the electronic device 20 disclosed in any of the foregoing embodiments. The data 223 may include data received by the electronic device and transmitted from an external device, or may include data collected by the input/output interface 25 itself.
Further, an embodiment of the present application further discloses a computer-readable storage medium, where a computer program is stored in the storage medium, and when the computer program is loaded and executed by a processor, the method steps executed in the process of dynamically establishing a tunnel disclosed in any of the foregoing embodiments are implemented.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The method, apparatus, device and storage medium for dynamically establishing a tunnel according to the present invention are described in detail above, and a specific example is applied in the description to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for dynamically establishing a tunnel, comprising
Determining a target computing node of a tunnel to be established, and reporting the target computing node to a target network component so that the target network component establishes a corresponding tunnel port;
binding the tunnel port with the target computing node through the target network component, broadcasting the target computing node, and monitoring state change information of the tunnel port to determine whether to establish a tunnel;
and if the tunnel is determined to be established, adding the tunnel port to a preset bridge, and setting the tunnel port to be in a port available state.
2. The method of claim 1, wherein the monitoring status change information of the tunnel port to determine whether to establish the tunnel comprises:
monitoring state change information of the tunnel port to acquire a tunnel port number and an IP address of a remote computing node, and acquiring currently established tunnel information from a preset database;
and judging whether a tunnel corresponding to the tunnel port number and the IP address exists at present or not based on the tunnel information, and if not, determining to establish the tunnel between the target computing node and the far-end computing node.
3. The method for dynamically establishing a tunnel according to claim 2, further comprising:
and if the tunnel is determined to be established, storing tunnel information comprising the tunnel port number and the IP address of the remote computing node into the preset database.
4. The method of claim 3, wherein the tunnel is dynamically established according to a predetermined rule
When a tunnel deleting command is acquired, screening target tunnel information corresponding to a tunnel to be deleted from the preset database;
and extracting the IP address of the remote computing node in the target tunnel information, and executing deletion operation on the target tunnel information.
5. The method according to claim 1, wherein in the monitoring of the status change information of the tunnel port to determine whether to establish the tunnel, the method further comprises:
and acquiring heartbeat packet information sent by the tunnel port at a preset time interval so as to judge whether a target computing node corresponding to the tunnel port is in an online state or not according to the heartbeat packet information.
6. The method according to claim 1, wherein the adding the tunnel port to the predetermined bridge further comprises:
and determining horizontal division group numbers of other ports in the preset bridge, and configuring the tunnel port by using the horizontal division group numbers.
7. The method according to any of claims 1 to 6, wherein in the broadcasting to the target computing node, further comprising:
determining a target network where the tunnel port is located, and searching other target ports in a port available state in the target network;
and acquiring the computing node information corresponding to the target port.
8. An apparatus for dynamically establishing a tunnel, comprising
The information reporting module is used for determining a target computing node of a tunnel to be established and reporting the target computing node to a target network component so as to facilitate the target network component to establish a corresponding tunnel port;
a binding module, configured to bind the tunnel port with the target computing node through the target network component, and broadcast the target computing node;
the monitoring module is used for monitoring the state change information of the tunnel port to determine whether to establish a tunnel;
and the tunnel establishing module is used for adding the tunnel port to a preset bridge if the tunnel is determined to be established, and setting the tunnel port to be in a port available state.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program for implementing the steps of the method of dynamically establishing a tunnel according to any of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the steps of the method of dynamically establishing a tunnel according to any of claims 1 to 7.
CN202211378244.4A 2022-11-04 2022-11-04 Method, device, equipment and medium for dynamically establishing tunnel Pending CN115834290A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211378244.4A CN115834290A (en) 2022-11-04 2022-11-04 Method, device, equipment and medium for dynamically establishing tunnel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211378244.4A CN115834290A (en) 2022-11-04 2022-11-04 Method, device, equipment and medium for dynamically establishing tunnel

Publications (1)

Publication Number Publication Date
CN115834290A true CN115834290A (en) 2023-03-21

Family

ID=85526664

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211378244.4A Pending CN115834290A (en) 2022-11-04 2022-11-04 Method, device, equipment and medium for dynamically establishing tunnel

Country Status (1)

Country Link
CN (1) CN115834290A (en)

Similar Documents

Publication Publication Date Title
US11463511B2 (en) Model-based load balancing for network data plane
CN108989066B (en) Equipment management method and device
CN109474936B (en) Internet of things communication method and system applied among multiple lora gateways
CN110730478B (en) Slice association method, device, end-to-end slice organizer and storage medium
CN113596191A (en) Data processing method, network element equipment and readable storage medium
CN110808857B (en) Network intercommunication method, device, equipment and storage medium for realizing Kubernetes cluster
CN113572835B (en) Data processing method, network element equipment and readable storage medium
CN113556359B (en) Communication protocol conversion method, device, system and gateway device
CN103631652A (en) Method and system for achieving virtual machine migration
CN113572864B (en) Data processing method, network element equipment and readable storage medium
CN115225493B (en) Configuration generation method and device of networking node based on wireless
CN111064626A (en) Configuration updating method, device, server and readable storage medium
CN109857439B (en) Game version updating method and device
CN114025000B (en) Method, device, equipment and storage medium for establishing network access relationship
CN111682968B (en) Network access management method and system for communication equipment
WO2021083033A1 (en) Method and device for determining intermediate session management function i-smf
CN112235378B (en) Data updating method and device, storage medium and electronic equipment
CN112994915B (en) SD-WAN service arrangement method, system, equipment and storage medium
CN112714146B (en) Resource scheduling method, device, equipment and computer readable storage medium
CN116566830A (en) Network configuration method, device, system, edge equipment and storage medium
CN115996187A (en) Routing information processing method and device, routing information interaction system and routing equipment
CN114422427B (en) Flow balancing method and device, electronic equipment and storage medium
CN115834290A (en) Method, device, equipment and medium for dynamically establishing tunnel
CN114374614A (en) Network topology configuration method and device
CN115225634A (en) Data forwarding method and device under virtual network and computer program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination