CN108900441B - Network switching method, first electronic device and readable storage medium - Google Patents

Network switching method, first electronic device and readable storage medium Download PDF

Info

Publication number
CN108900441B
CN108900441B CN201810724314.4A CN201810724314A CN108900441B CN 108900441 B CN108900441 B CN 108900441B CN 201810724314 A CN201810724314 A CN 201810724314A CN 108900441 B CN108900441 B CN 108900441B
Authority
CN
China
Prior art keywords
switch
virtual
network
electronic device
establishing
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.)
Active
Application number
CN201810724314.4A
Other languages
Chinese (zh)
Other versions
CN108900441A (en
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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201810724314.4A priority Critical patent/CN108900441B/en
Publication of CN108900441A publication Critical patent/CN108900441A/en
Application granted granted Critical
Publication of CN108900441B publication Critical patent/CN108900441B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/70Virtual switches
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/253Routing or path finding in a switch fabric using establishment or release of connections between ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • H04L49/354Switches specially adapted for specific applications for supporting virtual local area networks [VLAN]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention provides a network switching method, first electronic equipment and a readable storage medium, wherein the first electronic equipment comprises a virtual machine and a first virtual switch, and the virtual machine of the first electronic equipment interacts with the virtual machine in second electronic equipment (the second electronic equipment is other electronic equipment except the first electronic equipment) through the first virtual switch and a third switch by using a second virtual network at the beginning; in order to ensure that the first electronic device can still perform normal interaction with the second electronic device in the second virtual network during the network switching process, the embodiment adopts a technology of establishing the second switch (a communication channel between the first virtual switch and the second electronic device can be established in the first virtual network), and setting configuration information for establishing a communication channel between a virtual machine in the first electronic device and the second switch in the first virtual switch, thereby implementing the network switching.

Description

Network switching method, first electronic device and readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a network switching method, a first electronic device, and a readable storage medium.
Background
An electronic device may include multiple virtual machines, different virtual machines in the same electronic device, or different virtual machines in different electronic devices may communicate with each other through a virtual network of the same type, where the type of virtual network includes: VLAN (virtual local area Network) and VXLAN (virtual extensible local area Network).
Due to the limitation of some types of virtual networks in application scenarios, the electronic device needs to switch from one type of virtual network to another type of virtual network. For example, currently, VLAN is used for communication between virtual machines in electronic devices, and a maximum of 4096 user groups are allowed in a VLAN network, each user group including one or more virtual machines; on the other hand, since the VXLAN network has no limitation on the number of user groups, if there is a large-scale user group demand, for example, more than 4096 user groups, it is necessary to switch the electronic device from the VLAN network to the VXLAN network.
In summary, how to implement network switching in an electronic device is a problem to be considered by those skilled in the art.
Disclosure of Invention
In view of the above, the present invention provides a network switching method, a first electronic device and a readable storage medium to implement network switching.
In order to achieve the purpose, the invention provides the following technical scheme:
a network switching method is applied to a first electronic device, and the first electronic device comprises: the system comprises at least one virtual machine and a first virtual switch which is in communication connection with the at least one virtual machine; the network switching method comprises the following steps:
establishing a second switch having a communication connection with the first virtual switch;
wherein the second switch is configured to establish a communication channel between the first virtual switch and a second electronic device under a first virtual network, wherein the first virtual switch has a communication connection with a third switch before the second switch is established, the third switch is configured to establish the communication channel between the first virtual switch and the second electronic device under a second virtual network, and the first transmission network is different from the second virtual network;
setting configuration information for establishing a communication channel between the at least one virtual machine and the second switch in the first virtual switch;
and controlling the at least one virtual machine to interact with the second electronic equipment through the first virtual switch and the second switch under the first virtual network respectively based on the configuration information.
The second switch is a virtual switch located in the first electronic device, or the second switch is a physical switch;
and/or the presence of a gas in the gas,
the third switch is a virtual switch located in the first electronic device, or the third switch is a physical switch.
Wherein, still include:
deleting configuration information preset in the first virtual switch and used for establishing a communication channel between the at least one virtual machine and the third switch;
and if the third switch is a virtual switch, deleting the third switch.
Wherein, still include:
and sending indication information carrying the switching of the first electronic equipment from the second virtual network to the first virtual network to a server for managing the use of the virtual network category by the electronic equipment.
Wherein said establishing a second switch having a communication connection with said first virtual switch comprises:
setting a first flow table for establishing a reception channel for receiving a message from the second electronic device under the first virtual network;
setting a second flow table for establishing a transmission channel for transmitting a message to the second electronic device under the first virtual network.
Wherein setting configuration information for establishing a communication channel between the at least one virtual machine and the second switch in the first virtual switch includes:
setting a third flow table for establishing a reception channel for receiving a message from the second switch;
setting a fourth flow table for establishing a transmission channel for transmitting a message to the second switch.
Wherein, still include:
detecting whether first hardware related to a virtual network in the first electronic device supports the first virtual network;
if the first hardware does not support the first virtual network, replacing the first hardware with second hardware supporting the first virtual network.
A first electronic device, comprising: at least one virtual machine, and, with at least one virtual machine respectively have communication connection's first virtual switch, still include:
an establishing module for establishing a second switch having a communication connection with the first virtual switch;
wherein the second switch is configured to establish a communication channel between the first virtual switch and a second electronic device under a first virtual network, wherein the first virtual switch has a communication connection with a third switch before the second switch is established, the third switch is configured to establish the communication channel between the first virtual switch and the second electronic device under a second virtual network, and the first transmission network is different from the second virtual network;
a setting module, configured to set configuration information for establishing a communication channel between the at least one virtual machine and the second switch in the first virtual switch;
and the interaction module is used for controlling the at least one virtual machine to interact with the second electronic equipment through the first virtual switch and the second switch under the first virtual network respectively based on the configuration information.
A first electronic device, comprising: at least one virtual machine, and, with at least one virtual machine respectively have communication connection's first virtual switch, still include:
a memory for storing a program;
a processor configured to execute the program, the program specifically configured to:
establishing a second switch having a communication connection with the first virtual switch;
wherein the second switch is configured to establish a communication channel between the first virtual switch and a second electronic device under a first virtual network, wherein the first virtual switch has a communication connection with a third switch before the second switch is established, the third switch is configured to establish the communication channel between the first virtual switch and the second electronic device under a second virtual network, and the first transmission network is different from the second virtual network;
setting configuration information for establishing a communication channel between the at least one virtual machine and the second switch in the first virtual switch;
and controlling the at least one virtual machine to interact with the second electronic equipment through the first virtual switch and the second switch under the first virtual network respectively based on the configuration information.
A readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the network switching method according to any one of the preceding claims.
As can be seen from the foregoing technical solutions, compared with the prior art, an embodiment of the present invention provides a network switching method, where a first electronic device includes a virtual machine and a first virtual switch, and initially, the virtual machine of the first electronic device interacts with a virtual machine in a second electronic device (where the second electronic device is an electronic device other than the first electronic device) through the first virtual switch and a third switch by using a second virtual network; in order to ensure that the first electronic device can still perform normal interaction with the second electronic device in the second virtual network during the network switching process, the embodiment adopts a technology of establishing the second switch (a communication channel between the first virtual switch and the second electronic device can be established in the first virtual network), and setting configuration information for establishing a communication channel between a virtual machine in the first electronic device and the second switch in the first virtual switch, thereby implementing the network switching. Further, in the network switching method provided by the embodiment of the present invention, within a certain time, the first electronic device may simultaneously use the first virtual network and the second virtual network to respectively communicate with other electronic devices, so that, during the process of switching from the second virtual network to the first virtual network, the first electronic device does not need to migrate the virtual machine in the first electronic device, and during the process of switching the virtual networks, the first electronic device does not affect the communication with other electronic devices using the second virtual network.
Drawings
In order to more clearly illustrate the embodiments of the present invention 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 structural diagram of a network switching system according to an embodiment of the present invention;
fig. 2 is a flowchart of an implementation manner of a network switching method according to an embodiment of the present invention;
fig. 3 is a block diagram of an implementation manner of a first electronic device according to an embodiment of the present invention;
fig. 4 is a block diagram of another implementation manner of a first electronic device according to an embodiment of the present invention;
fig. 5 is a block diagram of an implementation manner of a first electronic device according to an embodiment of the present invention;
fig. 6 is a block diagram of another implementation manner of the first electronic device according to the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, 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.
An embodiment of the present invention provides a network switching method, where the network switching method may be applied to a first electronic device, and the first electronic device may be applied to a network switching system, as shown in fig. 1, which is a structural diagram of the network switching system provided in the embodiment of the present invention, where the network switching system includes:
a first electronic device 11, a second electronic device 12, and a server 13; wherein, the first electronic device 11 includes: at least one virtual machine 111, and a first virtual switch 112 having a communication connection with the at least one virtual machine 111, respectively; the server 13 is a data transmission bridge between the first electronic device 11 and the second electronic device 12.
The first electronic device 11 may further comprise a switch 113 for communicating with the second electronic device, the switch 113 being different for different types of virtual networks; for example, if the electronic device is in the first virtual network, the first virtual switch 112 in the first electronic device 11 interacts with the virtual machine in the second electronic device 12 through the second switch 1131. If the virtual machine is in the second virtual network, the first virtual switch 112 in the first electronic device 11 interacts with the virtual machine of the second electronic device 12 through the third switch 1132.
In an embodiment of the present invention, after the virtual network is switched, for example, after the virtual network is switched from the second virtual network to the first virtual network, the first electronic device 11 generally does not switch from the first virtual network to the second virtual network again, and therefore, in an optional embodiment, in a class of virtual networks, the first electronic device only includes the second switch 1131 or the third switch 1132 corresponding to the virtual network; in an optional embodiment, during the switching process of the two types of virtual networks, the second switch 1131 or the third switch 1132 may be allowed to exist at the same time, so as to ensure that data in both types of virtual networks can be transmitted and received. After the virtual network is switched, the information corresponding to the second virtual network is deleted, so that the first virtual switch and the third switch 1132 are connected by a dotted line in fig. 1.
It is understood that the switch 113 may be a virtual switch or a physical switch, if the switch 113 is a virtual switch, the switch 113 is located inside the first electronic device, and if the switch 113 is a physical switch, the switch 113 is located outside the first electronic device, and fig. 1 illustrates the switch 113 as a virtual switch.
The following describes a network handover method provided in an embodiment of the present invention with reference to the structure of the network handover system, and as shown in fig. 2, is a flowchart of an implementation manner of the network handover method provided in the embodiment of the present invention, where the method includes:
step S201: establishing a second switch having a communication connection with the first virtual switch.
Wherein the second switch is configured to establish a communication channel between the first virtual switch and a second electronic device under a first virtual network, wherein the first virtual switch and a third switch have a communication connection before the second switch is established, the third switch is configured to establish the communication channel between the first virtual switch and the second electronic device under a second virtual network, and the first transmission network is different from the second virtual network.
The second switch is a virtual switch located in the first electronic device, or the second switch is a physical switch.
In an alternative embodiment, when the second switch is a virtual switch, the second switch may be a tunnel bridge br-tun and the first virtual switch may be a bridge br-int.
In an optional embodiment, the third switch is a virtual switch located in the first electronic device, or the third switch is a physical switch.
In an alternative embodiment, where the third switch is a virtual switch, the third switch may be a tunnel bridge br-prv.
Since the second switch is already established, the first electronic device may receive data transmitted by the second electronic device under the first virtual network.
Step S202: setting configuration information for establishing a communication channel between the at least one virtual machine and the second switch in the first virtual switch.
Before switching to the first virtual network, the virtual machine in the first electronic device communicates with the second electronic device through the first virtual switch and the third switch, so the first virtual switch stores configuration information for controlling a communication channel between the at least one virtual machine and the third switch in advance. In an optional embodiment, at this time, the first electronic device may interact with the second electronic device under the first virtual network and the second virtual network at the same time. The service flow between the first electronic device and the second electronic device under the second virtual network is not interrupted.
Step S203: and controlling the at least one virtual machine to interact with the second electronic equipment through the first virtual switch and the second switch under the first virtual network respectively based on the configuration information.
To sum up, the network switching method provided in the embodiment of the present invention first establishes the receiving channel and the sending channel between the first virtual network and the second electronic device, and the receiving channel and the sending channel in the first virtual network and the receiving channel and the sending channel in the second virtual network exist simultaneously in the switching process, so that the traffic of the service staff between the first electronic device and the second electronic device is not interrupted, and the problem of network capacity expansion is solved.
Generally, the virtual network of the first electronic device needs to be switched because the current second virtual network restricts the first electronic device, for example, assuming that the second virtual network is a VLAN network and the first virtual network is a VXLAN network, since the second virtual network allows 4096 user groups at most, if 4096 user groups are exceeded, the first electronic device needs to be switched from the second virtual network to the first virtual network.
In an optional embodiment, after the first electronic device may interact with the second electronic device under the first virtual network, configuration information preset in the first virtual switch and used for establishing a communication channel between the at least one virtual machine and the third switch may be deleted; and if the third switch is a virtual switch, deleting the third switch.
The embodiment of the invention provides a network switching method, wherein first electronic equipment comprises a virtual machine and a first virtual switch, and the virtual machine of the first electronic equipment interacts with the virtual machine in second electronic equipment (wherein the second electronic equipment is other electronic equipment except the first electronic equipment) through the first virtual switch and a third switch by using a second virtual network at the beginning; in order to ensure that the first electronic device can still perform normal interaction with the second electronic device in the second virtual network during the network switching process, the embodiment adopts a technology of establishing the second switch (a communication channel between the first virtual switch and the second electronic device can be established in the first virtual network), and setting configuration information for establishing a communication channel between a virtual machine in the first electronic device and the second switch in the first virtual switch, thereby implementing the network switching. Further, in the network switching method provided by the embodiment of the present invention, within a certain time, the first electronic device may simultaneously use the first virtual network and the second virtual network to respectively communicate with other electronic devices, so that, during the process of switching from the second virtual network to the first virtual network, the first electronic device does not need to migrate the virtual machine in the first electronic device, and during the process of switching the virtual networks, the first electronic device does not affect the communication with other electronic devices using the second virtual network.
After the first electronic device establishes the second switch and configuration information for establishing a communication channel between the at least one virtual machine and the second switch is set in the first virtual switch, the first electronic device can interact with the second electronic device through the first virtual network. And a proxy gateway is not needed, so that the performance loss during data packet forwarding is reduced.
The server 13 is configured to record information of a virtual network between the first electronic device and the second electronic device, and therefore, in an optional embodiment, the first electronic device needs to send, to the server 13 configured to manage the electronic device to use a virtual network type, indication information carrying a switch of the first electronic device from the second virtual network to the first virtual network.
In an optional embodiment, the establishing a second switch having a communication connection with the first virtual switch comprises:
setting a first flow table for establishing a reception channel for receiving a message from the second electronic device under the first virtual network;
setting a second flow table for establishing a transmission channel for transmitting a message to the second electronic device under the first virtual network.
In an optional embodiment, setting, in the first virtual switch, configuration information for establishing a communication channel between the at least one virtual machine and the second switch includes:
setting a third flow table for establishing a reception channel for receiving a message from the second switch;
setting a fourth flow table for establishing a transmission channel for transmitting a message to the second switch.
In order to make the embodiment of the present invention more understandable to those skilled in the art, a specific example is described below. The following is a specific implementation manner provided by the embodiment of the present invention, and does not limit the implementation manner of the present invention.
1. Setting, in a second switch of a first electronic device, a first flow table for establishing a reception channel for receiving a message from the second electronic device under the first virtual network.
2. Setting a third flow table for establishing a reception channel for receiving a message from the second switch in the first virtual switch of the first electronic device.
That is, a receiving channel with the second electronic device is first established in the first electronic device.
At this time, the first electronic device may interact with the second electronic device in the second virtual network, or may receive data sent by the second electronic device in the first virtual network.
3. Setting a second flow table for establishing a transmission channel for transmitting a message to the second electronic device under the first virtual network in a second switch of the first electronic device.
4. And setting a fourth flow table for establishing a sending channel for sending the message to the second switch in the first virtual switch of the first electronic device.
A transmission channel is established in the first electronic device with the second electronic device.
Assuming that the first virtual network is a VXLAN network, the first electronic device and the second electronic device may interact under the VXLAN network.
As the third switch and the configuration information preset in the first virtual switch and used for establishing the communication channel between the at least one virtual machine and the third switch are not deleted; therefore, the first electronic device and the second electronic device can normally interact under both the first virtual network and the second virtual network.
In an alternative embodiment, steps 3 and 4 may be performed first, and then steps 1 and 2 may be performed.
5. The method comprises the step that a first electronic device sends instruction information carrying the first electronic device to be switched from the second virtual network to the first virtual network to a server for managing the electronic device to use the virtual network type.
6. Deleting configuration information preset in the first virtual switch and used for establishing a communication channel between the at least one virtual machine and the third switch; and if the third switch is a virtual switch, deleting the third switch.
Fig. 3 is a block diagram of an implementation manner of a first electronic device according to an embodiment of the present invention.
Fig. 3 illustrates an example in which the second switch is a physical switch.
Assume that the first electronic device includes a first virtual machine VM1 and a second virtual machine VM2, the first virtual switch 112 is a bridge br-int, and the third switch 1132 is a tunnel bridge br-prv. Since third switch 1132 has been deleted, it is drawn with a dashed line in fig. 3; in an alternative embodiment the second switch 1131 is connected to the first virtual switch 112 via the vtep interface 31 of the first electronic device 11.
Fig. 4 is a block diagram of another implementation manner of the first electronic device according to the embodiment of the present invention.
Fig. 4 illustrates an example in which the second switch is a virtual switch.
Assume that the first electronic device includes a first virtual machine VM1 and a second virtual machine VM2, the first virtual switch is a bridge br-int, and the third switch is a tunnel bridge br-prv. Since third switch 1132 has been deleted, it is drawn with a dashed line in fig. 3; the second switch 1131 is a tunnel bridge br-tun.
It is understood that before the first electronic device establishes the second switch, it is necessary to determine whether the first hardware associated with the virtual network in the first electronic device supports the first virtual network. If the first virtual network is supported, the network switching method provided by the embodiment of the invention can be executed, and if the first virtual network is not supported, the first hardware in the first electronic device needs to be replaced, so that the first virtual network is supported by the first electronic device.
The first hardware includes but is not limited to: and (5) network card.
It is understood that the first electronic device generally has two modes, a main standby mode and a single machine mode; the active/standby mode means that the first electronic device has a backup electronic device, and before the virtual network is switched, it is required to detect whether the first electronic device and the backup electronic device both support the first virtual network, and if not, the corresponding first hardware needs to be replaced. When the network is switched, the first electronic device (or the backup electronic device) may be switched to the network first, and if the first electronic device switched to the first virtual network can be used normally, the backup electronic device is switched from the second virtual network to the first virtual network.
The single-machine mode means that the first electronic device is not backed up, and at this time, if the line of the first electronic device is plugged, the virtual machine above is migrated first, and then the virtual machine is migrated back after the line is plugged.
As shown in fig. 5, a structure diagram of an implementation manner of a first electronic device provided in an embodiment of the present invention is shown, where the first electronic device includes: at least one virtual machine, and, with at least one virtual machine respectively have communication connection's first virtual switch, still include:
an establishing module 51, configured to establish a second switch having a communication connection with the first virtual switch;
wherein the second switch is configured to establish a communication channel between the first virtual switch and a second electronic device under a first virtual network, wherein the first virtual switch has a communication connection with a third switch before the second switch is established, the third switch is configured to establish the communication channel between the first virtual switch and the second electronic device under a second virtual network, and the first transmission network is different from the second virtual network;
a setting module 52, configured to set configuration information for establishing a communication channel between the at least one virtual machine and the second switch in the first virtual switch;
an interaction module 53, configured to control, based on the configuration information, the at least one virtual machine to interact with the second electronic device through the first virtual switch and the second virtual switch under the first virtual network, respectively.
In an optional embodiment, the second switch is a virtual switch located in the first electronic device, or the second switch is a physical switch;
and/or the presence of a gas in the gas,
the third switch is a virtual switch located in the first electronic device, or the third switch is a physical switch.
In an optional embodiment, further comprising:
a first deleting module, configured to delete configuration information preset in the first virtual switch and used to establish a communication channel between the at least one virtual machine and the third switch;
and the second deleting module is used for deleting the third switch if the third switch is a virtual switch.
In an optional embodiment, further comprising:
and the sending module is used for sending the indication information carrying the switching of the first electronic equipment from the second virtual network to the first virtual network to a server for managing the virtual network types used by the electronic equipment.
In an alternative embodiment, the establishing module 51 comprises:
a first setting unit configured to set a first flow table for establishing a reception channel for receiving a message from the second electronic device under the first virtual network;
a second setting unit, configured to set a second flow table used for establishing a transmission channel for transmitting a message to the second electronic device in the first virtual network.
In an alternative embodiment, the setup module 52 includes:
a third setting unit configured to set a third flow table for establishing a reception channel for receiving a message from the second switch;
a fourth setting unit configured to set a fourth flow table for establishing a transmission channel for transmitting a message to the second switch.
In an optional embodiment, further comprising:
the detection module is used for detecting whether first hardware related to a virtual network in the first electronic equipment supports the first virtual network;
a replacing module, configured to replace the first hardware with a second hardware that supports the first virtual network if the first hardware does not support the first virtual network.
As shown in fig. 6, which is a structural diagram of another implementation manner of a first electronic device provided in an embodiment of the present invention, the first electronic device includes: at least one virtual machine, and, with at least one virtual machine respectively have communication connection's first virtual switch, still include:
a memory 61 for storing a program;
a processor 62 configured to execute the program, the program specifically configured to:
establishing a second switch having a communication connection with the first virtual switch;
wherein the second switch is configured to establish a communication channel between the first virtual switch and a second electronic device under a first virtual network, wherein the first virtual switch has a communication connection with a third switch before the second switch is established, the third switch is configured to establish the communication channel between the first virtual switch and the second electronic device under a second virtual network, and the first transmission network is different from the second virtual network;
setting configuration information for establishing a communication channel between the at least one virtual machine and the second switch in the first virtual switch;
and controlling the at least one virtual machine to interact with the second electronic equipment through the first virtual switch and the second switch under the first virtual network respectively based on the configuration information.
The processor 62 may be a central processing unit CPU or an ASIC specific integrated circuit
(Application Specific Integrated Circuit) or one or more Integrated circuits configured to implement embodiments of the invention.
Optionally, the first electronic device may further include a communication bus 63 and a communication interface 64, where the memory 61, the processor 62, and the communication interface 64 complete communication with each other through the communication bus 63;
alternatively, the communication interface 64 may be an interface of a communication module, such as an interface of a GSM module.
An embodiment of the present invention further provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the network switching method according to any one of the above-mentioned embodiments.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be 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 phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A network switching method is applied to a first electronic device, and the first electronic device comprises: the system comprises at least one virtual machine and a first virtual switch which is in communication connection with the at least one virtual machine; the network switching method comprises the following steps:
establishing a second switch having a communication connection with the first virtual switch;
the second switch is used for establishing a communication channel between the first virtual switch and a second electronic device under a first virtual network, wherein the first virtual switch and a third switch have communication connection before the second switch is established, the third switch is used for establishing the communication channel between the first virtual switch and the second electronic device under a second virtual network, and the network types of the first virtual network and the second virtual network are different;
first configuration information for controlling a communication channel between the at least one virtual machine and a third switch is prestored in the first virtual switch; presetting second configuration information for establishing a communication channel between the at least one virtual machine and the second switch in the first virtual switch;
when network switching is carried out, controlling the at least one virtual machine to communicate with a second electronic device under the second virtual network through a first virtual switch and a third switch based on the first configuration information, and controlling the at least one virtual machine to interact with the second electronic device under the first virtual network through the first virtual switch and the second switch based on the second configuration information.
2. The network switching method according to claim 1,
the second switch is a virtual switch located in the first electronic device, or the second switch is a physical switch;
and/or the presence of a gas in the gas,
the third switch is a virtual switch located in the first electronic device, or the third switch is a physical switch.
3. The network handover method according to claim 1 or 2, further comprising:
deleting first configuration information preset in the first virtual switch and used for establishing a communication channel between the at least one virtual machine and the third switch;
and if the third switch is a virtual switch, deleting the third switch.
4. The network handover method according to claim 1 or 2, further comprising:
and sending indication information carrying the switching of the first electronic equipment from the second virtual network to the first virtual network to a server for managing the use of the virtual network category by the electronic equipment.
5. The network switching method of claim 1, wherein the establishing a second switch having a communication connection with the first virtual switch comprises:
setting a first flow table for establishing a reception channel for receiving a message from the second electronic device under the first virtual network;
setting a second flow table for establishing a transmission channel for transmitting a message to the second electronic device under the first virtual network.
6. The network switching method according to claim 1 or 5, wherein setting second configuration information for establishing a communication channel between the at least one virtual machine and the second switch in the first virtual switch includes:
setting a third flow table for establishing a reception channel for receiving a message from the second switch;
setting a fourth flow table for establishing a transmission channel for transmitting a message to the second switch.
7. The network handover method according to claim 1, further comprising:
detecting whether first hardware related to a virtual network in the first electronic device supports the first virtual network;
if the first hardware does not support the first virtual network, replacing the first hardware with second hardware supporting the first virtual network.
8. A first electronic device, comprising: at least one virtual machine, and, with at least one virtual machine respectively have communication connection's first virtual switch, still include:
an establishing module for establishing a second switch having a communication connection with the first virtual switch;
the second switch is used for establishing a communication channel between the first virtual switch and a second electronic device under a first virtual network, wherein the first virtual switch and a third switch have communication connection before the second switch is established, the third switch is used for establishing the communication channel between the first virtual switch and the second electronic device under a second virtual network, and the network types of the first virtual network and the second virtual network are different;
a setting module, configured to preset, in the first virtual switch, first configuration information for controlling a communication channel between the at least one virtual machine and a third switch; and second configuration information for establishing a communication channel between the at least one virtual machine and the second switch;
and the interaction module is used for controlling the at least one virtual machine to interact with the second electronic equipment under the first virtual network through the first virtual switch and the second switch based on the second configuration information when the at least one virtual machine is controlled to communicate with the second electronic equipment under the second virtual network through the first virtual switch and the third switch based on the first configuration information during network switching.
9. A first electronic device, comprising: at least one virtual machine, and, with at least one virtual machine respectively have communication connection's first virtual switch, still include:
a memory for storing a program;
a processor configured to execute the program, the program specifically configured to:
establishing a second switch having a communication connection with the first virtual switch;
the second switch is used for establishing a communication channel between the first virtual switch and a second electronic device under a first virtual network, wherein the first virtual switch and a third switch have communication connection before the second switch is established, the third switch is used for establishing the communication channel between the first virtual switch and the second electronic device under a second virtual network, and the network types of the first virtual network and the second virtual network are different;
presetting first configuration information for controlling a communication channel between the at least one virtual machine and a third switch in the first virtual switch; and second configuration information for establishing a communication channel between the at least one virtual machine and the second switch;
when network switching is carried out, controlling the at least one virtual machine to communicate with a second electronic device under the second virtual network through a first virtual switch and a third switch based on the first configuration information, and controlling the at least one virtual machine to interact with the second electronic device under the first virtual network through the first virtual switch and the second switch based on the second configuration information.
10. A readable storage medium having stored thereon a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the network switching method according to any one of claims 1 to 7.
CN201810724314.4A 2018-07-04 2018-07-04 Network switching method, first electronic device and readable storage medium Active CN108900441B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810724314.4A CN108900441B (en) 2018-07-04 2018-07-04 Network switching method, first electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810724314.4A CN108900441B (en) 2018-07-04 2018-07-04 Network switching method, first electronic device and readable storage medium

Publications (2)

Publication Number Publication Date
CN108900441A CN108900441A (en) 2018-11-27
CN108900441B true CN108900441B (en) 2021-01-15

Family

ID=64348301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810724314.4A Active CN108900441B (en) 2018-07-04 2018-07-04 Network switching method, first electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN108900441B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109450701B (en) * 2018-12-07 2020-04-17 北京金山云网络技术有限公司 Virtual switch switching method and device, host machine and computer readable storage medium
CN114710408A (en) * 2022-03-18 2022-07-05 阿里云计算有限公司 Method and device for realizing hot upgrade of virtual switch
CN114745422A (en) * 2022-04-02 2022-07-12 阿里云计算有限公司 Line switching method for data transmission, data transmission system, line management interface and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101808375A (en) * 2009-02-16 2010-08-18 Lg电子株式会社 Portable terminal and changing method thereof
US9128622B1 (en) * 2013-12-16 2015-09-08 Emc Corporation Network virtualization-aware data storage system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107493180B (en) * 2016-06-13 2021-04-30 阿里巴巴集团控股有限公司 Upgrading method and device of virtual switch
CN106713025B (en) * 2016-12-14 2019-08-20 广州市品高软件股份有限公司 A kind of network disaster tolerance method for synchronizing information
CN107018058B (en) * 2017-03-30 2020-04-21 国家计算机网络与信息安全管理中心 Method and system for sharing VLAN (virtual local area network) and VXLAN (virtual extensible local area network) communication in cloud environment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101808375A (en) * 2009-02-16 2010-08-18 Lg电子株式会社 Portable terminal and changing method thereof
US9128622B1 (en) * 2013-12-16 2015-09-08 Emc Corporation Network virtualization-aware data storage system

Also Published As

Publication number Publication date
CN108900441A (en) 2018-11-27

Similar Documents

Publication Publication Date Title
CN110896371B (en) Virtual network equipment and related method
CN109842694B (en) Method for synchronizing MAC addresses, network equipment and computer readable storage medium
US11425604B2 (en) User plane resource management method, user plane network element, and control plane network element
CN108900441B (en) Network switching method, first electronic device and readable storage medium
WO2021057526A1 (en) Disaster recovery method for gateway device, and communication device
CN108199962B (en) Address migration method and device, network equipment and readable storage medium
CN110932876B (en) Communication system, method and device
CN109246762A (en) A kind of local service shunt method and device
CN111181765A (en) Task processing method and device
CN104426816B (en) A kind of virtual machine communication method and device
CN103199990B (en) A kind of method and apparatus of Routing Protocol certification migration
CN113037599A (en) Message processing method, device and storage medium
CN112803998B (en) Multi-bus network cross-network communication method, device, system, equipment and storage medium
CN114007241A (en) ZigBee system, gateway equipment thereof, gateway switching method and device
JP2009194787A (en) Gateway apparatus
CN110324202B (en) Method and device for detecting line quality
CN110311861B (en) Method and device for guiding data flow
CN101686081A (en) Method for reestablishing synchronous connection, device and system thereof
CN112532532B (en) Service returning method, device, equipment and readable storage medium
CN106792843B (en) Equipment management method and device
CN108810168A (en) A kind of method and L2TP Network Server of access L2TP Network Server
CN103327482A (en) Terminal and network switching control method
JP2014230234A (en) Network management device and network management method
CN110798514B (en) Service processing method and device
CN110784410A (en) Route establishing method and related equipment

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
GR01 Patent grant
GR01 Patent grant