Summary of the invention
The present invention provides message forwarding method and device in a kind of VPLS network, to solve in the prior art, from identical
The message and purpose equipment that source device receives are relatively fixed or in certain period relatively fixed VPLS network, are executing
It is actually only concerned Section MAC address forwarding-table item when target MAC (Media Access Control) address routing, but needs where the target MAC (Media Access Control) address
The matched mac address forwarding table item of target MAC (Media Access Control) address is searched in VPLS broadcast domain in all mac address forwarding table item information,
It is big to search radix, in addition MAC Address feature causes MAC Address search efficiency lower, to influence the forward efficiency of VPLS message
The problem of.
The main purpose of the embodiment of the present invention is, provides message forwarding method in a kind of VPLS network, the method packet
It includes:
Target MAC (Media Access Control) address is created for each mac address forwarding table item and manages table, and the target MAC (Media Access Control) address management table is used for
MAC when saving the MAC Address in each mac address forwarding table item as source address where corresponding each target MAC (Media Access Control) address
Address repeat listing information;
After receiving VPLS message, obtain the source MAC and target MAC (Media Access Control) address of the VPLS message, find with
After the matched mac address forwarding table item of source MAC, then for the matched mac address forwarding table of the source MAC
In the target MAC (Media Access Control) address management table of item creation, search and the matched mac address forwarding table item information of the target MAC (Media Access Control) address, root
The VPLS message is forwarded according to the matched mac address forwarding table item information of the target MAC (Media Access Control) address.
The present invention is by the matched mac address forwarding table item of the target MAC (Media Access Control) address of the VPLS message with identical source MAC
Information is added in the same target MAC (Media Access Control) address management table, and when forwarding VPLS message in this way, it is matched to find source MAC
It after mac address forwarding table item, does not need to carry out routing according to target MAC (Media Access Control) address in the entire domain VPLS, and only needs in source
It is searched in the target MAC (Media Access Control) address management table safeguarded in the matched mac address forwarding table item of MAC Address, i.e., only in concerned MAC address
It is searched in forwarding-table item information, thus greatly reduces routing seeking scope, improve the forward efficiency of VPLS message.
The another object of the embodiment of the present invention also resides in, and provides apparatus for forwarding message in a kind of VPLS network, described device
Include:
Creation module is used to be each mac address forwarding table item creation target MAC (Media Access Control) address management table, the purpose MAC
Location management table corresponding each purpose MAC when being used to save MAC Address in each mac address forwarding table item as source address
Mac address forwarding table item information where location;
Message receiving module obtains the source MAC and purpose of the VPLS message after receiving VPLS message
MAC Address
Forwarding table searching module, for find with after the matched mac address forwarding table item of the source MAC, then
To be managed in table with the target MAC (Media Access Control) address of the source MAC matched mac address forwarding table item creation, search with it is described
The matched mac address forwarding table item information of target MAC (Media Access Control) address, triggering message sending module according to the target MAC (Media Access Control) address
The mac address forwarding table item information matched forwards the VPLS message;
The message sending module, for turning according to the matched mac address forwarding table item information of the target MAC (Media Access Control) address
Send out VPLS message described.
The invention has the benefit that the present invention is according to create mesh in the mac address forwarding table item where source MAC
MAC Address manage table, the MAC Address forwarding where corresponding target MAC (Media Access Control) address is saved in target MAC (Media Access Control) address management table on demand
When list item information, the in this way target MAC (Media Access Control) address routing of execution VPLS message, realizes and only believe in concerned MAC address forwarding-table item
It is searched in breath, reduces target MAC (Media Access Control) address routing seeking scope, improve the forward efficiency of VPLS message.
Specific embodiment
For technical solution of the present invention is more clearly understood, the present invention is described in further details now in conjunction with attached drawing:
The embodiment of the present invention provides message forwarding method and device in a kind of VPLS network, to solve in the prior art,
It is relatively fixed or in certain period relatively fixed VPLS network from the message and purpose equipment that identical source device receives,
It is actually only concerned Section MAC address forwarding-table item when executing target MAC (Media Access Control) address routing, but is needed in purpose MAC
The matched MAC Address forwarding of target MAC (Media Access Control) address is searched where location in mac address forwarding table item information all in VPLS broadcast domain
List item, lookup radix is big, in addition MAC Address feature causes MAC Address search efficiency lower, to influence the forwarding of VPLS message
The problem of efficiency.
The embodiment of the invention provides message forwarding methods in a kind of VPLS network, as shown in Figure 1, which comprises
Step 101 creates target MAC (Media Access Control) address management table, the target MAC (Media Access Control) address pipe for each mac address forwarding table item
Reason table corresponding each target MAC (Media Access Control) address institute when being used to save the MAC Address in each mac address forwarding table item as source address
Mac address forwarding table item information;In this step, mac address forwarding table item is held when receiving VPLS message for the first time
Row source MAC learns.It executes source MAC study and belongs to prior art, details are not described herein again.
The embodiment of the present invention maintains a target MAC (Media Access Control) address management table, purpose in existing mac address forwarding table item
MAC Address management table is according to the target MAC (Media Access Control) address and the target MAC (Media Access Control) address in the message with identical source MAC
The forwarding information creation recorded in the mac address forwarding table item matched, target MAC (Media Access Control) address, which manages, saves one or multiple in table
Mac address forwarding table item information can recorde the matched MAC Address of the target MAC (Media Access Control) address in mac address forwarding table item information
The pointer of forwarding-table item can also directly record the information of the matched mac address forwarding table item of the target MAC (Media Access Control) address.Purpose
The matched mac address forwarding table item information of the target MAC (Media Access Control) address safeguarded in MAC Address management table will record it and create foundation
The pointer of mac address forwarding table item, the purpose of record pointer be when there is message to find the mac address forwarding table item information,
It can be quickly found out the mac address forwarding table item as the mac address forwarding table item information creating foundation according to pointer, and increased
The use of the mac address forwarding table item counts, can be with accurate judgement MAC so as to when executing mac address forwarding table aging process
Address repeat listing by service condition.As shown in Fig. 2, in Fig. 2 it is exemplary depict mac address forwarding table item 201 (1) and
Mac address forwarding table item 201 (2), mac address forwarding table item 201 (1) one target MAC (Media Access Control) address management table 202 (1) of middle maintenance,
One target MAC (Media Access Control) address management table 202 (2) of maintenance, each target MAC (Media Access Control) address manage table in mac address forwarding table item 201 (2)
In save mac address forwarding table item information on demand, target MAC (Media Access Control) address, which manages, saves one or multiple mac address forwarding tables in table
Item information preserves 2 mac address forwarding table item information (203 (11) in target MAC (Media Access Control) address management table 202 (1) in Fig. 2
With 203 (12)), target MAC (Media Access Control) address manages in table 202 (2) and preserves n mac address forwarding table item information (203 (21) to 203
(2n)), n here is the integer greater than 0.In Fig. 2,203 information of mac address forwarding table item (12) can be directed toward it according to pointer
Create the mac address forwarding table item 201 (2) of foundation.
It in embodiments of the present invention, can also be directly straight by the information of the matched mac address forwarding table item of target MAC (Media Access Control) address
It connects and copies in target MAC (Media Access Control) address management table, it, can also be with accurate judgement in this way when executing mac address forwarding table aging process
Mac address forwarding table item by service condition.In Fig. 2, mac address forwarding table item 201 (2) is the matched MAC of source MAC
The matched mac address forwarding table item of the target MAC (Media Access Control) address of address repeat listing 201 (1), therefore can be by mac address forwarding table
The information of 201 (2) of item is copied directly to the mac address forwarding table item information of the maintenance in target MAC (Media Access Control) address management table 202 (1)
In 203 (12).
Through the embodiment of the present invention a target MAC (Media Access Control) address management is maintained in existing mac address forwarding table item
The mode of table, it is ensured that the VPLS message of identical source MAC can the same target MAC (Media Access Control) address manage table in search,
Creation, maintenance mac address forwarding table item information;VPLS message with different source MACs searches different target MAC (Media Access Control) address
Manage table.
Step 102 after receiving VPLS message, obtains the source MAC and target MAC (Media Access Control) address of the VPLS message,
Find with after the matched mac address forwarding table item of the source MAC, then for the matched MAC of the source MAC
In the target MAC (Media Access Control) address management table of location forwarding-table item creation, search and the matched mac address forwarding table of the target MAC (Media Access Control) address
Item information forwards the VPLS message according to the matched mac address forwarding table item information of the target MAC (Media Access Control) address.In this step
In rapid, the method also includes:
When not finding mac address forwarding table item matched with the source MAC, source MAC study is being executed
Afterwards, search with the matched mac address forwarding table item of the target MAC (Media Access Control) address, according to the matched MAC of the target MAC (Media Access Control) address
Address repeat listing forwards the VPLS message;And it will add with the matched mac address forwarding table item information of the target MAC (Media Access Control) address
It is added in the target MAC (Media Access Control) address management table for the mac address forwarding table item creation where the source MAC.
Further, the embodiment of the present invention the method also includes:
Find with after the matched mac address forwarding table item of the source MAC, then for the source MAC
In the target MAC (Media Access Control) address management table of matched mac address forwarding table item creation, does not find and matched with the target MAC (Media Access Control) address
Mac address forwarding table item information when, search with the matched mac address forwarding table item of the target MAC (Media Access Control) address, according to it is described
The matched mac address forwarding table item of target MAC (Media Access Control) address forwards the VPLS message;And it will be matched with the target MAC (Media Access Control) address
Mac address forwarding table item information is with being added to the purpose MAC of the mac address forwarding table item creation where the source MAC
Location manages in table.
After the basis forwards the VPLS message with the matched mac address forwarding table item of the target MAC (Media Access Control) address, institute
State method further include:
If being according to the target MAC (Media Access Control) address management table with the matched mac address forwarding table item of the target MAC (Media Access Control) address
It finds, then updates the mac address forwarding table item letter where target MAC (Media Access Control) address described in the target MAC (Media Access Control) address management table
Corresponding count value is ceased, and updates count value corresponding with the matched mac address forwarding table item of the target MAC (Media Access Control) address;
If the matched mac address forwarding table item of target MAC (Media Access Control) address is by searching for the lookup of mac address forwarding table item
It arrives, then updates meter count value corresponding with the matched mac address forwarding table item of the target MAC (Media Access Control) address.
In embodiments of the present invention, if not finding purpose MAC in the mac address forwarding table item information of VPLS broadcast domain
The mac address forwarding table of address matching does not continue to then execute VPLS message forwarding operation.
The embodiment of the present invention is to index in mac address forwarding table item with maintaining a purpose MAC according to source MAC
Location manages table, saves the mac address forwarding table item letter where corresponding target MAC (Media Access Control) address in target MAC (Media Access Control) address management table on demand
It when breath, the in this way target MAC (Media Access Control) address routing of execution VPLS message, realizes and is only searched in concerned MAC address forwarding-table item, contract
Small target MAC (Media Access Control) address routing seeking scope, improves the forward efficiency of VPLS message.
The embodiment of the present invention turns the matched MAC Address of target MAC (Media Access Control) address of the VPLS message with identical source MAC
Forwarding list item information is added in the same target MAC (Media Access Control) address management table, when forwarding VPLS message in this way, finds source MAC
After matched mac address forwarding table item, do not need to carry out routing according to target MAC (Media Access Control) address in the entire domain VPLS again, and only
It needs to search in the target MAC (Media Access Control) address management table safeguarded in the matched mac address forwarding table item of source MAC, i.e., only in phase
It closes and is searched in mac address forwarding table item information, thus greatly reduce routing seeking scope, improve the forwarding of VPLS message
Efficiency.For example 1000 mac address forwarding table items are saved in a VPLS broadcast domain, the equipment A in VPLS broadcast domain is only same
Other 5 equipment communications, the target MAC (Media Access Control) address that equipment A issues message have 5, that is to say, that execute target MAC (Media Access Control) address routing
When, mac address forwarding table item to be selected only has 5.When executing target MAC (Media Access Control) address routing, needed using original processing mode
It is searched in 1000 mac address forwarding table items, and uses method described in the embodiment of the present invention, it is only necessary to turned in 5 MAC Address
It is searched in forwarding list item, greatly reduces the seeking scope of target MAC (Media Access Control) address routing, improve message forward efficiency, be especially suitable for
The case where point-to-point or point-to-multipoint forwards is realized in VPLS network.
In a kind of VPLS network shown in Fig. 1 of the embodiment of the present invention after message forwarding method, further comprise at aging
Step is managed, as shown in figure 3, the aging process step includes:
Step 301 successively traverses each mac address forwarding table item according to the time cycle of setting, judges each MAC Address
Whether forwarding-table item needs to be implemented aging process, in this step, judges whether mac address forwarding table item needs the aging process to be
The prior art usually judges whether the mac address forwarding table item is accessed in set time period, and details are not described herein again.
Step 302, if it is determined that some mac address forwarding table item needs to be implemented aging process, then will some MAC
Location forwarding-table item is deleted, and is deleted and managed table for the target MAC (Media Access Control) address of some mac address forwarding table item creation;
Step 303, if it is determined that some described mac address forwarding table item do not need execute aging process, then successively traverse
Target MAC (Media Access Control) address for the creation of some described mac address forwarding table item manages table, judges in the target MAC (Media Access Control) address management table
Whether the mac address forwarding table item information where each target MAC (Media Access Control) address saved needs to be implemented aging process, if it is determined that certain
Mac address forwarding table item information where a target MAC (Media Access Control) address needs to be implemented aging process, then by some purpose MAC
Mac address forwarding table item information where location is deleted from target MAC (Media Access Control) address management table.
In embodiments of the present invention, described to judge whether each mac address forwarding table item needs to be implemented aging process, specifically
Include:
Judge whether some corresponding count value of mac address forwarding table item updates, if not, judging that the MAC Address forwards
List item needs to be implemented aging process;If some corresponding count value of mac address forwarding table item has within the time cycle of setting
It updates, does not then need to carry out aging process.
MAC Address forwarding where each target MAC (Media Access Control) address saved in the judgement target MAC (Media Access Control) address management table
Whether list item information needs to be implemented aging process, specifically includes:
Judge the mac address forwarding table item where each target MAC (Media Access Control) address saved in the target MAC (Media Access Control) address management table
Whether the corresponding count value of information updates, if not, the mac address forwarding table item information where judging the target MAC (Media Access Control) address needs
Execute aging process;If each purpose MAC saved in the target MAC (Media Access Control) address management table within the time cycle of setting
The corresponding count value of mac address forwarding table item information where address has update, then does not need to carry out aging process.
MAC Address where having traversed each target MAC (Media Access Control) address for judging to save in the target MAC (Media Access Control) address management table
After whether the corresponding count value of forwarding-table item information has update within the time cycle of setting, continue to next MAC Address
Forwarding-table item is made whether to need the judgement of aging process.
The embodiment of the invention also provides apparatus for forwarding message in a kind of VPLS network, as shown in figure 4, described device 40 is wrapped
It includes:
Creation module 401 manages table, the purpose for creating target MAC (Media Access Control) address for each mac address forwarding table item
MAC Address management table corresponding each purpose when being used to save the MAC Address in each mac address forwarding table item as source address
Mac address forwarding table item information where MAC Address;
Message receiving module 402 obtains the source MAC and mesh of the VPLS message after receiving VPLS message
MAC Address;
Forwarding table searching module 403, for find with after the matched mac address forwarding table item of the source MAC,
It to be managed in table with the target MAC (Media Access Control) address of the source MAC matched mac address forwarding table item creation, is searching and institute again
The matched mac address forwarding table item information of target MAC (Media Access Control) address is stated, triggers message sending module 404 according to the purpose MAC
The matched mac address forwarding table item information in location forwards the VPLS message;
The message sending module 404, for believing according to the matched mac address forwarding table item of the target MAC (Media Access Control) address
Breath forwards the VPLS message.
The forwarding table searching module 403 is also used to do not finding and the matched MAC Address of the source MAC turn
When forwarding list item, after executing source MAC study, search and the matched mac address forwarding table item of the target MAC (Media Access Control) address, touching
Literary sending module 404 of transmitting messages according to the matched mac address forwarding table item of the target MAC (Media Access Control) address forwards the VPLS message;
And it triggers creation module 401 and will be added to the source with the matched mac address forwarding table item information of the target MAC (Media Access Control) address
In the target MAC (Media Access Control) address management table of mac address forwarding table item creation where MAC Address;
The creation module 401 is also used to after executing source MAC study, is the MAC where the source MAC
The target MAC (Media Access Control) address of address repeat listing creation manages table, will be with the matched mac address forwarding table item of the target MAC (Media Access Control) address
Information is added in the target MAC (Media Access Control) address management table of the mac address forwarding table item creation where the source MAC.
The forwarding table searching module 403 is also used to finding and the matched MAC Address forwarding of the source MAC
After list item, then to be managed in table with the target MAC (Media Access Control) address of the source MAC matched mac address forwarding table item creation, not
When finding mac address forwarding table item information matched with the target MAC (Media Access Control) address, lookup is matched with the target MAC (Media Access Control) address
Mac address forwarding table item, triggering message sending module 404 according to the matched mac address forwarding table of the target MAC (Media Access Control) address
Item forwards the VPLS message;And trigger creation module 401 will be with the matched mac address forwarding table item of the target MAC (Media Access Control) address
Information is added in the target MAC (Media Access Control) address management table of the mac address forwarding table item creation where the source MAC;
The creation module 401, is also used to find in forwarding table searching module 403 and matches with the target MAC (Media Access Control) address
Mac address forwarding table item after, will be added to the matched mac address forwarding table item information of the target MAC (Media Access Control) address described
In the target MAC (Media Access Control) address management table of mac address forwarding table item creation where source MAC.
As shown in figure 5, described device 40 further includes counting module 505,
The counting module 505, if for being basis with the matched mac address forwarding table item of the target MAC (Media Access Control) address
What the target MAC (Media Access Control) address management table was found, then update target MAC (Media Access Control) address institute described in the target MAC (Media Access Control) address management table
The corresponding count value of mac address forwarding table item information, and update and forwarded with the matched MAC Address of the target MAC (Media Access Control) address
The corresponding count value of list item;
The counting module 505, if being also used to the matched mac address forwarding table item of the target MAC (Media Access Control) address is to pass through
It searches what mac address forwarding table item was found, then updates corresponding with the matched mac address forwarding table item of the target MAC (Media Access Control) address
Count value.
As shown in fig. 6, described device 40 further includes ageing module 606,
The ageing module 606 successively traverses each mac address forwarding table item for the time cycle according to setting, sentences
Whether each mac address forwarding table item that breaks needs to be implemented aging process,
If it is determined that some mac address forwarding table item needs to be implemented aging process, then it will some described mac address forwarding table
Entry deletion, and delete and manage table for the target MAC (Media Access Control) address of some mac address forwarding table item creation;
If it is determined that some described mac address forwarding table item does not need to execute aging process, then successively traversal for it is described certain
The target MAC (Media Access Control) address of a mac address forwarding table item creation manages table, judges to save in the target MAC (Media Access Control) address management table each
Whether the mac address forwarding table item information where a target MAC (Media Access Control) address needs to be implemented aging process, if it is determined that some purpose
Mac address forwarding table item information where MAC Address needs to be implemented aging process, then will some target MAC (Media Access Control) address place
Mac address forwarding table item information deleted from target MAC (Media Access Control) address management table.
The ageing module 606, is specifically used for, and judges that some mac address forwarding table item is corresponding in the counting module 505
Count value whether update, if not, judging that the mac address forwarding table item needs to be implemented aging process;
The ageing module 606, is specifically also used to, and judges target MAC (Media Access Control) address management table described in the counting module 505
Whether the corresponding count value of mac address forwarding table item information where each target MAC (Media Access Control) address of middle preservation updates, if not,
Mac address forwarding table item information where judging the target MAC (Media Access Control) address needs to be implemented aging process.
Apparatus for forwarding message is index in MAC according to source MAC in a kind of VPLS network described in the embodiment of the present invention
A target MAC (Media Access Control) address management table is maintained in address repeat listing, target MAC (Media Access Control) address management table saves MAC Address on demand and turns
When forwarding list item information, the in this way target MAC (Media Access Control) address routing of execution VPLS message, realize only in concerned MAC address forwarding-table item
It is searched in information, reduces target MAC (Media Access Control) address routing seeking scope, improve the forward efficiency of VPLS message.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.