The detection of hot plug and processing method
Affiliated technical field
The invention belongs to computer network communication field, be specifically related to a kind of hot plug detection and processing method towards high-end switch.
Background technology
In switch work, may be owing to reasons such as module failures, the user wishes under switch is not delayed the situation of machine, carries out the heat of module and inserts or hot drawing.On the one hand, the detection of hot plug and processing do not influence other modules, do not have influence on the normal forwarding of Business Stream; On the other hand, the user extract modules configured information deleted after, when inserting once more, this modules configured information in the time of can recovering to extract.Be the operation of extracting other modules of the system of not influencing of module, and system to reflect really that this module does not exist; When the user inserted this module once more, this modules configured information can be recovered, and after the insertion, the user need not to intervene, and module just can be as not extracting operate as normal (forwarding).
At present, the switch that has is not supported hot plug, and perhaps after carrying out hot plug, whole system must restart, and promptly needs the machine of delaying, and can not allow the unremitting work of system; The hot plug mechanism that also has can not be accomplished the recovery fully of configuration information.
Summary of the invention
The present invention overcomes the deficiency of the processing method of above-mentioned hot plug, provides a kind of under switch is not delayed the situation of machine, can arbitrarily replace or the hot plug detection and the processing method of mobile module.
Technology contents of the present invention: a kind of detection of hot drawing and processing method comprise:
(1) detects interruption when master control borad, when finding to have module to be pulled out, or when the equipment state machine normally moves, during the overtime status report message of not receiving module, carry out the processing of hot drawing by the equipment state machine.
(2) from global configuration information, extract the configuration information relevant with this module, preserve in the global configuration information and the related command of module;
(3) data link layer, IP route layer, each processing module deletion of QoS configuration information relevant with this module, and back up accordingly;
(4) remove the state information of this module.
Detection and processing method that a kind of heat is inserted comprise:
(1) when the equipment state machine normally moves, receive the register requirement message of new module, carry out the processing that heat is inserted;
(2) data link layer, IP route layer, each processing module of QOS issue the configuration relevant with this module;
(3) hold-over command of execution global configuration information is recovered the relevant configuration information of this module.
Current NETDEV data structure on the master control borad is synchronized to this module, on this module, recovers hardware setting according to the NETDEV tables of data;
The processing of data link layer comprises in the step (3) that hot drawing is handled:
A, after module is extracted, at first each port on the module all produces a NETDEV_DOWN incident, removes multidate information by this incident;
B, execution and the opposite order of preservation message command effect are removed relevant configuration information, and produce the corresponding apparatus notification event in the fill order processes;
The contents in table of each port correspondence in c, the deletion NETDEV table and in the module, and produce the NETDEV_UNREGISTER incident.
The processing of IP route layer comprises in the step (3) that hot drawing is handled: the port NETDEV_DOWN incident of module is by notice chain function notice routing module, and routing module re-routes and calculates, and deletes corresponding route table items.
The processing of each processing module of QoS comprises in the step (3) that hot drawing is handled: by all relevant QOS and ACL configuration software information on the call back function removing module interface of registration hot plug processing.
The processing that heat is inserted data link layer in the step of handling (2) comprises: the current NETDEV data structure on the master control borad is issued to this module, and module is recovered hardware setting according to the NETDEV tables of data.
The processing that heat is inserted IP route layer in the step of handling (2) comprises: fib table all is issued to this module.
The processing that heat is inserted each processing module of QoS in the step of handling (2) comprises: recover relevant configuration by the CALLBACK function.
Technique effect of the present invention: the present invention under switch is not delayed the situation of machine by interrupting and the status report message of equipment state machine detects the triggering hot plug, in the time of the hot drawing module, do not influence under the state of normal forwarding of Business Stream, data link layer, IP route layer and each processing module of QOS are deleted this modules configured information respectively and are backed up; When heat is inserted module, the configuration information that this module recovery is relevant.But operate as normal still after module is handled through hot plug, under the situation of not closing switch, the user can arbitrarily replace or mobile module, is convenient to installation, debugging and fault detect, make that the switch product is more competitive, realized " plug and play " of switch.And detection for hot drawing, use two kinds of mechanism: interrupt (the hard detection) and status report message (soft detection), do not receive the message of module when master control borad a period of time after, both can think that this module extracted, can think that also fault has taken place this module, so the detection of hot drawing also has the function of a fault detect.
Description of drawings
Fig. 1 is the process chart of hot drawing of the present invention;
Fig. 2 is the process chart that the present invention's heat is inserted.
Embodiment
For the detection of hot drawing, use two kinds of mechanism: interrupt (the hard detection) and status report message (soft detection); The processing that heat is inserted only is the registration triggering by business module, interrupts not triggering heat and inserts processing procedure.It all is to carry out at a new task space that all hot plugs are handled, and the priority of the task that this is new is equal to the priority of equipment state machine task; When hot plug is finished dealing with, this task withdraws from automatically.
The detection of hot drawing and processing mainly are the deletion of configuration information and the extraction backup of configuration information.As user's physics extract a module time, master control borad detects interruption, when finding to have module to be pulled out by equipment state machine (master control borad a period of time is not received the other side's heartbeat message), detecting that module inside this interrupts is pulled out, slot number according to module, check the running status of module, if the current running status of this module less than MODULE_MOD_READY, is not then carried out the processing of hot plug; Otherwise, then carry out the processing of hot plug; When ACTIVE MASTER (interruption) does not receive the status report message of certain business module for a long time, if this module current running status be not less than MODULE_MOD_READY, then carry out the processing of hot drawing.
With reference to figure 1, the processing of hot drawing comprises: (1) is from global configuration information (SHOW RUN), extract the configuration information relevant with this module, at first form and be pulled out the command block that plate is associated, to each command block structural feature keyword, search out the configuration information that comprises the corresponding command piece, and preserve in the global configuration information and the related command of module.(2) after module is extracted, at first all produce a NETDEV_DOWN incident for each port on the module, remove multidate information by the DOWN incident, secondly, the order of preserving is the configuration that is used for inserting at interface board back restoration interface plate, so after interface board is extracted, as long as carry out the order opposite with these order effects, just can remove the configuration information relevant, and in the fill order process, produce the corresponding apparatus notification event with extracting veneer; After finishing relevant configuration and removing, the contents in table of each port correspondence in the deletion NETDEV table and in the interface board, and produce the NETDEV_UNREGISTER incident.The most crucial task of L3 layer module is to handle the variation of routing table and ARP table during hot drawing.After professional version was extracted, the port DOWN incident of interface board was by notice chain function notice routing module, and routing module can re-route calculating, deletes corresponding route table items.This process can be handled and can reasonablely be connected with the hot drawing of L2 by the notice chain function that routing module is registered, so does not need special processing on the flow process.For the ARP table, after plank was extracted, the ARP table of learning from this plate had kept necessity, should aging deletion from system immediately.Delete all relevant QOS and ACL configuration software information by the call back function that the registration hot plug is handled.
(3) remove the context information of this module.
(4) to be died by the withdrawing pattern piece in order preventing, can to carry out this module and once restart.
Detection and processing that heat is inserted mainly are to realize the recovery of configuration information by issuing the software list item again.When new business board injected, it will send the register requirement message to master control borad, and ACTIVE MASTER (interruption) sends to this business module and replys, and the tagging position is that heat is inserted.Interface board begins to carry out synchronously with master control borad after receiving the registration response message, after a veneer inserts, current NETDEV data structure on the master control borad (not comprising the configuration relevant with extracting veneer of having preserved) need be synchronized to this interface board, and in hardware, dispose accordingly according to these software list items.With reference to figure 2, order is done following processing:
(1) create port and default VLAN, the operation of carrying out during with system start-up is the same substantially;
(2) the synchronous NETDEV tables of data of master control borad is to the interface board that inserts, send data after, master control borad waits for that interface board finishes hardware configuration;
(3) interface board carries out the relevant hardware setting according to this tables of data after the NETDEV tables of data, after interface board is finished hardware setting, sends the message informing master control borad;
(4) master control borad competitive list board type judges whether to be configured recovery;
(5) master control borad extracts and carries out the configuration order piece of preserving, and the interface board that inserts is configured.
(6) after master control borad is finished the configuration of interface board, open each port of interface board, make the interface board of insertion can carry out the business forwarding;
The most crucial task of L3 module was to handle the variation of routing table and ARP table when heat was inserted.
Professional version for new insertion need all be issued to this module with fib table, and the route that inserting rear port UP in addition increases also will issue in the lump.QOS and ACL module can realize recovering by registering the slotting CALL_BACK function of heat.
Simultaneously during insertion system, heat is inserted and handled is serial as a plurality of modules; Processing procedure for each module is the same.