CN109450676B - Switch upgrading method and device, electronic equipment and computer readable medium - Google Patents

Switch upgrading method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN109450676B
CN109450676B CN201811271032.XA CN201811271032A CN109450676B CN 109450676 B CN109450676 B CN 109450676B CN 201811271032 A CN201811271032 A CN 201811271032A CN 109450676 B CN109450676 B CN 109450676B
Authority
CN
China
Prior art keywords
virtual machine
switch
forwarding
forwarding table
table item
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
CN201811271032.XA
Other languages
Chinese (zh)
Other versions
CN109450676A (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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN201811271032.XA priority Critical patent/CN109450676B/en
Publication of CN109450676A publication Critical patent/CN109450676A/en
Application granted granted Critical
Publication of CN109450676B publication Critical patent/CN109450676B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/20Support for services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a method and a device for upgrading a switch, electronic equipment and a computer readable medium, belonging to the technical field of communication, wherein the method comprises the following steps: receiving an upgrading file of a switch; the method comprises the steps of taking a virtual machine for forwarding a current control message as a first virtual machine, starting the virtual machine which has a hot standby relation with the first virtual machine as a second virtual machine, loading an upgrade file into the second virtual machine to upgrade a switch, synchronizing current state information of the first virtual machine to the second virtual machine after upgrade is successful, wherein the state information at least comprises a first forwarding table item which is sent to a switch chip by the first virtual machine for forwarding the message last time, switching the second virtual machine to be the virtual machine for forwarding the control message, sending a second table item which is sent by the second virtual machine to the switch chip, and indicating the switch chip to replace the stored first forwarding table item with the stored second forwarding table item.

Description

Switch upgrading method and device, electronic equipment and computer readable medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for upgrading a switch, an electronic device, and a computer-readable medium.
Background
At present, when a switch is upgraded, the aim of upgrading an uninterrupted message forwarding service is achieved in a hardware redundancy mode.
Specifically, referring to fig. 1, a switch 1 and a switch 2 form a Virtual Switching Unit (VSU) system through a backup link, that is, two switches logically become one switch, and one Switching interface of each of the two switches is taken to form an aggregation interface, that is, the two Switching interfaces logically become one Switching interface, and 2 aggregation interfaces are shown in fig. 1, where the switch 1 is a master device of the VSU system and the switch 2 is a slave device of the VSU system.
When the switch 1 needs to be upgraded, firstly loading the mirror image of the new operating system 1 in the original operating system 1, as shown in fig. 2, still forwarding the message by the switch 1 in the process, then restarting the switch 1, and upgrading the original operating system 1 by using the mirror image of the new operating system 1 after restarting, that is, upgrading the switch 1, in the process, the switch 2 is switched to the main device of the VSU system to be responsible for forwarding the message, as shown in fig. 3, after the switch 1 is upgraded successfully, recovering the data from the switch 2, switching the switch 1 to the main device of the VSU system to continue to be responsible for forwarding the message, as shown in fig. 4, so that the switch 2 takes over the message forwarding service when the switch 1 is upgraded, and after the switch 1 is upgraded successfully, switching the switch 1 to the main device of the VSU system and taking over the message forwarding service, therefore, the aim of not interrupting the message forwarding service in the process of upgrading the switch 1 is fulfilled.
The scheme achieves the purpose of upgrading the uninterrupted message forwarding service by putting in hardware resources, wastes the hardware resources of the switch, and has higher upgrading cost because the hardware resources are expensive.
Disclosure of Invention
The embodiment of the application provides a method and a device for upgrading a switch, electronic equipment and a computer readable medium, which are used for solving the problems of hardware resource waste and high upgrading cost caused by the fact that a message forwarding service is not interrupted when the switch is upgraded in the prior art.
In a first aspect, a method for upgrading a switch provided in an embodiment of the present application includes:
receiving an upgrading file of a switch;
taking a virtual machine which forwards a current control message as a first virtual machine, starting a virtual machine from the virtual machines in a closed state as a second virtual machine, wherein the second virtual machine and the first virtual machine have hot standby relation, and loading the upgrade file into the second virtual machine for upgrading;
after the upgrade is successful, synchronizing the current state information of the first virtual machine to the second virtual machine, wherein the state information at least comprises a first forwarding table item which is sent to a switching chip by the first virtual machine for message forwarding last time;
switching the second virtual machine to a virtual machine for controlling the message to be forwarded, receiving a second forwarding table item for forwarding the message, which is sent by the second virtual machine, sending the second forwarding table item to the switch chip, and instructing the switch chip to replace the stored first forwarding table item with the second forwarding table item.
In the embodiment of the application, when an upgrade file of a switch is received, a virtual machine forwarding a current control message is used as a first virtual machine, a virtual machine having a hot standby relationship with the first virtual machine is started from the virtual machines in a closed state to be used as a second virtual machine, the upgrade file is loaded into the second virtual machine to upgrade the switch, after the upgrade is successful, state information of the first virtual machine is synchronized to the second virtual machine, the second virtual machine is switched to the virtual machine forwarding the control message, when a forwarding table item sent by the second virtual machine is received, the forwarding table item is sent to a switching chip, the switching chip is instructed to replace the stored forwarding table item issued by the first virtual machine with the forwarding table item, wherein the upgrade file is installed in the newly started second virtual machine, the switch does not need to be restarted, after the upgrade is successful, and then sending the forwarding table entry sent by the second virtual machine to the switch chip, that is, before the upgrade is successful, the switch chip still uses the forwarding table entry sent by the first virtual machine to forward the message, and after the upgrade is successful, the switch chip uses the forwarding table entry sent by the second virtual machine to forward the message, so that the service can be upgraded without interruption without using an additional switch chip, and therefore, the upgrade cost is low.
In a second aspect, an embodiment of the present application provides a switch upgrading apparatus, including:
the receiving module is used for receiving the upgrading file of the switch;
the upgrading module is used for taking a virtual machine for forwarding the current control message as a first virtual machine, starting a virtual machine from the virtual machines in a closed state as a second virtual machine, wherein the second virtual machine and the first virtual machine have hot standby relation, and loading the upgrading file into the second virtual machine for upgrading;
the synchronization module is used for synchronizing the current state information of the first virtual machine to the second virtual machine after the upgrade is successful, wherein the state information at least comprises a first forwarding table item which is sent to a switching chip by the first virtual machine for message forwarding at the latest time;
and the switching module is used for switching the second virtual machine to a virtual machine for controlling message forwarding, receiving a second forwarding table item which is sent by the second virtual machine and used for message forwarding, sending the second forwarding table item to the switching chip, and instructing the switching chip to replace the stored first forwarding table item with the second forwarding table item.
In a third aspect, an electronic device provided in an embodiment of the present application includes: at least one processor, and a memory communicatively coupled to the at least one processor, wherein:
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the switch upgrade method described above.
In a fourth aspect, an embodiment of the present application provides a computer-readable medium, which stores computer-executable instructions, where the computer-executable instructions are used to execute the switch upgrading method described above.
In addition, for technical effects brought by any one of the design manners in the second aspect to the fourth aspect, reference may be made to technical effects brought by different implementation manners in the first aspect, and details are not described here.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram of a prior art VSU system with two switches;
fig. 2 to fig. 4 are schematic diagrams illustrating a process of upgrading a switch without interrupting a packet forwarding service in the prior art;
fig. 5 is a schematic view of an application scenario of a switch upgrading method according to an embodiment of the present application;
fig. 6 to fig. 8 are schematic diagrams of a process of upgrading a switch without interrupting a message forwarding service according to an embodiment of the present application;
fig. 9 is a flowchart of a method for upgrading a switch according to an embodiment of the present application;
fig. 10 is a flowchart of another switch upgrading method provided in an embodiment of the present application;
fig. 11 is a schematic hardware structure diagram of an electronic device for implementing a switch upgrade method according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a switch upgrading apparatus according to an embodiment of the present application.
Detailed Description
In order to solve the problems of hardware resource waste and high upgrade cost caused by uninterrupted message forwarding service when upgrading a switch in the prior art, embodiments of the present application provide a switch upgrading method and apparatus, an electronic device, and a computer readable medium.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it should be understood that the preferred embodiments described herein are merely for illustrating and explaining the present application, and are not intended to limit the present application, and that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
First, it should be noted that, in this embodiment of the present application, the first virtual machine and the second virtual machine are only used to distinguish two different virtual machines, and do not refer to a specific virtual machine, and similarly, the first forwarding entry and the second forwarding entry are also only used to distinguish two different forwarding entries, and do not refer to a specific forwarding entry.
Considering that the dual-computer VSU system can satisfy the upgrading of the switch uninterrupted service, the operating system is considered to be operated in the virtual machine, and when the upgrading of the uninterrupted service is required, the dual-virtual machine is started to form the VSU system, so that the purpose of upgrading the uninterrupted service can be achieved without the need of dual hardware switches, and the number of the virtual machines can be larger than two.
In specific implementation, the native operating System in the switch may be an LINUX Operating System (OS), and the virtualization platform may be a Kernel Virtual Machine (KVM), specifically, referring to fig. 5, fig. 5 shows a schematic diagram of the switch provided in the embodiment of the present application, which includes a Virtual Machine management System, a Virtual Machine 1, a Virtual Machine 2, and a switch chip, where the Virtual Machine 1 and the Virtual Machine 2 have a hot standby relationship, for example, the Virtual Machine 1 and the Virtual Machine 2 may form a VSU System; the virtual machine management system is used for controlling the switching between the virtual machine 1 and the virtual machine 2; the switching chip is used for forwarding the message according to a forwarding table item issued by the main device in the VSU system, and supports VT-D, wherein the VT-D is a VT virtualization technology which is provided by Intel and can support direct I/O access, and the direct access of the virtual machine to the switching chip can be realized.
In specific implementation, when a startup instruction is received, the virtual machine management system may start a default started virtual machine, such as the virtual machine 1, and after the default started virtual machine is started, send the switching chip VT-D to the virtual machine, receive a forwarding table item for forwarding a message sent by the virtual machine, and send the forwarding table item to the switching chip, and subsequently, the switching chip may forward the message received from the switching interface according to the forwarding table item.
When the switch needs to be upgraded, the virtual machine management system determines the virtual machine which forwards the current control message as a first virtual machine, starts another virtual machine in a closed state, such as the virtual machine 2, as a second virtual machine, loads an upgrade file into the second virtual machine to upgrade the switch, and synchronizes the current state information of the first virtual machine to the second virtual machine through a backup link after the upgrade is successful, such as a first forwarding table item which is last issued by the first virtual machine to the switch chip, configuration information of each protocol used by the first virtual machine, an operation state of a currently used protocol, and the like, as shown in fig. 6, at this time, the switch chip still forwards the message according to the first forwarding table item issued by the first virtual machine.
Further, the virtual machine management system switches the second virtual machine to be the main device of the VSU system, for example, sends the switch chip VT-D to the second virtual machine, then receives a second forwarding table item for message forwarding sent by the second virtual machine, sends the second forwarding table item to the switch chip, and instructs the switch chip to refresh the stored first forwarding table item by using the second forwarding table item, and then the second virtual machine is responsible for message forwarding, as shown in fig. 7.
In specific implementation, because the previous first forwarding table entry can be cached in the switch chip, and the second virtual machine synchronizes the current protocol information of the first virtual machine, the switch chip can still forward the message according to the first forwarding table entry issued by the first virtual machine before the forwarding table entry is refreshed, and forward the message according to the second forwarding table entry issued by the second virtual machine after the switch chip refreshes the forwarding table entry, the time required for refreshing the forwarding table entry is far shorter than the time required for forwarding the message, and can be ignored, so that the message forwarding service does not need to be interrupted.
Further, the virtual machine management system may shut down the first virtual machine and set the second virtual machine, i.e. virtual machine 2, as the virtual machine started by default next time, as shown in fig. 8, so that the subsequent switch runs the second virtual machine installed with the latest version of the upgrade file after the system is restarted.
Subsequently, when the switch needs to be upgraded again, the virtual machine that currently controls the forwarding of the message, i.e., virtual machine 2, becomes the first virtual machine, and the newly started virtual machine, i.e., virtual machine 1, becomes the second virtual machine, i.e., the two virtual machines can exchange identities at this time, and then the process executed is the same as the above process, which is not described herein again, so that the switch can be upgraded without service interruption by using the two virtual machines alternately.
Here, it should be noted that the forwarding table entry is determined by the virtual machine according to various factors such as the available port of the current switch and the states of the network neighbors, and these factors may change with time, so that even if the forwarding table entries issued by the same virtual machine at different times are different.
In the embodiment of the application, at least two virtual machines with hot standby relationship are installed in a switch, and the at least two virtual machines have hot standby relationship, after the switch is started, one virtual machine is used for message forwarding, when an upgrade file of the switch is received, another virtual machine is started again, the upgrade file is loaded into the other virtual machine for upgrading, after the upgrade is successful, the state information of the virtual machine which is operated before is resynchronized to the other virtual machine, and a forwarding table item generated by the other switch is sent to a switching chip, so that extra hardware resources are not needed, the switch can be upgraded, and message exchange service does not need to be interrupted, and therefore, the upgrade cost is low.
As shown in fig. 9, a flowchart of a switch upgrading method provided in the embodiment of the present application includes the following steps:
s901: the virtual machine management system receives a switch upgrade file.
S902: and taking the virtual machine which forwards the current control message as a first virtual machine, starting one virtual machine from the virtual machines in the closed state as a second virtual machine, wherein the second virtual machine and the first virtual machine have hot standby relation, and loading an upgrade file into the second virtual machine to upgrade the switch.
S903: after the upgrade is successful, synchronizing the current state information of the first virtual machine to the second virtual machine, wherein the state information at least comprises a first forwarding table item which is sent by the first virtual machine to the exchange chip last time and used for message forwarding.
The state information further includes configuration information of each protocol used by the first virtual machine and an operating state of a currently used protocol, where the protocol is a unicast protocol or a multicast protocol, and the operating state of the protocol is idle, connected, active, or the like.
S904: and switching the second virtual machine to be a virtual machine for controlling the message to be forwarded, receiving a second forwarding table item which is sent by the second virtual machine and used for forwarding the message, sending the second forwarding table item to the switching chip, and instructing the switching chip to replace the stored first forwarding table item with the second forwarding table item.
In specific implementation, the switching chip VT-D is given to the second virtual machine, so that the second virtual machine can control the switching chip.
S905: and the switching chip forwards the message received by the switch according to the second forwarding table entry.
In the embodiment of the application, in the process of forwarding the message, when an upgrade file for upgrading the switch is received, a virtual machine for forwarding the current control message is used as a first virtual machine, a virtual machine having a hot standby relationship with the first virtual machine is started from the virtual machines in the closed state to be used as a second virtual machine, the upgrade file is installed in the second virtual machine to upgrade the switch, after the upgrade is successful, the state information of the first virtual machine is synchronized to the second virtual machine, the second virtual machine is switched to the virtual machine for forwarding the control message, then a second forwarding table item for forwarding the message sent by the second virtual machine is received, the second forwarding table item is sent to the switch chip, and the switch chip uses the first forwarding table item sent by the first virtual machine before the second forwarding table item is stored in the second forwarding table item, so that, the switch can be upgraded by using the two virtual machines alternately without interrupting the message forwarding service or needing additional hardware resources, so that the upgrading cost is lower.
In specific implementation, a default started virtual machine can be set in the switch, and after each upgrade is successful, the virtual machine provided with the latest upgrade file can be set as the default started virtual machine, so that the latest version of the switch restart is ensured.
The following describes an embodiment of the present application by taking, as an example, a default-started virtual machine in which two virtual machines having a hot standby relationship, i.e., virtual machine 1 and virtual machine 2, are installed in a switch, and virtual machine 1 is initially set.
As shown in fig. 10, a flowchart of a switch upgrading method provided in the embodiment of the present application includes the following steps:
s1001: and receiving a starting-up instruction.
S1002: the default started virtual machine 1 is started.
S1003: and allocating the switching chip to the virtual machine 1 for management and control, and receiving a forwarding table entry 1 which is sent by the virtual machine 1 and used for forwarding the message.
In specific implementation, the virtual machine 1 can manage and control the switching chip by the switching chip VT-D.
S1004: and sending the forwarding table item 1 to the switching chip, and instructing the switching chip to forward the message received by the switch according to the forwarding table item 1.
S1005: and receiving the upgrading file 1 of the switch in the process of forwarding the message according to the forwarding table item 1.
S1006: the virtual machine 2 is started.
S1007: and loading the upgrade file 1 into the virtual machine 2 to upgrade the switch.
S1008: after the upgrade is successful, synchronizing the current state information of the virtual machine 1, which is forwarded by the current control message, to the virtual machine 2, wherein the state information at least comprises a forwarding table entry 1 which is sent to the switching chip by the virtual machine 1 last time.
Here, the state information also includes configuration information of each protocol used by the virtual machine 1 and an operation state of a currently used protocol, where the protocol is a unicast protocol or a multicast protocol, and the operation state of the protocol is idle, connected, active, or the like.
S1009: and the switching virtual machine 2 is a virtual machine for controlling the message to be forwarded, and receives a forwarding table entry 2 which is sent by the virtual machine 2 and used for forwarding the message.
Here, the virtual machine 2 can be managed and controlled by the switching chip 2 by giving the switching chip VT-D to the virtual machine 2.
S1010: and sending the forwarding table entry 2 to the switching chip, and instructing the switching chip to replace the stored forwarding table entry 1 with the forwarding table entry 2.
In specific implementation, after receiving the forwarding table entry 2, the switching chip may refresh the forwarding table entry stored by itself, so that before refreshing the forwarding table entry, the switching chip forwards the message by using the forwarding table entry 1, and after refreshing the forwarding table entry, the switching chip forwards the message by using the forwarding table entry 2.
S1011: virtual machine 1 is shut down and virtual machine 2 is set as the default starting virtual machine.
S1012: and receiving the switch upgrading file 2 in the process of forwarding the message according to the forwarding table entry 2.
S1013: virtual machine 1 is started.
S1014: and loading the upgrade file 2 into the virtual machine 1 to upgrade the switch.
S1015: after the upgrade is successful, synchronizing the current state information of the virtual machine 2 to the virtual machine 1, where the state information at least includes a forwarding table entry 2 that the virtual machine 2 has sent to the switch chip for message forwarding last time.
Here, the state information also includes configuration information of each protocol used by the virtual machine 2 and an operation state of a currently used protocol, where the protocol is a unicast protocol or a multicast protocol, and the operation state of the protocol is idle, connected, active, or the like.
S1016: the switching virtual machine 1 is a virtual machine for controlling the message forwarding, and receives a forwarding table entry 3 for message forwarding sent by the virtual machine 1.
S1017: and sending the forwarding table item 3 to the switching chip, and instructing the switching chip to replace the stored forwarding table item 2 with the forwarding table item 3.
S1018: virtual machine 2 is shut down and virtual machine 1 is set as the default starting virtual machine.
Therefore, the switch can be upgraded cyclically by using the two virtual machines, the subsequent processing flow when receiving the upgrade file is similar to the above-mentioned flow, and the only difference is that the forwarding table entries issued by the switch at different times are different, and the details are not repeated herein.
Referring to fig. 11, a schematic structural diagram of an electronic device provided in this embodiment of the present application includes a transceiver 1101, a processor 1102, and other physical devices, where the processor 1102 may be a Central Processing Unit (CPU), a microprocessor, an application specific integrated circuit, a programmable logic circuit, a large scale integrated circuit, or a digital processing unit. The transceiver 1101 is used for data transmission and reception between the electronic device and other devices.
The electronic device may further comprise a memory 1103 for storing software instructions executed by the processor 1102, and of course may also store some other data required by the electronic device, such as identification information of the electronic device, encryption information of the electronic device, user data, etc. The memory 1103 may be a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 1103 may also be a non-volatile memory (non-volatile memory) such as, but not limited to, a read-only memory (ROM), a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD), or the memory 1103 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 1103 may be a combination of the above.
The specific connection medium between the processor 1102, the memory 1103 and the transceiver 1101 is not limited in the embodiment of the present application. In the embodiment of the present application, only the memory 1103, the processor 1102, and the transceiver 1101 are connected by the bus 1104 in fig. 11 for explanation, the bus is shown by a thick line in fig. 11, and the connection manner between other components is only for illustrative purpose and is not limited thereto. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 11, but this is not intended to represent only one bus or type of bus.
The processor 1102 may be dedicated hardware or a processor running software, and when the processor 1102 may run software, the processor 1102 reads software instructions stored in the memory 1103 and executes the switch upgrade method in the foregoing embodiment under the driving of the software instructions.
When the method provided in the embodiments of the present application is implemented in software or hardware or a combination of software and hardware, a plurality of functional modules may be included in the electronic device, and each functional module may include software, hardware or a combination of software and hardware. Specifically, referring to fig. 12, a schematic structural diagram of a switch upgrading apparatus provided in the embodiment of the present application includes a determining unit receiving module 1201, a determining module 1202, an upgrading module 1203, a synchronizing module 1204, a switching module 1205, and a sending module 1206.
A receiving module 1201, configured to receive a switch upgrade file;
an upgrade module 1202, configured to use a virtual machine to forward a current control packet as a first virtual machine, start a virtual machine from among virtual machines in a closed state as a second virtual machine, where the second virtual machine and the first virtual machine have a hot standby relationship, and load the upgrade file into the second virtual machine for upgrade;
a synchronization module 1203, configured to synchronize, after the upgrade is successful, current state information of the first virtual machine to the second virtual machine, where the state information at least includes a first forwarding table entry, which is sent by the first virtual machine to the switch chip last time and is used for forwarding a message;
a switching module 1204, configured to switch the second virtual machine to a virtual machine that controls forwarding of a packet, receive a second forwarding table item that is sent by the second virtual machine and used for forwarding the packet, send the second forwarding table item to the switch chip, and instruct the switch chip to replace the stored first forwarding table item with the second forwarding table item.
In a possible implementation manner, the switching module 1204 is specifically configured to:
and allocating the switching chip to the second virtual machine for management and control.
In a possible implementation manner, the switch is provided with a default-started virtual machine, and further includes a setting module 1205 configured to:
after the second forwarding table entry is sent to the switch chip, the first virtual machine is closed, and the second virtual machine is set as a default started virtual machine.
In a possible implementation manner, the state information further includes configuration information of each protocol used by the first virtual machine and an operation state of a currently used protocol.
The division of the modules in the embodiments of the present application is schematic, and only one logical function division is provided, and in actual implementation, there may be another division manner, and in addition, each functional module in each embodiment of the present application may be integrated in one processor, may also exist alone physically, or may also be integrated in one module by two or more modules. The coupling of the various modules to each other may be through interfaces that are typically electrical communication interfaces, but mechanical or other forms of interfaces are not excluded. Thus, modules described as separate components may or may not be physically separate, may be located in one place, or may be distributed in different locations on the same or different devices. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions required to be executed by the processor, and includes a program required to be executed by the processor.
In some possible embodiments, the aspects of the switch upgrade method provided in this application may also be implemented in the form of a program product including program code for causing an electronic device to perform the steps in the switch upgrade method according to various exemplary embodiments of this application described above in this specification when the program product is run on the electronic device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product for switch upgrade of embodiments of the present application may employ a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device over any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., over the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for upgrading a switch, comprising:
receiving an upgrading file of a switch;
taking a virtual machine which forwards a current control message as a first virtual machine, starting a virtual machine from the virtual machines in a closed state as a second virtual machine, wherein the second virtual machine and the first virtual machine have hot standby relation, and loading the upgrade file into the second virtual machine for upgrading;
after the upgrade is successful, synchronizing the current state information of the first virtual machine to the second virtual machine, wherein the state information at least comprises a first forwarding table item which is sent to a switching chip by the first virtual machine for message forwarding last time;
switching the second virtual machine to a virtual machine for controlling the message to be forwarded, receiving a second forwarding table item for forwarding the message, which is sent by the second virtual machine, sending the second forwarding table item to the switch chip, and instructing the switch chip to replace the stored first forwarding table item with the second forwarding table item.
2. The method of claim 1, wherein switching the second virtual machine to a virtual machine that forwards control messages comprises:
and allocating the switching chip to the second virtual machine for management and control.
3. The method according to claim 1 or 2, wherein a default-activated virtual machine is set in the switch, and after the second forwarding table entry is sent to the switch chip, the method further comprises:
and closing the first virtual machine, and setting the second virtual machine as a default started virtual machine.
4. The method of claim 1 or 2, wherein the state information further includes configuration information of each protocol used by the first virtual machine and an operating state of a currently used protocol.
5. A switch upgrade apparatus, comprising:
the receiving module is used for receiving the upgrading file of the switch;
the upgrading module is used for taking a virtual machine for forwarding the current control message as a first virtual machine, starting a virtual machine from the virtual machines in a closed state as a second virtual machine, wherein the second virtual machine and the first virtual machine have hot standby relation, and loading the upgrading file into the second virtual machine for upgrading;
the synchronization module is used for synchronizing the current state information of the first virtual machine to the second virtual machine after the upgrade is successful, wherein the state information at least comprises a first forwarding table item which is sent to a switching chip by the first virtual machine for message forwarding at the latest time;
and the switching module is used for switching the second virtual machine to a virtual machine for controlling message forwarding, receiving a second forwarding table item which is sent by the second virtual machine and used for message forwarding, sending the second forwarding table item to the switching chip, and instructing the switching chip to replace the stored first forwarding table item with the second forwarding table item.
6. The apparatus of claim 5, wherein the switching module is specifically configured to:
and allocating the switching chip to the second virtual machine for management and control.
7. The apparatus of claim 5 or 6, wherein a default-started virtual machine is set in the switch, further comprising a setting module configured to:
after the second forwarding table entry is sent to the switch chip, the first virtual machine is closed, and the second virtual machine is set as a default started virtual machine.
8. The apparatus of claim 5 or 6, wherein the state information further comprises configuration information for each protocol used by the first virtual machine and an operating state of a currently used protocol.
9. An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein:
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 4.
10. A computer-readable medium storing computer-executable instructions, which when executed by a processor implement the method of any one of claims 1 to 4.
CN201811271032.XA 2018-10-29 2018-10-29 Switch upgrading method and device, electronic equipment and computer readable medium Active CN109450676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811271032.XA CN109450676B (en) 2018-10-29 2018-10-29 Switch upgrading method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811271032.XA CN109450676B (en) 2018-10-29 2018-10-29 Switch upgrading method and device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN109450676A CN109450676A (en) 2019-03-08
CN109450676B true CN109450676B (en) 2022-04-26

Family

ID=65548772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811271032.XA Active CN109450676B (en) 2018-10-29 2018-10-29 Switch upgrading method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN109450676B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181469A (en) * 2020-10-27 2021-01-05 北京百度网讯科技有限公司 Software upgrading method and device, electronic equipment and readable storage medium
CN113434341B (en) * 2021-07-01 2023-02-17 北京东土科技股份有限公司 Method, device, equipment and storage medium for realizing redundant virtual PLC
CN113572636A (en) * 2021-07-13 2021-10-29 武汉迈威通信股份有限公司 Batch upgrading method for switches in ring network topology structure and ring network topology structure
CN113660123B (en) * 2021-08-16 2024-02-13 杭州网易数之帆科技有限公司 Virtual switch upgrading method, device, electronic equipment and storage medium
CN114389951B (en) * 2022-03-02 2024-06-18 深圳震有科技股份有限公司 Seamless upgrading method, network equipment and storage medium under 5G network

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011170528A (en) * 2010-02-17 2011-09-01 Nec Corp Distributed information processing system and distributed storage system
US9021459B1 (en) * 2011-09-28 2015-04-28 Juniper Networks, Inc. High availability in-service software upgrade using virtual machine instances in dual control units of a network device
CN104780071A (en) * 2015-04-21 2015-07-15 杭州华三通信技术有限公司 Method and device for upgrading virtual switch
WO2016184320A1 (en) * 2015-05-15 2016-11-24 阿里巴巴集团控股有限公司 Method and device for upgrading qemu online
CN106201564A (en) * 2015-05-07 2016-12-07 阿里巴巴集团控股有限公司 Online upgrading equipment based on kernel virtual machine module and method
CN106250166A (en) * 2015-05-21 2016-12-21 阿里巴巴集团控股有限公司 A kind of half virtualization network interface card kernel accelerating module upgrade method and device
CN106470121A (en) * 2016-08-30 2017-03-01 锐捷网络股份有限公司 The upgrade method of virtual switch unit VSU system, device and VSU system
CN107493180A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 The upgrade method and device of a kind of virtual switch
CN108023756A (en) * 2016-10-28 2018-05-11 阿里巴巴集团控股有限公司 The upgrade method and device of a kind of virtual switch

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8782632B1 (en) * 2012-06-18 2014-07-15 Tellabs Operations, Inc. Methods and apparatus for performing in-service software upgrade for a network device using system virtualization

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011170528A (en) * 2010-02-17 2011-09-01 Nec Corp Distributed information processing system and distributed storage system
US9021459B1 (en) * 2011-09-28 2015-04-28 Juniper Networks, Inc. High availability in-service software upgrade using virtual machine instances in dual control units of a network device
CN104780071A (en) * 2015-04-21 2015-07-15 杭州华三通信技术有限公司 Method and device for upgrading virtual switch
CN106201564A (en) * 2015-05-07 2016-12-07 阿里巴巴集团控股有限公司 Online upgrading equipment based on kernel virtual machine module and method
WO2016184320A1 (en) * 2015-05-15 2016-11-24 阿里巴巴集团控股有限公司 Method and device for upgrading qemu online
CN106250166A (en) * 2015-05-21 2016-12-21 阿里巴巴集团控股有限公司 A kind of half virtualization network interface card kernel accelerating module upgrade method and device
CN107493180A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 The upgrade method and device of a kind of virtual switch
CN106470121A (en) * 2016-08-30 2017-03-01 锐捷网络股份有限公司 The upgrade method of virtual switch unit VSU system, device and VSU system
CN108023756A (en) * 2016-10-28 2018-05-11 阿里巴巴集团控股有限公司 The upgrade method and device of a kind of virtual switch

Also Published As

Publication number Publication date
CN109450676A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
CN109450676B (en) Switch upgrading method and device, electronic equipment and computer readable medium
CN108183871B (en) A kind of virtual switch, virtual switch start method, electronic equipment
CN102891882B (en) Utilize the high availability based on checkpoint that the network packet in hardware cushions
EP4083786A1 (en) Cloud operating system management method and apparatus, server, management system, and medium
CN100524219C (en) Configuration synchronization for redundant processors executing different versions of software
CN102081540B (en) Distributed dual-master control network equipment software updating method and device
JP7116802B2 (en) Master/standby container system switching
CN109861839B (en) Method for upgrading virtual switch without service interruption and related equipment
CN105677380B (en) Method and device for board-by-board upgrading of double master control isolations
WO2014059804A1 (en) Method and system for data synchronization
CN105426213B (en) Oftware updating method and system
CN112052230B (en) Multi-machine room data synchronization method, computing device and storage medium
JP2013114684A (en) System and method for managing virtual machine
CN103220183A (en) Implement method of Hadoop high-availability system based on double-main-engine warm backup
CN116257276B (en) Virtual host machine user back-end upgrading method supporting virtualized hardware acceleration
CN111654384A (en) Main/standby switching method, BRAS (broadband remote Access Server) equipment and storage medium
CN108804129B (en) Software upgrading method and device
US20190065527A1 (en) Information processing device and information processing system
CN109542829A (en) The control method of GPU equipment, device and electronic equipment in multisystem
CN101251815A (en) System and method for recoverring computer system
WO2020122024A1 (en) Network interface card, computer, circuit information rewriting method and program
WO2021179584A1 (en) Method and apparatus for migrating druid cluster, computer device and storage medium
CN113660123B (en) Virtual switch upgrading method, device, electronic equipment and storage medium
CN115103011B (en) Cross-data center service processing method, device and equipment
CN108021408B (en) Upgrading method and device

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