Invention content
In view of this, the present invention provides a kind of mac address processing methods and device, to protect after solving active link failure
Port needs the problem of relearning mac address tables.Technical solution is as follows:
A kind of mac address processing methods are applied to communication equipment, including:
It is identical with the protection virtual LAN access list of port in working port, super mouth is redefined, it is described
Super mouth is made of the working port, the protection port and the virtual LAN access list;
Medium access control mac address tables are generated, record has the virtual office corresponding to the super mouth in the mac address tables
The addresses mac of the super mouth in opposite end corresponding to domain net access list and the super mouth;
In the case where the super mouth receives the first data frame for carrying the addresses target mac, the target mac is judged
Address whether there is in the addresses mac of the super mouth in opposite end corresponding to the super mouth;
If so, determining active port from the working port and the protection port, visited based on the virtual LAN
It asks that list determines the super mouth in target opposite end corresponding to the addresses the target mac, and controls the active port and counted described first
It is forwarded to the super mouth in target opposite end according to frame.
Preferably, the generation medium access control mac address tables, including:
If detecting that the working port or the protection port receive carries the addresses active medium access control mac
The second data frame, the addresses the source mac are determined as to the addresses mac of the super super mouth in mouth opposite end;
According to the addresses mac of the super mouth in opposite end corresponding to the super mouth and the virtual LAN access list, described in generation
Mac address tables corresponding to super mouth.
Preferably, the active port determining from the working port and the protection port, including:
There are the ports of business datum for selection from the working port and the protection port;
Selected port is determined as active port.
Preferably, further include:
Detecting the active port there are in the case of altering event, the active port of the active port is identified
It is sent to the super mouth in target opposite end.
Preferably, the port type of the working port is common port or link aggregation group.
Preferably, the protection port type is common port or link aggregation group.
A kind of mac address process device, including:Redefine module, generation module, judgment module and control module;
It is described to redefine module, for the situation identical with the protection virtual LAN access list of port in working port
Under, super mouth is redefined, the super mouth is by the working port, the protection port and the virtual LAN access list structure
At;
The generation module records described in having for generating medium access control mac address tables in the mac address tables
The addresses mac of the super mouth in opposite end corresponding to virtual LAN access list and the super mouth corresponding to super mouth;
The judgment module, for the case where the super mouth receives the first data frame for carrying the addresses target mac
Under, judge the addresses the target mac with the presence or absence of in the addresses mac of the super mouth in opposite end corresponding to the super mouth;If so, triggering
The control module;
The control module, for determining active port from the working port and the protection port, based on described
Virtual LAN access list determines the super mouth in target opposite end corresponding to the addresses the target mac, and controls the active port
First data frame is forwarded to the super mouth in target opposite end.
Preferably, generation module is specifically used for:
If detecting that the working port or the protection port receive carries the addresses active medium access control mac
The second data frame, the addresses the source mac are determined as to the addresses mac of the super super mouth in mouth opposite end;It is right according to the super mouth institute
The addresses mac of the super mouth in opposite end and the virtual LAN access list are answered, the mac address tables corresponding to the super mouth are generated.
Preferably, the determining module, is specifically used for:
There are the ports of business datum for selection from the working port and the protection port;Selected port is true
It is set to active port.
Preferably, the control module, is additionally operable to:
Detecting the active port there are in the case of altering event, the active port of the active port is identified
It is sent to the super mouth in target opposite end.
Compared to the prior art, what the present invention realized has the beneficial effect that:
A kind of mac address processing methods and device provided by the invention above, this method is applied to communication equipment, by work
Port, protection port and the identical virtual LAN access list definition of the two are super mouth, utilize super mouth and the mac learnt
Address table completes forwarding.This can skip the update of the addresses mac during link switching, it is only necessary to determine active port,
To greatly reduce the data forwarding duration of communication equipment.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Vlan technology:Ethernet is a kind of based on CSMA/CD (Carrier Sense Multiple Access/
Collision Detect, Carrier Sense Multiple Access/collision detection) shared communication media data network mechanics of communication,
The problems such as serious, broadcast flooding, the performance of leading to a conflict when number of host is more are remarkably decreased or even keep network unavailable.It is logical
Cross communication equipment, although such as interchanger or router realize and LAN interconnections can solve conflict (Collision) is serious to ask
Topic, but still broadcasting packet cannot be isolated.Occur in this case VLAN (Virtual Local Area Network,
Virtual LAN) technology, this technology can be divided into a LAN LAN --- the VLAN of multiple logics, and each VLAN is one
A broadcast domain, the inter-host communication in VLAN just as in a LAN, and between VLAN then cannot direct intercommunication, in this way, extensively
Text is reported to be limited in a VLAN.
The division of VLAN is not limited by physical location:It not may belong in the host of same physical location range same
VLAN;The user that one VLAN includes can be connected on the same interchanger, can also cross over interchanger, it might even be possible to cross over
Router.
Based on above-mentioned vlan technology, the embodiment of the present invention provides a kind of mac address processing methods, and this method is applied to communication
Equipment, the communication equipment include but is not limited to interchanger, router etc., and method flow diagram is as shown in Figure 1, including following step
Suddenly:
S10, it is identical with the protection virtual LAN access list of port in working port, it is communication equipment weight
Super mouth is defined, the super mouth is made of working port, protection port and virtual LAN access list;
In the present embodiment, record has multiple VLAN to identify in virtual LAN access list vlanlist, and VLAN is marked
There are correspondences with the addresses mac with access rights host under the VLAN for knowledge.
The port type of working port can be common end mouth port, can also be link aggregation group lag (link
Aggregation group), wherein link aggregation group lag is polymerized by multiple common port port.And protect port
Port type is alternatively port or lag.Therefore, super mouth is by two members --- and working port and protection port are constituted, each
Member is port+vlanlist or lag+vlanlist.
S20 generates medium access control mac address tables, and record has the virtual office corresponding to super mouth in the mac address tables
The addresses mac of the super mouth in opposite end corresponding to domain net access list and super mouth;
In the present embodiment, the mac address tables of communication equipment are that the source addresses mac based on data frame are learnt.It lifts below
Example illustrates the process of super oral area point study mac address tables in communication equipment:
If receiving the data frame that the super mouth in opposite end is sent from working port or protection port, communication equipment will
The source addresses mac (being assumed to be MAC-SOURCE) for analyzing the data frame, using MAC-SOURCE as the super mouth in opposite end corresponding to super mouth
The addresses mac and be added in mac address tables.Certainly, in the process, if detecting that MAC-SOURCE is already present on
Mac address tables suffer, then can not be added into.
In addition, the super mouth corresponding to communication equipment can be one or more, can be super mouth addition mark in mac address tables
Know, such as super mouth number, to distinguish the addresses mac, the virtual LAN access list of the super mouth in opposite end corresponding to each super mouth.
Certainly, in the process, communication equipment also may be learned transmitted by common port port or link aggregation group lag
The addresses mac, therefore working port or protection port receive the data frame for carrying such addresses mac when, directly general
Data frame is sent to connected Peer-Port.
Following step can specifically be used by " generating medium access control mac address tables " during specific implementation, in step S20
Suddenly, method flow diagram is as shown in Figure 2:
S201 carries the addresses active medium access control mac if detecting working port or port being protected to receive
The source addresses mac are determined as the addresses mac of the super mouth in opposite end corresponding to super mouth by the second data frame;
It is right to generate super mouth institute according to the addresses mac of the super mouth in opposite end and virtual LAN access list corresponding to super mouth by S202
The mac address tables answered.
S30 judges the addresses target mac in the case where super mouth receives the first data frame for carrying the addresses target mac
With the presence or absence of in the addresses mac of the super mouth in opposite end corresponding to super mouth;If so, thening follow the steps S40;
In the present embodiment, if the addresses target mac are not present in the addresses mac of the super mouth in opposite end corresponding to super mouth, communicate
Equipment executes any operation.
S40 determines active port from working port and protection port, target is determined based on virtual LAN access list
The super mouth in target opposite end corresponding to the addresses mac, and control active port and the first data frame is forwarded to the super mouth in target opposite end;
In the present embodiment, active link during the work time, only by working port forwarding data frame, therefore at working port
There are business datums.Conversely, communication equipment when detecting active link failure, can automatically switch to protection link, at this point, only
By protecting port forwarding data frame, therefore there are business datums at protection port.It can be seen that communication equipment exists by choosing
The port of business datum can determine active port.
And during the first data frame is forwarded to the super mouth in target opposite end by active port, it is first determined first data frame
Pass-through mode the first data frame is directly then forwarded to the super mouth in target opposite end if mode of unicast, and if broadcast mode,
Then take broadcast mode that the first data frame is forwarded to all of the port for including the super mouth in target opposite end.
In addition, in order to ensure that opposite end communication equipment is switched to port corresponding with active port in time, some other
Further include following steps in embodiment, method flow diagram is as shown in Figure 3:
The active port of active port is identified and is sent detecting active port there are in the case of altering event by S50
To the super mouth in target opposite end.
Active port mark can be that the port numbers etc. of active port can be used for the mark of unique designation active port.
Above step S201~step S202 is only " to generate medium access in the step S20 that the embodiment of the present application discloses
A kind of preferred realization method of control mac address tables " process, the specific implementation in relation to this process can be according to the need of oneself
Arbitrary setting is asked, is not limited herein.
Mac address processing methods provided in an embodiment of the present invention are applied to communication equipment, by working port, protection port
And the identical virtual LAN access list definition of the two is super mouth, completes to turn using super mouth and the mac address tables learnt
Hair.This can skip the update of the addresses mac during link switching, it is only necessary to active port be determined, to greatly reduce
The data forwarding duration of communication equipment.
Based on the mac address processing methods that above-described embodiment provides, then corresponding provide executes above-mentioned mac to the embodiment of the present invention
The device of address processing method, structural schematic diagram is as shown in figure 4, include:Redefine module 10, generation module 20, judgment module
30 and control module 40;
Module 10 is redefined, for the situation identical with the protection virtual LAN access list of port in working port
Under, super mouth is redefined, the super mouth is made of working port, protection port and virtual LAN access list;
Generation module 20, for generating medium access control mac address tables, being recorded in the mac address tables has super mouth institute
The addresses mac of the super mouth in opposite end corresponding to corresponding virtual LAN access list and super mouth;
Judgment module 30, in the case where super mouth receives the first data frame for carrying the addresses target mac, judging
The addresses target mac whether there is in the addresses mac of the super mouth in opposite end corresponding to super mouth;If so, trigger control module 40;
Control module 40 is accessed for determining active port from working port and protection port based on virtual LAN
List determines the super mouth in target opposite end corresponding to the addresses target mac, and controls active port and the first data frame is forwarded to target
The super mouth in opposite end.
In some other embodiment, generation module 20 is specifically used for:
If detecting working port or port being protected to receive the second number for carrying the addresses active medium access control mac
According to frame, the source addresses mac are determined as to the addresses mac of the super super mouth in mouth opposite end;According to the addresses mac of the super mouth in opposite end corresponding to super mouth and
Virtual LAN access list generates the mac address tables corresponding to super mouth.
In some other embodiment, determining module 40 is specifically used for:
There are the ports of business datum for selection from working port and protection port;Selected port is determined as activity
Port.
In some other embodiment, control module 40 is additionally operable to:
Detecting active port there are in the case of altering event, the active port mark of active port is sent to mesh
Mark the super mouth in opposite end.
Mac address process device provided in an embodiment of the present invention skips the update of the addresses mac, only during link switching
Active port need to be determined, to greatly reduce the data forwarding duration of interchanger.
A kind of mac address processing methods provided by the present invention and device are described in detail above, answered herein
With specific case, principle and implementation of the present invention are described, and the explanation of above example is only intended to help to manage
Solve the method and its core concept of the present invention;Meanwhile for those of ordinary skill in the art, according to the thought of the present invention,
There will be changes in specific implementation mode and application range, in conclusion the content of the present specification should not be construed as to this hair
Bright limitation.
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment weight
Point explanation is all difference from other examples, and the same or similar parts between the embodiments can be referred to each other.
For the device disclosed in the embodiment, since it is corresponded to the methods disclosed in the examples, so fairly simple, the phase of description
Place is closed referring to method part illustration.
It should also be noted that, herein, relational terms such as first and second and the like are used merely to one
Entity or operation are distinguished with another entity or operation, without necessarily requiring or implying between these entities or operation
There are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to contain
Lid non-exclusive inclusion, so that the element that the process, method, article or equipment including a series of elements is intrinsic,
Further include either the element intrinsic for these process, method, article or equipments.In the absence of more restrictions,
The element limited by sentence "including a ...", it is not excluded that in the process, method, article or equipment for including the element
In there is also other identical elements.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest range caused.