Retransmission method and access device based on VLAN mapping
Technical field
The present invention relates to the business treatment technique field, be specifically related to retransmission method and access device based on VLAN mapping.
Background technology
At present, in carrier network, propose more and more can realize fine-grained management, can pass through VLAN (VLAN, Virtual Local Area Network) information each user, every kind of business are discerned user's different business.User's multiple business type, as internet service, professional, the ip voice (VOIP of Internet Protocol Television (IPTV), Voice Over IP) business, gather the gateway (HG of family, Home Gateway), home gateway is every kind of vlan information that traffic assignments is different, and for the consideration that is easy to safeguard, the home gateway configuration requirement of different user is unified.The notion of VLAN mapping (Mapping) proposes under this background just.Because each user's home gateway is with the identical VLAN of a kind of traffic assignments, need carry out unique mapping to identical VLAN by VLAN Mapping, so that by the vlan information identifying user after the mapping.
VLAN Mapping has 2 kinds of implementations at present:
1, uses the hardware table item of VLAN Mapping, directly carry out the replacement of VLAN label.This implementation is the simplest, but because the two-way hardware table item that all needs to support the VLAN Mapping of some is gone into/gone out to each access interface of equipment, cost is higher.
2, use the stream rule directly to carry out the modification of VLAN label, need issue the VLAN label that the coupling home gateway distributes at each service port of equipment, the action of stream rule is that the VLAN label that service message carries is replaced with VLAN label after the mapping, when the reverse mapping of VLAN Mapping, also need the configuration flow rule to realize simultaneously.
Based on media interviews control (MAC, Media Access Control) VLAN distributes (MACbased VLAN) to be meant that the source MAC according to message is that message distributes the VLAN label, generally require message not have the VLAN label, if but the vlan information that message carries is distrusted in the equipment support, also can distribute vlan information for the message that carries the VLAN label, replace the VLAN label that carries in the message with the vlan information that distributes.A lot of equipment are all supported this function, but because configuration is upward more loaded down with trivial details, and workload is big, are not easy to safeguard, generally seldom use.
Fig. 1 is a VLAN Mapping typical services illustraton of model, as shown in Figure 1, at user side 2 kinds of business is arranged: PC business of networking and IPTV business, home gateway are that 2 kinds of business are distributed VLAN 1 and VLAN 2 respectively; Access device is converted to network side VLAN 101,201,102,202,103,203 with user side VLAN 1 and the VLAN 2 that home gateway distributes, the PC business of networking of VLAN 101 identifying users 1 wherein, the IPTV business of VLAN 201 identifying users 1, the PC business of networking of VLAN 102 identifying users 2, the IPTV business of VLAN 202 identifying users 2, the PC business of networking of VLAN 103 identifying users 3, the IPTV business of VLAN 203 identifying users 3.In actual networking during, as long as certain that guarantees that VLAN label after the mapping can certain user of unique identification is professional to delineation of activities; According to type of service the VLAN label after shining upon is done flexible secondary VLAN label encapsulation (QinQ) at convergence-level equipment, promptly add outside VLAN label 1001, at the professional outside VLAN label 2001 that adds of IPTV at business of networking; The different business that outside VLAN label that just can carry according to message at the service convergence point server and inner VLAN label are distinguished particular user is carried out default action respectively, as is carried out Limit Rate, and service quality (QOS, Quality ofService) etc. is set.
For ease of subsequent descriptions, the VLAN that home gateway is distributed is called user vlan, is labeled as C_VLAN, VLAN 1 as shown in Figure 1 and VLAN 2; VLAN after the mapping is called network side VLAN, is labeled as SP_VLAN, VLAN 101,201,102,202,103,203 as shown in Figure 1.
Use the stream rule directly to carry out the modification of VLAN label, need be in each service port configuration flow rule of equipment, the content of stream rule is the C_VLAN that the coupling home gateway distributes, VLAN 1 promptly shown in Figure 1 and VLAN 2; The action of stream rule is that the C_VLAN in the service message is replaced with SP_VLAN after the mapping, and promptly VLAN 101,201,102,202,103,203.After finishing above-mentioned configuration, the VLAN label from the message (as PC business of networking or IPTV service message) that user side sends will be replaced by the SP_VLAN after the mapping.In like manner, reverse traffic need be made opposite VLANMapping, need issue many stream rules respectively at uplink port, the content of stream rule is coupling SP_VLAN, be VLAN 101,201,102,202,103,203, the action of stream rule is that the SP_VLAN in the message is replaced with C_VLAN, i.e. VLAN 1 and VLAN 2.
By above analysis as can be known, suppose to offer a kind business in Operation Network, the appliance services port has b, and uplink port c, each service port has d user, and then required stream rule resource is (c+1) * a*b*d bar.
Fig. 2 is for realizing the forwarding process schematic diagram of VLAN Mapping by the stream rule, as shown in Figure 2, Port X and Port Y are the descending access service port of access device, and Port Z links to each other with convergence-level equipment as the uplink port of access device.Carry out VLAN Mapping:VLAN1--at Port X〉VLAN101, the MAC Address of customer service equipment is MAC 1; VLAN 2--〉VLAN 201, the MAC Address of customer service equipment is MAC2.Carry out VLAN Mapping:VLAN1--at Port Y〉VLAN 102, the MAC Address of customer service equipment is MAC 3; VLAN 2--〉VLAN 202, the MAC Address of customer service equipment is MAC 4.Carry out reverse VLAN Mapping:VLAN 101--at Port Z〉VLAN 1, the source MAC of data service is MAC 5; VLAN201--〉VLAN 2, the source MAC of data service is MAC 6; VLAN 102--〉VLAN 1, the source MAC of data service is MAC 7; VLAN 202--〉VLAN 2, the source MAC of data service is MAC 8.
Suppose that MAC address learning carried out before the stream rule is replaced VLAN ID, then the VLAN situation of MAC address learning is as shown in Figure 2 on access device, MAC1 study is in VLAN 1, MAC 2 study are in VLAN 2, and MAC 3 study are in VLAN 1, and MAC 4 study are in VLAN2, MAC 5 study are in VLAN 101, MAC 6 study are in VLAN 201, and MAC 7 study are in VLAN 102, and MAC 8 study are in VLAN 202.Suppose bidirectional traffic be MAC1<--MAC 5, MAC 2<--MAC 6, MAC 3<--MAC 7, MAC 4<--MAC 8.With bidirectional traffic MAC 1<--MAC 5 is example, because MAC 1 is that study is in VLAN 1, and MAC 5 study are in VLAN 101, when E-Packeting, understand because in the VLAN of appointment, search, and message is broadcasted as unknown message less than target MAC (Media Access Control) address, for fear of this phenomenon, MAC 1 need be added among the VLAN 101, MAC 5 adds among the VLAN 1, and bidirectional traffic could be done correct clean culture forwarding like this.Therefore, for guaranteeing professional operate as normal, same MAC Address should all exist in 2 VLAN before and after the mapping, be that MAC 1 wants simultaneously in VLAN 1 and VLAN 101, the rest may be inferred for other MAC Address, so, on access device shown in Figure 2, should have 16 MAC Address to be present in the mac address forwarding table.Above-mentioned phenomenon is present in the situation that MAC address learning carries out after revising VLAN ID equally.
As seen, existing by there being following shortcoming in the forwarding process that flows rule realization VLAN Mapping:
1, because the two-way stream that all uses of VLAN Mapping is regular, occupying system resources is more.
2, because the source MAC of bidirectional traffic is learnt in different VLAN, can produce broadcasting and flood.
3, for fear of flooding that MAC address learning may produce in different VLAN, need software that MAC Address is added among the VLAN after the mapping, to consider the problem of MAC address aging simultaneously, increased the complexity of software processes.
Summary of the invention
The invention provides retransmission method and access device, to reduce taking of system resource based on VLAN Mapping.
Technical scheme of the present invention is achieved in that
A kind of retransmission method based on the VLAN mapping, this method comprises:
According to the VLAN allocation table of VLAN mapping table maintenance based on MAC, described VLAN allocation table comprises the MAC Address of user side equipment and the corresponding relation of network side VLAN label, the network side VLAN label of the user side VLAN label correspondence that described network side VLAN label is a user side equipment;
The source MAC that uses user side to send message is inquired about described VLAN allocation table, determines the network side VLAN label of described message according to Query Result, and the user side VLAN label of described message is replaced with determined network side VLAN label;
According to the target MAC (Media Access Control) address of described message and the network side VLAN label forwarding message after the replacement.
Describedly safeguard that according to described VLAN mapping table the VLAN allocation table based on MAC comprises:
In VLAN mapping table, search the network side VLAN label of the user side VLAN label correspondence in the message that user side sends, the source MAC of this message and this network side VLAN label are added to respectively in the VLAN allocation table and mac address forwarding table based on MAC.
Described source MAC and this network side VLAN label with this message adds to respectively based on further comprising in the VLAN allocation table of MAC and the mac address forwarding table: issue the stream rule that comprises user side VLAN label and network side VLAN label, and,
When access device from the up port that converges when receiving message, in mac address forwarding table, search network side VLAN label and target MAC (Media Access Control) address corresponding output port in the message, the user side VLAN label of Network Search side VLAN label correspondence in the stream rule, network side VLAN label with in the user side VLAN label replacement message forwards message from described outbound port.
Each access interface of access device is set to software learning MAC Address mode in advance.
For each port that disposes VLAN mapping table, the mac address forwarding table entry deletion of the MAC Address correspondence of the user side equipment that this port is connected.
Further comprise before the described network side VLAN label of in VLAN mapping table, searching the user side VLAN label correspondence in the message that user side sends:
In VLAN allocation table, search the source MAC of message based on MAC, if do not find, in mac address forwarding table, search the source MAC and the user side VLAN label of message, if do not find yet, then carry out described action of in VLAN mapping table, searching the network side VLAN label of the user side VLAN label correspondence in the message that user side sends.
Described user side VLAN label with described message replaces with after the determined network side VLAN label, further comprise according to the target MAC (Media Access Control) address of described message with before the network side VLAN label forwarding message after replacing:
Search the source MAC and the network side VLAN label of message in mac address forwarding table, if do not find, then source MAC and the network side VLAN label with message adds in the mac address forwarding table.
Described VLAN mapping table is the N:1 mapping, and wherein, N is the positive integer greater than 1,
The source MAC that also comprises message in the described stream rule.
Described method further comprises:
Access device receives message from the up port that converges, in mac address forwarding table, search network side VLAN label and target MAC (Media Access Control) address corresponding output port in the message, the user side VLAN label of Network Search side VLAN label and target MAC (Media Access Control) address correspondence in the stream rule, network side VLAN label with in the user side VLAN label replacement message forwards message from described outbound port.
Described method further comprises: find the MAC address aging in the mac address forwarding table, then according to the network side VLAN label of this MAC Address correspondence, the VLAN based on MAC that deletes this network side VLAN label correspondence distributes list item and stream rule.
A kind of access device, this equipment comprises:
The list item memory module, the VLAN allocation table that storage is safeguarded according to VLAN mapping table based on MAC, described VLAN allocation table comprises the MAC Address of user side equipment and the corresponding relation of network side VLAN label, the network side VLAN label of the user side VLAN label correspondence that described network side VLAN label is a user side equipment;
The forwarded upstream module, the source MAC that uses user side to send message is inquired about described VLAN allocation table, determine the network side VLAN label of described message according to Query Result, and the user side VLAN label of described message is replaced with determined network side VLAN label; According to the target MAC (Media Access Control) address of described message and the network side VLAN label forwarding message after the replacement.
Described forwarded upstream module further comprises, is used to issue the module of the stream rule that comprises user side VLAN label and network side VLAN label,
And, described access device further comprises: descending forwarding module, be used for receiving message from the up port that converges, in mac address forwarding table, search network side VLAN label and target MAC (Media Access Control) address corresponding output port in the message, the user side VLAN label of Network Search side VLAN label correspondence in the stream rule, network side VLAN label with in the user side VLAN label replacement message forwards message from described outbound port.
Described access device further comprises:
The port arrangement module, each access interface of access device is set to software learning MAC Address mode.
Described port arrangement module further comprises, is used for for each port that disposes VLAN mapping table the module of the mac address forwarding table entry deletion of the MAC Address correspondence of the user side equipment that this port is connected.
Described forwarded upstream module further comprises, be used for when the time from access interface reception message, distribute the source MAC that does not find message in the list item at VLAN based on MAC, then in the mac address forwarding table item, search the source MAC and the user side VLAN label of message, if do not find yet, then determine in VLAN mapping table, to search the module of the network side VLAN label of the user side VLAN label correspondence in this message.
Described forwarded upstream module further comprises, be used for when the time from access interface reception message, if in VLAN allocation table, find the source MAC of message based on MAC, then in the mac address forwarding table item, search the source MAC and the network side VLAN label of message, if do not find, then the source MAC of message and network side VLAN label are added to the module in the mac address forwarding table.
What described port arrangement module disposed on each access interface of access device is the N:1VLAN mapping table,
Described forwarded upstream module is when issuing the stream rule that comprises user side VLAN label and network side VLAN label, and further the source MAC with message adds in the stream rule,
Described access device further comprises: descending forwarding module, be used for receiving message from the up port that converges, in mac address forwarding table, search network side VLAN label and target MAC (Media Access Control) address corresponding output port in the message, search the network side VLAN label in the message and the user side VLAN label of target MAC (Media Access Control) address correspondence in the rule at stream, network side VLAN label with in the user side VLAN label replacement message forwards message from described outbound port.
This access device further comprises:
Aging module is found the MAC address aging in the mac address forwarding table, and then according to the network side VLAN label of this MAC Address correspondence, the VLAN based on MAC that deletes this network side VLAN label correspondence distributes list item and stream rule.
Compared with prior art, the present invention does not use the stream rule at up direction, has reduced taking of system resource.
The embodiment of the invention can be added the source MAC and the SP_VLAN of message to the MACbased vlan table, like this, uplink message just can be realized the replacement of VLAN label by MAC based vlan table, thereby, for the equipment that does not dispose VLAN mapping table in the hardware, use the embodiment of the invention also can realize the fastext forwarding.
In addition, in the embodiment of the invention, only with MAC address learning in SP_VLAN, avoided broadcasting flooding, reduced the software processes burden simultaneously.
Description of drawings
Fig. 1 is a VLAN Mapping typical services illustraton of model;
Fig. 2 is for realizing the forwarding process schematic diagram of VLAN Mapping by the stream rule;
The forwarded upstream flow chart that Fig. 3 provides for the embodiment of the invention based on VLAN mapping;
The descending forwarding process figure that Fig. 4 provides for the embodiment of the invention based on VLAN mapping;
Fig. 5 is for using instantiation schematic diagram of the present invention;
The composition schematic diagram of the access device that Fig. 6 provides for the embodiment of the invention.
Embodiment
Core concept of the present invention is: according to the vlan table of VLAN Mapping table maintenance based on MAC, it is MAC based vlan table, described MAC based vlan table comprises the MAC Address of user side equipment and the corresponding relation of SP_VLAN at least, and described SP_VLAN is the SP_VLAN of the C_VLAN correspondence in the uplink message sent of user side equipment;
Use the source MAC inquiry MAC based vlan table of the uplink message that user side equipment sends, determine the SP_VLAN of described message, and the C_VLAN of described message is replaced with determined SP_VLAN according to Query Result; Transmit uplink message according to the target MAC (Media Access Control) address of uplink message and the SP_VLAN after the replacement.
The source MAC of uplink message is the MAC Address of the user side equipment of sending this message.
The present invention is further described in more detail below in conjunction with drawings and the specific embodiments.
The forwarded upstream flow chart that Fig. 3 provides for the embodiment of the invention based on VLAN mapping, as shown in Figure 3, its concrete steps are as follows:
Step 300: be each access interface configuration software VLAN Mapping table of access device, the mapping relations between this VLAN Mapping table maintenance customer side VLAN and the network side VLAN, i.e. C_VLAN--〉SP_VLAN; Dispose the port of VLAN mapping table for each, the mac address forwarding table entry deletion of the MAC Address correspondence of the user side equipment that this port is connected; The access interface that respectively disposes VLAN mapping table is set to software learning MAC Address mode.
Access interface is set to software learning MAC Address mode, then receive message from this port after, hardware can initiatively not carry out MAC address learning.
Step 301: access device receives the message that customer service equipment is sent from an access interface, searches the source MAC of this message in MAC based vlan table.
When access device receives a uplink message, all in hardware, look into MAC basedVLAN table usually earlier, look into mac address forwarding table then.
At least comprise in the MAC based vlan table: the source MAC of uplink message and the SP_VLAN corresponding with described source MAC.
Step 302: the source MAC according to uplink message is inquired about at described MAC based vlan table, determines whether to find the source MAC of message, if, execution in step 310; Otherwise, execution in step 303.
Step 303: access device is searched the source MAC of this uplink message and the mac address forwarding table item of C_VLAN correspondence in mac address forwarding table.
Step 304: judge whether to find, if, execution in step 305; Otherwise, execution in step 306.
In the present invention, generally the content of MAC based vlan table and mac address forwarding table is synchronous, that is: if a source MAC is present in the MAC based vlan table, then this source MAC is inevitable also is present in the mac address forwarding table, and vice versa; But, may make only to be present in the MAC based vlan table or only to be present in the mac address forwarding table at certain source MAC sometime owing to the reasons such as time difference of MAC address aging.
Step 305: access device is searched the C_VLAN and the target MAC (Media Access Control) address corresponding output port of message in mac address forwarding table, and message is forwarded from outbound port, and this flow process finishes.
Step 306: access device sends to innernal CPU with message by management interface.
Because each access interface is set to software learning MAC Address mode in the step 300, therefore, when not finding the outbound port of message in mac address forwarding table, message will be sent to CPU and be for further processing.
After step 307:CPU receives message, C_VLAN in the analytic message, in the VLAN Mapping that in access device, the disposes table, search the SP_VLAN of described C_VLAN correspondence, with the source MAC of message and SP_VLAN adds in the MAC based vlan table and mac address forwarding table in.
So far, realized according to VLAN Mapping table, promptly based on the maintenance of the VLAN allocation table of MAC to MAC based vlan table.Those skilled in the art can know, and described source MAC is the MAC Address of user side equipment, and described C_VLAN is a user side VLAN label, and described SP_VLAN is MAC Address and the corresponding network side VLAN label of C_VLAN with user side equipment.
Step 308: access device produces the stream rule that network side VLAN is replaced with the user side VLAN corresponding with it: SP_VLAN--〉C_VLAN.
Stream rule in this step is used when descending forwarding, so those skilled in the art all can know, and the treatment step that the stream rule is set is not limited between step 307 and step 309 to be carried out.
Step 309:CPU is after determining the SP_VLAN corresponding with described uplink message by inquiry VLAN Mapping table, with the C_VLAN in the SP_VLAN replacement message, in mac address forwarding table, search target MAC (Media Access Control) address, SP_VLAN corresponding output port with message, message is forwarded from outbound port, and this flow process finishes.
Owing to only in mac address forwarding table, deleted the mac address forwarding table item of the MAC Address correspondence of the user side equipment that each access interface of disposing VLAN mapping table connects among the present invention in advance, promptly deleted the forwarding-table item of the source MAC correspondence of uplink message in the mac address forwarding table, do not handle and the mac address forwarding table item of the target MAC (Media Access Control) address correspondence of uplink message is done deletion, therefore under normal circumstances, can carry out normal forwarding operation according to the target MAC (Media Access Control) address of uplink message and the SP_VLAN inquiry mac address forwarding table after the replacement.
Step 310: access device is with the C_VLAN in the SP_VLAN replacement message of source MAC correspondence in the MAC based vlan table item.
From this step as can be seen, uplink message is transmitted and is not used the stream rule.
Step 311: access device is searched the source MAC in the message and the mac address forwarding table item of SP_VLAN correspondence in mac address forwarding table.
Step 312: judge whether to find, if, execution in step 313; Otherwise, execution in step 314.
Step 313: access device is searched target MAC (Media Access Control) address, the SP_VLAN corresponding output port in the message in mac address forwarding table, and message is forwarded from outbound port, and this flow process finishes.
Step 314: access device sends to innernal CPU by management interface with message.
Step 315:CPU adds source MAC in the message and SP_VLAN in the mac address forwarding table to.
Step 316:CPU searches target MAC (Media Access Control) address, the SP_VLAN corresponding output port in the message in mac address forwarding table, message is sent from outbound port.
If CPU does not find target MAC (Media Access Control) address, SP_VLAN corresponding output port with message in mac address forwarding table, then message is broadcasted in SP_VLAN.
Fig. 3 has provided the message forwarding handling process that receives from interface port, below provides converging the message forwarding handling process that port receives from up.
The descending forwarding process figure that Fig. 4 provides for the embodiment of the invention based on VLAN mapping, as shown in Figure 4, its concrete steps are as follows:
Step 401: access device receives message, target MAC (Media Access Control) address, the SP_VLAN corresponding output port of searching this message in mac address forwarding table from the up port that converges.
Step 402: access device is searched the C_VLAN of the SP_VLAN correspondence in the message in the stream rule.
Stream rule in this step produces in step 308 shown in Figure 3, and those skilled in the art after obtaining the necessary information that produces the stream rule, also can satisfy the downlink traffic forwarding at other and issue the stream rule when requiring as can be known.
Step 403: access device is with the SP_VLAN in the C_VLAN replacement message.
Step 404: access device forwards message from outbound port.
In actual applications, but whether also regular check MAC Address of CPU is aging, if aging, MAC based vlan table item and the stream of then deleting this MAC Address correspondence are regular.Concrete steps are as follows: dispose the access interface of VLAN mapping table for each, CPU is according to the SP_VLAN and the MAC Address of port, in mac address forwarding table, search the mac address forwarding table item of this SP_VLAN and MAC Address correspondence, if do not find, then determine this MAC address aging, then delete the MAC based vlan table item and the stream rule of SP_VLAN correspondence.Wherein, in step 301, for access interface configuration VLAN mapping table the time, CPU can write down the SP_VLAN and the MAC Address of this port, so that follow-up MAC address aging uses.
From flow process shown in Fig. 3,4 as can be seen: the embodiment of the invention can be added the source MAC and the SP_VLAN of message to MAC based vlan table, like this, uplink message just can be realized the replacement of VLAN label by MAC based vlan table, thereby, for the equipment that does not dispose VLAN mapping table in the hardware, use the embodiment of the invention also can realize the fastext forwarding.
Simultaneously, only use the stream rule in the embodiment of the invention at down direction, reduced taking of system resource, suppose in Operation Network, to offer a kind business, the appliance services port has b, and uplink port c, each service port has d user, then required stream rule resource is the a*b*d bar, much smaller than (c+1) of the prior art * a*b*d bar.
In addition, in the embodiment of the invention, only with MAC address learning in SP_VLAN, avoided broadcasting flooding, reduced the software processes burden simultaneously.
Below provide one and use instantiation of the present invention:
As shown in Figure 5, the port Port X that establishes access device supports two kinds of business, and the MAC Address of two kinds of business devices is respectively MAC 1, MAC 2, and home gateway is that business device 1 has disposed VLAN1, for business device 2 has disposed VLAN 2; For the VLAN mapping table of the Port X of access device configuration is: VLAN 1--〉VLAN 101; VLAN 2--〉VLAN 201.Simultaneously, with MAC 1, the mac address forwarding table entry deletion of MAC 2 correspondences; The MAC address learning mode of Port X is configured to the software learning mode.Access device receives the message that business device 1 is sent from Port X, do not find the source MAC of message in MAC based vlan table: MAC 1, in mac address forwarding table, do not find simultaneously the source MAC of message: the C_VLAN:VLAN 1 in MAC 1 and the message, then message is sent to CPU, CPU finds C_VLAN:VLAN 1 correspondence in the message in VLAN mapping table SP_VLAN is: VLAN 101, then MAC 1 and VLAN 101 are added in MAC based vlan table and the mac address forwarding table, simultaneously, with the VLAN 1 in the VLAN 101 replacement messages, in mac address forwarding table, search the target MAC (Media Access Control) address of message: MAC 3 and VLAN 101 corresponding output port then, message is forwarded from outbound port.
VLAN mapping in Fig. 3,4 illustrated embodiments is 1:1VLAN mapping, in actual applications, also exist N:1VLAN mapping (N〉1 and N be positive integer), that is: N C_VLAN is mapped on the same SP_VLAN.At this moment, the difference of forwarded upstream flow process and flow process shown in Figure 3 is that the stream rule in the step 315 is: the source MAC+SP_VLAN--of message〉C_VLAN; The difference of descending forwarding process and flow process shown in Figure 4 is: in the step 402, access device is searched the target MAC (Media Access Control) address of message and the C_VLAN of SP_VLAN correspondence in the stream rule.
The composition schematic diagram of the access device that Fig. 6 provides for the embodiment of the invention, as shown in Figure 6, it mainly comprises: list item memory module 60, port arrangement module 61, forwarded upstream module 62 and descending forwarding module 63, wherein:
List item memory module 60 comprises: VLAN mapping table, MAC based vlan table and mac address forwarding table memory module.
Port arrangement module 61: be each access interface configuration software VLAN mapping table of access device, the mac address forwarding table entry deletion of the MAC Address correspondence of the user side equipment that each access interface that disposes VLAN mapping table is connected; Each access interface is set to software learning MAC Address mode.
Forwarded upstream module 62: access device receives message from access interface, in MAC based vlan table, search the source MAC of message, if do not find, then in mac address forwarding table, search the source MAC and the C_VLAN of this message, if do not find, in VLAN mapping table, search the SP_VLAN of the C_VLAN correspondence in this message, source MAC and this SP_VLAN of this message are added to respectively in MAC based vlan table and the mac address forwarding table, issue the stream rule that comprises C_VLAN and SP_VLAN simultaneously, C_VLAN with in the SP_VLAN replacement message forwards message according to mac address forwarding table;
If in MAC based vlan table, find the source MAC of message, then with the C_VLAN in the SP_VLAN replacement message of source MAC correspondence in the MAC BasedVLAN table, in mac address forwarding table, search SP_VLAN and source MAC in the message, if find, then in mac address forwarding table, search SP_VLAN and target MAC (Media Access Control) address corresponding output port in the message, message is forwarded from outbound port; If do not find, then source MAC and the SP_VLAN with message adds in the mac address forwarding table, searches SP_VLAN and target MAC (Media Access Control) address corresponding output port in the message in mac address forwarding table, and message is forwarded from outbound port;
If in MAC based vlan table, do not find the source MAC of message, then in mac address forwarding table, search C_VLAN and source MAC in the message, if find, then in mac address forwarding table, search the C_VLAN and the target MAC (Media Access Control) address corresponding output port of message, message is forwarded from outbound port.
Descending forwarding module 63: be used for receiving message from the up port that converges, in mac address forwarding table, search SP_VLAN and target MAC (Media Access Control) address corresponding output port in the message, in the stream rule, search the C_VLAN of the SP_VLAN correspondence in the message, SP_VLAN with in the C_VLAN replacement message forwards message from described outbound port.
In actual applications, if port arrangement module 61 be access device the configuration of each access interface be the N:1VLAN mapping table, then, forwarded upstream module 62 is when issuing the stream rule that comprises C_VLAN and SP_VLAN, further the source MAC with message adds in the stream rule, simultaneously, descending forwarding module 63 when receiving message, be searched C_VLAN from the up port that converges according to the target MAC (Media Access Control) address of SP_VLAN and message in the stream rule.
Access device also can comprise: aging module, be used for when finding the MAC address aging of mac address forwarding table, and according to the SP_VLAN of this MAC Address correspondence, the VLAN based on MAC that deletes this SP_VLAN correspondence distributes list item and stream rule.
The above only is process of the present invention and method embodiment, in order to restriction the present invention, all any modifications of being made within the spirit and principles in the present invention, is not equal to replacement, improvement etc., all should be included within protection scope of the present invention.