CN105959430A - Switcher MAC address aging method - Google Patents

Switcher MAC address aging method Download PDF

Info

Publication number
CN105959430A
CN105959430A CN201610377793.8A CN201610377793A CN105959430A CN 105959430 A CN105959430 A CN 105959430A CN 201610377793 A CN201610377793 A CN 201610377793A CN 105959430 A CN105959430 A CN 105959430A
Authority
CN
China
Prior art keywords
mac address
list item
digestion period
time
granularity
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.)
Pending
Application number
CN201610377793.8A
Other languages
Chinese (zh)
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.)
Shenzhen Forward Industrial Co Ltd
Original Assignee
Shenzhen Forward Industrial 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 Shenzhen Forward Industrial Co Ltd filed Critical Shenzhen Forward Industrial Co Ltd
Priority to CN201610377793.8A priority Critical patent/CN105959430A/en
Publication of CN105959430A publication Critical patent/CN105959430A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Abstract

The invention provides a switcher MAC address aging method, and the method comprises the following steps: S1, configuring the aging period and granularity of an MAC address; S2, taking the source MAC address and VLAN ID of a message as key values, making a Hash index, and judging whether there is already a corresponding item or not; S3, updating the current time as an updated time stamp of a table item if the corresponding table item is in an MAC address list, or else, adding one table item, and updating the current time as the updated time stamp of the table item; S4, scanning the MAC address list in an aging process when the aging period granularity arrives, calculating the time difference between the current time and the updated time stamp, and judging whether the time difference is greater than an aging period or not; S5, repeatedly carrying out the step S4 if the time difference is less than the aging period; S6, deleting the table item if the time difference is greater than the aging period. The method reduces the error of aging time, enables the forwarding behavior of a switcher to be more accurate, and improves the effective utilization rate of the MAC address list.

Description

A kind of switch mac address aging method
Technical field
The invention belongs to switch field, be specifically related to a kind of switch mac address aging method.
Background technology
Switch realizes Layer 2 data based on mac address table and forwards, and houses MAC in mac address table Address, VLAN ID and the mapping relations of port numbers.Switch allows automatically after port receives message Practise MAC Address, add the source MAC of message, VLAN ID and port numbers to mac address table In.Due to mac address table limited space, it is impossible to unconfined learned addresses, when therefore introducing aging Between mechanism.Switch clears up, by the mechanism of ageing time, the table being of little use in mac address table termly , provide space for new address learning, it is ensured that the normal forwarding of switch.
The most conventional way is to create two processes, an address learning process, a ground in a switch Location ager process, two processes are relatively independent operations, and its principle is as follows:
Address learning process: switch ports themselves after receiving message, with the source MAC of message and VLAN ID is that key assignments does Hash index, searches mac address table.If mac address table does not also have The list item that this MAC Address is corresponding, then carry out address learning, by the source MAC of this message, VLAN ID Mapping with port numbers adds in mac address table, simultaneously by the hit position 1 of this list item, represents this MAC Address is active;If mac address table has existed for this MAC Address, the most only update this list item Hit position, by hit position 1, represent that this MAC Address remains in that active;
Address aging process: ageing time defaults to 300 seconds, it is allowed to the scope of user setup from 10 seconds to 1000000 seconds;Address aging process every a digestion period will run-down mac address table, by it Middle hit position be 0 list item directly delete;Simultaneously by the list item hit position 0 that hit position is 1, represent and wait to delete Remove.
Owing to address learning process and address aging process work independently from each other, a therefore MAC Address Ageing time can there is error, this error is arrange ageing time 1-2 times, concrete error such as Fig. 3 Shown in.Situation shown in Fig. 3 (a) is: list item a just updates, its hit position 1, immediately digestion period Arrive, its hit position 0, when arriving next digestion period, delete MAC ground corresponding for this list item a Location, now the ageing time of MAC Address is a digestion period;Situation shown in Fig. 3 (b) is: table Item a updates at the end of a digestion period is just, its hit position 1, when next digestion period arrives, Its hit position 0, when another digestion period arrives, deletes MAC Address corresponding to this list item a, now The ageing time of MAC Address is two digestion periods.Long ageing time can make the MAC in switch Address table exceeds the time limit, and makes switch make some irrational forwardings and determines, also reduces mac address table simultaneously Effective rate of utilization.
Summary of the invention
Present invention aims to the deficiencies in the prior art, it is provided that a kind of aging side of switch mac address Method, this switch mac address aging method can reduce the error of MAC address aging time so that hands over The forwarding behavior changed planes more accurately, also improve the effective rate of utilization of mac address table.
For reaching above-mentioned requirements, the present invention adopts the technical scheme that a kind of switch mac address of offer is aging Method, comprises the following steps:
S1, the digestion period of configuration MAC Address and granularity digestion period;
S2, do Hash index with the source MAC of message and VLAN ID for key assignments, search MAC ground Location table, it may be judged whether there is corresponding list item;
If S3 mac address table has existed corresponding list item, then current time is updated to described list item Update timestamp;If mac address table does not exist corresponding list item, then add a list item, by current time It is updated to the renewal timestamp of this list item;
S4, when digestion period granularity arrive time, ager process scanning mac address table, calculate current time with The time difference of this renewal timestamp, it is judged that whether this time difference is more than digestion period;
If this time difference of S5 is less than digestion period, repeat step S4;
If this time difference of S6 is more than digestion period, then delete this list item.
Compared with prior art, this switch mac address aging method has the advantage that as follows: introduce aging Cycle granularity and renewal timestamp, current time and renewal timestamp when calculating each granularity arrival digestion period Difference, judge whether to delete list item, by MAC Address by the size comparing this difference and digestion period Ageing time error, from 0 second to MAC address aging cycle time, is reduced to from 0 second to MAC Address old Change cycle granularity time, greatly reduces the error of ageing time so that the forwarding behavior of switch is more Obtain accurately, also improve the effective rate of utilization of mac address table.
Accompanying drawing explanation
Accompanying drawing described herein is used for providing further understanding of the present application, constitutes the part of the application, Using identical reference number to represent same or analogous part in the drawings, the application's is schematic Embodiment and explanation thereof are used for explaining the application, are not intended that the improper restriction to the application.In the accompanying drawings:
Fig. 1 is the flow chart of the application;
Fig. 2 is the schematic diagram of a kind of embodiment of the application;
Fig. 3 is the schematic diagram of prior art.
Detailed description of the invention
For making the purpose of the application, technical scheme and advantage clearer, below in conjunction with accompanying drawing and be embodied as Example, is described in further detail the application.For the sake of simplicity, this area skill is eliminated in below describing Art personnel some technical characteristic known.
According to one embodiment of present invention, it is provided that a kind of switch mac address aging method, such as Fig. 1 institute Show, comprise the following steps:
S1, the configuration digestion period of MAC Address and granularity digestion period, digestion period in the range of 10-1000000s;Digestion period, granularity was the time of MAC address aging process run-down mac address table Interval, digestion period, granularity was more than or equal to 10s, and less than or equal to digestion period;Digestion period and aging Cycle granularity is user and can configure, and can determine by arranging software variable or configuration register;
S2, do Hash index with the source MAC of message and VLAN ID for key assignments, search MAC ground Location table, it may be judged whether there is corresponding list item;
If S3 mac address table has existed corresponding list item, then current time is updated to this list item more New timestamp;If mac address table does not exist corresponding list item, then add a list item, by current time more It it is newly the renewal timestamp of this list item;
S4, when digestion period granularity arrive time, ager process scanning mac address table, calculate current time with The time difference of this renewal timestamp, it is judged that whether this time difference is more than digestion period;
If this time difference of S5 is less than digestion period, repeat step S4;
If this time difference of S6 is more than digestion period, then delete this list item.
Being illustrated according to one embodiment of present invention, arranging ageing time is 300 seconds, aging week Phase granularity is 75 seconds.
Situation shown in Fig. 2 (a) is to update or after interpolation list item a, and digestion period, granularity arrived for the first time immediately Coming, concrete operations are as follows:
101: update or add list item a, current time is saved in renewal timestamp;
102: granularity digestion period arrives for the first time, ager process scanning mac address table for the first time, calculate The time difference of the timestamp preserved in current time and MAC Address list item a, slightly larger than 0 second, not to address List item a does any operation;
103: granularity digestion period arrives for the second time, ager process second time scanning mac address table, calculate The time difference of the timestamp preserved in current time and MAC Address list item a, slightly larger than 75 seconds, the most over the ground Location list item a does any operation;
104: granularity digestion period arrives for the third time, ager process third time scanning mac address table, calculate The time difference of the timestamp preserved in current time and MAC Address list item a, slightly larger than 150 seconds, the most over the ground Location list item a does any operation;
105: the four granularity arrivals digestion period, the 4th scanning mac address table of ager process, calculate The time difference of the timestamp preserved in current time and MAC Address list item a, slightly larger than 225 seconds, the most over the ground Location list item a does any operation;
106: the five granularity arrivals digestion period, the 5th scanning mac address table of ager process, calculate The time difference of the timestamp preserved in current time and MAC Address list item a, slightly larger than 300 seconds, more than old The change cycle, deleting MAC address list item a.
From above mode of operation, in the case of 2 (a) Suo Shi, during MAC Address list item a aging Between be a digestion period, ageing time error is 0 second.
Situation shown in Fig. 2 (b) is after a digestion period, granularity terminated, and updates immediately or adds list item a, Concrete operations are as follows:
201: update or add list item a, current time is saved in timestamp;
202: granularity digestion period arrives for the first time, ager process scanning mac address table for the first time, calculate The time difference of timestamp preserved in current time and MAC Address list item a, is slightly less than 75 seconds, the most over the ground Location list item a does any operation;
203: granularity digestion period arrives for the second time, ager process second time scanning mac address table, calculate The time difference of timestamp preserved in current time and MAC Address list item a, is slightly less than 150 seconds, the most over the ground Location list item a does any operation;
204: granularity digestion period arrives for the third time, ager process third time scanning mac address table, calculate The time difference of timestamp preserved in current time and MAC Address list item a, is slightly less than 225 seconds, the most over the ground Location list item a does any operation;
205: the four granularity arrivals digestion period, the 4th scanning mac address table of ager process, calculate The time difference of timestamp preserved in current time and MAC Address list item a, is slightly less than 300 seconds, the most over the ground Location list item a does any operation;
206: the five granularity arrivals digestion period, the 5th scanning mac address table of ager process, calculate The time difference of the timestamp preserved in current time and MAC Address list item a, is slightly less than 375 seconds, more than old The change cycle, deleting MAC address list item a;
From above mode of operation, in the case of 2 (b) Suo Shi, during MAC Address list item a aging Between be add a digestion period one digestion period granularity, ageing time error be one digestion period granularity.
Therefore, after using the ageing time mechanism optimized in the present invention, ageing time scope is 300 seconds-375 Second, error is the 0-75 second, and the ageing time scope of conventional MAC address aging mechanism is 300 seconds-600 Second, ageing time error is the 0-300 second, and the present invention greatly reduces the error of ageing time so that exchange The forwarding behavior of machine more accurately, also improve the effective rate of utilization of mac address table.
For convergence-level, core layer switch, need the data volume forwarded relatively big inside switch, relate to And the mac address table item enormous amount arrived.The present invention is when practice, in order to ensure performance, can adopt Automatically learn with hardware based MAC Address and aging method.It is embodied as to the present invention to mention The method logic of MAC address aging, is integrated in exchange chip, realizes related algorithm by hardware and patrols Volume, provide related register to configure the parameter such as ageing time, granularity digestion period for user simultaneously.
For access-layer switch, inside switch, need data volume relatively convergence-level, the core layer forwarded For switch less, the mac address table item quantity related to is relatively fewer.The present invention when practice, In order to consider hardware cost and increase functional mobility, MAC Address based on software can be used automatically to learn And aging way.It is embodied as being the messages transmitted to CPU that receives of exchange chip, CPU message is carried out Resolve, and MAC Address is carried out study with aging.The MAC Address so can will mentioned in the present invention Automatically study and aging way, be integrated in software, realize related algorithm and logic by software, with Time be also required to provide the user ageing time, the isoparametric configuration of granularity digestion period.
Embodiment described above only represents the several embodiments of the present invention, and it describes more concrete and detailed, But limitation of the scope of the invention can not be interpreted as.It should be pointed out that, for the ordinary skill of this area For personnel, without departing from the inventive concept of the premise, it is also possible to make some deformation and improvement, these Broadly fall into scope.Therefore protection scope of the present invention should be as the criterion with described claim.

Claims (3)

1. switch mac address aging method, it is characterised in that comprise the following steps:
S1, the digestion period of configuration MAC Address and granularity digestion period;
S2, do Hash index with the source MAC of message and VLAN ID for key assignments, search MAC ground Location table, it may be judged whether there is corresponding list item;
If S3 mac address table has existed corresponding list item, then current time is updated to described list item Update timestamp;If mac address table does not exist corresponding list item, then add a list item, will be current Time is updated to the renewal timestamp of described list item;
S4, when digestion period granularity arrive time, ager process scanning mac address table, calculate current time with The time difference of described renewal timestamp, it is judged that whether described time difference is more than digestion period;
If the described time difference of S5 is less than digestion period, repeat step S4;
If the described time difference of S6 is more than digestion period, then delete described list item.
Switch mac address aging method the most according to claim 1, it is characterised in that described Digestion period is in the range of 10-1000000s.
Switch mac address aging method the most according to claim 2, it is characterised in that described Digestion period, granularity was more than or equal to 10s, and less than or equal to digestion period.
CN201610377793.8A 2016-05-31 2016-05-31 Switcher MAC address aging method Pending CN105959430A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610377793.8A CN105959430A (en) 2016-05-31 2016-05-31 Switcher MAC address aging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610377793.8A CN105959430A (en) 2016-05-31 2016-05-31 Switcher MAC address aging method

Publications (1)

Publication Number Publication Date
CN105959430A true CN105959430A (en) 2016-09-21

Family

ID=56908329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610377793.8A Pending CN105959430A (en) 2016-05-31 2016-05-31 Switcher MAC address aging method

Country Status (1)

Country Link
CN (1) CN105959430A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411622A (en) * 2016-12-16 2017-02-15 成都西加云杉科技有限公司 Table entry processing method and device
CN107872391A (en) * 2017-11-23 2018-04-03 锐捷网络股份有限公司 A kind of entry updating method and device
CN108173784A (en) * 2017-12-29 2018-06-15 湖南恒茂高科股份有限公司 A kind of aging method and device of the data pack buffer of interchanger
CN108347494A (en) * 2017-01-25 2018-07-31 中兴通讯股份有限公司 MAC address aging processing method, network processor chip and communication equipment
CN108616614A (en) * 2018-04-28 2018-10-02 深圳市风云实业有限公司 MAC Address management method, device and electronic equipment
CN109451087A (en) * 2018-10-26 2019-03-08 新华三技术有限公司 MAC address entries ageing method and device
CN111147624A (en) * 2019-12-31 2020-05-12 苏州浪潮智能科技有限公司 MAC (media Access control) table entry aging time adjusting method and device
CN112838993A (en) * 2019-11-22 2021-05-25 武汉神州数码云科网络技术有限公司 Method for realizing dynamic issuing of MAC VLAN
CN113542130A (en) * 2021-07-22 2021-10-22 新华三信息安全技术有限公司 Method and device for processing address table items
CN114024919A (en) * 2021-09-28 2022-02-08 苏州裕太微电子有限公司 Method and system for realizing accurate aging of Ethernet two-layer forwarding table

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1484405A (en) * 2003-08-11 2004-03-24 北京港湾网络有限公司 Method for speeding ARP table entry aging for switch board
CN101909065A (en) * 2010-08-13 2010-12-08 北京中创信测科技股份有限公司 Network equipment and aging update method of ARP (Address Resolution Protocol) table in same
CN102983984A (en) * 2011-09-05 2013-03-20 盛科网络(苏州)有限公司 Method and system for solution of aging of multicast entries
CN104333520A (en) * 2014-11-28 2015-02-04 上海斐讯数据通信技术有限公司 Method for controlling interchanger MAC address table dual-ageing time

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1484405A (en) * 2003-08-11 2004-03-24 北京港湾网络有限公司 Method for speeding ARP table entry aging for switch board
CN101909065A (en) * 2010-08-13 2010-12-08 北京中创信测科技股份有限公司 Network equipment and aging update method of ARP (Address Resolution Protocol) table in same
CN102983984A (en) * 2011-09-05 2013-03-20 盛科网络(苏州)有限公司 Method and system for solution of aging of multicast entries
CN104333520A (en) * 2014-11-28 2015-02-04 上海斐讯数据通信技术有限公司 Method for controlling interchanger MAC address table dual-ageing time

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411622A (en) * 2016-12-16 2017-02-15 成都西加云杉科技有限公司 Table entry processing method and device
CN106411622B (en) * 2016-12-16 2019-06-07 成都西加云杉科技有限公司 A kind of table entry processing method and device
CN108347494A (en) * 2017-01-25 2018-07-31 中兴通讯股份有限公司 MAC address aging processing method, network processor chip and communication equipment
CN108347494B (en) * 2017-01-25 2022-03-11 中兴通讯股份有限公司 MAC address aging processing method, network processor chip and communication equipment
CN107872391A (en) * 2017-11-23 2018-04-03 锐捷网络股份有限公司 A kind of entry updating method and device
CN107872391B (en) * 2017-11-23 2021-06-18 锐捷网络股份有限公司 Table entry updating method and device
CN108173784A (en) * 2017-12-29 2018-06-15 湖南恒茂高科股份有限公司 A kind of aging method and device of the data pack buffer of interchanger
CN108616614A (en) * 2018-04-28 2018-10-02 深圳市风云实业有限公司 MAC Address management method, device and electronic equipment
CN108616614B (en) * 2018-04-28 2021-04-06 深圳市风云实业有限公司 MAC address management method and device and electronic equipment
CN109451087A (en) * 2018-10-26 2019-03-08 新华三技术有限公司 MAC address entries ageing method and device
CN112838993A (en) * 2019-11-22 2021-05-25 武汉神州数码云科网络技术有限公司 Method for realizing dynamic issuing of MAC VLAN
CN111147624A (en) * 2019-12-31 2020-05-12 苏州浪潮智能科技有限公司 MAC (media Access control) table entry aging time adjusting method and device
CN111147624B (en) * 2019-12-31 2022-12-13 苏州浪潮智能科技有限公司 MAC (media Access control) table entry aging time adjusting method and device
CN113542130A (en) * 2021-07-22 2021-10-22 新华三信息安全技术有限公司 Method and device for processing address table items
CN114024919A (en) * 2021-09-28 2022-02-08 苏州裕太微电子有限公司 Method and system for realizing accurate aging of Ethernet two-layer forwarding table

Similar Documents

Publication Publication Date Title
CN105959430A (en) Switcher MAC address aging method
CN103259725B (en) Messaging method and network equipment
CN102185706B (en) Method for generating IEEE1394 (Institute of Electrical and Electronics Engineers 1394) network topological graph
CN103441932B (en) A kind of Host routes list item generates method and apparatus
CN102821168B (en) Based on method and the device of the MAC address aging of VPLS
CN105959254A (en) Message processing method and device
CN107104824A (en) A kind of network topology determines method and apparatus
CN103581022B (en) MAC address finding and transmitting method and device
CN109246785B (en) Method for realizing future mobile network
CN107547346B (en) Message transmission method and device
CN104125128A (en) Method for supporting VLAN (virtual local area network) by aid of Linux soft bridge
US9135833B2 (en) Process for selecting compressed key bits for collision resolution in hash lookup table
CN111416865A (en) Protocol proxy processing method and system based on mimicry defense
CN107276916A (en) Interchanger flow table management method based on agreement unaware retransmission technique
CN105745882A (en) Realization method for flat networks routing based on network
CN102801622A (en) Transmitting method and device for data messages
CN106453091A (en) Equivalent routing management method and device of router forwarding plane
CN111800338B (en) Cross-AS EVPN route interaction method and device
CN105281960A (en) Method for managing flow entry in software defined network
US9419909B2 (en) Determining when to relearn a relationship between a network address and a port
CN102263700A (en) Method, device and system for sending and receiving messages
CN108494595B (en) High-efficiency new-generation big data network implementation method
CN105634999B (en) A kind of aging method and device of Media Access Control address
CN108183851B (en) Message forwarding method and forwarding equipment
CN107800630A (en) Message processing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160921