Background technology
In communication network, in order to guarantee the high-end devices reliability of operation, usually all there are two control boards in each system, one for being in the main main control board of using with state, provide management and controlled function to system equipment, and Ethernet interface with the webmaster main-machine communication is provided, other one is standby control board, is in the wait state of not enabling.When the master breaks down with control board or needs upgrading, can carry out switching of two control boards by automatic or manual, be that original master reduces to standby control board with control board, standby control board originally is upgraded to lead with control board and replace original master provides management and controlled function with control board to system equipment, and Ethernet interface with the webmaster main-machine communication is provided, this process is called masterslave switchover.
(Media Access Control, MAC) address is the ethernet data link layer address in medium access control.When an equipment sends to another equipment that is positioned at same local area network (LAN) to ethernet data frame, be to determine the purpose interface according to target MAC (Media Access Control) address wherein.Each piece control board all has been set up globally unique MAC Address when dispatching from the factory, this MAC Address be kept at control board static memory (Static Random Access Memory, SRAM) in.On the equipment that moves in network, every control board all has oneself in the unique MAC Address of the whole network, otherwise the MAC Address conflict can take place.
In the masterslave switchover process, prior art has two kinds of methods of handling MAC Address:
1, the nonsynchronous method of MAC Address
In the masterslave switchover process, the master is asynchronous with control board and standby control board MAC Address.Data sync is meant main and uses in the control board running, and its service data is extracted, and is sent to standby control board and generates respective data structures at standby control board by synchronization module.MAC Address when the master shows that with control board is asynchronous with standby control board MAC Address two each self-sustainings of control board self are dispatched from the factory.
Behind the masterslave switchover, because the MAC Address that the webmaster main frame is learnt is the former main control board of using, but former master does not externally provide function and interface with control board, and new master uses the MAC Address of control board different with former main MAC Address with control board, so new master is interrupted with control board and the data communication that is in the webmaster main frame of the same network segment.This need outwards send address resolution protocol (Address Resolution Protocol with control board by new master, ARP) packet, the mapping relations of MAC Address and IP address in the renewal ARP high-speed buffer, new master relearns the connection that MAC Address could be recovered the webmaster maintenance channel with control board and webmaster main frame.In this course, the obstructed meeting of webmaster maintenance channel causes the interruption of the cluster management passage of webmaster, also may cause network management system can't receive the warning information that the equipment of generation masterslave switchover reports, cause losing even the interruption of out-of-band communication of network management information, have influence on the continuity of equipment operation.
2, the synchronous method of MAC Address
In the masterslave switchover process, main MAC Address with control board and standby control board is synchronous.As shown in Figure 1, in the masterslave switchover process, main MAC Address with control board is extracted from SRAM, is sent to standby control board by synchronization module, with synchronous MAC Address be kept among the SRAM of standby control board and cover the original MAC Address of standby control board.
Behind masterslave switchover, because the MAC Address of equipment do not change, so the webmaster maintenance channel can not interrupt, and need not to carry out the renewal of ARP high-speed buffer after switching yet.But, suppose that device A is arranged, B, be moved on the equipment B as main when using control board when main on the device A with any control board in control board or the standby control board, because MAC Address is synchronously and is saved among the SRAM, device A has identical MAC Address with equipment B so, and this can cause the conflict of both MAC Address.If the control board of device A and equipment B all flows, will cause the conflict once more of MAC Address.
Summary of the invention
In view of this, the present invention is in order to overcome above-mentioned shortcoming, proposed a kind of in masterslave switchover the method for treatment media accessing to control address, its purpose is to guarantee the unimpeded of webmaster maintenance channel, and reduces the possibility of MAC Address conflict in the network.
For achieving the above object, the present invention proposes a kind of in the masterslave switchover process method of treatment media access control MAC addresses, this method may further comprise the steps:
A. when the master starts as current operation control board with control board, with this main current C urrent MAC Address of using control board with the default Default MAC Address of control board as this master, and with this Current MAC Address as external MAC Address, communicate with the network equipment;
B. behind masterslave switchover, standby control board is as current operation control board, and with the Current MAC Address of described main Current MAC Address with control board as this standby control board, and as external MAC Address, communicate with the network equipment.
When being standby control board initialization, the MAC Address of Current described in the step B obtains by main synchronously Current MAC Address of preserving automatically with control board.
In leading, a memory space is set respectively in advance, preserves the Current MAC Address of its use in service respectively with the memory of control board and standby control board.
Described main memory with control board is this main volatile storage medium with control board.
The memory of described standby control board is the volatile storage medium of this standby control board.
Described master is the internal memory of this control board with the volatile storage medium of control board or standby control board.
Technique scheme further comprises: after the master is with control board or the outage of standby control board, eliminate the above Current MAC Address of this control board.
From such scheme as can be seen, because the present invention is provided with a memory space that is used to store the Current MAC Address respectively on leading with control board and standby control board, and use the Current MAC Address of control board as external MAC Address with current master, keep the identical Default MAC Address that all is main with control board of main Current MAC with control board and standby control board, and in the masterslave switchover process, keep former standby control board Current MAC Address constant, therefore the present invention has kept the consistency of the external MAC Address of equipment before and after the masterslave switchover process, thereby has guaranteed the unimpeded of webmaster maintenance channel.Because main Current MAC Address with control board is identical with its Default MAC Address,, reduced the possibility that the MAC Address conflict takes place so after control board was transferred to miscellaneous equipment, the Current MAC Address of each equipment all was globally unique.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in more detail by the following examples.
Core concept of the present invention is: when the master starts as current operation control board with control board, use default (Default) MAC Address of control board as current (Current) MAC Address this master, and with this Current MAC Address as external MAC Address, communicate with the network equipment; Behind masterslave switchover, standby control board is as current operation control board, and with described Current MAC Address as external MAC Address, communicate with the network equipment.
And the present invention is provided with a memory space respectively in leading with the memory of control board and standby control board, be used to store the Current MAC Address, and this memory space can be non-volatile memory medium or volatile storage medium.The Default MAC that the present invention also will lead with control board and standby control board is kept in the non-volatile memory medium.Whether therefore, no matter lead with control board and standby control board and start or power down, the Default MAC of himself storage is constant.When standby control board starts, need be main synchronously automatically with control board Current MAC Address, the Current MAC Address of standby like this control board is identical with the Current MAC Address of control board with the master.After this, in the masterslave switchover process, standby control board just can communicate with the network equipment with the main described Current MAC Address of using veneer as external MAC Address as current operation control board.
Elaborate technical scheme of the present invention below in conjunction with Fig. 2 and Fig. 3 specific embodiment.
As shown in Figure 2, the flow process of the specific embodiment of realization the inventive method is as follows:
Step 201: in leading, two memory spaces are set respectively, are respectively applied for storage Current MAC Address and Default MAC with control board and standby control board.
As shown in Figure 3, main control board 31 and the standby control board 35 used arranged on the system equipment of present embodiment.The master comprises a SRAM 32 and first memory space 34 at least with control board 31, wherein, the one SRAM32 is used to preserve the main Default MAC Address that writes with control board when dispatching from the factory, first memory space 34, the Current MAC Address of using when being used to preserve this control board operation.Equally, at least comprise the 2nd SRAM 36 and second memory space 38 in the memory of standby control board 35, wherein, the 2nd SRAM36 is used to preserve the Default MAC Address that standby control board writes when dispatching from the factory, and second memory space 38 is used to preserve the Current MAC Address of standby control board.
And a SRAM 32 and the 2nd SRAM 36 are non-volatile memory medium, and first memory space 34 and second memory space 38 can be non-volatile memory medium or volatile storage medium.Here, non-volatile memory medium can be flash memory (Flash Memory), electrically-erasable memory (Electrically Erasable Programmable ROM, EEPROM), non-volatile ram (Non-Volatile Random Access Memory, NVRAM), Nonvolatile sram etc.Volatile storage medium can be internal memory, volatibility SRAM etc.
Therefore, under initial condition, main with control board a SRAM 32 and the 2nd SRAM 36 of standby control board in preserved its corresponding Default MAC Address.
Step 202: when the master switches on initialization with control board, the Default MAC Address that is kept among the SRAM 32 is write first memory space 34 as the Current MAC Address, and when operation with this Current MAC Address as external MAC Address, communicate with the network equipment.
The purpose of this step is externally to use as the Current MAC Address with the Default MAC Address of control board main, can guarantee that like this Current MAC Address has the whole network uniqueness, avoids the conflict of MAC Address.Therefore, after this step that is finished, main identical with the MAC Address of first memory space, 34 preservations with a SRAM 32 in the control board.
Step 203: when standby control board is switched on initialization, main synchronously automatically with control board Current MAC Address.
Before the energising initialization, preserved the Default MAC Address that writes when dispatching from the factory in the standby control board, the Default MAC Address is kept in the non-volatile memory medium, but when standby control board energising initialization, do not need the Default MAC Address of self preserving, and the CurrentMAC address synchronization that will lead with control board stores in second memory space 38 of standby control board into.So, the Current MAC Address of standby control board is consistent with main Current MAC Address with control board, and is promptly all identical with main Default MAC Address with control board, is that the whole network is unique.
Step 204: in the masterslave switchover process, keep in the standby control board Current MAC Address in second memory space 38 constant.
Step 205: behind the masterslave switchover, standby control board as external MAC Address, carries out data communication with the network equipment with the Current MAC Address as current operation veneer.
Here, main out of service because standby control board is as current operation veneer with control board, use control board so this standby control board can be called new leading, will lead with control board and be called new standby control board.
Behind masterslave switchover, if new standby control board resets or power-down rebooting after, new standby control board will new synchronously main Current MAC Address with control board, the Current MAC Address that is about in second memory space 38 is synchronized in first memory space 34.Like this, first memory space 34 is still identical with Current MAC Address in second memory space 38, all is the Default MAC Address among the SRAM, has kept the consistency of the external MAC Address of system equipment.
To sum up, before and after the masterslave switchover, separately Default MAC Address is constant among a SRAM 32 and the 2nd SRAM 36; Current MAC Address in second memory space 38 is constant, and the Current MAC Address final and in second memory space 38 of the Current address in first memory space 34 is identical.
Therefore, because when carrying out data communication at present, with the new main control board of using, the Current MAC Address that is former standby control board is carried out transfer of data as external MAC Address, and the Current MAC Address of former standby control board is identical with former main Current MAC Address with control board, therefore, has guaranteed that the external MAC Address in masterslave switchover front and back does not change, thereby need not the master and relearn MAC Address, kept the unimpeded of webmaster maintenance channel with control board and opposite equip..
And, when the environment for use of control board in the system changes, as main be moved with control board or standby control board after, the Current MAC Address of preserving in its internal memory or other volatile storage medium can be lost automatically, when they are powered on once more, to be written into content corresponding as step 202 or 203 descriptions, and promptly can be written into self Default MAC Address with control board, and can be write corresponding main Current MAC Address synchronously with control board as standby control board as main.If main Current MAC Address with control board or standby control board is to be stored in the non-volatile memory medium, Currant MAC Address in this control board can not lost automatically, when this control board powers on again, the memory space that is used for preserving the Current MAC Address can be write content corresponding, its process such as step 202 and 203 descriptions again.Anyway, be kept at the master and can not lose and change with the Default MAC Address in control board or the standby control board non-volatile memory medium.Different with prior art 2, suppose device A is arranged, B, if after on the device A masterslave switchover taking place, wherein any control board is moved to equipment B as the main control board of using, because the Default MAC Address that will lead in step 202 with control board writes the memory space that is used to store the Current MAC Address, the Current MAC Address is each autonomous Default MAC Address with control board in device A and the equipment B, and main Default MAC Address with control board is the globally unique MAC Address of setting when dispatching from the factory, therefore the CurrentMAC address of device A and equipment B can be not identical, can not cause the problem of MAC Address conflict.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.