For the treatment of the method and apparatus of MAC Address conflict
Technical field
The present invention relates to EVI(Ethernet Virtualization Interconnection, Ethernet is virtual interconnected) technology, in particular to being applicable to the one of EVI network for the treatment of MAC(Media Access Control, medium education) method of address conflict and a kind of device for the treatment of MAC Address conflict.
Background technology
EVI is a kind of advanced person " MAC in IP " technology, for realizing two-layer VPN (the Virtual PrivateNetwork based on IP kernel heart net, VPN (virtual private network)) technology, to realize VLAN(Virtual Local Area Network, VLAN) expansion between different website.
As real in Fig. 1 institute, in the network of application EVI technology, comprise station network, EVI network and core network.Wherein:
Station network is real double layer network, has Host(main frame in each station network), ED(Edge Device, edge device) and Switch(switching equipment for realizing Layer2 switching between Host and the ED of this station network);
EVI network is the virtual double layer network be connected between each station network, can set up vLink(virtualLink in EVI network, empty link) and by the vLink of foundation realize between each station network virtual two layers interconnected;
Core network is then real three layers of IP network and carries EVI network, has Router(routing device in core network), in order to carry the vLink set up in EVI network;
And each station network all connects by respective ED the EVI network that core network Access Core Network carry.
Based on the above-mentioned network architecture, for the inner stream flow of station network, real two layers of forwarding can be realized by the Switch in each station network; And for the external flow between the station network in identical VLAN, then need virtual two layers of the vLink that provided by EVI network interconnectedly to realize two layers of virtual forwarding.
Be explained respectively below in conjunction with example as shown in Figures 2 and 3.In example as shown in Figures 2 and 3, all comprise station network 1 ~ 2, station network 1 comprises HostA and HostB and ED1, station network 2 comprises HostC and ED2.
Refer to Fig. 2, in order to realize two layers of forwarding of the inner stream flow of station network, ED1 carries out the endogenous MAC address learning of VLAN at station network 1, and learns the MAC Address MAC-A of HostA at the local port Eth1/1 connecting HostA, learn the MAC Address MAC-B of HostB at the local port Eth1/2 connecting HostB; Then, ED1 can record the local port Eth1/1 at MAC-A place and the local port Eth1/2 at affiliated VLAN and MAC-B place and affiliated VLAN in mac address table.In like manner, ED2, by the endogenous MAC address learning of VLAN carried out at station network 2, also can record the local port Eth2/1 at the MAC Address MAC-C place of HostC and affiliated VLAN in mac address table.
Correspondingly, when the HostA of station network 1 needs to E-Packet to HostB, this inner stream flow first can be forwarded to ED1 by HostA, ED1 finds corresponding port in mac address table according to the target MAC (Media Access Control) address MAC-B in message be local port Eth1/2, and with the local port Eth1/2 found for outbound port sends message, thus message is made to arrive HostB.Similarly, the message forwarded between other Host after this occurred in the HostC in the message forwarded to HostA for the HostB of station network 1 and station network 2 and station network 2 is also in like manner.
Please again see Fig. 3, in order to enable the external flow between each station network by the virtual two layers of forwarding of EVI real-time performance, ED1 and ED2 needs mutually find the other side by neighbor uni-cast and set up vLink1 with the other side, the two ends of this vLink1 are respectively the outer net port IF2/0 of outer net port IF1/1 and ED2 of ED1, and its outer net port IF1/1 can be designated vLink port EVI-Link1, ED2 by ED1 also its outer net port IF2/0 can be designated vLink port EVI-Link1; Then, the MAC Address MAC-B of the MAC Address MAC-A of the HostA in station network 1 and HostB can be noticed to ED2 by vLink1 clean culture by ED1, similarly, the MAC Address MAC-C of the HostC in station network 2 also can be noticed to ED1 by vLink1 clean culture by ED2; Thus, ED1 will learn the MAC Address MAC-C of HostC at its vLink port EVI-Link1, and VLAN belonging to vLink port EVI-Link1 and MAC-C recording MAC-C place in mac address table, similarly, ED2 also can learn the MAC Address MAC-A of HostA and the MAC Address MAC-B of HostB at its vLink port EVI-Link1, and in mac address table, record the vLink port EVI-Link1 at MAC-A place and the vLink port EVI-Link1 at affiliated VLAN and MAC-B place and affiliated VLAN.
Correspondingly, when the HostA of station network 1 needs the HostC to station network 2 to E-Packet, this inner stream flow first can be forwarded to ED1 by HostA, ED1 finds corresponding port in mac address table according to the target MAC (Media Access Control) address MAC-C in message be vLink port EVI-Link1, and with the local port Eth1/2 found for outbound port sends message, thus make message can be forwarded to ED2 by vLink1; Then, after ED2 receives this message from vLink1, in mac address table, find corresponding port according to the target MAC (Media Access Control) address MAC-C in message be local port Eth2/1, and with the local port Eth2/1 found for outbound port sends message, thus make this message to arrive HostC.
As above visible, by the source MAC study in station network, two layers of forwarding of the inner stream flow of station network can be realized; By the neighbor uni-cast between station network and the study of mutual source MAC, virtual two layers of forwarding of the external flow between station network can be realized.
But because the Host in different station network may exist identical MAC Address, therefore, the ED of each station network just likely there will be MAC Address conflict when carrying out source MAC study.Be explained below in conjunction with example as shown in Figure 4.The station network 1 ~ 2 shown in Fig. 2 and Fig. 3 is comprised in example as shown in Figure 4, and comprise station network 3, this station network 3 comprises HostD and ED3 and the MAC Address of HostD is identical with HostC, and, according to mode as shown in Figure 2, ED3, by the endogenous MAC address learning of VLAN carried out at station network 3, records the local port Eth3/1 at the MAC Address MAC-C place of HostD and affiliated VLAN in mac address table.
Refer to Fig. 4, after ED1 and ED2 sets up vLink1 according to mode as shown in Figure 3, ED3 in ED1 and station network 3 mutually finds the other side by neighbor uni-cast and sets up vLink2 with the other side, the two ends of this vLink2 are respectively the outer net port IF3/0 of outer net port IF1/2 and ED3 of ED1, and its outer net port IF1/2 can be designated vLink port EVI-Link2, ED3 by ED1 its outer net port IF3/0 can be designated vLink port EVI-Link2; Then, ED1 is noticed by clean culture and can make ED3 in its mac address table, record the vLink port EVI-Link2 at MAC-A place and the vLink port EVI-Link2 at affiliated VLAN and MAC-B place and affiliated VLAN, further, the MAC Address MAC-C of the HostD in station network 3 can be noticed to ED1 by vLink2 clean culture by ED3;
Now, because port corresponding for MAC-C is recorded as vLink port EVI-Link1 according to mode as shown in Figure 3 by ED1 in mac address table, therefore, when ED1 is after its vLink port EVI-Link2 learns the MAC Address MAC-C of HostC, need the port of MAC-C corresponding in mac address table to change to vLink port EVI-Link2.If but after this MAC Address MAC-C of the HostC in station network 2 is noticed to ED1 clean culture by vLink1 by ED2 once more, then ED1 can be made again the port of MAC-C corresponding in mac address table to be changed back vLink port EVI-Link1.So repeatedly, MAC-C will be caused repeatedly to change at the port that ED1 is corresponding.
In like manner, if the ED3 in ED2 and station network 3 also sets up vLink and mutually carries out MAC address learning, port can be caused repeatedly to change due to MAC Address conflict too at ED2 and ED3.
Visible, when there is MAC Address conflict in prior art, the MAC Address that cannot avoid conflict frequently changes at the port of ED, and then just likely cause flow interrupt.
Summary of the invention
In view of this, the invention provides a kind of method for the treatment of MAC Address conflict and a kind of device for the treatment of MAC Address conflict.
A kind of method for the treatment of MAC Address conflict provided by the invention, the method is applied in the edge device of EVI station network, comprises the steps:
A1, when the machine learns MAC Address at arbitrary port, in the mac address table of the machine, search the forwarding-table item that this MAC Address is corresponding, if find, perform step a2, otherwise perform step a9;
A2, the port port in the forwarding-table item found and the machine this time being learnt to this MAC Address are compared, if difference, perform step a3, if identical, terminate to work as pre-treatment to this MAC Address;
A3, in the conflict chained list of the machine, search conflict list item corresponding to this MAC Address, if find, perform step a5, otherwise perform step a4; Wherein, the list item that conflicts comprises MAC Address, port pair change number of times and conflict attribute;
A4, be that this MAC Address increases corresponding conflict list item in the conflict chained list of the machine, then perform step a5; Wherein, the MAC Address in the conflict list item that creates of step a4 be this time study to MAC Address, port pair change number of times be 0, conflict attribute is invalid;
A5, the port pair change number of times in conflict list item corresponding for this MAC Address is added 1, then perform step a6;
A6, judge whether the port pair change number of times in the conflict list item that this MAC Address is corresponding reaches the upper limit, if do not reach the upper limit, performs step a7, if reach the upper limit, performs step a8;
A7, the port in the forwarding-table item of correspondence changed to the machine this time study to the port of this MAC Address, then terminate to work as pre-treatment to this MAC Address;
A8, the conflict attribute in conflict list item corresponding for this MAC Address is set to effectively, then performs step a9;
A9, to be this time study of this MAC Address and the machine in the mac address table of the machine increase corresponding forwarding-table item to port of this MAC Address, then terminates to work as pre-treatment to this MAC Address.
Conflict list item comprises forwarding-table item number further, and the forwarding-table item number in the conflict list item that step a4 creates is 1; And the method is included in the following steps that this edge device runs further:
B0, when triggered by step a8 perform step a9 time, the forwarding-table item number in the conflict list item of correspondence is added 1, then terminates to work as pre-treatment to this MAC Address;
B1, when the MAC address aging that the machine has learnt or the machine arbitrary port perceived MAC Address cancel time, search should the forwarding-table item of port and this MAC Address in the mac address table of the machine, if find, perform step b2, otherwise terminate to work as pre-treatment to this MAC Address;
B2, by mac address table to deleting the forwarding-table item of port and this MAC Address, then perform step b3;
B3, in the conflict chained list of the machine, search conflict list item corresponding to this MAC Address, if find, perform step b4, otherwise terminate to work as pre-treatment to this MAC Address;
B4, the forwarding-table item number in conflict list item corresponding for this MAC Address is subtracted 1, then terminate to work as pre-treatment to this MAC Address.
The study of MAC Address and to cancel be that the MAC notice message received according to the machine realizes, and the method is included in the following steps that this edge device runs further:
C1, after the machine receives MAC notice message, in the conflict chained list of the machine, check the forwarding-table item number of all conflict list items;
C2, the forwarding-table item number be checked through by step c1 are less than or equal to the collision table entry deletion of 1.
The method is included in the following steps that this edge device runs further:
D0, in the conflict chained list of the machine, there is the conflict attribute of conflict list item when becoming effective, by issuing ACL list item by from local port and the port that records in all forwarding-table items that mac address table is corresponding to this MAC Address of all traffic mirrorings pointing to MAC Address corresponding to this conflict list item;
And the ACL list item of the MAC Address of correspondence is deleted by described step c2 further.
The method is included in the following steps that this edge device runs further:
E0, in the conflict chained list of the machine, there is the conflict attribute of conflict list item when becoming effective, produce collision alert.
A kind of device for the treatment of MAC Address conflict provided by the invention, this application of installation, in the edge device of EVI station network, comprises as lower module:
Forwarding-table item searches module, when the machine learns MAC Address at arbitrary port, searches the forwarding-table item that this MAC Address is corresponding in the mac address table of the machine, if find, triggers and forwards port comparing module, otherwise triggers forwarding-table item interpolation module;
Forward port comparing module, the port in the forwarding-table item found and port that the machine this time learns this MAC Address are compared, if difference, trigger the list item that conflicts and search module, if identical, terminate to work as pre-treatment to this MAC Address;
Conflict list item searches module, searches the conflict list item that this MAC Address is corresponding in the conflict chained list of the machine, if find, trigger variation counting how many times module, otherwise triggering conflict list item adds module; Wherein, the list item that conflicts comprises MAC Address, port pair change number of times and conflict attribute;
Conflict list item adds module, for this MAC Address increases corresponding conflict list item in the conflict chained list of the machine, then triggers variation counting how many times module; Wherein, the MAC Address in the conflict list item that list item interpolation module of conflicting creates is this MAC Address learnt, port pair change number of times is 0, conflict attribute is invalid;
Variation counting how many times module, adds 1 by the port pair change number of times in conflict list item corresponding for this MAC Address, then trigger address conflict resolution module;
Address conflict judging module, judges whether the port pair change number of times in the conflict list item that this MAC Address is corresponding reaches the upper limit, if do not reach the upper limit, triggers forwarding-table item and changes module, if reach the upper limit, and trigger address conflict identification module;
Forwarding-table item changes module, the port in the forwarding-table item of correspondence is changed to the machine this time study to the port of this MAC Address, then terminates to work as pre-treatment to this MAC Address;
Address conflict identification module, is set to effectively by the conflict attribute in conflict list item corresponding for this MAC Address, then triggers forwarding-table item and adds module;
Forwarding-table item adds module, the forwarding-table item of correspondence that be this time study of this MAC Address and the machine in the mac address table of the machine to port of this MAC Address increase, and then terminates to work as pre-treatment to this MAC Address.
Conflict list item comprises forwarding-table item number further, and the forwarding-table item number in the conflict list item that conflict list item interpolation module creates is 1; And, this device be included in further this edge device run as lower module:
List item number counting module, when address conflict identification module trigger forwarding-table item add module time, the forwarding-table item number in the conflict list item of correspondence is added 1, then terminates to work as pre-treatment to this MAC Address;
Enquiry module is cancelled in address, when the machine is at the MAC address aging that arbitrary port learns or when being cancelled, search should the forwarding-table item of port and this MAC Address in the mac address table of the machine, if find, trigger forwarding-table item removing module, otherwise terminate to work as pre-treatment to this MAC Address;
Forwarding-table item removing module, by mac address table to deleting the forwarding-table item of port and this MAC Address, then trigger conflict list item check module;
Conflict list item check module, searches the conflict list item that this MAC Address is corresponding, if find, triggers list item number adjusting module in the conflict chained list of the machine, otherwise terminates to work as pre-treatment to this MAC Address;
List item number adjusting module, subtracts 1 by the forwarding-table item number in the conflict list item of correspondence, then terminates to work as pre-treatment to this MAC Address, then terminates to work as pre-treatment to this MAC Address.
The study of MAC Address and to cancel be that the MAC notice message received according to the machine realizes, and, this device be included in that this edge device runs further as lower module:
Checking module is removed in conflict, after the machine receives MAC notice message, checks the forwarding-table item number of all conflict list items in the conflict chained list of the machine;
Address conflict removes module, conflict is removed the forwarding-table item number that is checked through of checking module be less than or equal to 1 collision table entry deletion and the ACL list item that the MAC Address corresponding for this conflict list item is issued delete.
This device be included in further this edge device run as lower module:
Address conflict mirror module, the conflict attribute of conflict list item is had when becoming effective, by issuing ACL list item by from local port and the port that records in all forwarding-table items that mac address table is corresponding to this MAC Address of all traffic mirrorings pointing to MAC Address corresponding to this conflict list item in the conflict chained list of the machine;
And described address conflict is removed module and is deleted by the ACL list item of the MAC Address of correspondence further.
This device be included in further this edge device run as lower module:
Address conflict alarm module, when having the conflict attribute of conflict list item to become effective in the conflict chained list of the machine, produces collision alert.
As can be seen here, the present invention can detect the port situation of change of MAC Address that learns; When detecting that same MAC Address frequently changes between different port, this MAC Address can be designated conflict by the present invention; Further, for conflict MAC Address, the present invention for all study sets up corresponding forwarding-table item respectively to the port of conflict MAC Address in mac address table, can send from all possible port to allow the flow of corresponding conflict MAC Address.Thus the present invention can avoid port to change too frequently when occurring that MAC Address is conflicted, and then can alleviate flow interrupt caused thus.
Accompanying drawing explanation
Fig. 1 is the network architecture schematic diagram applying EVI technology in prior art;
Fig. 2 is the example schematic realizing the forwarding of station network inner stream flow in the network architecture as shown in Figure 1;
Fig. 3 is the example schematic of the external flow forwarding realized in the network architecture as shown in Figure 1 between station network;
Fig. 4 is example schematic when there is MAC Address conflict in the network architecture as shown in Figure 1;
Fig. 5 a to Fig. 5 c is the method flow schematic diagram for the treatment of MAC Address conflict in the embodiment of the present invention;
Fig. 6 a and Fig. 6 b is the example schematic processing MAC Address conflict in the embodiment of the present invention.
Embodiment
For making object of the present invention, technical scheme and advantage clearly understand, to develop simultaneously embodiment referring to accompanying drawing, the present invention is described in more detail.
In the present embodiment, the port situation of change of the MAC Address that it learns is detected by the ED of each station network; When detecting that same MAC Address frequently changed before the different port of this ED, this MAC Address can be designated conflict by this ED; And, for conflict MAC Address, the port of forwarding-table item unique in mac address table for conflict MAC Address continues repeatedly to change by the ED of station network as prior art, but for all study sets up corresponding forwarding-table item respectively to the port of conflict MAC Address in mac address table, can send from all possible port to allow the external flow of corresponding conflict MAC Address.Thus because the ED in each station network just can avoid port to change too frequently when detecting that MAC Address is conflicted, and then the external flow can alleviated between station network caused thus is interrupted.
Based on above-mentioned principle, present embodiments provide a kind of method for the treatment of MAC Address conflict, the method is applied in the ED of EVI station network.Further, in the ED of application the method, not only there is the mac address table for forwarding, also needing establishment to have conflict chained list; Wherein, each conflict list item conflicted in chained list includes MAC Address, port pair change number of times, conflict attribute and forwarding-table item number.
Refer to Fig. 5 a, in the present embodiment, be included in the following steps of ED operation for the treatment of the method for MAC Address conflict:
Step 511, when the machine arbitrary port (can be the machine connect Host local port, also can be the outer net port being identified as vLink port) study to MAC Address time, the forwarding-table item that this MAC Address is corresponding is searched in the mac address table of the machine, if find, represent and likely there occurs MAC Address conflict and perform step 512, otherwise expression not MAC Address conflict and performs step 519.
Step 512, the port that port in forwarding-table item step 511 found and the machine this time learn this MAC Address is compared, if difference, represent the possibility that exists and MAC Address conflict occurs and perform step 513, if identical, represent and be not MAC Address conflict and terminate to work as pre-treatment to this MAC Address.
Step 513, searches the conflict list item that this MAC Address is corresponding in the conflict chained list of the machine, if find, performs step 515, otherwise performs step 514.
Step 514, for this MAC Address increases corresponding conflict list item in the conflict chained list of the machine, then performs step 515; Wherein, the MAC Address in the conflict list item that creates of step 514 be this time study to MAC Address, port pair change number of times be initial value 0, conflict attribute be invalid, forwarding-table item number is initial value 1.
Step 515, adds 1 by the port pair change number of times in conflict list item corresponding for this MAC Address, then performs step 516.
Step 516, judge whether the port pair change number of times in the conflict list item that this MAC Address is corresponding has reached the upper limit (such as 2 times), if do not reach the upper limit, not MAC Address conflict and perform step 517, if reach the upper limit, representing and determine there occurs MAC Address conflict and perform step 518.
Step 517, the port in the forwarding-table item of the correspondence be present in mac address table is changed to the machine this time study to the port of this MAC Address, namely normal port changes, and then terminates to work as pre-treatment to this MAC Address.
Step 518, is set to effectively by the conflict attribute in conflict list item corresponding for this MAC Address, then performs step 519 and step 520.
Step 519 is this time study of this MAC Address and the machine in the mac address table of the machine increases corresponding forwarding-table item to port of this MAC Address, then terminates to work as pre-treatment to this MAC Address.
Wherein, for the situation directly performing step 519 from step 511, the forwarding-table item that above-mentioned steps 519 creates is the new MAC Address learnt unique corresponding forwarding-table item in mac address table; And for performing the situation of step 519 from step 518, the forwarding-table item that above-mentioned steps 519 creates is then the forwarding-table item that the MAC Address of conflict is set up for newly-increased port in mac address table.
Step 520, when triggered by step 518 perform step 519 time, the forwarding-table item number in the conflict list item of correspondence is added 1, then terminates to work as pre-treatment to this MAC Address.
So far, above-mentioned flow process terminates.
Through above-mentioned flow process, the ED of application the method can detect the frequent conflict MAC Address changed before different port, and for all study sets up corresponding forwarding-table item respectively to the port of conflict MAC Address in mac address table, thus the flow of corresponding conflict MAC Address can be sent from all possible port.
Flow for the ease of correspondence conflict MAC Address can send from all possible port, and the present embodiment can by issuing ACL(Access Control List, Access Control List (ACL)) list item and by traffic mirroring at all possible port.Correspondingly, just may further include for the treatment of the method for MAC Address conflict the following steps run at ED in the present embodiment:
When having the step 518 of conflict attribute in above-mentioned flow process of conflict list item and become effective in the conflict chained list of the machine, by issuing ACL list item by from local port and the port that records in all forwarding-table items that mac address table is corresponding to this MAC Address of all traffic mirrorings pointing to MAC Address corresponding to this conflict list item.
Carry out collision detection except utilizing the conflict list item in conflict chained list when learning MAC address and adjust except the forwarding-table item in mac address table according to testing result, when having MAC address aging or being cancelled, same needs carries out respective handling to the conflict list item in conflict chained list and the forwarding-table item in mac address table.
For this reason, refer to Fig. 5 b, in the present embodiment, just may further include the following steps run at ED for the treatment of the method for MAC Address conflict:
Step 521, when the machine is at the MAC address aging that arbitrary port learns or when being cancelled, search in the mac address table of the machine should port and forwarding-table item corresponding to this MAC Address, if find, perform step 522, otherwise terminate to work as pre-treatment to this MAC Address;
Step 522, by mac address table to deleting the forwarding-table item of port and this MAC Address, then perform step 523;
Step 523, searches the conflict list item that this MAC Address is corresponding in the conflict chained list of the machine, if find, performs step 524, otherwise terminates to work as pre-treatment to this MAC Address;
Step 524, subtracts 1 by the forwarding-table item number in conflict list item corresponding for this MAC Address, then terminates to work as pre-treatment to this MAC Address.
So far, above-mentioned flow process terminates.
After above-mentioned flow process, the forwarding-table item number of conflict list item or can be cancelled and be reduced along with the aging of conflict MAC Address.If the forwarding-table item number of conflict list item is less than or equal to 1, then also just there is not conflict in corresponding MAC Address, now, just needs the conflict list item be in due course in conflict chained list to clear up, to realize the releasing conflicted.Wherein, due to MAC Address study and to cancel be that the MAC notice message received according to the machine realizes, therefore, the present embodiment is just to receive the opportunity of MAC Address message for conflict releasing.
For this reason, refer to Fig. 5 c, in the present embodiment, may further include the following steps run at ED for the treatment of the method for MAC Address conflict:
Step 531, after the machine receives MAC notice message, checks the forwarding-table item number of all conflict list items in the conflict chained list of the machine.
Step 532, the forwarding-table item number that step 531 is checked through be less than or equal to 1 collision table entry deletion and the ACL list item that the MAC Address corresponding for this conflict list item is issued delete.
So far, above-mentioned flow process terminates.
In addition, when can also the conflict attribute of conflict list item be had in conflict chained list to become effective for the treatment of the method for MAC Address conflict in the present embodiment, collision alert be produced.
Be more than in the present embodiment for the treatment of the detailed description of method of MAC Address conflict.Because the method can realize with computer program, therefore, the present embodiment also provides a kind of device for the treatment of MAC Address conflict accordingly.
This application of installation in the ED of EVI station network and be included in ED run as lower module:
Forwarding-table item searches module, when the machine learns MAC Address at arbitrary port, searches the forwarding-table item that this MAC Address is corresponding in the mac address table of the machine, if find, triggers and forwards port comparing module, otherwise triggers forwarding-table item interpolation module;
Forward port comparing module, the port in the forwarding-table item found and port that the machine this time learns this MAC Address are compared, if difference, trigger the list item that conflicts and search module, if identical, terminate to work as pre-treatment to this MAC Address;
Conflict list item searches module, searches the conflict list item that this MAC Address is corresponding in the conflict chained list of the machine, if find, trigger variation counting how many times module, otherwise triggering conflict list item adds module; Wherein, the list item that conflicts comprises MAC Address, port pair change number of times, conflict attribute and forwarding-table item number;
Conflict list item adds module, for this MAC Address increases corresponding conflict list item in the conflict chained list of the machine, then triggers variation counting how many times module; Wherein, the list item MAC Address of adding in the conflict list item that creates of module of conflicting be this time study to MAC Address, port pair change number of times be 0, conflict attribute be invalid, forwarding-table item number is initial value 1;
Variation counting how many times module, adds 1 by the port pair change number of times in conflict list item corresponding for this MAC Address, then trigger address conflict resolution module;
Address conflict judging module, judges whether the port pair change number of times in the conflict list item that this MAC Address is corresponding reaches the upper limit, if do not reach the upper limit, triggers forwarding-table item and changes module, if reach the upper limit, and trigger address conflict identification module;
Forwarding-table item changes module, the port in the forwarding-table item of already present correspondence is changed to the machine this time study to the port of this MAC Address, then terminates to work as pre-treatment to this MAC Address;
Address conflict identification module, is set to effectively by the conflict attribute in conflict list item corresponding for this MAC Address, then triggers forwarding-table item and adds module and list item number counting module;
Forwarding-table item adds module, the forwarding-table item of correspondence that be this time study of this MAC Address and the machine in the mac address table of the machine to port of this MAC Address increase, and then terminates to work as pre-treatment to this MAC Address;
Wherein, look for the direct situation triggering forwarding-table item interpolation module for forwarding-table item inquiry mould, the forwarding-table item that above-mentioned forwarding-table item interpolation module creates is the forwarding-table item of the new MAC Address learnt unique correspondence in mac address table; And the situation that forwarding-table item adds module is triggered for address conflict identification module, the forwarding-table item that above-mentioned forwarding-table item interpolation module creates is then the forwarding-table item that the MAC Address of conflict is set up for newly-increased port in mac address table;
List item number counting module, when address conflict identification module trigger forwarding-table item add module time, the forwarding-table item number in the conflict list item of correspondence is added 1, then terminates to work as pre-treatment to this MAC Address.
Based on above-mentioned module, the ED applying this device can detect the frequent conflict MAC Address changed before different port, and for all study sets up corresponding forwarding-table item respectively to the port of conflict MAC Address in mac address table, thus the flow of corresponding conflict MAC Address can be sent from all possible port.
Flow for the ease of correspondence conflict MAC Address can send from all possible port, and the present embodiment can by issuing ACL list item by traffic mirroring at all possible port.Correspondingly, in the present embodiment for the treatment of the device of MAC Address conflict just may further include ED run as lower module:
Address conflict mirror module, when having the step 518 of conflict attribute in above-mentioned flow process of conflict list item and become effective in the conflict chained list of the machine, by issuing ACL list item by from local port and the port that records in all forwarding-table items that mac address table is corresponding to this MAC Address of all traffic mirrorings pointing to MAC Address corresponding to this conflict list item.
Carry out collision detection except utilizing the conflict list item in conflict chained list when learning MAC address and adjust except the forwarding-table item in mac address table according to testing result, when having MAC address aging or being cancelled, same needs carries out respective handling to the conflict list item in conflict chained list and the forwarding-table item in mac address table.
For this reason, in the present embodiment for the treatment of the device of MAC Address conflict may further include ED run as lower module:
Enquiry module is cancelled in address, when the machine is at the MAC address aging that arbitrary port learns or when being cancelled, search should port and forwarding-table item corresponding to this MAC Address in the mac address table of the machine, if find, trigger forwarding-table item removing module, otherwise terminate to work as pre-treatment to this MAC Address;
Forwarding-table item removing module, by mac address table to deleting the forwarding-table item of port and this MAC Address, then trigger conflict list item check module;
Conflict list item check module, searches the conflict list item that this MAC Address is corresponding, if find, triggers list item number adjusting module in the conflict chained list of the machine, otherwise terminates to work as pre-treatment to this MAC Address;
List item number adjusting module, subtracts 1 by the forwarding-table item number in conflict list item corresponding for this MAC Address, then terminates to work as pre-treatment to this MAC Address.
Based on above-mentioned module, the forwarding-table item number of conflict list item or can be cancelled and be reduced along with the aging of conflict MAC Address.If the forwarding-table item number of conflict list item is less than or equal to 1, then also just there is not conflict in corresponding MAC Address, now, clearing up, removing to realize conflict with regard to needing when receiving MAC Address message to the conflict list item in conflict chained list.Correspondingly, in the present embodiment for the treatment of the device of MAC Address conflict may further include ED run as lower module:
Checking module is removed in conflict, after the machine receives MAC notice message, checks the forwarding-table item number of all conflict list items in the conflict chained list of the machine;
Address conflict removes module, conflict is removed the forwarding-table item number that is checked through of checking module be less than or equal to 1 collision table entry deletion and the ACL list item that the MAC Address corresponding for this conflict list item is issued delete.
In addition, in order to realize alarm, can further include for the treatment of the device of MAC Address conflict in the present embodiment: address conflict alarm module, when having the conflict attribute of conflict list item to become effective in the conflict chained list of the machine, producing collision alert.
Below, then the example combined as shown in figures 6 a and 6b the present embodiment is further described.
In example as shown in figures 6 a and 6b, comprise the station network 1 ~ 2 in example as shown in Figures 2 and 3, and, after ED1 and ED2 sets up vLink1 according to mode as shown in Figure 3, add again the station network 3 in example as shown in Figure 4.
ED3 in ED1 and station network 3 finds the other side mutually by neighbor uni-cast and after setting up vLink2 with the other side, ED1 and ED3 still carries out MAC address learning mutually according to the mode in example as shown in Figure 4.
Now, refer to Fig. 6 a, ED1 learns the MAC Address MAC-C of the HostD in station network 3 at vLink port EVI-Link2, and then, ED1 can find corresponding forwarding-table item and judge that the port in this forwarding-table item is another vLink port EVI-Link1 in mac address table.And, ED1 can increase corresponding conflict list item for MAC-C and port pair change number of times wherein be added 1 in conflict chained list, because port pair change number of times 1 now not yet reaches the upper limit of 2 times, therefore, the port of forwarding-table item corresponding in mac address table is changed to this time study to the vLink port EVI-Link2 of MAC-C by ED1, now, the forwarding-table item number in the conflict list item that this MAC-C is corresponding still remains initial value 1.
After this, ED2 have advertised the MAC Address MAC-C of HostC again to ED1 by vLink1.
Now, refer to Fig. 6 b, ED1 has learnt MAC-C again at vLink port EVI-Link1, and then, ED1 can find corresponding forwarding-table item and judge that the port in this forwarding-table item is another vLink port EVI-Link2 in mac address table.And, ED1 can find conflict list item corresponding to MAC-C in conflict chained list, and port pair change number of times is wherein added 1, because port pair change number of times 2 has now reached the upper limit of 2 times, therefore, ED1 does not rechange the forwarding-table item of corresponding MAC-C in mac address table, but for MAC-C increases the forwarding-table item of a corresponding vLink port EVI-Link1 again in mac address table, now, the forwarding-table item number in the conflict list item that this MAC-C is corresponding adds 1 and becomes 2.
Thus, by issuing ACL list item, the flow of all corresponding MAC-C can be mirrored to vLink port EVI-Link1 and EVI-Link2 simultaneously, thus can guarantee that the flow of HostC and HostD of shared MAC-C can not interrupt owing to changing at the frequent port of ED1.
Certainly, if MAC-C is aging at vLink port EVI-Link1 or EVI-Link2, cancel, then in conflict chained list, the forwarding-table item number of the conflict list item of corresponding MAC-C will subtract 1, correspondingly, if after this ED1 receives any MAC notice message again, the forwarding-table item number that then can be checked through the conflict list item of MAC-C is less than or equal to 1, and by the collision table entry deletion of MAC-C, to realize removing the conflict of MAC-C.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.