CN100508496C - Method for carrying out policy management on medium access control address learning - Google Patents

Method for carrying out policy management on medium access control address learning Download PDF

Info

Publication number
CN100508496C
CN100508496C CNB200510008647XA CN200510008647A CN100508496C CN 100508496 C CN100508496 C CN 100508496C CN B200510008647X A CNB200510008647X A CN B200510008647XA CN 200510008647 A CN200510008647 A CN 200510008647A CN 100508496 C CN100508496 C CN 100508496C
Authority
CN
China
Prior art keywords
mac address
timer
address learning
switching equipment
counter
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.)
Active
Application number
CNB200510008647XA
Other languages
Chinese (zh)
Other versions
CN1829188A (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.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CNB200510008647XA priority Critical patent/CN100508496C/en
Publication of CN1829188A publication Critical patent/CN1829188A/en
Application granted granted Critical
Publication of CN100508496C publication Critical patent/CN100508496C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention relates to a method to proceed strategy administrant to exchange equipment medium access control address learning. Said method includes following steps: starting up first timer and counter when first detecting to MAC address, if in first preset time said counter exceeding preset number then converting said exchange equipment to not allowable MAC address learning state and starting up second timer, keeping said exchange equipment not allowable MAC address learning state in second preset time, when exceeding second preset time, converting said exchange equipment to allowing MAC address learning state. Said invention can reduce CPU utilization ratio in MAC address collision and unaffecting exchange equipment MAC address learning function.

Description

Medium access control address learning is carried out the method for tactical management
Technical field
The present invention relates to a kind ofly on switching equipment, MAC (Media Access Controller, medium access control) address learning be carried out the method for tactical management.
Background technology
Along with popularizing with network size day by day of network application is huge day by day, need big the increasing that contain much information that transmits on the Internet.For Ethernet switch, two layers what transmit institute's foundations is exactly MAC Address, and MAC Address leaves in the mac address table, by to operations such as the study of MAC Address, renewal, aging deletions, safeguard the correctness of mac address table, thereby realize two layers of forwarding capability of Ethernet switch.
The MAC address learning of Ethernet switch be SMAC (source medium access control) address learning, the study of SMAC address is exactly to extract the SMAC address field from the ethernet frame that enters ethernet switch port, is inserted in the mac address table.The purpose of SMAC address learning is to use for two layers of addressing when transmitting.The SMAC address learning can generate mac address table, the port that enters Ethernet switch when ethernet frame carries out two layers and transmits when needing to seek corresponding output port, target MAC (Media Access Control) address according to this ethernet frame is searched in mac address table, if in mac address table, find this MAC Address, then addressing success, ethernet frame will be forwarded to corresponding output port.After switches learn arrives new SMAC address, can adopt Hash (Hash) algorithm computing to be carried out in this SMAC address as the MAC address learning algorithm, and with operation result as the address in the mac address table, the SMAC address is inserted into the position at this place, address in the mac address table.Though the SMAC address is unique, but because the mac address table space is limited, the result of different SMAC addresses through drawing after the hash conversion, it is the situation that storage address may occur equating, that is to say, have on the some identical position that a plurality of different SMAC addresses will be inserted into mac address table, this will cause conflict.When there has been the value that is different from this SMAC address in a new SMAC address owing to the relevant position in the mac address table, then be referred to as to have taken place a MAC Address conflict.
MAC address learning is default to be to be finished by the hardware of equipment, and the work of being finished by hardware does not need the intervention of CPU (central processing unit).But when device start some when service, as enable this function of the maximum study of MAC Address number of restrictive ports, just must add the intervention of CPU, just must finish MAC address learning to become by software by hardware and finish this moment.When ethernet frame enters ethernet switch port, can carry out MAC address learning, promptly when not having this SMAC address in the mac address table of Ethernet switch, just the SMAC address in this ethernet frame is inserted in the mac address table of switch, when this work is finished by CPU, will make CPU carry out once inserting table handling, when a large amount of ethernet frames with different SMAC address enters some ports of Ethernet switch continuously, wherein a part of SMAC address can be because the MAC Address conflict makes it can't be inserted in the mac address table, thereby the ethernet frame that causes having identical SMAC address is successively behind the entry port, also need table handling is inserted in this SMAC address, so repeatedly, finally cause CPU carrying out MAC address learning always, cause cpu busy percentage too high.Cpu busy percentage is too high will cause Ethernet switch to the delay of other process scheduling and operation, can't in time handle a lot of drawbacks such as other ethernet frame.The agreement that causes the most at last running well is disregarded owing to CPU is overtime and is caused the network upheaval or interrupt, and order generates the tree upset, causes network broadcasting windstorm, to make Routing Protocol shake hands overtime, causes route oscillation.In a word, CPU crosses the busy normal operation that can have a strong impact on the stable and variety of protocol of network.And if make CPU no longer carry out the study of MAC Address, will cause the port of Ethernet switch to stop the MAC address learning function, will certainly destroy the correctness of MAC table, influence two layers of forwarding capability of Ethernet switch.
Summary of the invention
Technical problem to be solved by this invention is, a kind of method of medium access control address learning being carried out tactical management is provided, this method is used on switching equipment, the utilance of CPU when it can reduce the MAC Address conflict, and the while does not influence the MAC address learning function of switching equipment again.
In order to solve the problems of the technologies described above, the technical solution used in the present invention is, a kind of method that medium access control address learning is carried out tactical management, and this method is used on switching equipment and be may further comprise the steps:
A) definition and initialization first timer, the second timer sum counter on memory;
B) receive packet when described switching equipment, and after detecting the MAC Address conflict of first pre-determined number, start the number of times of the first timer sum counter with recording scheduled time durations generation MAC Address conflict;
C) judge whether a predetermined level is exceeded of the whether overtime and counter of first timer;
D) if first timer at the time durations of first scheduled time, the counter a predetermined level is exceeded then is converted to the state that does not allow MAC address learning with described switching equipment, and starts second timer;
E) judge whether second timer is overtime;
F) when second timer surpassed for second scheduled time, described switching equipment is converted to the state that allows MAC address learning;
In addition, in the judgement of step c), if first timer at the time durations that did not surpass for first scheduled time, counter is no more than predetermined quantity, then keeps the state of the permission MAC address learning of described switching equipment; If first timer surpassed for first scheduled time and counter is no more than predetermined quantity,, and keep the state of the permission MAC address learning of described switching equipment then with the first timer sum counter zero clearing.
In addition, in the judgement of step e),, then keep the state that does not allow MAC address learning of described switching equipment if second timer did not surpass for second scheduled time; If second timer surpassed for second scheduled time, then with first timer, the second timer sum counter zero clearing.
Described switching equipment can be an Ethernet switch.
In addition, described first pre-determined number can be for once, starts the first timer sum counter after promptly detecting for the first time the MAC Address conflict.
The present invention can realize following technique effect: under the situation of a large amount of generation MAC Address conflict, can reduce the utilance of the CPU of switching equipment, can make cpu busy percentage under extreme case, 100% be reduced to 60%, simultaneously, the method can effectively guarantee the address learning function of switching equipment to SMAC, make the MAC address learning degree of depth and MAC address learning speed not be affected, do not influence two layers of forwarding capability of switching equipment.
Description of drawings
Accompanying drawing is the flow chart that the MAC address learning of switching equipment is carried out the method for tactical management of the present invention.
Embodiment
The present invention will be described in detail below in conjunction with drawings and Examples.
State machine SML of definition in the MAC address learning module at first is used to represent that Ethernet switch is current whether allows to carry out MAC address learning.The SML value represents to allow to carry out MAC address learning for suspend; The SML value represents not allow to carry out MAC address learning for delay.The SML initial value is suspend, promptly allows to carry out MAC address learning.Definition counter SMN, expression SMS start the number of times that back MAC Address conflict during 0 to MAX_SMS takes place, and the SMN initial value is 0, does not promptly have the MAC Address conflict to take place.Define the first timer SMS, it is long that expression becomes 1 moment elapsed time from the value of SMN, i.e. the time of the state continuance of back permission MAC address learning takes place in MAC Address conflict for the first time, and the SMS initial value is 0.Definition MAX_SMS is the maximum of SMS, and promptly the span of SMS is 0 to MAX_SMS, and MAX_SMS is greater than 0.Definition MAX_SMN is that SMS starts back MAC Address maximum collision number of times during 0 to MAX_SMS, it is the maximum of SMN, the maximum address conflict number of times that is allowed in the indication equipment unit interval, MAX_SMN is greater than 0 and less than the maximum address stored number of switch mac address table.Define the second timer SMD, expression becomes the moment elapsed time of delay from SML from suspend long, promptly do not allow to carry out the time of the state continuance of MAC address learning, and the SMD initial value is 0.Definition MAX_SMD is the maximum of SMD, and promptly the span of SMD is 0 to MAX_SMD.With above numerical value initialization and be stored in the memory.
When the SML state is represented during for suspend current the MAC Address conflict not to take place, or MAC Address conflict number of times do not surpass the MAC Address conflict number of times maximum MAX_SMN that is allowed at MAX_SMS in the time period, and still can proceed MAC address learning this moment; The SML state represents that current MAC Address conflict and the MAC Address conflict number of times of existing surpassed the conflict maximum MAX_SMN that is allowed at MAX_SMS in the time period during for delay, and can not carry out MAC address learning this moment.
As shown in drawings, before switch starts the MAC address learning function, initialization correlated variables: SML=suspend at first, SMN=0, SMS=0, SMD=0.When new packet enters switch, switch takes out the SMAC address of this packet, judge whether this SMAC address exists in mac address table, exist as this SMAC address, then expression need not to carry out MAC address learning, return step 100, packet is carried out respective handling and waits for next packet; If this SMAC address is in mac address table, then in step 101, judge switch current whether be permission MAC address learning state, judge promptly whether the SML value is suspend, is suspend as current SML value, then carries out MAC address learning.
Arrive shown in the step 110 as step 102, when switch at a time detects the MAC Address conflict generation of first pre-determined number, start timer SMS sum counter SMN immediately, preferably, when switch has at a time detected for the first time the MAC Address conflict, just start timer SMS sum counter SMN immediately.Add up the number of times that the MAC Address conflict takes place at SMS in 0 to MAX_SMS time period, conflict is not serious if the SMN statistical value, is then represented MAC Address less than MAX_SMN, and system can carry out MAC address learning as usual, does not promptly change the SML value.Judging in step 108 whether timer is overtime, surpass MAX_SMS as the value of timer SMS, is clearly zero with SMS and SMN in step 109 then, and the state of SML state machine still be suspend, promptly adds up the MAC Address frequency that conflicts again.
In step 107, if in 0 to MAX_SMS time period, detect the statistical value of SMN greater than MAX_SMN at SMS, then expression MAC Address conflict this moment is serious, at this moment, change the SML state machine into the delay state, and start the timing of SMD timer simultaneously, when the SMD timer is less than or equal to MAX_SMD, stop the MAC address learning of Ethernet switch.Promptly in step 101,111, when SML is in the delay state, whether judge SMD,, then do not change the SML value if SMD is not more than MAX_SMD greater than MAX_SMD.As SMD during greater than MAX_SMD, in step 112, restart the MAC address learning of Ethernet switch, the SML state machine reverts to the suspend state.And SMS is set to 0, and SMN is set to 0, and SMD is set to 0.
The SML state machine reverts to after the suspend, recovers the SMAC learning functionality, repeats above-mentioned steps once more.
In addition, method of the present invention can also be applied in multi-layer switches etc. and carry out on the switching equipment that packet transmits based on MAC Address except can being applied on the Ethernet switch.

Claims (7)

1, a kind of method that medium access control address learning is carried out tactical management, this method is used on switching equipment, it is characterized in that: this method may further comprise the steps:
A) definition and initialization first timer, the second timer sum counter on memory;
B) receive packet when described switching equipment, and after detecting the MAC Address conflict of first pre-determined number, start the first timer sum counter to write down the number of times of first predetermined time period generation MAC Address conflict;
C) judge whether a predetermined level is exceeded of the whether overtime and counter of first timer;
D) if first timer at the time durations of first scheduled time, the counter a predetermined level is exceeded then is converted to the state that does not allow MAC address learning with described switching equipment, and starts second timer;
E) judge whether second timer is overtime;
F) when second timer surpassed for second scheduled time, described switching equipment is converted to the state that allows MAC address learning.
2, the method for claim 1 is characterized in that further comprising the steps of:
In the judgement of step c), if first timer at the time durations that did not surpass for first scheduled time, counter is no more than predetermined quantity, then keeps the state of the permission MAC address learning of described switching equipment.
3, the method for claim 1 is characterized in that further comprising the steps of:
In the judgement of step c),,, and keep the state of the permission MAC address learning of described switching equipment then with the first timer sum counter zero clearing if first timer surpassed for first scheduled time and counter is no more than predetermined quantity.
4, the method for claim 1 is characterized in that further comprising the steps of:
In the judgement of step e),, then keep the state that does not allow MAC address learning of described switching equipment if second timer did not surpass for second scheduled time.
5, the method for claim 1 is characterized in that further comprising the steps of:
In the judgement of step e), if second timer surpassed for second scheduled time, then with first timer, the second timer sum counter zero clearing.
6, the method for claim 1 is characterized in that: described switching equipment is Ethernet switch or multi-layer switches.
7, the method for claim 1 is characterized in that: described first pre-determined number is for once.
CNB200510008647XA 2005-03-01 2005-03-01 Method for carrying out policy management on medium access control address learning Active CN100508496C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB200510008647XA CN100508496C (en) 2005-03-01 2005-03-01 Method for carrying out policy management on medium access control address learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB200510008647XA CN100508496C (en) 2005-03-01 2005-03-01 Method for carrying out policy management on medium access control address learning

Publications (2)

Publication Number Publication Date
CN1829188A CN1829188A (en) 2006-09-06
CN100508496C true CN100508496C (en) 2009-07-01

Family

ID=36947321

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB200510008647XA Active CN100508496C (en) 2005-03-01 2005-03-01 Method for carrying out policy management on medium access control address learning

Country Status (1)

Country Link
CN (1) CN100508496C (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188510A (en) * 2006-11-16 2008-05-28 华为技术有限公司 Method, device and system for central address control
CN101179514B (en) * 2007-12-18 2010-08-18 杭州华三通信技术有限公司 Method and device of maintaining MAC item of distributed network processing system
CN101197787B (en) * 2008-01-03 2010-08-25 杭州华三通信技术有限公司 Packet information learning method and apparatus
CN102014112B (en) * 2010-01-29 2013-08-14 柳州市达迪通信设备有限公司 Hardware realizing method based on MAC/IP (Media Access Control/Internet Protocol) address classified statistic
CN103117928B (en) 2013-01-21 2017-02-08 深圳市迪浦电子有限公司 Method and device for improving chip forwarding performance
CN104038566B (en) * 2014-06-12 2017-11-03 福建星网锐捷网络有限公司 A kind of method of virtual swap device address learning, apparatus and system
CN107547408B (en) * 2017-07-28 2020-08-28 新华三技术有限公司 Method and device for processing MAC address hash collision
CN110365811B (en) * 2019-07-22 2022-03-01 杭州迪普科技股份有限公司 MAC address learning limiting method, device and equipment

Also Published As

Publication number Publication date
CN1829188A (en) 2006-09-06

Similar Documents

Publication Publication Date Title
CN100508496C (en) Method for carrying out policy management on medium access control address learning
US8249065B2 (en) Destination MAC aging of entries in a Layer 2 (L2) forwarding table
US20150295843A1 (en) Time-triggered ethernet-based data transmission method and node device
CN101778113B (en) Method for detection of RP state in multicast network, device, RP device and multicast system
CN102104541A (en) Header processing engine
JPH07183898A (en) Method for recovering predetermined order for cell style of asymmetric order in atm exchange technology
JP2004242326A (en) Address learning for executing high-speed routing table search
US7310803B2 (en) Method and system for executing multiple tasks in a task set
US20230205708A1 (en) Flow Table Aging Optimized For Dram Access
CN103685058B (en) Method for controlling QoS (Quality of Service) of stream data, and OpenFlow controller
CN105207908B (en) A kind of message processing method and system
EP2040399B1 (en) An optical burst switching network based burst packet transmitting system and the method thereof
US6957267B2 (en) Data packet processing
CN100469055C (en) Method for processing forwarding message, and process module
CN102014065A (en) Method for analyzing packet headers, header analysis preprocessing device and network processor
US9847886B2 (en) Sleeping link waking method and apparatus
CN107547408B (en) Method and device for processing MAC address hash collision
CN101663865A (en) Intelligent database exchange for ospf
US9137158B2 (en) Communication apparatus and communication method
CN107707548A (en) TLV message parsing methods, device, electronic equipment and storage medium
CN106506074B (en) A kind of method and apparatus detecting optical port state
JP2011060028A (en) Information processing apparatus and control method thereof
EP2947827B1 (en) Method and apparatus for improving forwarding performance of chip
CN115118662A (en) Hash collision processing method, system, equipment and medium based on ARP table
RU2675050C1 (en) Method and device for selecting access control address to mac environment

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
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: Xinhua three Technology Co., Ltd.

Address before: 310053 Hangzhou science and Technology Industrial Park, hi tech Industrial Development Zone, Zhejiang, China, HUAWEI,, Hangzhou, six

Patentee before: Huasan Communication Technology Co., Ltd.

CP03 Change of name, title or address