Disclosure of Invention
The embodiment of the invention provides a software upgrading method and equipment, which are used for avoiding the loss of forwarding flow and ensuring that services are not interrupted when incompatible upgrading mode software upgrading is carried out on network equipment.
In order to achieve the above object, an embodiment of the present invention provides a software upgrading method for upgrading software in an incompatible upgrading manner for a network device, where the network device includes a main active control board, a standby main control board, and a plurality of line card boards, where at least two line card boards in the plurality of line card boards are connected to a same neighbor network device, and each link between the at least two line card boards and the neighbor network device is an equivalent link, and the method includes:
the main master control board determines the upgrading sequence of the plurality of line card boards;
when the main master control board determines that software upgrading needs to be performed on one of the at least two line card boards currently based on the upgrading sequence, the main master control board stops issuing a route corresponding to the currently upgraded line card board to the neighbor network device, so that the neighbor network device transfers the traffic sent to the currently upgraded line card board to the other line card boards of the at least two line card boards;
when the main master control board determines that no flow passes through the currently upgraded cable clamping board, software upgrading is carried out on the currently upgraded cable clamping board; after the upgrade of the currently upgraded line card board software is completed, registering the currently upgraded line card board to the standby main control board, and re-issuing a route corresponding to the currently upgraded line card board to the neighbor network device by the standby main control board so that the neighbor network device sends flow to the currently upgraded line card board;
the route identifier Router-ID used by the route corresponding to the currently upgraded line card board issued by the standby main control board is different from the Router-ID used by the route corresponding to the currently upgraded line card board issued by the main control board before upgrading.
Before the main control board performs software upgrade on the plurality of line card boards, the method further includes: the main control board informs the standby main control board to carry out software upgrading; after receiving the notice of software upgrading, the standby main control board upgrades the software;
after the main control board performs software upgrade on the plurality of line card boards, the method further includes: and the main control board carries out software upgrading, and the standby main control board is switched to the main control board.
The process of determining the upgrading sequence of the plurality of line card boards by the main control board specifically includes:
the main control board determines the upgrading sequence of the plurality of line card boards according to the pre-configured line card board upgrading sequence, and only one line card board is subjected to software upgrading in each software upgrading process; or,
the main control board determines the upgrading sequence of the plurality of line card boards according to the sequence of line card board identifiers from small to large, and only one line card board is subjected to software upgrading in each software upgrading process; or,
the main control board determines the upgrading sequence of the plurality of line card boards according to the sequence of line card board identifications from large to small, and only one line card board is subjected to software upgrading in each software upgrading process.
The process that the current upgraded line card board registers to the standby main control board, and the standby main control board reissues the route corresponding to the current upgraded line card board to the neighbor network device specifically includes:
the currently upgraded line card board sends a registration message to the standby main control board, wherein the registration message is used for enabling the standby main control board to be responsible for carrying out routing management on the currently upgraded line card board;
after receiving the registration message, if the currently upgraded line card board is successfully registered, the standby main control board performs route management on the currently upgraded line card board and re-issues a route corresponding to the currently upgraded line card board to the neighbor network device.
The method further comprises:
after the standby main control board reissues the route corresponding to the currently upgraded line card board to the neighbor network device, the standby main control board checks the route neighbor state of the currently upgraded line card board, and notifies the main control board to perform software upgrade on other line card boards after waiting for a preset time when determining that the route neighbor state is the route synchronization completion;
and after receiving the notification of software upgrading to other line card boards, the main control board determines the next line card board needing software upgrading based on the upgrading sequence.
The embodiment of the invention provides network equipment for upgrading software in an incompatible upgrading mode, which comprises a main control board, a standby control board and a plurality of wire clamping boards, wherein at least two wire clamping boards in the plurality of wire clamping boards are connected with the same neighbor network equipment, and each link between the at least two wire clamping boards and the neighbor network equipment is an equivalent link; the main master control board comprises a determining module, a first processing module and a software upgrading module; the standby main control board comprises a second processing module; wherein:
the determining module is used for determining the upgrading sequence of the plurality of cable clamping boards;
the first processing module is configured to, when it is determined that software upgrade needs to be performed on one of the at least two line card boards currently based on an upgrade order, stop issuing a route corresponding to the currently upgraded line card board to the neighbor network device, so that the neighbor network device migrates traffic sent to the currently upgraded line card board to the other of the at least two line card boards;
the software upgrading module is used for upgrading software of the currently upgraded cable clamping board when the current upgraded cable clamping board is determined to have no flow;
the second processing module is configured to, when the upgrade of the currently upgraded cable-clamping board software is completed and the currently upgraded cable-clamping board is registered to the standby main control board, reissue a route corresponding to the currently upgraded cable-clamping board to the neighboring network device, so that the neighboring network device sends a traffic to the currently upgraded cable-clamping board;
the route identifier Router-ID used by the route corresponding to the currently upgraded cable card board issued by the second processing module is different from the Router-ID used by the route corresponding to the currently upgraded cable card board issued by the first processing module before upgrading.
The first processing module is further configured to notify the standby main control board of software upgrade before the software upgrade is performed on the plurality of cable-clamping boards; after receiving the notice of software upgrading, the standby main control board upgrades the software;
the software upgrading module is further configured to upgrade software of the main control board after the plurality of cable card boards are upgraded, and the standby main control board is switched to the main control board.
The determining module is specifically configured to determine an upgrading sequence of the plurality of cable-clamping boards according to a preconfigured cable-clamping board upgrading sequence, and only one cable-clamping board is subjected to software upgrading in each software upgrading process; or, determining the upgrading sequence of the plurality of line card boards according to the sequence of the line card board identifications from small to large, and only performing software upgrading on one line card board in each software upgrading process; or, determining the upgrading sequence of the plurality of line card boards according to the sequence of the line card board identifications from large to small, and only performing software upgrading on one line card board in each software upgrading process.
The second processing module is specifically configured to receive a registration message sent by the currently-upgraded line card board to the standby main control board, where the registration message is used to enable the standby main control board to be responsible for performing routing management on the currently-upgraded line card board; after receiving the registration message, if the currently upgraded line card board is successfully registered, performing routing management on the currently upgraded line card board, and reissuing a route corresponding to the currently upgraded line card board to the neighbor network device.
The second processing module is further configured to check a route neighbor state of the currently upgraded line card board after reissuing the route corresponding to the currently upgraded line card board to the neighbor network device, and notify the main control board to perform software upgrade on other line card boards after waiting for a preset time when determining that the route neighbor state is the route synchronization completion; after receiving the notification of software upgrading to other line card boards, the main control board determines the next line card board needing software upgrading based on the upgrading sequence.
Compared with the prior art, the embodiment of the invention at least has the following advantages: in the embodiment of the invention, when the network equipment is subjected to software upgrading in an incompatible upgrading mode and one line card board is subjected to software upgrading, the neighbor network equipment of the network equipment is triggered to transfer the traffic sent to the line card board to other line card boards, so that the loss of the forwarding traffic is avoided, and the service is ensured not to be interrupted.
Detailed Description
To solve the problems in the prior art, embodiments of the present invention provide a software upgrading method, which is used to perform software upgrading in an incompatible upgrading manner on a network device, where the network device is a frame-type three-layer switch or a frame-type router. The network equipment comprises a main control board, a standby main control board and a plurality of line card boards, wherein at least two line card boards in the plurality of line card boards are connected with the same neighbor network equipment, and each link between the at least two line card boards and the same neighbor network equipment is an equivalent link. For example, the network device includes 3 cable card boards, the 3 cable card boards are all connected to the neighbor network device 1, and links between the 3 cable card boards and the neighbor network device 1 are all equivalent links.
In the embodiment of the invention, when determining that software upgrading needs to be carried out on one of at least two line card boards currently based on the upgrading sequence, the main master control board stops issuing the route corresponding to the currently upgraded line card board to the neighbor network equipment corresponding to the currently upgraded line card board, so that the neighbor network equipment transfers the flow sent to the currently upgraded line card board to other line card boards of the at least two line card boards; further, when the main master control board determines that no flow passes through the currently upgraded cable clamping board, software upgrading is carried out on the currently upgraded cable clamping board; further, after the upgrade of the currently upgraded line card board software is completed, the currently upgraded line card board registers to the standby main control board, and the standby main control board reissues the route corresponding to the currently upgraded line card board to the neighbor network device, so that the neighbor network device sends the flow to the currently upgraded line card board.
For convenience of description, in the embodiment of the present invention, the at least two wire clamping boards are taken as two wire clamping boards, and the two wire clamping boards are respectively taken as a first wire clamping board and a second wire clamping board for example to perform the following description.
Fig. 2 is a schematic view of an application scenario of the embodiment of the present invention, where a network includes a network device 0, a network device 1, a network device 2, a network device 3, and a network device 4, and currently, software upgrade in an incompatible upgrade manner needs to be performed on the network device 0, and the network device 1, the network device 2, the network device 3, and the network device 4 are all neighbor network devices of the network device 0. The network equipment 0 comprises a network equipment 1, a network equipment 2, a line card board 1, a line card board 3 and a line card board 3, wherein the line card board 1 and the line card board 3 of the network equipment 0 are respectively connected with the network equipment 1; or, the line card board 3 is a first line card board, and the line card board 1 is a second line card board. Similarly, the line card board 2 and the line card board 4 of the network device 0 are respectively connected with the network device 3, the line card board 2 and the line card board 4 of the network device 0 are respectively connected with the network device 4, based on the above, the line card board 2 is a first line card board, and the line card board 4 is a second line card board; or, the wire clamping plate 4 is a first wire clamping plate, and the wire clamping plate 2 is a second wire clamping plate.
In the above network, the routing information is interacted between the network device 0 and other neighboring network devices (network device 1, network device 2, network device 3, and network device 4) based on a dynamic routing protocol, such as: routing information is interacted based on a routing protocol such as BGP (border gateway protocol) or OSPF (Open Shortest Path first). In addition, network device 0 is interconnected with other neighboring network devices (network device 1, network device 2, network device 3, and network device 4) based on a full three-layer, and each neighboring network device (network device 1, network device 2, network device 3, and network device 4) has at least two equivalent three-layer links with network device 0.
Based on this, network device 0 can issue to network device 1 the route that line card board 1 corresponds and the route that line card board 3 corresponds, based on the route that line card board 1 corresponds and the route that line card board 3 corresponds, network device 1 confirms that self needs to send the flow that sends for network device 2 to line card board 1 or line card board 3 of network device 0 on to form two equivalence three-layer links between line card board 1 and line card board 3.
Similarly, the network device 0 may issue, to the network device 2, a route corresponding to the line card board 1 and a route corresponding to the line card board 3, and based on the route corresponding to the line card board 1 and the route corresponding to the line card board 3, the network device 2 determines that it is necessary for itself to send the traffic sent to the network device 1 to the line card board 1 or the line card board 3 of the network device 0, and forms two equivalent three-layer links between the line card board 1 and the line card board 3.
Similarly, the network device 0 may issue, to the network device 3, a route corresponding to the line card board 2 and a route corresponding to the line card board 4, and based on the route corresponding to the line card board 2 and the route corresponding to the line card board 4, the network device 3 confirms that it is necessary for itself to send the traffic sent to the network device 4 to the line card board 2 or the line card board 4 of the network device 0, and two equivalent three-layer links are formed between the line card board 2 and the line card board 4.
Similarly, the network device 0 may issue, to the network device 4, a route corresponding to the line card board 2 and a route corresponding to the line card board 4, and based on the route corresponding to the line card board 2 and the route corresponding to the line card board 4, the network device 4 confirms that it is necessary for itself to send the traffic sent to the network device 3 to the line card board 2 or the line card board 4 of the network device 0, and two equivalent three-layer links are formed between the line card board 2 and the line card board 4.
In the application scenario, the new software version is loaded to each main control board (main control board and standby main control board) and each cable card board of the network device, and at this time, the new software version cannot be operated, but needs to be operated in the subsequent software upgrading process. As shown in fig. 3, the method comprises the steps of:
step 301, the main control board informs the standby main control board to perform software upgrading, and the standby main control board performs software upgrading. And after receiving the notice of software upgrading, the standby main control board upgrades the software.
And in the software upgrading process of the standby main control board, restarting the standby main control board and operating a new software version to finish the software upgrading process. Because the standby main control board does not bear the work of forwarding flow, equipment management and the like, the software upgrading process of the standby main control board does not influence the forwarding flow in the network.
After the software upgrade of the standby main control board is completed, the main control board confirms that the software upgrade needs to be performed on the plurality of line card boards currently, and performs the subsequent step 302.
Step 302, the main control board determines an upgrading sequence of the plurality of line card boards, and the upgrading sequence of the plurality of line card boards is used for enabling the main control board to sequentially upgrade the software of each line card board according to the upgrading sequence.
In the embodiment of the present invention, the determining, by the master control board, the upgrading sequence of the plurality of cable card boards specifically includes, but is not limited to, the following ways: the main control board determines the upgrading sequence of a plurality of line card boards according to the pre-configured line card board upgrading sequence (the line card board upgrading sequence which can be configured for a user or the default line card board upgrading sequence), and only one line card board is subjected to software upgrading in each software upgrading process; or, the main control board determines the upgrading sequence of the plurality of line card boards according to the sequence of the line card board identifications from small to large (the line card board with the small line card board identification is upgraded firstly, and the line card board with the large line card board identification is upgraded later), and only one line card board is subjected to software upgrading in each software upgrading process; or, the main control board determines the upgrading sequence of the plurality of line card boards according to the sequence of the line card board identifications from large to small (the line card board with the large line card board identification is upgraded firstly, and the line card board with the small line card board identification is upgraded later), and only one line card board is subjected to software upgrading in each software upgrading process.
Of course, in practical applications, the method is not limited to the determination of the upgrading sequence of the multiple line card boards, as long as it can be ensured that only one line card board is subjected to software upgrading in each software upgrading process, and details of the method are not repeated herein in the embodiment of the present invention. For example, the upgrading sequence of the plurality of cable card boards is as follows: the cable clamping board comprises a cable clamping board 1, a cable clamping board 2, a cable clamping board 3 and a cable clamping board 4; or the upgrading sequence of the plurality of wire clamping plates is as follows: the cable clamping plate comprises a cable clamping plate 4, a cable clamping plate 3, a cable clamping plate 2 and a cable clamping plate 1; or the upgrading sequence of the plurality of wire clamping plates is as follows: the cable clamping board comprises a cable clamping board 1, a cable clamping board 3, a cable clamping board 2 and a cable clamping board 4; or the upgrading sequence of the plurality of wire clamping plates is as follows: the cable clamping plate 3, the cable clamping plate 1, the cable clamping plate 4, the cable clamping plate 2 and the like; for convenience of description, in the embodiment of the present invention, the upgrading sequence of the multiple cable clamping boards is as follows: the wire clip board 1, the wire clip board 3, the wire clip board 2, and the wire clip board 4 will be described as examples.
Step 303, the main control board determines that software upgrade needs to be performed on the line card board 1 (the first line card board) currently based on the upgrade sequence, and stops issuing a route corresponding to the line card board 1 to the neighboring network device, so that the neighboring network device transfers the traffic sent to the line card board 1 to the line card board 3 (the second line card board); when the main control board determines that the line card board 1 does not pass the flow, the line card board 1 is upgraded with software.
Before software upgrading of the line card board 1 is needed, the main control board issues a route corresponding to the line card board 1 and a route corresponding to the line card board 3 to the network device 1, so that the network device 1 confirms that the traffic sent to the network device 2 needs to be sent to the line card board 1 or the line card board 3 of the network device 0; on this basis, in the embodiment of the present invention, when the main control board determines that software upgrade needs to be performed on the line card board 1 currently, the main control board stops issuing the route corresponding to the line card board 1 to the network device 1, so that the network device 1 determines that it needs to send the traffic sent to the network device 2 to the line card board 3 of the network device 0, and then the network device 1 transfers the traffic sent to the line card board 1 to the line card board 3. Similarly, before the line card board 1 needs to be upgraded, the main control board issues a route corresponding to the line card board 1 and a route corresponding to the line card board 3 to the network device 2, so that the network device 2 confirms that the traffic sent to the network device 1 needs to be sent to the line card board 1 or the line card board 3 of the network device 0; on this basis, in the embodiment of the present invention, when the main control board determines that software upgrade needs to be performed on the line card board 1 currently, the main control board stops issuing the route corresponding to the line card board 1 to the network device 2, so that the network device 2 determines that it needs to send the traffic sent to the network device 1 to the line card board 3 of the network device 0, and then the network device 2 transfers the traffic sent to the line card board 1 to the line card board 3.
Further, after the release of the route corresponding to the line card board 1 to the network device 1 and the network device 2 is stopped, neither the network device 1 nor the network device 2 will send the traffic to the line card board 1 of the network device 0; based on this, when the main control board monitors that the line card board 1 has no flow, the line card board 1 can be upgraded with software. In the software upgrading process of the line card board 1, the line card board 1 is restarted, and a new software version is operated to complete the software upgrading process. Because the traffic on the line card board 1 is migrated to the line card board 3 for forwarding, the software upgrading process of the line card board 1 does not affect the forwarding traffic in the network.
Step 304, after the software upgrade of the line card board 1 is completed, the line card board 1 registers to the standby main control board (at this time, the standby main control board completes the software upgrade), and the standby main control board re-issues the route corresponding to the line card board 1 to the neighboring network device, so that the neighboring network device re-sends the traffic to the line card board 1.
Before the line card board 1 registers to the standby main control board, because the line card board 1 has executed operations such as restart, the line card board 1 has logged out its registration on the main control board.
Specifically, after the software of the line card board 1 is upgraded, the line card board 1 sends a registration message to the standby main control board (the registration message is used for enabling the standby main control board to be responsible for carrying out route management on the line card board 1, for example, the standby main control board executes route management processes of issuing a route corresponding to the line card board 1, receiving the route from the line card board 1, establishing a route neighbor at a corresponding interface and the like); after receiving the registration message, if the line card board 1 is successfully registered, the standby main control board performs route management on the line card board 1 and issues a route corresponding to the line card board 1 to the neighboring network device, so that the neighboring network device sends traffic to the line card board 1 again.
It should be noted that, in order to ensure the correct operation of the routing protocol, in the embodiment of the present invention, since both the standby main control board and the main control board need to issue the route corresponding to the line card board, it is necessary to configure the standby main control board and the main control board to use different Router-IDs (route identifiers); based on this, the Router-ID used by the route corresponding to the line card board 1 issued by the standby main control board is different from the Router-ID used by the route corresponding to the line card board 1 issued by the main control board (the route issued before the software of the line card board 1 is upgraded).
Further, after the software of the line card board 1 is upgraded, the main control board issues a route corresponding to the line card board 3 to the network device 1, and the standby control board issues a route corresponding to the line card board 1 to the network device 1; because the standby main control board and the main control board use different Router-IDs, the network device 1 will use the main control board and the line card board 3 as a neighbor network device, and use the standby main control board and the line card board 1 as a neighbor network device. Based on the route corresponding to the line card board 1 and the route corresponding to the line card board 3, the network device 1 considers that the traffic sent to the network device 2 by itself needs to be shared and backed up between the neighboring network devices corresponding to the main control board and the line card board 3 and the neighboring network devices corresponding to the standby main control board and the line card board 1. Accordingly, the network device 1 can retransmit the traffic to the line card board 1.
After the software of the line card board 1 is upgraded, the main control board issues a route corresponding to the line card board 3 to the network device 2, and the standby main control board issues a route corresponding to the line card board 1 to the network device 2; because the standby main control board and the main control board use different Router-IDs, the network device 2 will use the main control board and the line card board 3 as a neighbor network device, and use the standby main control board and the line card board 1 as a neighbor network device. Based on the route corresponding to the line card board 1 and the route corresponding to the line card board 3, the network device 2 considers that the traffic sent to the network device 1 by itself needs to be shared and backed up between the neighboring network devices corresponding to the main control board and the line card board 3 and the neighboring network devices corresponding to the standby main control board and the line card board 1. Accordingly, the network device 2 can retransmit the traffic to the line card board 1.
In the embodiment of the present invention, after the standby main control board reissues the route corresponding to the line card board 1 to the neighboring network device, the standby main control board further needs to check the route neighbor state of the line card board 1, and when it is determined that the route neighbor state is the route synchronization completion, after waiting for a preset time, notifies the main control board to perform software upgrade on other line card boards; after receiving the notification of software upgrade to other line card boards, the main control board determines the next line card board to be subjected to software upgrade based on the upgrade sequence, and step 305 is executed.
The route synchronization completion refers to a state corresponding to a route neighbor on the cable card board 1. For example, in the BGP protocol, when the state corresponding to the routing neighbor is Established, it indicates that the routing neighbor state is the routing synchronization completion; for example, in the OSPF protocol, when the corresponding state of the routing neighbor is Full, it indicates that the routing neighbor state is routing synchronization completion. Further, when the route neighbor state is the route synchronization completion, and after waiting for a preset time (which may be selected according to an actual empirical value), it may be ensured that the neighbor network devices (such as the network device 1 and the network device 2) may already be able to send traffic to the line card board 1.
305, determining that software upgrading needs to be performed on the line card board 3 (a second line card board) currently by the main control board based on the upgrading sequence, and stopping issuing a route corresponding to the line card board 3 to the neighbor network device, so that the neighbor network device transfers the flow sent to the line card board 3 to the line card board 1 (a first line card board); when the main control board determines that no flow passes through the cable card board 3, software upgrading is performed on the cable card board 3.
Before software upgrading of the line card board 3 is needed, the main control board issues a route corresponding to the line card board 3 to the network equipment 1, the standby main control board issues a route corresponding to the line card board 1 to the network equipment 1, and the network equipment 1 confirms that the traffic sent to the network equipment 2 needs to be sent to the line card board 1 or the line card board 3 of the network equipment 0; on this basis, when the main control board determines that software upgrade needs to be performed on the line card board 3 currently, the main control board stops issuing the route corresponding to the line card board 3 to the network device 1, so that the network device 1 confirms that the traffic sent to the network device 2 needs to be sent to the line card board 1 of the network device 0, and then the network device 1 migrates the traffic sent to the line card board 3 to the line card board 1. Before software upgrading of the line card board 3 is needed, the main control board issues a route corresponding to the line card board 3 to the network equipment 2, the standby main control board issues a route corresponding to the line card board 1 to the network equipment 2, and the network equipment 2 confirms that the traffic sent to the network equipment 1 needs to be sent to the line card board 1 or the line card board 3 of the network equipment 0; on this basis, when the main control board determines that software upgrade needs to be performed on the line card board 3 currently, the main control board stops issuing a route corresponding to the line card board 3 to the network device 2, so that the network device 2 confirms that traffic sent to the network device 1 needs to be sent to the line card board 1 of the network device 0, and then the network device 2 migrates the traffic sent to the line card board 3 to the line card board 1.
Further, after stopping issuing the routes corresponding to the line card boards 3 to the network device 1 and the network device 2, neither the network device 1 nor the network device 2 will send the traffic to the line card board 3 of the network device 0; based on this, when the main control board monitors that the line card board 3 has no flow, the software of the line card board 3 can be upgraded. In the software upgrading process of the line card board 3, the line card board 3 is restarted and a new software version is run to complete the software upgrading process. Because the traffic on the line card board 3 is migrated to the line card board 1 for forwarding, the software upgrading process of the line card board 3 does not affect the forwarding traffic in the network.
Step 306, after the software upgrade of the line card board 3 is completed, the line card board 3 registers to the standby main control board (at this time, the standby main control board completes the software upgrade), and the standby main control board re-issues the route corresponding to the line card board 3 to the neighboring network device, so that the neighboring network device re-sends the traffic to the line card board 3.
Before the line card board 3 registers to the standby main control board, because the line card board 3 has executed operations such as restart, the line card board 3 has logged out its registration on the main control board.
Specifically, after the software of the line card board 3 is upgraded, the line card board 3 sends a registration message to the standby main control board (the registration message is used for enabling the standby main control board to be responsible for carrying out route management on the line card board 3, for example, the standby main control board executes route management processes of issuing a route corresponding to the line card board 3, receiving the route from the line card board 3, establishing a route neighbor at a corresponding interface and the like); after receiving the registration message, if the line card board 3 is successfully registered, the standby main control board performs route management on the line card board 3 and issues a route corresponding to the line card board 3 to the neighboring network device, so that the neighboring network device sends traffic to the line card board 3 again.
It should be noted that, in order to ensure the correct operation of the routing protocol, in the embodiment of the present invention, since both the standby main control board and the main control board need to issue the route corresponding to the line card board, it is necessary to configure the standby main control board and the main control board to use different Router-IDs; based on this, the Router-ID used by the route corresponding to the line card board 3 issued by the standby main control board is different from the Router-ID used by the route corresponding to the line card board 3 issued by the main control board (the route issued before the software of the line card board 3 is upgraded).
Further, after the software of the line card board 3 is upgraded, the standby main control board issues the route corresponding to the line card board 1 to the network device 1, and the standby main control board issues the route corresponding to the line card board 3 to the network device 1; based on the route corresponding to the line card board 1 and the route corresponding to the line card board 3, the network device 1 determines that the traffic sent to the network device 2 by itself needs to be sent to the line card board 1 and the line card board 3 of the network device 0, that is, the network device 1 sends the traffic to the line card board 3 again. Similarly, after the software of the line card board 3 is upgraded, the standby main control board issues the route corresponding to the line card board 1 to the network device 2, and the standby main control board issues the route corresponding to the line card board 3 to the network device 2; based on the route corresponding to the line card board 1 and the route corresponding to the line card board 3, the network device 2 determines that the traffic sent to the network device 1 by itself needs to be sent to the line card board 1 and the line card board 3 of the network device 0, that is, the network device 2 sends the traffic to the line card board 3 again.
In the embodiment of the present invention, after the standby main control board reissues the route corresponding to the line card board 3 to the neighboring network device, the standby main control board further needs to check the route neighbor status of the line card board 3, and when it is determined that the route neighbor status is the route synchronization completion, after waiting for a preset time, notifies the main control board to perform software upgrade on other line card boards; after receiving the notification of software upgrading to other line card boards, the main control board determines the next line card board needing software upgrading based on the upgrading sequence.
The route synchronization completion refers to a state corresponding to a route neighbor on the cable card board 3. For example, in the BGP protocol, when the state corresponding to the routing neighbor is Established, it indicates that the routing neighbor state is the routing synchronization completion; for example, in the OSPF protocol, when the state corresponding to the routing neighbor is Full, it indicates that the routing neighbor state is routing synchronization completion. Further, when the route neighbor state is the route synchronization completion, and after waiting for a preset time (which may be selected according to an actual empirical value), it may be ensured that the neighbor network devices (such as the network device 1 and the network device 2) may already be able to send traffic to the line card board 3.
Then, the main master control board determines that software upgrading needs to be carried out on the line card board 2 (the first line card board) at present based on the upgrading sequence, and stops issuing the route corresponding to the line card board 2 to the neighbor network device, so that the neighbor network device transfers the flow sent to the line card board 2 to the line card board 4 (the second line card board); and then, when the main control board determines that the line card board 2 does not pass the flow, the main control board performs software upgrade on the line card board 2. After the software upgrade of the line card board 2 is completed, the line card board 2 registers to the standby main control board (at this moment, the standby main control board completes the software upgrade), and the standby main control board redistributes the route corresponding to the line card board 2 to the neighbor network device, so that the neighbor network device sends the flow to the line card board 2 again.
Then, the main master control board determines that software upgrading needs to be carried out on the line card board 4 (the second line card board) at present based on the upgrading sequence, and stops issuing the route corresponding to the line card board 4 to the neighbor network device, so that the neighbor network device transfers the flow sent to the line card board 4 to the line card board 2 (the first line card board); and then, when the main control board determines that no flow passes through the cable card board 4, software upgrading is carried out on the cable card board 4. After the software upgrade of the line card board 4 is completed, the line card board 4 registers to the standby main control board (at this time, the standby main control board has completed the software upgrade), and the standby main control board redistributes the route corresponding to the line card board 4 to the neighbor network device, so that the neighbor network device sends the traffic to the line card board 4 again.
The process of software upgrade of the line card board 2 and the line card board 4 by the main control board is similar to the process of software upgrade of the line card board 1 and the line card board 3, and details are not repeated here.
Further, after the software upgrading process of the line card board 2 and the line card board 4 is completed, the software upgrading process of all the line card boards is completed, and then the subsequent step 307 needs to be executed.
And 307, upgrading the software of the main control board, and switching the standby main control board into the main control board.
In the software upgrading process of the original main control board, the original main control board is restarted, and a new software version is operated to complete the software upgrading process. At this time, the management work of all the line card boards is executed by the original standby main control board, so that the original main control board does not carry the work of forwarding flow, equipment management and the like, namely, the software upgrading process of the original main control board does not influence the forwarding flow in the network, and the current original standby main control board is switched to the main control board.
In summary, in the embodiment of the present invention, when performing software upgrade in an incompatible upgrade manner on a network device, and when performing software upgrade on one line card board, a neighboring network device of the network device is triggered to transfer traffic sent to the line card board to another line card board, so as to avoid loss of forwarding traffic, ensure that a service is not interrupted, and solve a problem of forwarding packet loss in a software upgrade process in an incompatible upgrade manner.
Based on the same inventive concept as the method, the embodiment of the invention also provides a network device for upgrading software in an incompatible upgrading mode, wherein the network device comprises a main control board, a standby main control board and a plurality of line card boards, at least two line card boards in the plurality of line card boards are connected with the same neighbor network device, and each link between the at least two line card boards and the neighbor network device is an equivalent link; as shown in fig. 4, the main master control board includes a determining module 11, a first processing module 12, and a software upgrading module 13; the standby main control board comprises a second processing module 14; wherein:
the determining module 11 is configured to determine an upgrading sequence of the plurality of cable-clamping boards;
the first processing module 12 is configured to, when it is determined that software upgrade needs to be performed on one of the at least two line card boards currently based on an upgrade order, stop issuing a route corresponding to the currently upgraded line card board to the neighbor network device, so that the neighbor network device migrates traffic sent to the currently upgraded line card board to another line card board of the at least two line card boards;
the software upgrading module 13 is configured to upgrade software of the currently upgraded cable-clamping board when it is determined that no flow passes through the currently upgraded cable-clamping board;
the second processing module 14 is configured to, when the upgrade of the currently upgraded cable-clamping board software is completed and the currently upgraded cable-clamping board registers to the standby main control board, reissue a route corresponding to the currently upgraded cable-clamping board to the neighboring network device, so that the neighboring network device sends a traffic to the currently upgraded cable-clamping board;
the route identifier Router-ID used by the route corresponding to the currently upgraded line card board issued by the second processing module 14 is different from the Router-ID used by the route corresponding to the currently upgraded line card board issued by the first processing module 12 before upgrading.
The first processing module 12 is further configured to notify the standby main control board to perform software upgrade before performing software upgrade on the plurality of cable card boards; after receiving the notice of software upgrading, the standby main control board upgrades the software;
the software upgrading module 13 is further configured to upgrade software of the main control board after the plurality of cable card boards are upgraded, and the standby main control board is switched to the main control board.
The determining module 11 is specifically configured to determine an upgrading sequence of the plurality of line card boards according to a preconfigured line card board upgrading sequence, and only one line card board is subjected to software upgrading in each software upgrading process; or, determining the upgrading sequence of the plurality of line card boards according to the sequence of the line card board identifications from small to large, and only performing software upgrading on one line card board in each software upgrading process; or, determining the upgrading sequence of the plurality of line card boards according to the sequence of the line card board identifications from large to small, and only performing software upgrading on one line card board in each software upgrading process.
The second processing module 14 is specifically configured to receive a registration message sent by the currently upgraded line card board to the standby main control board, where the registration message is used to enable the standby main control board to be responsible for performing routing management on the currently upgraded line card board; after receiving the registration message, if the currently upgraded line card board is successfully registered, performing routing management on the currently upgraded line card board, and reissuing a route corresponding to the currently upgraded line card board to the neighbor network device.
The second processing module 14 is further configured to check a route neighbor state of the currently upgraded line card board after reissuing the route corresponding to the currently upgraded line card board to the neighbor network device, and notify the main control board to perform software upgrade on other line card boards after waiting for a preset time when determining that the route neighbor state is the route synchronization completion; after receiving the notification of software upgrading to other line card boards, the main control board determines the next line card board needing software upgrading based on the upgrading sequence.
The modules of the device can be integrated into a whole or can be separately deployed. The modules can be combined into one module, and can also be further split into a plurality of sub-modules.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present invention may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
Those skilled in the art will appreciate that the drawings are merely schematic representations of one preferred embodiment and that the blocks or flow diagrams in the drawings are not necessarily required to practice the present invention.
Those skilled in the art will appreciate that the modules in the devices in the embodiments may be distributed in the devices in the embodiments according to the description of the embodiments, and may be correspondingly changed in one or more devices different from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The above disclosure is only for a few specific embodiments of the present invention, but the present invention is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present invention.