Disclosure of Invention
In order to solve the technical problem how to realize the intelligent configuration of each network management type switch into a non-conflicted static network management address in a local area network, the invention provides a method for intelligently configuring the non-conflicted static network management address for the switch, and the invention provides an intelligent elimination technology which causes the phenomenon that a target switch cannot be accessed through a switch access control technology and a switch neighbor technology, and once the conflicted network address is found, the conflicted network address is immediately set as the non-conflicted network address; therefore, the intelligent degree of the network can be effectively improved, the cost of network deployment and maintenance is greatly reduced, the efficiency of network deployment and maintenance is improved, and the method is a basic technical solution for further development and realization of network intelligence.
The method for intelligently configuring the non-conflict static network management address for the switch comprises the following steps:
s1, initializing basic data:
importing the non-conflict temporary network address into a non-conflict temporary network address list, and setting all the non-conflict temporary network addresses in the non-conflict temporary network address list to be in an unoccupied state;
setting that all the switches in the actual switch list are not detected;
setting the actual network addresses of all the switches in the actual switch list to be null, and setting all the switches in the actual switch list to be in a state that the uniqueness detection of all the neighbor switches is not completely finished;
setting neighbor relation-free data in a neighbor relation list of the switch;
s2, acquiring actual data of a switch, adding the actual data into an actual switch list, and setting the network address of the switch as the unique characteristic of all switches found at present;
s3, obtaining the switch whose neighbor switches do not complete the current unique characteristic detection from the actual switch list:
if the current uniqueness states of all the switches in the actual switch list are non-uniqueness, selecting any one switch; otherwise, acquiring the switch of which the current uniqueness state is the current uniqueness and the neighbor switches do not complete the uniqueness state detection from the actual switch list;
s4, judging whether the switch meeting the requirements is found in the step S3:
if found, go to step S5; otherwise, it indicates that all network addresses have been set as non-conflicting network addresses, and the process goes to step S17;
s5, remotely acquiring actual data of the current switch;
s6, judging whether the remote acquisition is successful:
if successful, go to step S7; otherwise, jumping to step S14;
s7, updating the actual switch list data: if the switch mac address does not exist in the actual switch list, adding the switch data to the actual switch list;
s8, judging whether the network address is repeated: if the network address is repeated, jumping to step S12; otherwise, go to step S9;
s9, remotely acquiring the actual neighbor switch list of the current switch: if the phenomenon that the repeated network address is set as the non-conflict temporary network address occurs in the current round of detection, waiting for the survival time of the LLDP or longer is needed to avoid the phenomenon that false neighbor information exists when neighbor list information of the switch is remotely acquired;
s10, updating the data of the actual switch list and updating the neighbor relation list of the switch;
s11, judging whether there is a duplicate network address: if there is no duplicate network address, go to step S13; otherwise, go to step S12;
s12, eliminating duplicate network addresses: if a plurality of or all repeated network addresses need to be eliminated, a plurality of or all repeated network addresses need to be recorded temporarily, and then the repeated network addresses are eliminated one by one according to the step; when the repeated network address is eliminated, any one or more switches with the repeated network address can be processed as the non-conflict temporary network address; after the repeated network address of one switch is eliminated each time, a certain time is needed to wait, the function of the method is to ensure that the setting of the switch is really effective and the actual data of the switch acquired at the later stage is real;
if the repeated network address is a temporary network address, after the repeated network address is completely eliminated, the non-conflict temporary network address is timely withdrawn, namely the temporary network address is set to be in an unoccupied state; the method has the advantages that the phenomenon that the non-conflict temporary network address is insufficient, so that the setting of the non-conflict network address in the whole network fails, is avoided;
s13, setting the current switch as the current unique state detection of all the network addresses of the neighbor switches;
s14, judging whether the current switch really exists or not, and if the current switch really exists, jumping to the step 15; otherwise, jumping to the step 16; the judging method comprises the following steps:
searching a neighbor switch of the switch through a switch neighbor relation list; then, acquiring an actual neighbor list of the current switch by adopting a remote access technology through the network address of the neighbor switch, wherein if the mac address of the current switch is in the actual neighbor list, the mac address still really exists;
if the current switch has a plurality of neighbors in the switch neighbor relation list, the current switch can be judged not to really exist only if the neighbor list information of all the neighbor switches does not comprise mac information of the current switch;
s15, the relevant attributes of the master control host or the relevant switches are adjusted through technology, so that the master control host can remotely access the current switch: if the attribute of the switch needing to be adjusted in the local area network is related to the ring network characteristics, related setting is needed according to the ring network characteristics so as to avoid the phenomenon that the switch cannot be remotely accessed due to network storm caused by related personalized ring network protocols;
s16, deleting the switch data from the actual switch list;
and S17, the actual network addresses of all the switches are the unique network addresses without conflict, and the method is ended.
In the above method, the actual data of the switch in step S2 includes a switch mac address and a switch management network address; the method for acquiring the actual data of the switch comprises the following steps:
acquiring actual data of the switch by capturing link layer data LLDP messages;
the method provides the actual data of one switch through modes of file input, network input and the like.
In the above method, the actual data of the current switch in step S5 includes the mac address of the switch and the management network address of the switch.
In the above method, the determination method in step S8 is:
checking all switch data in the actual switch list, if the same network address corresponds to two or more effective switch mac addresses, setting the network address as a repeated network address, and judging that the network address has the repeated network address;
in the actual switch list, if the switch does not have the repeated network address, setting the current uniqueness state of the switch as current uniqueness; if the switch has a duplicate network address, setting the current uniqueness state of the switch as non-uniqueness;
checking whether the neighbor switch of the switch with the repeated network address completes the current uniqueness detection work of the network addresses of all the neighbor switches, if so, setting the neighbor switch to complete the current uniqueness detection state of the network addresses of all the neighbor switches.
In the foregoing method, the updating the actual switch list data in step S10 includes a method of comparing mac addresses, and if the mac address of a switch in the actual neighbor switch list is not included in the actual switch list, the switch data is added to the actual switch list.
In the above method, the updating the switch neighbor relation list in step S10 includes:
updating the switch neighbor relation list according to the actual neighbor switch list, so that the switch neighbor relation in the switch neighbor relation list can truly and completely reflect the neighbor relation of the switch;
if the switch in the actual switch neighbor list does not exist in the switch neighbor relation list, adding the neighbor relation of the switch into the switch neighbor relation list;
and if a certain switch in the switch neighbor relation list does not exist in the actual switch neighbor list, deleting the switch data in the switch neighbor relation list.
In the above method, the judging method in step S11 includes:
comparing the switch data in the neighbor switch list with the switch data in the actual switch list, and if the switch mac addresses are different and have the same network address, determining the network address as a repeated network address; the function is to judge whether different switch entities have the same network address;
in the actual switch list, if the switch does not have the repeated network address, setting the current uniqueness state of the switch as current uniqueness; if the switch has a duplicate network address, setting the current uniqueness state of the switch as non-uniqueness;
checking whether the neighbor switches of the switches with the repeated network addresses complete the network address current uniqueness detection work of all the neighbor switches, and if so, setting the neighbor switches to complete the network address current uniqueness detection state of all the neighbor switches;
if there is no data in the actual switch list, i.e. the switch has no neighbor switch, it directly sets its non-duplicated network address and goes to step S13.
In the above method, the step S12 includes the following steps:
selecting an unoccupied non-conflicting temporary network address: selecting a temporary network address with a mark in an unoccupied state from a non-conflict temporary network address list, then detecting whether the address is occupied by adopting a network address occupied detection technology, if so, setting the non-conflict temporary network address as already occupied, and if not, selecting the non-conflict temporary network address;
remotely setting the switch as a non-conflicting temporary network address by using the repeated network addresses;
remotely acquiring actual data of the switch by using the non-conflict temporary network address; the function is to acquire the specific target switch set at this time, so as to provide actual data for updating the actual switch list;
updating the actual switch list data and the switch neighbor relation list data; and setting the occupation state of the current non-conflict temporary network address as occupied.
In the above method, the method for updating the actual switch list data includes the following steps:
judging whether the mac address of the switch exists in the actual switch list or not according to the actual switch data acquired in the step S10, and if not, adding the switch data to the actual switch list; if yes, modifying the network address of the switch with the mac address into the non-conflicting temporary network address;
setting the network address of the switch as having the current unique characteristic in an actual switch list;
and setting the occupation state of the current non-conflict temporary network address as occupied.
In the above method, in the step S15, when the private ring network protocol of each switch manufacturer requires a ring network soft cut point, it is required to ensure that at least one ring network soft cut point in each node switch of the ring network does not cause a network storm.
The invention has the advantages and beneficial effects that: the invention can greatly improve the efficiency of network deployment and maintenance, reduce the cost of network deployment and maintenance, lay a solid technical foundation for the further development and realization of network intellectualization, and has the following advantages:
1. the intelligent degree is high:
by adopting the method provided by the invention, the network intelligentization degree can be effectively improved; in the method, the configuration of the static management network addresses of all the switches in the whole local area network can be comprehensively and quickly finished as long as the actual data of any switch is acquired, and any repeated network addresses cannot appear, so that the problem of network address conflict when the switches are maintained and managed is avoided; and various phenomena that the target switch cannot be accessed due to different configurations can be intelligently eliminated. And a solid and reliable technical foundation is laid for the further development and realization of the network intelligent technology.
2. The cost of network deployment and maintenance is reduced:
for the application that only the static network address does not conflict in the local area network, the method can effectively reduce the cost of network configuration and maintenance, and during configuration or maintenance, the switch is connected and powered up according to the design without manual configuration through technologies such as a web interface and the like, and when the switch is configured and maintained, a network professional technician with higher technical knowledge level capability is needed, so that the cost of network deployment and maintenance can be greatly reduced by adopting the method;
3. improving efficiency of network deployment maintenance
When network configuration and maintenance are carried out on the basis of the prior art, if all network addresses in a local area network need to be configured into static non-conflicting network addresses, the network addresses need to be manually modified one by one, and artificial accidental errors can also occur in the process to cause configuration failure; especially, in the later maintenance, if a static repeated network address appears, the configuration is difficult to be abnormal, and even more, if the target switch cannot be accessed, the manual mode is very difficult to be found and corrected, so that the efficiency of network deployment and maintenance is low;
4. wide application range
The method provided by the invention has wide application range and can be suitable for local area networks with different network structures, such as: a bus network structure, a ring network structure, a star network structure, a hybrid network structure; the method can be suitable for various local area networks constructed by two-layer network pipe type switches and three-layer switches; the method mentioned in the present invention can be applied to various network topologies.
5. Low cost of implementation
The method provided by the invention can meet the requirements of various network management type switches in the prior art, namely, the method provided by the invention is based on the prior network industry technology, does not need to change and modify a switch manufacturer too much, does not need to do configuration work aiming at the switch in advance, and only needs to be configured on the spot.
Detailed Description
The following description of the embodiments of the present invention will be made with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
The method and the embodiment thereof related to the invention comprise the following steps:
as shown in fig. 1, the present invention describes a method for intelligently configuring a non-conflicting static network management address for a switch, which is characterized by comprising the following steps:
s1, initializing basic data:
importing the non-conflict temporary network address into a non-conflict temporary network address list, and setting all the non-conflict temporary network addresses in the non-conflict temporary network address list to be in an unoccupied state;
setting that all the switches in the actual switch list are not detected;
setting the actual network addresses of all the switches in the actual switch list to be null, and setting all the switches in the actual switch list to be in a state that the uniqueness detection of all the neighbor switches is not completely finished;
and setting no neighbor relation data in the switch neighbor relation list.
S2, acquiring actual data of a switch, adding the actual data into an actual switch list, and setting the network address of the switch as the unique characteristic of all switches found at present; the effect is that the method requires at least the actual data of one switch.
The actual data of the switch comprises a switch mac address and a switch management network address; the method for acquiring the actual data of the switch comprises the following steps:
(1) acquiring actual data of the switch by capturing link layer data LLDP messages;
(2) the method provides the actual data of one switch through modes of file input, network input and the like.
S3, obtaining the switch whose neighbor switches do not complete the current unique characteristic detection from the actual switch list:
if the current uniqueness states of all the switches in the actual switch list are non-uniqueness, selecting any one switch; otherwise, acquiring the switch of which the current uniqueness state is the current uniqueness and the neighbor switches do not complete the uniqueness state detection from the actual switch list;
s4, judging whether the switch meeting the requirements is found in the step S3: the function is to judge whether all the actual switches are configured as non-conflict network addresses; if found, go to step S5; otherwise, it indicates that all network addresses have been set as non-conflicting network addresses, and the process goes to step S17;
s5, remotely acquiring actual data of the current switch; and the actual data for the current switch includes the switch mac address and the switch management network address.
S6, judging whether the remote acquisition is successful: if successful, go to step S7; otherwise, jumping to step S14; the function is to judge whether the master control host can remotely access the switch through the network address and acquire data; if the network address can not be remotely acquired, judging whether the switch with the network address really exists or not;
s7, updating the actual switch list data: if the mac address of the switch does not exist in the actual switch list, adding the switch data to the actual switch list, wherein the function of the switch data is to ensure that the data in the actual switch list can actually reflect the actual data of the switch;
s8, judging whether the network addresses are repeated; the function is to judge whether the current actual switch list has repeated network addresses; if the network address is repeated, jumping to step S12; otherwise, go to step S9;
the judging method comprises the following steps:
(1) checking all switch data in the actual switch list, if the same network address corresponds to two or more effective switch mac addresses, setting the network address as a repeated network address, and judging that the network address has the repeated network address;
(2) in the actual switch list, if the switch does not have the repeated network address, setting the current uniqueness state of the switch as current uniqueness; if the switch has a duplicate network address, setting the current uniqueness state of the switch as non-uniqueness;
(3) checking whether the neighbor switch of the switch with the repeated network address completes the current uniqueness detection work of the network addresses of all the neighbor switches, if so, setting the neighbor switch to complete the current uniqueness detection state of the network addresses of all the neighbor switches.
S9, remotely acquiring the actual neighbor switch list of the current switch: if the phenomenon that the repeated network address is set as the non-conflict temporary network address occurs in the current detection (the current detection refers to the process from the current step to the next step), waiting for the survival time of the LLDP or longer is needed to avoid the phenomenon that false neighbor information occurs when the neighbor list information of the switch is remotely acquired; the method has the function of acquiring all neighbor switch information of the current switch;
s10, updating the data of the actual switch list and updating the neighbor relation list of the switch; the function of updating the actual switch list data is to truly reflect the actual data of the currently acquired switch; and the function of updating the neighbor relation list data of the switch is to truly and completely reflect the actual neighbor relation of the currently acquired switch.
Wherein updating the actual switch list data comprises: by means of the mac address comparison method, if the mac address of a certain switch in the actual neighbor switch list is not contained in the actual switch list, the switch data is added to the actual switch list.
Meanwhile, updating the switch neighbor relation list includes:
updating the switch neighbor relation list according to the actual neighbor switch list, so that the switch neighbor relation in the switch neighbor relation list can truly and completely reflect the neighbor relation of the switch;
if the switch in the actual switch neighbor list does not exist in the switch neighbor relation list, adding the neighbor relation of the switch into the switch neighbor relation list;
and if a certain switch in the switch neighbor relation list does not exist in the actual switch neighbor list, deleting the switch data in the switch neighbor relation list.
S11, judging whether a repeated network address exists; if there is no duplicate network address, go to step S13; otherwise, go to step S12;
the judging method comprises the following steps:
comparing the switch data in the neighbor switch list with the switch data in the actual switch list, and if the switch mac addresses are different and have the same network address, determining the network address as a repeated network address; the role of which is to decide whether different switch entities have the same network address.
In the actual switch list, if the switch does not have the repeated network address, setting the current uniqueness state of the switch as current uniqueness; if the switch has a duplicate network address, setting the current uniqueness state of the switch as non-uniqueness;
checking whether the neighbor switches of the switches with the repeated network addresses complete the current uniqueness detection work of the network addresses of all the neighbor switches, if so, setting the neighbor switches to complete the current uniqueness detection state of the network addresses of all the neighbor switches;
if there is no data in the actual switch list, i.e. the switch has no neighbor switch, it directly sets its non-duplicated network address, and jumps to step 13.
S12, eliminating duplicate network addresses: if a plurality of or all repeated network addresses need to be eliminated, a plurality of or all repeated network addresses need to be recorded temporarily, and then the repeated network addresses are eliminated one by one according to the step; when the repeated network address is eliminated, any one or more switches with the repeated network address can be processed as the non-conflict temporary network address; after the repeated network address of one switch is eliminated each time, a certain time is needed to wait, the function of the method is to ensure that the setting of the switch is really effective and the actual data of the switch acquired at the later stage is real; the specific wait time depends on the characteristics of the specific switch itself
If the repeated network address is a temporary network address, after the repeated network address is completely eliminated, the non-conflict temporary network address is timely withdrawn, namely the temporary network address is set to be in an unoccupied state; the method has the advantages that the phenomenon that the non-conflict temporary network address is insufficient, so that the setting of the non-conflict network address in the whole network fails, is avoided;
meanwhile, a plurality of duplicate network addresses may be currently found, and any one or more duplicate network addresses may be processed in this step.
The method specifically comprises the following steps:
selecting an unoccupied non-conflicting temporary network address: selecting a temporary network address with a mark in an unoccupied state from the non-conflict temporary network address list, then detecting whether the address is occupied by adopting a network address occupied detection technology, if so, setting the non-conflict temporary network address as already occupied, and if not, selecting the non-conflict temporary network address. Its role is to ensure that when the network address of the switch is set, it does not conflict with the network addresses of other devices in the network.
Network address occupancy detection techniques include, but are not limited to: ping technology, remote access technology, etc.
Remotely setting the switch as a non-conflicting temporary network address by using the repeated network addresses; the function is to eliminate the duplicate property of the network address of the switch;
remotely acquiring actual data of the switch by using the non-conflict temporary network address; the function of the method is to acquire the specific target switch set at this time, so as to provide actual data for updating the actual switch list.
The actual data of the switch includes but is not limited to: switch mac address, network address, etc.;
updating the actual switch list data and the switch neighbor relation list data; setting the occupation state of the current non-conflict temporary network address as occupied; the method for updating the actual switch list data comprises the following steps:
(1) judging whether the switch mac address exists in the actual switch list or not according to the switch actual data acquired in the step S10, and if not, adding the switch data (including but not limited to the switch mac address and the non-conflicting temporary network address) to the actual switch list; if yes, modifying the network address of the switch with the mac address into the non-conflicting temporary network address;
(2) setting the network address of the switch as having the current unique characteristic in an actual switch list; the function of the method is to truly reflect the characteristic that the network address of the switch has uniqueness in the switch discovered at present;
(3) the occupation state of the current non-conflict temporary network address is set to be occupied, and the method has the functions of improving the retrieval efficiency when the available non-conflict temporary network address is selected subsequently and improving the operation efficiency when the available non-conflict temporary network address is selected.
S13, setting the current switch as the current unique state detection of all the network addresses of the neighbor switches; the effect is to avoid repeated detections leading to the method of the invention entering useless dead cycles.
S14, judging whether the current switch really exists or not, and if the current switch really exists, jumping to the step 15; otherwise, jumping to the step 16; the method specifically comprises the following steps:
searching a neighbor switch of the switch through a switch neighbor relation list; then, acquiring an actual neighbor list of the current switch by adopting a remote access technology through the network address of the neighbor switch, wherein if the mac address of the current switch is in the actual neighbor list, the mac address still really exists;
if the current switch has a plurality of neighbors in the switch neighbor relation list, the current switch can be judged not to really exist only if the neighbor list information of all the neighbor switches does not comprise the mac information of the current switch.
S15, the relevant attributes of the master control host or the relevant switches are adjusted through technology, so that the master control host can remotely access the current switch: if the attribute of the switch needing to be adjusted in the local area network is related to the ring network characteristics, related setting is needed according to the ring network characteristics so as to avoid the phenomenon that the switch cannot be remotely accessed due to network storm caused by related personalized ring network protocols; the method has the advantages that when the interface attribute or the network address attribute of the switch is inconsistent, the switch can be a neighbor switch which exists really but cannot be remotely accessed, and the phenomenon that the switch exists really but cannot be remotely accessed is eliminated through a technical means.
Preferably, when the private ring network protocol of each switch manufacturer requires a ring network soft cut-off point, it is necessary to ensure that at least one ring network soft cut-off point in each node switch of the ring network does not cause a network storm.
S16, deleting the switch data from the actual switch list; the effect is to avoid invalid operations, so as to ensure that the method does not enter useless dead loop, which causes the method to fail to reach the target;
and S17, the actual network addresses of all the switches are the unique network addresses without conflict, and the method is ended.
As shown in fig. 2, the first embodiment of the intelligent configuration switch in the present invention includes the following steps:
s1, initializing basic data; specifically, the method includes but is not limited to:
acquiring a non-repeated temporary network address list; supposing to be TempNetAddressList, which is characterized in that all network addresses in the list are not repeated, and the number of the network addresses is larger than the number of switches required to be configured in the local area network; the method has the function that when the actual network address of the switch in the local area network is found to be repeated, a non-repeated temporary network address needs to be obtained from the list;
setting all temporary network addresses in the TempNetAddress List as unoccupied, and setting the flag isuSedflag as false;
assuming that the actual switch list is FacteACNList, initializing the list to be null, namely, the actual data of all switches are null;
setting the current uniqueness states of all the switches in the FacteACNLID to be non-uniqueness, assuming that the mark issuscessessChecked is set as false, the neighbor list is not detected, and assuming that the mark issuscesselnegehighborChecked is set as false; assuming that the actual network address of the switch is FactNedAddress, initializing the switch to be null; assuming that the actual mac address is MacAddress, initializing to be null;
assuming the switch neighbor relation list is EACNNeighborList, it is initialized to null, i.e. all switches have no neighbor switches.
Assuming that the repeated network address list is a RepeatNetAddressList, initializing to be empty, namely no repeated network address exists;
s2, acquiring relevant information of host adjacent switches by capturing LLDP messages; adding switch data to the FacteACNLST; setting the mark issuccessChecked of the switch as true;
s3, obtaining the switch whose neighbor switch has not finished detecting and setting from the fateacnlist, the specific method is:
any switch marked issuccessChecke as true and issuccessAllneighborChecke as false is selected from the FacteACNLList.
S4, found? If a switch which is unique at present and does not complete the uniqueness confirmation of all the neighbor switches is found, assuming that the switch is an EACN _ Current, and assuming that the network address of the switch is LocalNetAddress, jumping to step S5; if not, go to step S27;
s5, remotely acquiring actual data of the switch through LocalNetAddress;
s6, success of remote acquisition? If the remote acquisition is successful, assuming that the mac address is CurrentMac, jumping to step S7, otherwise, jumping to step S24;
s7, network address duplication? Comparing the CurrentMac and LocalNetddress with the MacAddress and FactNetddress in the actual switch list, and if the MacAddress is not equal to the TargetMac and the LocalNetddress is equal to the FactNetddress, judging that a repeated network address exists, and then jumping to step S22; otherwise, jumping to step S8;
s8, remotely acquiring an actual neighbor list of the switch; suppose the actual switch list is FactNeighborList;
s9, updating FacteACNLST and EACNNeighborList data; the specific method comprises the following steps:
(1) adding switches in the fatneighborlist to the fateacnlist if they do not exist in the fateacnlist;
(2) the neighbor relation of EACN _ Current in EACNNeighborList is corresponding to the neighbor relation reflected in FactNeighborList.
S10, there is a duplicate network address? If so, jumping to step S11; otherwise, jumping to step S23;
the specific method comprises the following steps:
(1) whether one effective FactNeighborList is in the EACNNeighborList or not corresponds to the condition of a plurality of effective MacAddresses, and if yes, determining that a repeated network address exists; otherwise, judging that no repeated network address exists.
(2) In the FacteACNLIST, if the switch does not have the repeated network address, setting the mark issuccessChecked of the switch as true; if the switch has the repeated network address, setting the mark issuccessed of the switch as false;
(3) checking whether the flag issuessallnelighborChecked of the neighbor switch of the switch having the duplicate network address is true, and if so, setting issuessallnelighborChecked to false.
(4) If there is no data in the actual switch list, i.e. the switch has no neighbor switch, it directly sets its non-duplicated network address, and jumps to step 23.
S11, updating the RepeatNetAddress List data; the specific method comprises the following steps:
adding all the repeated network addresses which do not exist in the RepeatNetAddress List into the RepeatNetAddress List;
s12, selecting a repeated network address from the RepeatNetAddress List;
s13, judging whether the finding is found; if the result is found, if the result is the RepeatNetAddress, jumping to step S14; otherwise, jumping to step S3;
s14, selecting an unoccupied non-conflict temporary network address TempNetAddress from the TempNetAddress List;
s15, setting the switch as TempNetAddress by using RepeatNetAddress;
s16, remotely acquiring the mac address of the set switch through TempNetAddress; assuming CurrentMac;
s17, updating the FacteACNLST data; if the CurrentMac does not exist in the FacteACNList, adding a switch into the FacteACNList, setting the MacAddress of the switch to be CurrentMac, and setting the FactNetddress to be TempNetddress. And if a switch with MacAddress equal to CurrentMac is found in the FacteACNLIST, modifying the FacteNeddress to TempNeddress.
S18, does there exist a switch with a network address of RepeatNetAddress? If so, jumping to step S14; otherwise, jumping to step S19;
s19, is RepeatNetAddress a non-conflicting temporary network address? If yes, go to step S21; otherwise, jumping to step S20;
s20, deleting RepeatNetAddress from the RepeatNetAddress List;
s21, setting the mark isusedFlag of the repeatNeddress as false; setting a mark isUsedFlag with a non-conflict temporary network address equal to RepeatNetAddress to false in a TempNetdessList;
s22, updating the FacteACNLST data; adding a repeated network address into the RepeatNetAddress List;
the specific method comprises the following steps:
if the CurrentMac does not exist in the FacteACNList, adding the data of the switch into the FacteACNList, setting the MacAddress of the switch to be CurrentMac, and setting the FactNeddress of the switch to be LocalNeddress;
setting the mark issuccesshecked of the switch with the FactNetdress of all switches in the FacteACNLST as LocalNetdress as false.
Checking whether the flag isSuccessAllneighborChecked of all switches adjacent to the EACN _ Current in the eacnneighbirlist is true, if so, setting the flag issuccessallnelighborchecked of the switch to false,
if LocalNetAddress does not exist in RepeatNetAddress List, the network address is added to RepeatNetAddress List.
S23, setting the mark issuccessAllneighborChecked of the Current switch EACN _ Current to true; the flag issuccessChecked of all the neighbor switches is set to true;
s24, judging whether the current situation exists really; if true, jumping to step S26; otherwise, jumping to step S25;
the specific method comprises the following steps:
searching a Neighbor switch of the EACN _ Current through the EACNNeighborList, and assuming the Neighbor switch is EACN _ Neighbor; and then acquiring an EACN _ Neighbor actual Neighbor list by using a remote access technology through the network address of the EACN _ Neighbor, wherein if the mac address of the EACN _ Current is in the actual Neighbor list, the actual Neighbor list still exists.
If the EACN _ Current has a plurality of neighbors in the EACNNeighborList, the EACN _ Current can be judged not to really exist only if the Neighbor list information of all the EACN _ Neighbors does not include the mac information of the EACN _ Current.
S25, deleting EACN _ Current of the switch from the FacteACNLST;
s26, changing the interface attribute of the EACN _ Neighbor to meet the requirement that the EACN _ Current can be accessed through the network address;
and S27, the actual network addresses of all the switches are the unique network addresses without conflict, and the process is ended.
Second, the data structure according to the present invention:
1. list of actual switches
Its role is to reflect all actual switches currently discovered, including but not limited to the following data:
switch mac address: the function is to uniquely mark the physical entity of the switch; the data may also be banned in other ways; such as fixed switch code, fixed switch name, node information in the switch logical structure, etc.; the claims that are advantageous for the invention are not affected in any way;
actual network address of switch: the function of the switch is to remotely access the switch through the network address, and the switch is necessary data for network layer communication;
current uniqueness state: its role is to indicate that the network address of the switch temporarily does not conflict with the actual switch that has been detected; the flag may be represented by other data or structures in a logical sense without affecting the claims that benefit from the present invention;
current uniqueness state of all neighbor switch network addresses: the function is to show that the network addresses of all the neighbor switches of the switch temporarily do not conflict with the detected actual switch; whether actually present or logically present, such data must be utilized in the present invention, regardless of its presentation, without affecting the claims that benefit from this invention;
2. switch neighbor relation list
The list may actually exist or may be a neighbor relation list in a logical sense, for example, the actual neighbor list is acquired from the switch through the network address when needed without the cache list, and the claims advantageous to the present invention are not affected no matter how the expression form is;
this list includes, but is not limited to, the following data items:
switch mac address: the function is to uniquely mark the physical entity of the switch; the data may also be banned in other ways; such as fixed switch code, fixed switch name, node information in the switch logical structure, etc.; the claims that are advantageous for the invention are not affected in any way;
switch neighbor mac list: its role is to actually reflect all the neighbor switches of the switch;
description of the drawings: the actual switch list and the switch neighbor relation list can be combined into one list, and can also be subdivided into a plurality of lists, without influencing the claims which are favorable for the invention;
3. non-conflicting temporary network address lists
It is characterized in that all network addresses in the list are not repeated; including but not limited to the following data items:
non-conflicting temporary network addresses: the function is that when repeated network addresses appear in the local area network, the repeated network addresses are set as the unused non-conflict temporary network addresses;
occupied flag: if the non-conflict temporary network address actually exists in the local area network, the address is occupied, and the network address cannot be selected when the temporary network address is needed; if the network address is not used in the operation, but cannot indicate that the network address can be used for setting the switch as a non-conflicting network address, whether the network address is occupied by other equipment in the network or not must be detected through a technical means, if the network address can be occupied, the network address cannot be used, otherwise, the network address can be used; once the temporary network address is found to actually exist in the network, the flag should be set to the occupied state;
4. duplicated real network address list
The function of the network address list is to record repeated network addresses so as to set the repeated actual network addresses as temporary non-repeated network addresses directly through the list when needed; the list may actually exist or may exist in a logical sense, for example, once a duplicate network address is found, the network address is immediately set as a temporary non-conflicting network address, and then the representation is a variable or a single data item; the claims that are advantageous to the present invention are not affected regardless of the expression form; its data items include, but are not limited to, the following:
actual duplicate network address: the effect is to indicate that the actual network address of more than two switches in the local area network is the network address.
Thirdly, the invention has the technical characteristics that:
1. the method for remotely acquiring the neighbor list information and the actual data of the target switch through the actual network address of the switch adds the switch into the actual switch list once finding the switch which does not exist in the actual switch list, and continuously acquires more actual switches. The method has the function of enabling all the switches in the local area network to detect and eliminate repeated network addresses, and finally achieving the aim of configuring all the switches in the local area network into non-conflicting static network addresses.
2. And carrying out conflict detection on the remotely acquired switch actual data, the remotely acquired actual network address in the switch neighbor list information and the data in the actual switch list. Its role is to discover and obtain duplicate network addresses in order to achieve the goal of eliminating duplicate network addresses.
3. Continuously eliminating the repeated network addresses until all the network addresses do not conflict;
4. acquiring first actual switch information comprising an actual network address and an actual mac address;
5. when the target switch is accessed abnormally due to different configurations between the master control host and the switch, the target switch can be accessed by adjusting the relevant configurations of the master control host and the switch; for example as follows:
(1) the phenomenon that the target switch cannot be remotely accessed due to the fact that the VLan attributes of the interfaces between the neighbor switches are inconsistent is eliminated;
(2) the phenomenon that a target switch cannot be remotely accessed due to the fact that networking attributes of neighbor switches are inconsistent is eliminated;
(3) the phenomenon that the target switch cannot be remotely accessed because the actual network address of the switch does not belong to the default subnet is eliminated;
(4) the phenomenon that the target switch cannot be remotely accessed due to false neighbor information after the neighbor switch is disconnected is eliminated;
(5) the phenomenon that only the standby network address causes that the target switch is continuously and repeatedly set to be the temporary non-repeated network address in a remote mode is eliminated;
(6) the phenomenon that the target switch cannot be remotely accessed due to the fact that the actual network address of the target switch changes is eliminated.
6. When the actual data of the switch cannot be remotely acquired, judging whether the switch really exists or not, if not, deleting the invalid switch from the actual switch list, namely, not performing operation on the switch any more; if the real existence exists, the master control host or the relevant attributes of the relevant exchanger are adjusted through the technology, so that the master control host can remotely access the current exchanger. The method has the effect that in the processing process by adopting the method, if the switch is disconnected or other switches with different interface attributes are accessed, the method can still successfully achieve the aim of the invention.
7. In the process of eliminating the repeated network address each time, an unoccupied non-conflict temporary network address needs to be selected, any switch with the repeated network address is remotely set as the non-conflict temporary network address, then the non-conflict temporary network address is adopted to remotely obtain the actual data of the switch, and the switch data in the actual switch list is updated according to the obtained actual data of the switch.
Scene that the invention can be applied
1. The invention can be applied to the dynamic intelligent allocation of the static network address of the Ethernet switch in the rail transit industry;
2. the invention can be applied to the dynamic intelligent allocation of the static network address of the Ethernet switch in the video monitoring system;
3. the invention can be used in the static network address dynamic intelligent distribution technology of the Ethernet switch in all Ethernet network topological structures in the power industry, the intelligent building industry, the ship industry, the water conservancy industry, the pipe gallery industry, the wind power industry, the rail transit industry and the like.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.