CN101917347A - Crossing method for performing label mapping based on HASH - Google Patents

Crossing method for performing label mapping based on HASH Download PDF

Info

Publication number
CN101917347A
CN101917347A CN2010102709828A CN201010270982A CN101917347A CN 101917347 A CN101917347 A CN 101917347A CN 2010102709828 A CN2010102709828 A CN 2010102709828A CN 201010270982 A CN201010270982 A CN 201010270982A CN 101917347 A CN101917347 A CN 101917347A
Authority
CN
China
Prior art keywords
mac
num
entry
address
mac address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2010102709828A
Other languages
Chinese (zh)
Other versions
CN101917347B (en
Inventor
徐剑辉
施先清
涂育红
江榕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN2010102709828A priority Critical patent/CN101917347B/en
Publication of CN101917347A publication Critical patent/CN101917347A/en
Application granted granted Critical
Publication of CN101917347B publication Critical patent/CN101917347B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to a crossing method for performing label mapping based on HASH. The crossing method comprises the following steps of; 1, generating a correspondence table for MAC addresses and HASHES of all ENTRIES, wherein the initial states of all the ENTRIES are idle states; 2, distributing an idle ENTRY to each new service, and selecting the corresponding unicast or multicast MAC address in the ENTRY content as a mapping address for the service, wherein the state of the ENTRY is changed into an on state after the distribution; 3, performing the label mapping by a TUNNEL MAP chip by using the distributed MAC address and setting an L2 address table by an MAC crossing chip by using the MAC address; and 4, releasing the ENTRY and assigning the state to be the idle state when the crossing service is deleted. The method of the invention absolutely solves the crossing limitation caused by HASH collision, and the number of the crossed entries is completely equal to the physical capacity of the MAC table; and the physical position of the MAC table corresponding to the crossing configuration is calculated in advance, so error positioning is easily performed.

Description

A kind of cross method that carries out the label mapping based on HASH
Technical field
The present invention relates to T-MPLS (transmission multiprotocol label switching) technology and intersection implementation method thereof, is a kind of cross method that carries out the label mapping based on HASH specifically.
Background technology
T-MPLS is the standardized a kind of Packet Transport Network technology of ITU-T (International Telecommunications Union), and it solves traditional SDH (SDH (Synchronous Digital Hierarchy)) exposes inefficiency in the network environment based on packet switching shortcoming.T-MPLS has connection-oriented data forwarding mechanism, multiple service supporting, stronger extension of network, abundant OAM (operation is safeguarded, management), QoS (service quality) mechanism of strictness and the technical characterictics such as network protection of 50ms.
T-MPLS is the subclass of MPLS (multiprotocol label switching), and on professional encapsulation mode, it has defined the packaging model of stratification.It obtains the PW packet with every professional encapsulation advance different PW (pseudo-line) lining earlier, again the PW data envelope is put into the MPLS bag that different TUNNEL (tunnel) linings obtains two-layer label, then this MPLS bag being delivered to the MPLS network transmits, the TUNNEL label that the network based MPLS bag of MPLS carries is transmitted, and can carry out the exchange of TUNNEL label at intermediate node.
On the protected mode of business, ITU-T defined T-MPLS looped network protection standard G.8132 with the linear protection standard G.8131.
In order to realize the miscellaneous service protection, general system all will construct CROSS (intersection) matrix of a TUNNEL aspect and realize that TUNNEL intersects.The MPLS that said TUNNEL intersection will contain certain TUNNEL label exactly wraps the one or more outlets that are forwarded to appointment, promptly realizes the function of " INPORT+TUNNEL-->OUTPORT LIST ".For the CROSS cross matrix of TUNNEL aspect, the bag of its incoming interface and outgoing interface all is based on the MPLS bag of the two-layer label (TUNNEL+PW) of Ethernet, and is as follows based on the MPLS packet format of the two-layer label (TUNNEL+PW) of Ethernet:
DMAC SMAC 0X8847 TUNNEL PW CUSTOM?DATA CRC
Wherein each field implication is as follows:
DMAC: destination-mac address;
SMAC: source MAC;
The ethernet type value of 0X8847:MPLS bag;
TUNNEL: tunnel label value;
PW: pseudo line tag value;
CUSTOM DATA: customer data content;
CRC: cyclic redundancy check (CRC).
In order to realize the CROSS cross matrix of jumbo TUNNEL aspect, described big capacity is meant cross entry>=4K*N (N>=1).According to present chip technology situation, the mapping of use label is a kind of implementation method wherein.Fig. 1 is the professional cross over model of label mapping.
1) as shown in Figure 1, its professional repeating process is:
Step 1, the chip T of branch (be among Fig. 1 T1, T2 ..., Tn) client's business is carried out encapsulation process, form the MPLS bag of two-layer label at the incoming interface place, said two-layer label is the TUNNEL+PW label;
Step 2, TUNNEL MAP chip (be among Fig. 1 MAP_1, MAP_2 ..., MAP_n) receive the MPLS bag of two-layer label after, be mapped as the function of DMAC with its TUNNEL that has, the MPLS bag of two-layer label is carried out the label mapping;
Step 3, DMAC cross chips receive the MPLS bag that carries out after label shines upon, and with the clean culture and the multicast resource of its L2 MAC that has table, transmit setting according to corresponding cross-over configuration;
Step 4, last, the chip T of branch of outgoing interface is forwarded to the MPLS bag on the corresponding network again;
The chip T of branch of the outgoing interface of the chip T of branch of above-mentioned incoming interface and symmetry is same chip.
2) the MPLS of two-layer label bag carried out the label mapping be meant described in the step 2:
Utilization is carried out the label mapping based on the DMAC territory of the MPLS bag of Ethernet, the DMAC value of shining upon MPLS packet header, back will change, just ethernet packet format increases in order to form owing to the DMAC in MPLS packet header and SMAC territory, generally there is not any concrete meaning, do not produce any influence so the change in DMAC territory can not handled follow-up bag.
Among Fig. 1, jumbo DMAC cross chips lacks TUNNEL intersection resource, but the clean culture and the multicast resource of abundant L2MAC table are but arranged, and this MAC table resource is exactly a media of realizing that label shines upon.Jumbo DMAC cross chips can be realized clean culture and multicast, wherein:
The content of L2 unicast entry is: DMAC-->OUTPORT;
The content of L2 multicast entry is: DMAC-->OUTPORT LIST;
The TUNNEL MAP chip of low capacity has abundant TUNNEL intersection resource, and can realize TUNNEL is mapped as the function of DMAC, and promptly it can be realized:
INPORT+TUNNEL-->OUTPORT, and
TUNNEL-->DMAC;
Therefore, at first TUNNEL MAP chip carries out the mapping of TUNNEL to DMAC, and the DMAC cross chips of back level is transmitted the clean culture or the multicast entry of DMAC configuration L2MAC table more then, thereby the big capacity that reaches the TUNNEL of system aspect intersects.
3) HASH (Hash) storage principle of L2MAC table:
HASH is used to provide a kind of index function simply fast, and it needs two calculating factors: keyword KEY and algorithm calculate HASH value, i.e. index value with algorithm to KEY then.
For the L2MAC table, KEY mainly is the MAC value, and algorithm can have multiple, as CRC16, and CRC32, XOR etc.As Fig. 2, the L2MAC table is made up of X BUCKET (bucket), and each BUCKET is made up of Y ENTRY (clauses and subclauses), and then the physical store capacity of L2MAC table is MAX=X*Y (X>=1, Y>=1).
Every TUNNEL intersection Cross_n can be mapped to certain address Mac_n, n=1,2,3 ... go out the BUCKET index value by Mac_n according to the HASH algorithm computation again, the scope of BUCKET is [0, X-1], identical BUCKET value is pointed to identical BUCKET memory block, and the idle ENTRY in the BUCKET will be used for store M ac_n by one of picked at random.After the BUCKET of HASH sensing expires, the HASH memory contention then appears, though this moment, the L2MAC table also had a large amount of BUCKET also to use.Such as:
If the physical capacity of L2MAC table is 32k ENTRY clauses and subclauses, each BUCKET comprises 8 ENTRY, and then (promptly=2^12), then its HASH bit needs 12 to total BUCKET number: the 32K/8=4K of L2MAC table.Suppose that the HASH algorithm is to get low 12 of MAC Address to carry out HASH, then be respectively: 0X0000,0X1000,0X2000 as 8 MAC Address, 0X3000,0X4000,0X5000,0X6000, during 0X7000, its HASH result all be 0 (because these MAC Address low 12 all identical, so HASH result is also identical), BUCKET=0 this moment barrel will be filled with.If there is a MAC=0X8000 to need storage again, because its HASH value also is 0, so though this moment, L2MAC physics table also had a lot of other BUCKET>=1 not to use, this MAC Address is conflicted owing to the HASH of BUCKET=0 and can't have been stored.
The L2MAC table of general DMAC cross chips all is to use the HASH mode to carry out index stores, though it is multiple that the HASH algorithm has, but no matter all can there be the HASH memory contention in which kind of algorithm, also even the mapping mode of TUNNEL-->DMAC adopts non-HASH mapping, as direct mapping mode, then be certain to bring born HASH conflict in theory.Below illustrate:
Adopt direct mapping mode, mapping result is as follows:
Clean culture intersection DMAC=(OUTPORT<<20)+TUNNEL;
Multicast intersection DMAC=0X010000000000+ (OUTPORT<<20)+TUNNEL;
Adopt direct mapping mode to have following problem:
A) directly the DMAC value of mapping comprises TUNNEL information, though mapping mode is simple and clear, can't avoid the HASH collision problem.
B) the low problem of utilization rate can appear in the L2MAC table, and the cross entry number is not equal to the capacity of L2MAC table.
In actual applications, for a correct cross-over configuration, do not allow certainly because the problem that HASH algorithm etc. are former thereby the appearance configuration can not be stored.Though can carry out the later quasi-complement of HASH conflict with resources such as ACL at this problem, it is not best solution all the time, not every after all DMAC cross chips all has ACL (Access Control List (ACL)) resource.
Summary of the invention
At the defective that exists in the prior art, the object of the present invention is to provide a kind of cross method that carries out the label mapping based on HASH, thoroughly solve the intersection restriction that causes because of the HASH conflict, cross entry counts up to the physical capacity that is congruent to the MAC table; The pairing MAC table of cross-over configuration physical location is calculated in advance, is easy to location of mistake.
For reaching above purpose, the technical scheme that the present invention takes is:
A kind of cross method that carries out the label mapping based on HASH is characterized in that, may further comprise the steps:
Step 1, the HASH that generates a MAC Address and all ENTRY concerns correspondence table, the initial condition of all ENTRY all is an Idle state;
Step 2, distribute the ENTRY of a free time for every new business:
For the cross business of the new configuration of each bar, concern the untapped ENTRY that applies for a free time the correspondence table from HASH,
Intersect if the cross attribute of the cross business of new configuration is clean culture, then select the mapping address of unicast mac address corresponding in the ENTRY content as business;
Intersect if the cross attribute of the cross business of new configuration is a multicast, then select multicast mac address corresponding in the ENTRY content as mapping address;
After the distribution, the state of this ENTRY becomes the use attitude;
Step 3, use the MAC Address of distributing to shine upon configuration:
TUNNEL MAP chip uses the MAC Address of distributing to carry out the label mapping, and the MAC cross chips also is provided with the L2 address table with this MAC Address;
Since a known location in the corresponding cross chips MAC table of newly assigned MAC Address total energy but untapped ENTRY, so for every new cross business, the HASH collision problem of MAC table will no longer appear in the MAC cross chips;
Step 4, professional deletion discharges ENTRY:
An ENTRY can only be assigned with once, and is deleted up to the cross business of correspondence, could be assigned with again;
When cross business was deleted, ENTRY was released, and d/d ENTRY state will be again assignment be Idle state.
On the basis of technique scheme, when the HASH of MAC Address of generation and all ENTRY concerns correspondence table in the step 1, if the HASH algorithm is the direct index algorithm, and algorithm uses the low level of MAC Address to carry out index, and HASH concerns that the generation method of correspondence table is as follows:
MAC Address is 48BIT, is expressed as BIT1~BIT48, and the value scope is [0,2^48];
If BIT8=0, then MAC is a unicast address; If BIT8=1, and all BIT are not 1 entirely, and then MAC Address is a multicast address;
If the BUCKET number is 4K, 4K=2^12, then the figure place of index BUCKET needs 12BIT,
If every BUCKET has 8 ENTRY, 8=2^3, then 8 ENTRY positions in the corresponding BUCKET of index need 3BIT,
Use array MAC_UC[4K] the corresponding unicast mac address of [8] storage,
Use array MAC_MC[4K] the corresponding multicast mac address of [8] storage,
Because algorithm uses the low level of MAC Address to carry out index, promptly a MAC high position does not participate in the HASH algorithm, and a high position can all be 0, so the value of MAC Address is:
MAC_UC[B_NUM][E_NUM]=(E_NUM<<12)|(B_NUM);
MAC_MC[B_NUM][E_NUM]=(0X01<<40)|(E_NUM<<12)|(B_NUM);
Wherein B_NUM is 12BIT, and the value scope is [0,4095];
E_NUM is 3BIT, and the value scope is [0,7];
Draw clean culture MAC array MAC_UC[X] [Y] and multicast MAC array MAC_MC[X] [Y], and the HASH that has promptly drawn a MAC Address and ENTRY concerns correspondence table, each ENTRY is with unicast address of correspondence and a multicast address.
On the basis of technique scheme, when the HASH of MAC Address of generation and all ENTRY concerns correspondence table in the step 1, if the HASH algorithm is the indirect index algorithm,
If the HASH algorithm is the CRC-32 verification, the low level of getting check value carries out HASH,
A) the CRC multinomial of Ji Suaning is:
G(x)=X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+X+1
B) calculation process is:
If the BUCKET number is 4K, 4K=2^12, then the figure place of index BUCKET needs 12BIT,
If every BUCKET has 8 ENTRY, for same BUCKET, need find out 8 identical MAC Address of HASH value and come corresponding its 8 ENTRY that comprise,
At first, carry out searching of unicast mac address:
Array MAC_UC[4K] [8] be used to store the clean culture MAC value of identical BUCKET, array COUNT_UC[4K] be used for the clean culture number of each BUCKET of accumulative total storage, variable TOTAL_UC is used for the current clean culture MAC value sum that has got of accumulative total, the initial value of all arrays and variable all is 0, when TOTAL_UC=4K*8=32K, unicast mac address is searched termination;
MAC Address is carried out the calculating of CRC-32 from small to large successively, and the span of MAC Address is the unicast address in [0,2^48];
If low 12 of the crc value of certain unicast address MAC_UC_N is B_NUM, the ENTRY storage numerical value E_NUM=COUNT_UC[B_NUM of its corresponding BUCKET], then MAC_UC_N is stored in MAC_UC[B_NUM] [E_NUM] position, then with COUNT_UC[B_NUM] add one, TOTAL_UC adds one; Promptly carry out:
MAC_UC[B_NUM][E_NUM]=MAC_UC_N;
COUNT_UC[B_NUM]++;
TOTAL_UC++;
As NUM=COUNT_UC[B_NUM] when being worth=8, represent that the BUCKET of corresponding B_NUM position has filled the unicast mac address of 8 ENTRY, then this BUCKET need not to store again, and the CRC that directly carries out next clean culture MAC calculates;
When TOTAL_UC=32K, the expression unicast address is filled with, and then termination is searched in clean culture, proceeds multicast and searches;
Next, carry out searching of multicast mac address, carry out searching and carrying out searching in like manner of unicast mac address of multicast mac address,
Array MAC_MC[4K] [8] be used to store the multicast MAC value of identical BUCKET, array COUNT_MC[4K] be used for the multicast number of each BUCKET of accumulative total storage, variable TOTALM_C is used for the current multicast MAC value sum that has got of accumulative total, the initial value of all arrays and variable all is 0, when TOTAL_MC=4K*8=32K, multicast mac address is searched termination;
MAC Address is carried out the calculating of CRC-32 from small to large successively, and the span of MAC Address is the multicast address in [0,2^48];
If low 12 of the crc value of certain multicast address MAC_MC_N is B_NUM, the ENTRY storage numerical value E_NUM=COUNT_MC[B_NUM of its corresponding BUCKET], then MAC_MC_N is stored in MAC_MC[B_NUM] [E_NUM] position, then with COUNT_MC[B_NUM] add one, TOTAL_MC adds one; Promptly carry out:
MAC_MC[B_NUM][E_NUM]=MAC_MC_N;
COUNT_MC[B_NUM]++;
TOTAL_MC++;
As NUM=COUNT_MC[B_NUM] when being worth=8, represent that the BUCKET of corresponding B_NUM position has filled the multicast mac address of 8 ENTRY, then this BUCKET need not to store again, and the CRC that directly carries out next multicast MAC calculates;
When TOTAL_MC=32K, the expression multicast address is filled with, and then multicast is searched termination;
Draw clean culture MAC array MAC_UC[X] [Y] and multicast MAC array MAC_MC[X] [Y], and the HASH that has promptly drawn a MAC Address and ENTRY concerns correspondence table, each ENTRY is with unicast address of correspondence and a multicast address.
The cross method that carries out the label mapping based on HASH of the present invention thoroughly solves the intersection restriction that causes because of the HASH conflict, and cross entry counts up to the physical capacity that is congruent to the MAC table; The pairing MAC table of cross-over configuration physical location is calculated in advance, is easy to location of mistake.
Description of drawings
The present invention has following accompanying drawing:
The professional cross over model of Fig. 1 label mapping,
The HASH process of Fig. 2 L2MAC table,
The business configuration flow chart of Fig. 3 HASH mapping.
Embodiment
Below in conjunction with accompanying drawing the present invention is described in further detail.
The cross method that carries out the label mapping based on HASH of the present invention uses the HASH mapping mode to solve the cross-over configuration problem that causes because of the HASH conflict.Fig. 3 is the business configuration flow chart that carries out the cross method of label mapping based on HASH of the present invention, introduces its implementation procedure below in detail:
Step 1, the HASH that generates a MAC Address and all ENTRY concerns correspondence table;
If the L2MAC table is made up of X BUCKET, each BUCKET is made up of Y ENTRY, and then the memory capacity of this L2MAC table is MAX=X*Y to the maximum;
Each ENTRY clauses and subclauses comprises following four information:
The physical location numbering, scope is [0, MAX-1],
The BUCKET coding, scope is [0, X-1],
The MAC Address content has two kinds of clean culture, multicasts in the MAC Address,
Current state, current state have the free time, use two kinds;
The initial condition of all ENTRY all is an Idle state;
Step 1.1), promptly use a few positions of 48 bit mac addresses to carry out direct index if the HASH algorithm is the direct index algorithm.Current direct index algorithm mainly is that the low level of getting MAC Address carries out the HASH algorithm, so this paper gives an example with this.
Be exemplified below: use the low level of MAC Address to carry out index.
MAC Address is 48BIT, is expressed as BIT1~BIT48, and the value scope is [0,2^48].If BIT8=0, then MAC is a unicast address; If BIT8=1, and all BIT are not 1 entirely, and then MAC Address is a multicast address.
If the BUCKET number is 4K, 4K=2^12, then the figure place of index BUCKET needs 12BIT,
If every BUCKET has 8 ENTRY, 8=2^3, then 8 ENTRY positions in the corresponding BUCKET of index need 3BIT.
Use array MAC_UC[4K] the corresponding unicast mac address of [8] storage, use array MAC_MC[4K] the corresponding multicast mac address of [8] storage.
Because algorithm uses the low level of MAC Address to carry out index, promptly a MAC high position does not participate in the HASH algorithm, and a high position can all be 0, so the value of MAC Address is:
MAC_UC[B_NUM][E_NUM]=(E_NUM<<12)|(B_NUM);
MAC_MC[B_NUM][E_NUM]=(0X01<<40)|(E_NUM<<12)|(B_NUM);
Wherein B_NUM is 12BIT, and the value scope is [0,4095];
E_NUM is 3BIT, and the value scope is [0,7];
Step 1.2) if the HASH algorithm is the indirect index algorithm, promptly uses 48 bit mac addresses to carry out the result that calculates of certain special algorithm, again this result is carried out the HASH value.Current indirect index algorithm is mainly the CRC algorithm, so this paper gives an example with the CRC algorithm.
Be exemplified below: the HASH algorithm is the CRC-32 verification, and the low level of getting check value carries out HASH.
A) the CRC multinomial of Ji Suaning is:
G(x)=X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+X+1
B) calculation process is:
If the BUCKET number is 4K, 4K=2^12, then the figure place of index BUCKET needs 12BIT,
If every BUCKET has 8 ENTRY,, need find out 8 identical MAC Address of HASH value and come corresponding its 8 ENTRY that comprise for same BUCKET.
At first, carry out searching of unicast mac address.
Array MAC_UC[4K] [8] be used to store the clean culture MAC value of identical BUCKET, array COUNT_UC[4K] be used for the clean culture number of each BUCKET of accumulative total storage, variable TOTAL_UC is used for the current clean culture MAC value sum that has got of accumulative total, the initial value of all arrays and variable all is 0, when TOTAL_UC=4K*8=32K, unicast mac address is searched termination.
MAC Address is carried out the calculating of CRC-32 from small to large successively, and the span of MAC Address is the unicast address in [0,2^48].
If low 12 of the crc value of certain unicast address MAC_UC_N is B_NUM, the ENTRY storage numerical value E_NUM=COUNT_UC[B_NUM of its corresponding BUCKET], then MAC_UC_N is stored in MAC_UC[B_NUM] [E_NUM] position, then with COUNT_UC[B_NUM] add one, TOTAL_UC adds one.Promptly carry out:
MAC_UC[B_NUM][E_NUM]=MAC_UC_N;
COUNT_UC[B_NUM]++;
TOTAL_UC++;
As NUM=COUNT_UC[B_NUM] when being worth=8, represent that the BUCKET of corresponding B_NUM position has filled the unicast mac address of 8 ENTRY, then this BUCKET need not to store again, and the CRC that directly carries out next clean culture MAC calculates.When TOTAL_UC=32K, the expression unicast address is filled with, and then termination is searched in clean culture, proceeds multicast and searches.
Secondly, carry out searching of multicast mac address.
In like manner, searching of corresponding multicast mac address needs storage array and variable: MAC_MC[4K] [8], COUNT_MC[4K], TOTAL_MC.The span of MAC Address is the multicast address in [0,2^48].
Array MAC_MC[4K] [8] be used to store the multicast MAC value of identical BUCKET, array COUNT_MC[4K] be used for the multicast number of each BUCKET of accumulative total storage, variable TOTAL_MC is used for the current multicast MAC value sum that has got of accumulative total, the initial value of all arrays and variable all is 0, when TOTAL_MC=4K*8=32K, multicast mac address is searched termination;
MAC Address is carried out the calculating of CRC-32 from small to large successively, and the span of MAC Address is the multicast address in [0,2^48];
If low 12 of the crc value of certain multicast address MAC_MC_N is B_NUM, the ENTRY storage numerical value E_NUM=COUNT_MC[B_NUM of its corresponding BUCKET], then MAC_MC_N is stored in MAC_MC[B_NUM] [E_NUM] position, then with COUNT_MC[B_NUM] add one, TOTAL_MC adds one; Promptly carry out:
MAC_MC[B_NUM][E_NUM]=MAC_MC_N;
COUNT_MC[B_NUM]++;
TOTAL_MC++;
As NUM=COUNT_MC[B_NUM] when being worth=8, represent that the BUCKET of corresponding B_NUM position has filled the multicast mac address of 8 ENTRY, then this BUCKET need not to store again, and the CRC that directly carries out next multicast MAC calculates;
When TOTAL_MC=32K, the expression multicast address is filled with, and then multicast is searched termination.
Step 1.3) can draw clean culture MAC array MAC_UC[X by step 1.1 or step 1.2] [Y] and multicast MAC array MAC_MC[X] [Y], the HASH that has promptly drawn a MAC Address and ENTRY concerns correspondence table, each ENTRY is with unicast address of correspondence and a multicast address, and the result is as follows:
Figure BSA00000254556200121
Step 2 is distributed the ENTRY of a free time for every new business;
For the cross business of the new configuration of each bar, concern the untapped ENTRY that applies for a free time the correspondence table from HASH.
Intersect if the cross attribute of the cross business of new configuration is clean culture, then select the mapping address of unicast mac address corresponding in the ENTRY content as business;
Intersect if the cross attribute of the cross business of new configuration is a multicast, then select multicast mac address corresponding in the ENTRY content as mapping address;
After the distribution, the state of this ENTRY becomes the use attitude.
Step 3 uses the MAC Address of distributing to shine upon configuration;
TUNNEL MAP chip uses the MAC Address of distributing to carry out the label mapping, and the MAC cross chips also is provided with the L2 address table with this MAC Address.Since a known location in the corresponding cross chips MAC table of newly assigned MAC Address total energy but untapped ENTRY, so for every new cross business, the HASH collision problem of MAC table will no longer appear in the MAC cross chips.
Step 4, professional deletion discharges ENTRY.
An ENTRY can only be assigned with once, and is deleted up to the cross business of correspondence, could be assigned with again;
When cross business was deleted, ENTRY was released, and d/d ENTRY state will be again assignment be Idle state.

Claims (3)

1. a cross method that carries out the label mapping based on HASH is characterized in that, may further comprise the steps:
Step 1, the HASH that generates a MAC Address and all ENTRY concerns correspondence table, the initial condition of all ENTRY all is an Idle state;
Step 2, distribute the ENTRY of a free time for every new business:
For the cross business of the new configuration of each bar, concern the untapped ENTRY that applies for a free time the correspondence table from HASH,
Intersect if the cross attribute of the cross business of new configuration is clean culture, then select the mapping address of unicast mac address corresponding in the ENTRY content as business;
Intersect if the cross attribute of the cross business of new configuration is a multicast, then select multicast mac address corresponding in the ENTRY content as mapping address;
After the distribution, the state of this ENTRY becomes the use attitude;
Step 3, use the MAC Address of distributing to shine upon configuration:
TUNNEL MAP chip uses the MAC Address of distributing to carry out the label mapping, and the MAC cross chips also is provided with the L2 address table with this MAC Address;
Since a known location in the corresponding cross chips MAC table of newly assigned MAC Address total energy but untapped ENTRY, so for every new cross business, the HASH collision problem of MAC table will no longer appear in the MAC cross chips;
Step 4, professional deletion discharges ENTRY:
An ENTRY can only be assigned with once, and is deleted up to the cross business of correspondence, could be assigned with again;
When cross business was deleted, ENTRY was released, and d/d ENTRY state will be again assignment be Idle state.
2. the cross method that carries out the label mapping based on HASH as claimed in claim 1, it is characterized in that: when the HASH of MAC Address of generation and all ENTRY concerns correspondence table in the step 1, if the HASH algorithm is the direct index algorithm, and algorithm uses the low level of MAC Address to carry out index, and HASH concerns that the generation method of correspondence table is as follows:
MAC Address is 48BIT, is expressed as BIT1~BIT48, and the value scope is [0,2^48];
If BIT8=0, then MAC is a unicast address; If BIT8=1, and all BIT are not 1 entirely, and then MAC Address is a multicast address;
If the BUCKET number is 4K, 4K=2^12, then the figure place of index BUCKET needs 12BIT,
If every BUCKET has 8 ENTRY, 8=2^3, then 8 ENTRY positions in the corresponding BUCKET of index need 3BIT,
Use array MAC_UC[4K] the corresponding unicast mac address of [8] storage,
Use array MAC_MC[4K] the corresponding multicast mac address of [8] storage,
Because algorithm uses the low level of MAC Address to carry out index, promptly a MAC high position does not participate in the HASH algorithm, and a high position can all be 0, so the value of MAC Address is:
MAC_UC[B_NUM][E_NUM]=(E_NUM<<12)|(B_NUM);
MAC_MC[B_NUM][E_NUM]=(0X01<<40)|(E_NUM<<12)|(B_NUM);
Wherein B_NUM is 12BIT, and the value scope is [0,4095];
E_NUM is 3BIT, and the value scope is [0,7];
Draw clean culture MAC array MAC_UC[X] [Y] and multicast MAC array MAC_MC[X] [Y], and the HASH that has promptly drawn a MAC Address and ENTRY concerns correspondence table, each ENTRY is with unicast address of correspondence and a multicast address.
3. the cross method that carries out the label mapping based on HASH as claimed in claim 1 is characterized in that: when the HASH of MAC Address of generation and all ENTRY concerns correspondence table in the step 1, if the HASH algorithm is the indirect index algorithm,
If the HASH algorithm is the CRC-32 verification, the low level of getting check value carries out HASH,
A) the CRC multinomial of Ji Suaning is:
G(x)=X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+X+1
B) calculation process is:
If the BUCKET number is 4K, 4K=2^12, then the figure place of index BUCKET needs 12BIT,
If every BUCKET has 8 ENTRY, for same BUCKET, need find out 8 identical MAC Address of HASH value and come corresponding its 8 ENTRY that comprise,
At first, carry out searching of unicast mac address:
Array MAC_UC[4K] [8] be used to store the clean culture MAC value of identical BUCKET, array COUNT_UC[4K] be used for the clean culture number of each BUCKET of accumulative total storage, variable TOTAL_UC is used for the current clean culture MAC value sum that has got of accumulative total, the initial value of all arrays and variable all is 0, when TOTAL_UC=4K*8=32K, unicast mac address is searched termination;
MAC Address is carried out the calculating of CRC-32 from small to large successively, and the span of MAC Address is the unicast address in [0,2^48];
If low 12 of the crc value of certain unicast address MAC_UC_N is B_NUM, the ENTRY storage numerical value E_NUM=COUNT_UC[B_NUM of its corresponding BUCKET], then MAC_UC_N is stored in MAC_UC[B_NUM] [E_NUM] position, then with COUNT_UC[B_NUM] add one, TOTAL_UC adds one; Promptly carry out:
MAC_UC[B_NUM][E_NUM]=MAC_UC_N;
COUNT_UC[B_NUM]++;
TOTAL_UC++;
As NUM=COUNT_UC[B_NUM] when being worth=8, represent that the BUCKET of corresponding B_NUM position has filled the unicast mac address of 8 ENTRY, then this BUCKET need not to store again, and the CRC that directly carries out next clean culture MAC calculates;
When TOTAL_UC=32K, the expression unicast address is filled with, and then termination is searched in clean culture, proceeds multicast and searches;
Next, carry out searching of multicast mac address, carry out searching and carrying out searching in like manner of unicast mac address of multicast mac address,
Array MAC_MC[4K] [8] be used to store the multicast MAC value of identical BUCKET, array COUNT_MC[4K] be used for the multicast number of each BUCKET of accumulative total storage, variable TOTAL_MC is used for the current multicast MAC value sum that has got of accumulative total, the initial value of all arrays and variable all is 0, when TOTAL_MC=4K*8=32K, multicast mac address is searched termination;
MAC Address is carried out the calculating of CRC-32 from small to large successively, and the span of MAC Address is the multicast address in [0,2^48];
If low 12 of the crc value of certain multicast address MAC_MC_N is B_NUM, the ENTRY storage numerical value E_NUM=COUNT_MC[B_NUM of its corresponding BUCKET], then MAC_MC_N is stored in MAC_MC[B_NUM] [E_NUM] position, then with COUNT_MC[B_NUM] add one, TOTAL_MC adds one; Promptly carry out:
MAC_MC[B_NUM][E_NUM]=MAC_MC_N;
COUNT_MC[B_NUM]++;
TOTAL_MC++;
As NUM=COUNT_MC[B_NUM] when being worth=8, represent that the BUCKET of corresponding B_NUM position has filled the multicast mac address of 8 ENTRY, then this BUCKET need not to store again, and the CRC that directly carries out next multicast MAC calculates;
When TOTAL_MC=32K, the expression multicast address is filled with, and then multicast is searched termination;
Draw clean culture MAC array MAC_UC[X] [Y] and multicast MAC array MAC_MC[X] [Y], and the HASH that has promptly drawn a MAC Address and ENTRY concerns correspondence table, each ENTRY is with unicast address of correspondence and a multicast address.
CN2010102709828A 2010-09-03 2010-09-03 Crossing method for performing label mapping based on HASH Expired - Fee Related CN101917347B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010102709828A CN101917347B (en) 2010-09-03 2010-09-03 Crossing method for performing label mapping based on HASH

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102709828A CN101917347B (en) 2010-09-03 2010-09-03 Crossing method for performing label mapping based on HASH

Publications (2)

Publication Number Publication Date
CN101917347A true CN101917347A (en) 2010-12-15
CN101917347B CN101917347B (en) 2012-08-22

Family

ID=43324741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102709828A Expired - Fee Related CN101917347B (en) 2010-09-03 2010-09-03 Crossing method for performing label mapping based on HASH

Country Status (1)

Country Link
CN (1) CN101917347B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102780568A (en) * 2012-07-13 2012-11-14 深圳市龙视传媒有限公司 Method, device, terminal and system for multicasting data in one-way network

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1671122A (en) * 2004-03-19 2005-09-21 港湾网络有限公司 Method for implementing message forwarding along RPR ring and RPR network
CN1832443A (en) * 2005-03-08 2006-09-13 杭州华为三康技术有限公司 Method for reducing VPN network arranging
US7684352B2 (en) * 2006-11-02 2010-03-23 Nortel Networks Ltd Distributed storage of routing information in a link state protocol controlled network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1671122A (en) * 2004-03-19 2005-09-21 港湾网络有限公司 Method for implementing message forwarding along RPR ring and RPR network
CN1832443A (en) * 2005-03-08 2006-09-13 杭州华为三康技术有限公司 Method for reducing VPN network arranging
US7684352B2 (en) * 2006-11-02 2010-03-23 Nortel Networks Ltd Distributed storage of routing information in a link state protocol controlled network

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102780568A (en) * 2012-07-13 2012-11-14 深圳市龙视传媒有限公司 Method, device, terminal and system for multicasting data in one-way network
CN102780568B (en) * 2012-07-13 2015-12-09 深圳市龙视传媒有限公司 The method of multicasting of data, device, terminal and system in a kind of unilateral network

Also Published As

Publication number Publication date
CN101917347B (en) 2012-08-22

Similar Documents

Publication Publication Date Title
CN107534613B (en) Multi-region source route multicast method using subtree identifier
CN103117931B (en) Media access control (MAC) address hardware learning method and system based on hash table and ternary content addressable memory (TCAM) table
CN101155130B (en) Method for learning MAC address and system and equipment for conveying VPLS client data
US20200159654A1 (en) Pipelined hash table with reduced collisions
CN104283806A (en) Service link processing method and device
CN106209648B (en) Multicast data packet forwarding method and apparatus across virtual expansible local area network
CN106209636B (en) Multicast data packet forwarding method and apparatus from VLAN to VXLAN
CN103152292B (en) The XGEM framing device of ONU end and framing method in XGPON system
CN108600074A (en) The retransmission method and device of multicast data message
CN108139882B (en) Implement the system and method for stratum's distribution lists of links for network equipment
CN105556916A (en) Network flow information statistics method and apparatus
CN100459587C (en) Method and equipment for realizing flexible QinQ
CN104639440A (en) Method and device for realizing third tier forwarding and packaging protocol information in Internet
CN105763457A (en) Multicast packet processing method and network device
CN101132285A (en) System and method for implementing MAC-IN-MAC
CN102687109B (en) For using the methods, devices and systems of the memory management of packet segmentation and forwarding
CN101917347B (en) Crossing method for performing label mapping based on HASH
CN103064794A (en) Method for realizing efficient multiple protocol label switching (MPLS) label management
CN103609063A (en) Protocol independent multicast last hop router discovery
CN109327393A (en) Network exchange destination port determines method, apparatus and the interchanger based on the device
CN109286564B (en) Message forwarding method and device
CN104753792B (en) The network equipment and the method to E-Packet
WO2012055168A1 (en) Forwarding messages in a fibre channel network
CN103457855A (en) Method and device for establishing classless inter-domain routing table and forwarding messages
CN102244615B (en) Forwarding entry sending method, device and system as well as autonomous system border router

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120822

CF01 Termination of patent right due to non-payment of annual fee