Specific embodiment
With reference to the accompanying drawings and examples, specific embodiment of the invention is further described.Following examples are only
For clearly illustrating technical scheme, and can not be limited the scope of the invention with this.
First, several embodiments on the inventive method:
First embodiment:
As shown in figure 1, this invention describes a kind of method of interchanger static management address in smart allocation LAN, its
It is characterised by, the described method comprises the following steps:
S1, acquisition design interchanger list, including the data import system that expected design will be met;Its effect is to meet
The data such as the network address of expected design imported into system;
Unduplicated temporary network address list is obtained, including unduplicated temporary network address is imported into system;Its
Effect is introduced into unduplicated temporary network address to system, so as to when elimination planned network address is taken by other interchangers
Need to use unduplicated temporary network address.
Actual switch list and related data are obtained, is specifically included by capturing LLDP data messages technical limit spacing and master
The management MAC Address of machine neighboring switch and the actual management network address, and also include by the actual network address of interchanger
Obtain the actual neighbors interchanger list information of interchanger, the list information of the actual neighbors interchanger include neighbor switch with
The interface corresponding relation of the interchanger, the MAC Address and actual network address of whole neighbor switch;Its effect is to obtain actual
Actual network address, neighbouring relations, the MAC Address of interchanger, the actual annexation of interface of the interchanger of presence etc..
Whether there is recurrent network address in the acquired actual switch list information of S2, judgement, if then entering step
Rapid S3, otherwise skips to step S4;
S3, by repeat the network address be set to unduplicated temporary network address, and return to step S1;
Whether S4, inspection actual switch planned network address are taken by other actual switch;Its effect is to prevent
When interchanger is set for planned network address, there is the phenomenon repeated with the actual network address of other interchangers;Realize technology
It is varied;For example, judged by checking the actual network address of all interchangers recorded in actual switch list,
The interchanger of whole network can be accessed by using the planned network address, different feedbacks are checked whether;Can also lead to
Cross and the planned network address is set to be the interim unduplicated network address have determining whether also other actual switch
The planned network address etc..
S5, it is configuration successful by all actual network address and planned network address identical switch configuration;
S6, selection not yet configuration successful and planned network address is not by the interchanger of the actual occupancy of other interchangers;
S7, it is the network address for meeting expected design by the switch configuration;
S8, judge whether the interchanger is successfully set to meet the network address of expected design, if it succeeds, into step
Rapid S9, otherwise return to step S1;Because if being not provided with successfully, then it can be assumed that the actual switch data change,
Therefore need to reacquire actual switch data.
S9, the interchanger is set for configuration successful;Its effect is that the network address for indicating the actual switch has met
Expected design.
S10, judge whether actual network address is temporary network address, temporary network address then enters step S11 in this way,
Otherwise skip to step S12;
S11, the unduplicated temporary network address of recovery, and enter step S12;Its effect is to avoid temporary network address not
Enough or wasting phenomenon.
S12, judge whether also qualified interchanger:Whether there are not yet configuration successful and planned network ground
Location is not by the interchanger of the actual occupancy of other interchangers;If then return to step S6, otherwise into step S13;
S13, judge whether all actual switch are each configured to work(, as being each configured to work(if skip to step S16, otherwise enter
Enter step S14;Its effect is that the actual network address for determining whether all of actual switch meets expected design;Specifically make
Claim of the invention is not influenceed with for which kind of technology.
The characteristic that S14, the elimination switch design network address are taken by other interchangers, including by once or repeatedly
Switch configuration by the planned network address that actual network address is other interchangers is the interim unduplicated network address;Its
Effect is to avoid the actual network address when being the network address for meeting expected design by switch configuration with other interchangers
Repeat in a local network.Multiple technologies means can be specifically used, for example:By once or repeatedly by real network ground
Location is that the switch configuration of the planned network address of other interchangers is interim unduplicated network address etc..
S15, judge eliminate whether succeed, the return to step S4 if eliminating successfully, otherwise return to step S1;
S16, all interchangers of whole LAN possess the network address for meeting expected design, and method terminates.
Second embodiment:
The characteristics of second embodiment is to be set to the network address of all actual switch in LAN not weigh first
The multiple network address, then corresponding switch configuration is meet expected design quiet by the planned network address according to interchanger
The state network address.
When being planned network address by switch configuration, first by actual network address and planned network address identical
Configuration successful is set to, then selection is not configured to the planned network address of work(and the interchanger not by other actual exchanges
The interchanger that machine takes, is the network address for meeting expected design by the switch configuration, until in actual switch list
The interchanger for meeting the condition is not found;Then check whether in actual switch list whether is all of actual switch again
It is each configured to meet the network address of expected design;If there is the interchanger for being not configured as meeting the expected design network address,
Selection wherein any one interchanger is then needed, its actual network address is set to unduplicated temporary network address;Then
Reselection " is not configured to the interchanger that the planned network address of work(and the interchanger is not taken by other actual switch ",
Once find the network address that it is set to meet expected design;Until all actual switch are disposed as meeting design in advance
The network address of phase;Assume that all remote operations for interchanger can succeed in this process, if any setting is handed over
The remote operation failure changed planes, then must reacquire actual switch list.
As shown in Fig. 2 second embodiment is comprised the following steps:
S1, acquisition design interchanger list, its effect is the design data of the interchanger required for the present invention, including but
It is not limited to the network address, neighborhood etc..
S2, the unduplicated temporary network address list of acquisition, its effect is for the present invention is needed some real network
Address is set to provide interim not recurrent network address during the unduplicated network address, all of network address in the list
Do not repeated with planned network address.
S3, acquisition actual switch list and related data, its effect are the exchange datas according to acquisition reality, including
But it is not limited to the neighborhood in actual network address, network between actual switch, interchanger actual physical address (MAC ground
Location), interface relationship etc..It is directed to for actual switch in the mentioned method of whole invention, it is therefore necessary to obtain actual friendship
The data of list and the correlation of changing planes;
S4, there is recurrent network addressIts effect be judge acquired in actual switch list in whether have the net of repetition
Network address, if it has, being then transferred to step S5, is otherwise transferred to step S6;
S5, recurrent network address is set to the interim unduplicated network address;Its effect is by weight in actual switch
Multiple actual network address is set to unduplicated temporary network address, so as to avoid cannot precisely being accessed during recurrent network address
Certain interchanger, reaches the unique technical requirements of network address the whole network.
Above step S3 to S5, goes to the spy that all of actual switch list is respectively provided with not recurrent network address always
Untill levying.
S6, DesignedNetAddressFlag==false is selected, FactNetAddress==
The interchanger of DesignedNetAddress;Its effect is that the actual friendship for meeting expected design is searched in actual switch list
Change planes.
S7, whether findIts effect is to determine whether to be found in actual switch list to meet expected design network ground
The interchanger of location;If it is found, then entering step S8;Otherwise illustrate to meet design by all in actual switch list
The switch configuration of anticipation network address is configuration successful, into step S9;
S8, set the interchanger DesignedNetAddressFlag be true;Its effect is to have indicated the interchanger
It is configured successfully, i.e. the actual network address of the interchanger is to meet the network address of expected design, without being configured.
Whether the DesignedNetAddress of interchanger is accounted for by other interchangers in S9, inspection actual switch list
With;If taken by other interchangers, it is set to occupied;It is otherwise provided as unoccupied;Its effect is detection design network
Whether shared by other interchangers, that is, whether the planned network address for detecting some interchanger is actual switch row for address
The actual network address of other interchangers in table, the detection design network address takes characteristic by other interchangers, if by other
Interchanger takes, then just have " planned network address takes characteristic by other interchangers ", to eliminate " planned network address quilt
Other interchangers take characteristic " foundation is provided.It is transferred to step S10;
S10, selection DesignedNetAddressFlag==false and the planned network from actual switch list
Address is not taken by other interchangers, and FactNetAddress!The interchanger of=DesignedNetAddress;Its effect
It is to ensure to be set to actual network address after planned network address, is not in the net of repetition in actual switch list
Network address.
S11, whether findIts effect is to determine whether there is directly to be set to meet design in advance by actual network address
The actual switch of the network address of phase;If it is found, being transferred to step S12;Otherwise it is transferred to step S18;If do not found, say
In bright actual switch list currently without directly actual network address being set to meet the expected design network address and
The unduplicated interchanger of actual network address of actual switch in network will not be caused.
S12, the planned network address for obtaining the interchanger, it is assumed that be DesignedNetAddress;Its effect is for this
Interchanger provides the network address for meeting expected design;
S13, the network address of the interchanger is set to DesignedNetAddress, and recorded interchanger;
Its effect is the network address that the actual network address of interchanger is set to meet expected design, recorded the work in interchanger
Reflect the actual network address of interchanger with being.If the step performs failure, illustrate that the interchanger has changed reality
The network address, then return to step S3;If run succeeded, step S14 is transferred to;
S14, FactNetAddress==TempNetAddressIts effect is to judge that the interchanger is being arranged to symbol
Whether the actual network address closed before the expected design network address is temporary network address, if it does, must just reclaim
Temporary network address, it is to avoid temporary network address is deactivated occupancy.If FactNetAddress==TempNetAddress,
Then it is transferred to step S15;Otherwise it is transferred to step S16;
S15, the usedFlag of the temporary network address is set to false;If the interchanger is being arranged to meet
Actual network address before the expected design network address is if temporary network address, to reclaim the temporary network address;The step
Rapid effect is to reclaim temporary network address, it is to avoid interim not recurrent network address is deactivated occupancy.It is transferred to step S16;
S16, set the interchanger DesignedNetAddressFlag be true;The interchanger is indicated in its effect
The network address is already set as meeting the network address of expected design and the whole network is unique;Step S10 is transferred to, is continued to search for
The exchange of " actual network address is different from planned network address and planned network address is not taken by other actual switch "
Machine.
S17, judge whether that all interchangers are disposed as meeting the network address of expected design;It is step that its effect is
S18 provides judgment basis.It is transferred to step S18;
S18, the interchanger for whether not meeting the expected design network address alsoIts effect is determined whether to complete global field
The actual network address of all actual switch is the network address for meeting expected design in net, if all interchangers are all provided with
The network address for meeting expected design is set to, step S24 is transferred to;Otherwise it is transferred to step S19;
S19, select any one DesignedNetAddress==false and DesignedNetAddress is by it
The interchanger that his interchanger takes;Its effect is to provide actual to eliminate " planned network address takes characteristic by other interchangers "
Exchange data, including but not limited to actual network address, interchanger actual association relation, actual interface relation etc.;
S20, one temporary network address of selection from unduplicated temporary network address list, it is assumed that be
TempNetAddress;Its effect is to provide unduplicated facing to eliminate " planned network address takes characteristic by other interchangers "
When the network address, with avoid eliminate the characteristic after occur actual network address repeat characteristic, reach change interchanger reality
Its actual network address still has the unique characteristic of the whole network after the network address;
S21, TempNetAddress exist in actual switch listIts effect is to avoid selection unduplicated interim
Selected temporary network address is repeated with the actual network address in actual switch list during the network address;If
TempNetAddress exists in actual switch list, then be transferred to step S20 and continue to select unduplicated casual network ground
Location;Otherwise it is transferred to step S22;
S22, setting temporary network address usedFlag=True;Its effect is to indicate the unduplicated temporary network address
Actually taken, the unduplicated casual network ground for actually being taken can not be selected when unduplicated temporary network address is needed
Location.
S23, to set the interchanger be the interim network address TempNetAddress not conflicted;The network address is recorded to arrive
In the interchanger, the actual network address as the interchanger;Its effect is to be set to the actual network address of the interchanger
Unduplicated temporary network address, and change the actual network address of the actual switch in actual switch list and be
TempNetAddress, with the actual network address of actual reflection actual switch;
When it is the network address TempNetAddress not conflicted to set interchanger temporarily, if setup failed, say
The actual network address of the bright actual switch there occurs change, it is necessary to be transferred to the reality that step S3 reacquires actual switch
Border relevant information;Set successfully, then need to record the network address in the interchanger, the real network ground as the interchanger
Location, with the actual network address of actual reflection actual switch;
If configured to work(, is transferred to step S9;
S24, all interchangers possess the network address for meeting expected design, and configuration terminates.
3rd embodiment:
The 3rd embodiment is with the difference of second embodiment:
(1) step S9 is mentioned between step S4 and step S6, if the real network that is, step S4 the whole networks are not repeated
After address, the second embodiment is to be transferred to step S6, and the 3rd embodiment is to be transferred to step S9;
(2) second embodiments do not find the actual network address situation consistent with planned network address and turn in step S7
Enter to step S9, this third embodiment is directly transferred to step S10 in this case;
Step S10 is directly transferred to after the step of (3) the second embodiment S9, S9 is direct the step of this three embodiment
It is transferred to step S6;
As shown in figure 3,3rd embodiment is comprised the following steps:
S1, acquisition design interchanger list, its effect is the design data of the interchanger required for the present invention, including but
It is not limited to the network address, neighborhood etc..
S2, the unduplicated temporary network address list of acquisition, its effect is for the present invention is needed some real network
Address is set to provide interim not recurrent network address during the unduplicated network address, all of network address in the list
Do not repeated with planned network address.
S3, acquisition actual switch list and related data, its effect are the exchange datas according to acquisition reality, including
But it is not limited to the neighborhood in actual network address, network between actual switch, interchanger actual physical address (MAC ground
Location), interface relationship etc..It is directed to for actual switch in the mentioned method of whole invention, it is therefore necessary to obtain actual friendship
The data of list and the correlation of changing planes;
S4, there is recurrent network addressIts effect be judge acquired in actual switch list in whether have the net of repetition
Network address, if it has, being then transferred to step S5, is otherwise transferred to step S9;
S5, recurrent network address is set to the interim unduplicated network address;Its effect is by weight in actual switch
Multiple actual network address is set to unduplicated temporary network address, so as to avoid cannot precisely being accessed during recurrent network address
Certain interchanger, reaches the unique technical requirements of network address the whole network.
Above step S3 to step S5, goes to all of actual switch list and is respectively provided with not recurrent network address always
Feature untill.
S6, DesignedNetAddressFlag==false is selected, FactNetAddress==
The interchanger of DesignedNetAddress;Its effect is that the actual friendship for meeting expected design is searched in actual switch list
Change planes.
S7, whether findIts effect is to determine whether to be found in actual switch list to meet expected design network ground
The interchanger of location;If it is found, then entering step S8;Otherwise illustrate to meet design by all in actual switch list
The switch configuration of anticipation network address is configuration successful, into step S10;
S8, set the interchanger DesignedNetAddressFlag be true;Its effect is to have indicated the interchanger
It is configured successfully, i.e. the actual network address of the interchanger is to meet the network address of expected design, without being configured.
Whether the DesignedNetAddress of interchanger is accounted for by other interchangers in S9, inspection actual switch list
With;If taken by other interchangers, it is set to occupied;It is otherwise provided as unoccupied;Its effect is detection design network
Whether shared by other interchangers, that is, whether the planned network address for detecting some interchanger is actual switch row for address
The actual network address of other interchangers in table, the detection design network address takes characteristic by other interchangers, if by other
Interchanger takes, then just have " planned network address takes characteristic by other interchangers ", to eliminate " planned network address quilt
Other interchangers take characteristic " foundation is provided.It is transferred to step S6;
S10, selection DesignedNetAddressFlag==false and the planned network from actual switch list
Address is not taken by other interchangers, and FactNetAddress!The interchanger of=DesignedNetAddress;Its effect
It is to ensure to be set to actual network address after planned network address, is not in the net of repetition in actual switch list
Network address.
S11, whether findIts effect is to determine whether there is directly to be set to meet design in advance by actual network address
The actual switch of the network address of phase;If it is found, being transferred to step S12;Otherwise it is transferred to step S18;If do not found, say
In bright actual switch list currently without directly actual network address being set to meet the expected design network address and
The unduplicated interchanger of actual network address of actual switch in network will not be caused.
S12, the planned network address for obtaining the interchanger, it is assumed that be DesignedNetAddress;Its effect is for this
Interchanger provides the network address for meeting expected design;
S13, the network address of the interchanger is set to DesignedNetAddress, and recorded interchanger;
Its effect is the network address that the actual network address of interchanger is set to meet expected design, recorded the work in interchanger
Reflect the actual network address of interchanger with being.If the step performs failure, illustrate that the interchanger has changed reality
The network address, then return to step S3;If run succeeded, step S14 is transferred to;
S14, FactNetAddress==TempNetAddressIts effect is to judge that the interchanger is being arranged to symbol
Whether the actual network address closed before the expected design network address is temporary network address, if it does, must just reclaim
Temporary network address, it is to avoid temporary network address is deactivated occupancy.If FactNetAddress==TempNetAddress,
Then it is transferred to step S15;Otherwise it is transferred to step S16;
S15, the usedFlag of the temporary network address is set to false;If the interchanger is being arranged to meet
Actual network address before the expected design network address is if temporary network address, to reclaim the temporary network address;The step
Rapid effect is to reclaim temporary network address, it is to avoid interim not recurrent network address is deactivated occupancy.It is transferred to step S16;
S16, set the interchanger DesignedNetAddressFlag be true;The interchanger is indicated in its effect
The network address is already set as meeting the network address of expected design and the whole network is unique;Step S10 is transferred to, is continued to search for
The exchange of " actual network address is different from planned network address and planned network address is not taken by other actual switch "
Machine.
S17, judge whether that all interchangers are disposed as meeting the network address of expected design;It is step that its effect is
S18 provides judgment basis.It is transferred to step S18;
S18, the interchanger for whether not meeting the expected design network address alsoIts effect is determined whether to complete global field
The actual network address of all actual switch is the network address for meeting expected design in net, if all interchangers are all provided with
The network address for meeting expected design is set to, step S24 is transferred to;Otherwise it is transferred to step S19;
S19, select any one DesignedNetAddress==false and DesignedNetAddress is by it
The interchanger that his interchanger takes;Its effect is to provide actual to eliminate " planned network address takes characteristic by other interchangers "
Exchange data, including but not limited to actual network address, interchanger actual association relation, actual interface relation etc.;
S20, one temporary network address of selection from unduplicated temporary network address list, it is assumed that be
TempNetAddress;Its effect is to provide unduplicated facing to eliminate " planned network address takes characteristic by other interchangers "
When the network address, with avoid eliminate the characteristic after occur actual network address repeat characteristic, reach change interchanger reality
Its actual network address still has the unique characteristic of the whole network after the network address;
S21, TempNetAddress exist in actual switch listIts effect is to avoid selection unduplicated interim
Selected temporary network address is repeated with the actual network address in actual switch list during the network address;If
TempNetAddress exists in actual switch list, then be transferred to step S20 and continue to select unduplicated casual network ground
Location;Otherwise it is transferred to step S22;
S22, setting temporary network address usedFlag=True;Its effect is to indicate the unduplicated temporary network address
Actually taken, the unduplicated casual network ground for actually being taken can not be selected when unduplicated temporary network address is needed
Location.
S23, to set the interchanger be the interim network address TempNetAddress not conflicted;The network address is recorded to arrive
In the interchanger, the actual network address as the interchanger;Its effect is to be set to the actual network address of the interchanger
Unduplicated temporary network address, and change the actual network address of the actual switch in actual switch list and be
TempNetAddress, with the actual network address of actual reflection actual switch;
When it is the network address TempNetAddress not conflicted to set interchanger temporarily, if setup failed, say
The actual network address of the bright actual switch there occurs change, it is necessary to be transferred to the reality that step S3 reacquires actual switch
Border relevant information;Set successfully, then need to record the network address in the interchanger, the real network ground as the interchanger
Location, with the actual network address of actual reflection actual switch;
If configured to work(, is transferred to step S9;
S24, all interchangers possess the network address for meeting expected design, and configuration terminates;
Fourth embodiment:
The characteristics of four embodiments is the switch configuration by all other switch design network address of occupancy for not
The temporary network address for repeating, i.e., eliminate all " planned network address takes characteristic by other actual switch " first.Then
The actual network address actual switch consistent with planned network address is set to configuration successful, that is, indicates the actual switch
The network address meet expected design;Then again the actual switch that the network address does not meet expected design is set to meet and is set
The expected network address of meter, untill the network address of all actual switch meets expected design;
As shown in figure 4, its specific implementation step is as follows:
S1, acquisition design interchanger list, its effect is the design data of the interchanger required for the present invention, including but
It is not limited to the network address, neighborhood etc..
S2, the unduplicated temporary network address list of acquisition, its effect is for the present invention is needed some real network
Address is set to provide interim not recurrent network address during the unduplicated network address, all of network address in the list
Do not repeated with planned network address.
S3, acquisition actual switch list and related data, its effect are the exchange datas according to acquisition reality, including
But it is not limited to the neighborhood in actual network address, network between actual switch, interchanger actual physical address (MAC ground
Location), interface relationship etc..It is directed to for actual switch in the mentioned method of whole invention, it is therefore necessary to obtain actual friendship
The data of list and the correlation of changing planes;
S4, there is recurrent network addressIts effect be judge acquired in actual switch list in whether have the net of repetition
Network address, if it has, being then transferred to step S5, is otherwise transferred to step S6;
S5, recurrent network address is set to the interim unduplicated network address;Its effect is by weight in actual switch
Multiple actual network address is set to unduplicated temporary network address, so as to avoid cannot precisely being accessed during recurrent network address
Certain interchanger, reaches the unique technical requirements of network address the whole network.
Whether the DesignedNetAddress of interchanger is accounted for by other interchangers in S6, inspection actual switch list
With;If taken by other interchangers, it is set to occupied;It is otherwise provided as unoccupied;Its effect is detection design network
Whether shared by other interchangers, that is, whether the planned network address for detecting some interchanger is actual switch row for address
The actual network address of other interchangers in table, the detection design network address takes characteristic by other interchangers, if by other
Interchanger takes, then just have " planned network address takes characteristic by other interchangers ", to eliminate " planned network address quilt
Other interchangers take characteristic " foundation is provided.It is transferred to step S7;
S7, selection take the time interchanger of other actual switch planned network addresses, it is assumed that be SW_i, its effect is
Actual switch data, including but not limited to actual net are provided to eliminate " planned network address takes characteristic by other interchangers "
Network address, interchanger actual association relation, actual interface relation etc.;
S8, whether findIf it is found, into step S9;Otherwise enter step S13;
S9, one temporary network address of selection from unduplicated temporary network address list, it is assumed that be
TempNetAddress;Its effect is to provide unduplicated facing to eliminate " planned network address takes characteristic by other interchangers "
When the network address, with avoid eliminate the characteristic after occur actual network address repeat characteristic, reach change interchanger reality
Its actual network address still has the unique characteristic of the whole network after the network address;
S10, TempNetAddress exist in actual switch listIts effect is to avoid selection unduplicated interim
Selected temporary network address is repeated with the actual network address in actual switch list during the network address;If
TempNetAddress exists in actual switch list, then be transferred to step S9 and continue to select unduplicated casual network ground
Location;Otherwise it is transferred to step S11;
S11, setting temporary network address usedFlag=True;Its effect is to indicate the unduplicated temporary network address
Actually taken, the unduplicated casual network ground for actually being taken can not be selected when unduplicated temporary network address is needed
Location.
S12, to set the interchanger be the interim network address TempNetAddress not conflicted;The network address is recorded to arrive
In the interchanger, the actual network address as the interchanger;Its effect is to be set to the actual network address of the interchanger
Unduplicated temporary network address, and change the actual network address of the actual switch in actual switch list and be
TempNetAddress, with the actual network address of actual reflection actual switch;
When it is the network address TempNetAddress not conflicted to set interchanger temporarily, if setup failed, say
The actual network address of the bright actual switch there occurs change, it is necessary to be transferred to the reality that step S3 reacquires actual switch
Relevant information;Set successfully, then need to record the network address in the interchanger, the real network ground as the interchanger
Location, with the actual network address of actual reflection actual switch;
If configured to work(, is transferred to step S6;
S13, DesignedNetAddressFlag==false is selected, FactNetAddress==
The interchanger of DesignedNetAddress;Its effect is that the actual friendship for meeting expected design is searched in actual switch list
Change planes;It is transferred to step S14;
S14, whether findIts effect is to determine whether to be found in actual switch list to meet expected design network ground
The interchanger of location;If it is found, then entering step S15;Otherwise illustrate in actual switch list by it is all meet set
The switch configuration of meter anticipation network address is configuration successful, into step S16;
S15, set the interchanger DesignedNetAddressFlag be true;Its effect is to have indicated the interchanger
It is configured successfully, i.e. the actual network address of the interchanger is to meet the network address of expected design, without being configured;
S16, selection DesignedNetAddressFlag==false and the planned network from actual switch list
Address is not taken by other interchangers, and FactNetAddress!The interchanger of=DesignedNetAddress;Its effect
It is to ensure to be set to actual network address after planned network address, is not in the net of repetition in actual switch list
Network address;It is transferred to step S17;
S17, whether findIts effect is to determine whether there is directly to be set to meet design in advance by actual network address
The actual switch of the network address of phase;If it is found, being transferred to step S18;Otherwise it is transferred to step S23;If do not found, say
In bright actual switch list currently without directly actual network address being set to meet the expected design network address and
The unduplicated interchanger of actual network address of actual switch in network will not be caused.
S18, the planned network address for obtaining the interchanger, it is assumed that be DesignedNetAddress;Its effect is for this
Interchanger provides the network address for meeting expected design;
S19, the network address of the interchanger is set to DesignedNetAddress, and recorded interchanger;
Its effect is the network address that the actual network address of interchanger is set to meet expected design, recorded the work in interchanger
Reflect the actual network address of interchanger with being.If the step performs failure, illustrate that the interchanger has changed reality
The network address, then return to step S3;If run succeeded, step S20 is transferred to;
S20, FactNetAddress==TempNetAddressIts effect is to judge that the interchanger is being arranged to symbol
Whether the actual network address closed before the expected design network address is temporary network address, if it does, must just reclaim
Temporary network address, it is to avoid temporary network address is deactivated occupancy.If FactNetAddress==TempNetAddress,
Then it is transferred to step S21;Otherwise it is transferred to step S22;
S21, the usedFlag of the temporary network address is set to false;If the interchanger is being arranged to meet
Actual network address before the expected design network address is if temporary network address, to reclaim the temporary network address;The step
Rapid effect is to reclaim temporary network address, it is to avoid interim not recurrent network address is deactivated occupancy.It is transferred to step S22;
S22, set the interchanger DesignedNetAddressFlag be true;The interchanger is indicated in its effect
The network address is already set as meeting the network address of expected design and the whole network is unique;Step S16 is transferred to, is continued to search for
The exchange of " actual network address is different from planned network address and planned network address is not taken by other actual switch "
Machine.
S23, judge whether that all interchangers are disposed as meeting the network address of expected design;It is step that its effect is
S24 provides judgment basis.It is transferred to step S24;
S24, the interchanger for whether not meeting the expected design network address alsoIts effect is determined whether to complete global field
The actual network address of all actual switch is the network address for meeting expected design in net, if all interchangers are all provided with
The network address for meeting expected design is set to, step S25 is transferred to;Otherwise return to step S6;
S25, all interchangers possess the network address for meeting expected design, and configuration terminates.
2nd, on data structure involved in the present invention:
1st, interchanger list:
Its effect is to ensure that the uniqueness of the network address of interchanger in whole network.Interchanger list is assumed to be
DesignEACNList;The field for possessing is included but is not limited to:Interchanger coding, management address;
Interchanger is encoded:DesignEACNCode_i is assumed to be, its effect is to represent some exchange in whole network
Machine, in the entire network with uniqueness feature;
The network address:DesignEACNIP_i is assumed to be, its effect is being capable of essence by the network address in expected design
Quasi- Access Management Access controls the interchanger, will the network address of interchanger DesignEACNCode_i should be set to
DesignEACNIP_i;
The specific manifestation of the data structure is various informative:Can be chained list, array, list etc., it is also possible to be respectively present many
In individual list, array, chained list etc., claim of the invention is not influenceed.
Design data source formation in interchanger list is various:Can be that system is automatically generated, or outside is led
Enter, or the generation of other modules be automatically provided to the system etc., and no matter the data in the table be in plain text or ciphertext,
It is not used to limit the present invention.
2nd, switch neighbor data list:
It is assumed to be DesignNeighborEACNList:The neighbours that the tables of data describes all of interchanger believe substantially
Breath, is the switch-layer topology structure during design determines network.Its effect is by " the switch neighbor data list " and " reality
Neighbor list information " and this interchanger coding can accurately determine the coding of neighbor switch such that it is able to from " interchanger is arranged
The expected design network address of the neighbor switch is found in table ".The field being provided simultaneously with is included but is not limited to:Interchanger is compiled
Code, neighbor switch coding, exchange interface coding, neighbor switch interface coding etc..
Interchanger is encoded:It is assumed to be DesignEACNCode_i;Its effect is to represent some exchange in whole network
Machine, in the entire network with uniqueness feature;
Neighbor switch is encoded:DesignNeighborEACNCode_i is assumed to be, its effect is Tag Switching machine
The uniqueness characteristic of the neighbor switch of DesignEACNCode_i.
Exchange interface is encoded:DesignLocalInterfaceCode_i is assumed to be, its effect is that logo design is expected
In, neighbor switch is linked on the DesignLocalInterfaceCode_i interfaces of DesignEACNCode_i;
Neighbor switch interface is encoded:DesignNeighborInterfaceCode_i is assumed to be, its effect is that mark sets
Count pre- interim, be linked into the interface coding on the neighbor switch on this interchanger DesignEACNCode_i
DesignNeighborInterfaceCode_i;
The specific manifestation of the data structure is various informative:Can be chained list, array, list etc., it is also possible to be respectively present many
In individual list, array, chained list etc.;Meanwhile, the design data source formation in list is various:Can be that system is automatically generated,
Can be that outside importing, or the generation of other modules are automatically provided to the presence of design neighbours on the system or logical meaning
Relation (such as in bus network, it is stipulated that since first, is then encoded and is progressively defined as 2,3,4 etc., such case backward
Existed on its logical meaning design neighborhood, that is, first be exactly below be encoded to 2 interchanger, after the 2nd
Face be exactly be encoded to 3 interchanger) etc., and no matter the data in the table are in plain text or ciphertext, not to be used to limit this hair
It is bright.
3rd, actual neighbors list information
" actual neighbors list information ", it is assumed that be FactNeighborList;Its effect is the actual neighbour for reflecting interchanger
Interchanger list information is occupied, its field includes but is not limited to following field:Neighbours management MAC Address, neighbours' interface mac address,
Neighbor networks address, neighbours' interface coding etc..
Neighbours manage MAC Address:Its effect is the actual physics mark of neighbor switch, indicates that the uniqueness of the equipment is special
Point;
Neighbours' interface mac address:Its effect is that mark neighbor switch is connected to by the interface for possessing the physical token
This interchanger;
Neighbor networks address:Its effect is the current network address of the neighbor switch, including IP address, subnet mask,
Gateway address etc., the network address is in neighbor switch;
Neighbours' interface is encoded:Its effect is that to identify actually neighbor switch be to be connected to this friendship by the interface of the numbering
Change planes, interface coding belongs to neighbor switch.
Local interface is encoded:Its effect is that to identify actually this interchanger be connected with the neighbor switch by the interface
Connect, interface coding belongs to local switch.
4th, temporary ip address list
Its effect is to provide a number of temporary network address not conflicted and is used to system, should " temporary ip address row
Temporary network address in table " must assure that its uniqueness, and can not include the network address, the standby net in interchanger list
Network address etc., its quantity is the record quantity that record strip number should be greater than in interchanger list;The field being provided simultaneously with include but not
It is limited to:Temporary ip address, whether busy flag.
Temporary ip address:Its effect is, when system needs, to reach the network address by using the network address and do not conflict
Effect.
Whether busy flag:Its effect be identify the temporary network address it is whether occupied, if occupied, using
The temporary network address can not be chosen during temporary network address, and is if setting certain interchanger by the temporary network address
When meeting the network address of expected design, the busy flag should be set to unoccupied.
It is somebody's turn to do " temporary ip address list " existence form various, can is form, list, array, file, link or software
Module etc., does not influence the claim to the data structure of the invention.
5th, interchanger configuration status tables of data
Its effect be dynamically arranged by the tables of data or all interchangers configuration status.Including but not limited to
Following field:Interchanger coding, the machine set Success Flag, all neighbor switch and set Success Flag;
Interchanger is encoded:It is assumed to be DesignEACNCode_i;Its effect is to represent some exchange in whole network
Machine, in the entire network with uniqueness feature.
The machine sets Success Flag:It is assumed to be:isEACNSuccessSetFlag_i;Its effect is for indicating the exchange
Whether machine (interchanger is encoded to the interchanger of DesignEACNCode_i) has been set or has been identified its network address
Meet the network address of expected design;Assuming that during isEACNSuccessSetFlag_i==true, having indicated the interchanger
It is the network address for meeting expected design to specify its network address;Assuming that during isEACNSuccessSetFlag_i==false,
Indicate whether the network address of the interchanger does not know to be the network address for meeting expected design.
All neighbor switch set Success Flag:It is assumed to be isNeighborSuccessSetFlag_i;Its effect is
It is the network address for meeting expected design to indicate whether all of neighbor switch of the interchanger is determined its network address;It is false
If during isNeighborSuccessSetFlag_i==true, indicating that all neighbor switch of the interchanger have been determined
Its network address is the network address for meeting expected design;During isNeighborSuccessSetFlag_i==false, mark
At least there is one in the neighbor switch of the interchanger and be not determined the network address that its network address meets expected design.
The existence form for being somebody's turn to do " interchanger configuration status tables of data " is various, can be individually present, it is also possible to interchanger
List merges presence, and if merging and existing, interchanger coding is exactly exist on logical meaning, interchanger row after merging
Increase isNeighborSuccessSetFlag_i and isEACNSuccessSetFlag_i fields, the data structure in table
Whatsoever form is present, and does not influence claim of the invention;
Simultaneously for this two marks, either manifest presence, manifest and use, or exist on logical meaning, logic meaning
Used in justice, do not influence claim of the invention.For example:Mark isNeighborSuccessSetFlag_i, is exchanging
When all neighbor switch of machine are all determined its network address and meet the network address of expected design, it is possible to use the mark shows
Now it is entered as true, it is also possible to by all neighbor switch for retrieving or determining the interchanger
IsEACNSuccessSetFlag_i judges that all neighbor switch of the interchanger are determined its network address symbol for true
Close the network address of expected design.Again for example:Mark isEACNSuccessSetFlag_i, by setting or confirming that certain is handed over
When the network address changed planes is the network address for meeting expected design, the mark of the interchanger can be of course thought
IsEACNSuccessSetFlag_i is true.No matter which kind of mode exists or uses, and does not influence the present invention to the data
The claim of structure.
3rd, other data structures
The coding of the interchanger that main frame is directly accessed:ServerEACNCode is assumed to be, its effect is that main frame can pass through
The data accurately obtain the information such as interchanger coding, the network address in " in interchanger list ".The data village can be more in form
Sample, such as by hardwired, address dial-up, address plug, file, data setting, main frame network interface quantity of access switch etc.
To show the presence of the coding, it might even be possible to be the ServerEACNCode on logical meaning, such as only one in whole network
Individual main frame, then specify that the main frame is linked into the interchanger of certain coding, then the ServerEACNCode of the main frame is exactly
There is logically, and encoded equal to the design data interchanger in institute's access switch list:DesignEACNCode_i;Should
Encode and exist on either which kind of form presence or logical meaning, do not influence claim of the invention.
LLDP neighbor information life spans:Can be by the LLDP Receive messages of system grabs, it is also possible to Initialize installation.Its
Effect is to ensure that after the network address change of switch neighbor, it is necessary to the time for waiting must be over LLDP neighbor informations life
Deposit the time, otherwise the neighbor information of the interchanger can also have former false neighbor information.Regardless of its form of expression,
Do not influence to be conducive to claim of the invention.
4th, the technical characterstic that the present invention can be realized:
1st, actual switch table data is obtained
In the mentioned method of whole invention, it is committed step to obtain actual switch table data, only obtains and hands over
The real data changed planes, can carry out the setting of static network address according to the design data of interchanger;For example:Can pass through
Management MAC Address, the actual management network address, Ke Yitong of crawl LLDP data messages technical limit spacing and main frame neighboring switch
The actual network address for crossing interchanger obtains the actual neighbors interchanger list information of interchanger, including neighbor switch and the friendship
Interface corresponding relation, the MAC Address of all neighbor switch, actual network address for changing planes etc..
2nd, the network address for repeating is set to interim not recurrent network address
The effect of the step is to ensure that uniqueness characteristic of the network address in actual switch list in the whole network, that is, pass through
The actual network address can precisely have access to the interchanger, once the actual network address for having repetition is found in network, then
Just have to for the network address for repeating to be set to interim not recurrent network address.
3rd, the interchanger that not yet configuration successful and its planned network address are not taken by other interchangers is selected
The effect of the step is to ensure that the planned network ground set by the actual network address by selected interchanger
Location is unique in the whole network, does not result in planned network address and is repeated in the whole network;If its planned network address is by other interchangers
Take, then need to be selected in this step after eliminating the characteristic taken by other interchangers.
4th, unduplicated temporary network address is reclaimed
The effect of the step is to avoid during the network address is set that temporary network address occur not enough, it is ensured that in net
Have in network address setup procedure and available enough do not repeat temporary network address.
5th, the network address set it is unsuccessful or eliminate the occupied characteristic in planned network address it is unsuccessful when, it is necessary to be transferred to step
Rapid S3;
When the network address sets the unsuccessful or unsuccessful elimination occupied characteristic in planned network address, it is meant that accessing should
Interchanger fails, and reason may have various, but way the most reliable is exactly to reacquire actual switch list, so that really
The network address that guarantor uses is the actual network address.
6th, the occupied characteristic in planned network address is eliminated
If once the planned network address of some interchanger is taken by other interchangers, then this should be eliminated first
Occupied characteristic, there is following several approach:The network address for taking other interchanger is set to interim unduplicated network ground
Location;It is symbol by the switch configuration in the case where the planned network address of the other interchanger of occupancy is not by other interchanger occupancy situations
Close the network address of expected design;The effect of the step is to avoid occurring reconstruction weight during the network address for setting interchanger
Multiple network address phenomenon.For example:The actual network address of the interchanger for accessing first is not planned network address A, and is designed
Network address A is taken by other interchangers, i.e., the actual network address of other interchangers is planned network address A, then this
Directly be set to the actual network address of interchanger if the A of planned network address by Shi Ruguo, then again many in a local network
One actual network address A of repetition, then at least two interchangers be owned by actual network address A.It is obviously necessary to first disappear
Except the characteristic that network address A is taken by other exchangers;It is exactly for the switch configuration of A is one by actual network address
The individual interim unduplicated network address;It is exactly to judge whether actual network address is handed over as the planned network address B of A by other
Change planes occupancy, if occupied, also should first eliminate can be by the real network after the occupied characteristic in planned network address
Address A is set to network address B, and the network address of the interchanger that then will be accessed first again is set to planned network address A.Always
For it, planned network address by other interchangers take if, it is necessary to eliminating occupied characteristic can utilize its reality
The network address is set to planned network address.
7th, judge whether all actual switch are each configured to work(
It is pre- that the effect of the step is to ensure that the network address of all of actual switch in whole LAN all meets design
Whether phase, i.e., the actual network address of all actual switch is identical with the planned network address of corresponding design interchanger,
Other steps mentioned by the method should otherwise be continued;If meeting expected design, mean that this method completes the overall situation
The setting work of all interchangers of domain net.Judge whether the network address of all of actual switch meets design in advance
Phase.
5th, adaptable scene of the invention
Method, data or system that the present invention is referred to, it is applicable in multiple industries, including power system industry,
Track transportation industry, Transportation industry, office network industry, hydraulic engineering industry, shipbuilding industry, Aviation Industry etc., for example:
Floor synthetic monitoring system in intelligence configuration, the track transportation industry of train-installed Ethernet in track transportation industry
The intelligence configuration of middle Ethernet, intelligence configuration, the colliery comprehensively monitoring of the Ethernet of the power supply comprehensive monitoring system of power industry
In Ethernet intelligence configuration, the Ethernet in intelligence configuration, company's factory building of Ethernet in building comprehensive monitoring system
Intelligence configuration, intelligence configuration, the comprehensive hospital office system of Ethernet in intelligent transportation industry in Ethernet intelligence
Intelligence configuration, the ship of the Ethernet in configuration, hotel's industry in the configuration of Ethernet intelligence, the production field of video monitoring
In intelligence configuration, the intelligence configuration of ethernet network in aircraft of ethernet network etc. scene be applicable to this hair
The method of bright offer, data or system.
Presently preferred embodiments of the present invention is the foregoing is only, is not intended to limit the invention, it is all in essence of the invention
Within god and principle, any modification, equivalent substitution and improvements made etc. should be included within the scope of the present invention.