CN101841473A - Method and apparatus for updating MAC (Media Access Control) address table - Google Patents

Method and apparatus for updating MAC (Media Access Control) address table Download PDF

Info

Publication number
CN101841473A
CN101841473A CN201010145545A CN201010145545A CN101841473A CN 101841473 A CN101841473 A CN 101841473A CN 201010145545 A CN201010145545 A CN 201010145545A CN 201010145545 A CN201010145545 A CN 201010145545A CN 101841473 A CN101841473 A CN 101841473A
Authority
CN
China
Prior art keywords
ethernet frame
list item
read
mac address
address table
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
CN201010145545A
Other languages
Chinese (zh)
Other versions
CN101841473B (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.)
Beijing Star Net Ruijie Networks Co Ltd
Original Assignee
Beijing Star Net Ruijie Networks 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 Beijing Star Net Ruijie Networks Co Ltd filed Critical Beijing Star Net Ruijie Networks Co Ltd
Priority to CN2010101455453A priority Critical patent/CN101841473B/en
Publication of CN101841473A publication Critical patent/CN101841473A/en
Application granted granted Critical
Publication of CN101841473B publication Critical patent/CN101841473B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method and an apparatus for updating an MAC (Media Access Control) address table. The method comprises the following steps of: searching corresponding table items from the MAC address table according to a source MAC address of the Ethernet frame after an Ethernet frame is received; computing a difference value between a system time stamp of the received Ethernet frame and an table item time stamp recorded in the searched entry if the searching is successful; and updating the table item time stamp with the system time stamp when the difference value is greater than a preset value. In the invention, only when the difference value is greater than the preset value, the table item time stamp of the link list can be updated with the system time stamp, and each received Ethernet frame is unnecessarily subjected to write operation, thereby reducing times of carrying out the write operation on the MAC address table, improving the concurrent processing capacity of a multi-core processor to the Ethernet frame and improving the forwarding performance of the Ethernet frame.

Description

Mac address table update method and device
Technical field
The embodiment of the invention relates to the ethernet frame retransmission technique field of data link layer, and (Media Access Control is called for short: MAC) address list updating method and device to relate in particular to a kind of media interviews control.
Background technology
In available data link layer retransmission technique, when the network equipment adopts polycaryon processor that ethernet frame is operated, for fear of operating collision to the list item of shared resource, available technology adopting the mode of spin lock or Read-Write Locks is set, if adopt spin lock can only have a keeper to obtain lock at any time, also just say to have a processor core to obtain spin lock at any time at most.If spin lock is kept by other processor core, this processor core just circulates in the there always and has discharged lock up to the keeper of this spin lock, and " spin " speech is exactly therefore to gain the name; (Read-Write Locks is actual to be a kind of special spin lock, and it is divided into the reader and the person of writing to the visitor to shared resource, and the reader only carries out read access to shared resource, and the person of writing then needs shared resource is carried out write operation also can to adopt Read-Write Locks mechanism.This phase-locked for spin lock, can improve concurrency, because in multicomputer system, it allows to have simultaneously a plurality of processor readers to visit shared resource simultaneously, reader's number of maximum possible is actual logic CPU number.The person of writing is an exclusiveness, and a Read-Write Locks can only have the person of writing or a plurality of reader (relevant with the processor check figure) to obtain lock simultaneously, but existing reader has the person of writing to obtain lock again simultaneously.Do not have the reader if Read-Write Locks is current, also do not write the person, do not write the person so and can obtain Read-Write Locks at once, otherwise this person of writing must spin there, up to without any the person of writing or reader; If Read-Write Locks is not write the person, the reader can obtain this Read-Write Locks immediately so, otherwise the reader must spin there, discharges this Read-Write Locks up to the person of writing.Wherein, write operation comprises in mac address table interpolation and remove entries or existing list item is upgraded.Here mac address table is operated the network equipment that refers to based on polycaryon processor and be used for two layers of forwarding (network bridge mode), the source MAC of the ethernet frame received is learnt and refreshed that (MAC Address of the learning place of depositing is called mac address table, the interface of the MAC Address correspondence that record is acquired), the target MAC (Media Access Control) address of ethernet frame is searched.If in mac address table, do not find target MAC (Media Access Control) address, then to broadcast at all network interfaces.If found the target MAC (Media Access Control) address item in mac address table, then the interface message in the utilization table sends.Therefore two layers of forwarding must be carried out MAC address learning in order to reduce broadcasting.In order to safeguard mac address table, to the source MAC list item in the ethernet frame constantly be upgraded after receiving ethernet frame; If simultaneously must be to the deletion of wearing out of this mac address entry, in order to avoid mac address table completely falls through there not being ethernet frame that MAC address entries is upgraded after a while.
There are the following problems at least to handle mac address table in the prior art:
When the list item of mac address table was upgraded operation, because the read operation of polycaryon processor can concurrently carry out, but write operation can only carry out separately, and therefore, write operation has reduced the concurrency of polycaryon processor.In order to overcome this defective, available technology adopting following scheme:
(1) build an IP address table in addition according to 5 tuple information of IP ethernet frame, this IP table record ethernet frame outlet and inlet information.When receiving, sets up first ethernet frame mac address table and IP address table simultaneously, and the number of record IP session in mac address table.If receiving can find behind the ethernet frame, polycaryon processor just no longer looks into mac address table in this IP table, if time is up that the related IP session in back exists then this mac address table wouldn't be deleted for MAC address aging, do not existed just up to the IP of association session and can delete MAC address entries.This processing method can to a certain degree reduce the number of times of mac address table visit.
But the defective of this scheme is: because IP Session Time all long usually (as the ageing time of TCP session stable state normally 1 hour), the ageing time of MAC address entries is subjected to the restriction of IP Session Time length and can't artificially controls, make that the ageing time of MAC address entries is also elongated thereupon, therefore can influence the list item ageing process.Therefore, some useless list items can not be in time deleted, thereby wasted the memory space resource of mac address table.And this scheme also can only be applicable to the IP frame, and can't be used for other ethernet frames, and (Address ResolutionProtocol is called for short: ARP) etc. as address resolution protocol.
(2) adopt three-state content addressing memory (Ternary Content Addressable Memory, be called for short: TCAM) store M AC address, search fast realizing.
But the defective of this scheme is: TCAM is a kind of hardware unit, costs an arm and a leg, and has therefore increased cost.
Summary of the invention
The embodiment of the invention provides a kind of mac address table update method and device, in order to reduce the number of times of write operation, has improved the concurrency of polycaryon processor.
The embodiment of the invention provides a kind of mac address table update method, comprising:
After receiving ethernet frame, in mac address table, search corresponding list item according to the source MAC of this ethernet frame;
If search successfully, then calculate the difference of the list item timestamp that writes down in system timestamp and the list item that finds when receiving described ethernet frame;
When described difference during, upgrade described list item timestamp with described system timestamp greater than preset value.
Another embodiment of the present invention provides a kind of mac address table updating device, comprising:
Search module, be used for after receiving ethernet frame, in mac address table, search corresponding list item according to the source MAC of this ethernet frame;
Computing module is used for the difference of the list item timestamp that writes down in system timestamp and the list item that finds searching module searches when success, calculate when receiving described ethernet frame;
The update of time stamp module when being used for the described difference that calculates when computing module greater than preset value, is upgraded described list item timestamp with described system timestamp.
Have only among the present invention when described difference during greater than preset value, just upgrade the list item timestamp of described chained list with described system timestamp, and do not need each ethernet frame that receives is all carried out write operation, thereby significantly reduced the number of times that mac address table is carried out write operation, improved the concurrent processing ability of polycaryon processor, improved the ethernet frame forwarding performance ethernet frame.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do one to the accompanying drawing of required use in embodiment or the description of the Prior Art below introduces simply, apparently, accompanying drawing in describing below is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the flow chart of mac address table update method embodiment one of the present invention;
Fig. 2 is the schematic diagram that adopts the mac address table of list structure among the described method embodiment one;
Fig. 3 is the data structure schematic diagram of node described in the method embodiment one;
Fig. 4 is the flow chart of mac address table update method embodiment two of the present invention;
Fig. 5 is the schematic diagram that adopts the mac address table of Hash table structure among the method embodiment two;
Fig. 6 is the structural representation of mac address table updating device embodiment one of the present invention;
Fig. 7 is for searching the structural representation of module among the mac address table updating device embodiment two of the present invention;
Fig. 8 is for searching the structural representation of module among the mac address table updating device embodiment three of the present invention;
Fig. 9 is the structural representation of mac address table updating device embodiment four of the present invention.
Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The embodiment of the invention provides a kind of mac address table update method, and this method comprises: after receiving ethernet frame, search corresponding list item according to the source MAC of this ethernet frame in mac address table; If search successfully, then calculate the difference of the list item timestamp that writes down in system timestamp and the list item that finds when receiving described ethernet frame; When described difference during, upgrade described list item timestamp with described system timestamp greater than preset value.
By the described method of present embodiment, have only when described difference during greater than preset value, just upgrade described list item timestamp with described system timestamp, and do not need each ethernet frame that receives is all carried out write operation, thereby significantly reduced the number of times that mac address table is carried out write operation, improved the concurrent processing ability of polycaryon processor, improved the ethernet frame forwarding performance ethernet frame.
Wherein, above-mentioned mac address table can be chained list or Hash (HASH) table, below is elaborated by different embodiment respectively.
Fig. 1 is the flow chart of mac address table update method embodiment one of the present invention.In the present embodiment, mac address table is with the storage of chain sheet form, and as shown in Figure 2, deposit two category informations in this chained list in advance: one is the linked list head pointer, and initial condition is defaulted as sky; Another one is the Read-Write Locks (lock) of chained list, and its value initial value becomes zero.This method can be carried out by a processor core in the polycaryon processor.
As shown in the figure, comprise the steps:
Step 110, receive ethernet frame after, with the Read-Write Locks that chained list is pinned in read operation, be starting point with the linked list head pointer, described chained list is traveled through, in chained list, search corresponding list item according to the source MAC of this ethernet frame.
Search finish after, discharge described Read-Write Locks.When finding corresponding source MAC, then search successfully execution in step 120; Otherwise search failure, execution in step 130.
Step 120 if search successfully, is then calculated the difference of the list item timestamp that writes down in system timestamp and the list item that finds when receiving described ethernet frame.
Wherein, in the moment when timestamp represents that a certain incident takes place, for example timestamp is 50, draws the concrete time after multiplying each other with system clock cycle.
Step 121 when described difference during greater than preset value, with the Read-Write Locks that write operation pins chained list, is upgraded described list item timestamp with described system timestamp, and is discharged described Read-Write Locks.
When described difference during, described list item timestamp is not upgraded less than described preset value.Wherein, described preset value can be 1 second or bigger value, just upgrades corresponding list item timestamp during greater than 1 second if difference less than 1 second then corresponding list item is not upgraded, has only when difference.
Step 130 discharges after the Read-Write Locks, if search failure, then according to described source MAC and the system timestamp when receiving described ethernet frame in described chained list table, add new list item.
Particularly, the memory space of application node from internal memory is inserted nodal information and is generated node earlier, with the Read-Write Locks that write operation pins described chained list, described node is inserted chained list, if this linked list head pointer changes, also need this head pointer is upgraded, discharge this Read-Write Locks.Wherein, as shown in Figure 3, described nodal information comprises: source MAC, receive the incoming interface of described ethernet frame, prior pointer and backpointer that the list item timestamp that generates according to system timestamp and this node are associated with the front and back node.
The list item ageing process of above-mentioned chained list can be responsible for finishing by a specific processor core, particularly, regularly (such as 1 second) travels through a chained list, the method of traversal is the Read-Write Locks of pinning chained list with read operation, finish the chained list traversal, overtime needs are aging to check the timestamp of MAC address entries, discharge this Read-Write Locks.If overtime the needs deletes, pin the Read-Write Locks of chained list again with write operation, deletion of node from chained list upgrades the linked list head pointer, discharges this Read-Write Locks.
By the described method of present embodiment, have only when described difference during greater than preset value, just upgrade the list item timestamp of described chained list with described system timestamp, and do not need each ethernet frame that receives is all carried out write operation, thereby significantly reduced the number of times that mac address table is carried out write operation, improved the concurrent processing ability of polycaryon processor, improved the ethernet frame forwarding performance ethernet frame.
And, compared with prior art also have following technical advantage:
(1) need not to use new hardware unit, thereby help saving manufacturing cost;
(2) only promptly can realize the described method of present embodiment based on data link layer ethernet frame and mac address table, irrelevant with the ethernet frame type of network layer, so the scope of application is wider;
(3) though have only when difference and just upgrade the list item timestamp during greater than preset value, also prolonged ageing time to a certain extent, but this preset value can artificially be set, then can not cause too much influence as long as be controlled at the scope of permission, for example allow the ageing time error in several seconds and the very big lifting that obtains performance is complete acceptable the list item ageing process.
Fig. 4 is the flow chart of mac address table update method embodiment two of the present invention.Mac address table described in the present embodiment can adopt Hash (HASH) table mode to organize, particularly, Fig. 5 is the mac address table schematic diagram that adopts the Hash table structure described in the method embodiment two, as shown in the figure, this mac address table comprises HASH bucket and ltsh chain table, and this HASH bucket comprises a plurality of grooves position (slot), a member of each groove bit representation array, wherein deposit two category informations: the head pointer of a ltsh chain table that is, initial condition is defaulted as sky; Another one is Read-Write Locks (lock), and its value initial value becomes zero.As shown in Figure 4, this method comprises:
Step 210 after certain processor core receives ethernet frame, utilizes hash algorithm that described source MAC is scaled index (index) value.
Wherein, hash algorithm is a kind of hashing algorithm, is used for the input value of random length is transformed into the hashed value of regular length as described index value.
Step 211 finds corresponding groove position according to described index value in described Hash table.
Particularly, search corresponding groove position in the HASH bucket in described Hash table.
Step 212, pin the Read-Write Locks of depositing in the described groove position with read operation, head pointer with the ltsh chain table preserved in the described groove position is a starting point, and described ltsh chain table is traveled through, and searches corresponding list item according to the source MAC of this ethernet frame in ltsh chain table.
Finish search after, discharge described Read-Write Locks.When finding corresponding source MAC, then search successfully execution in step 220; Otherwise search failure, execution in step 230.
Step 220 if search successfully, is then calculated the difference of the list item timestamp that writes down in system timestamp and the list item that finds when receiving described ethernet frame.
Step 221 when described difference during greater than preset value, with the Read-Write Locks that write operation pins Hash table, is upgraded described list item timestamp with described system timestamp, and is discharged described Read-Write Locks.
When described difference during, described list item timestamp is not upgraded less than described preset value.Wherein, described preset value can be 1 second or bigger value, just upgrades corresponding list item timestamp during greater than 1 second if difference less than 1 second then corresponding list item is not upgraded, has only when difference.
Step 230 discharges after the Read-Write Locks, if search failure, then according to described source MAC and the system timestamp when receiving described ethernet frame in described Hash table, add new list item.
Particularly, the memory space of application node from internal memory earlier, insert nodal information and generate node, pin the Read-Write Locks of described Hash table with write operation, described node is inserted ltsh chain table, if the head pointer of this ltsh chain table changes, also need the head pointer of this ltsh chain table is upgraded, and discharge this Read-Write Locks.
The described method of present embodiment has realized searching of list item on the basis of Hash table, as previously mentioned, read operation can not influence the concurrency of polycaryon processor, and therefore, the described process of searching corresponding list item of present embodiment also can not influence the concurrency of polycaryon processor.
In addition, the list item ageing process of Hash table can be responsible for finishing by a specific processor core, particularly, regularly (such as 1 second) travels through a ltsh chain table, the method of traversal be in the HASH bucket one by one to the node of each groove position each ltsh chain table of sequential search, check that whether the overtime needs of timestamp of MAC address entries are aging, particularly, only need pin the Read-Write Locks of depositing in the groove position, can finish the chained list traversal with read operation.If overtime the needs deletes, pin the Read-Write Locks of depositing in the groove position with write operation again, deletion of node from chained list upgrades the linked list head pointer of depositing in the groove position, discharges this lock.
Fig. 6 is the structural representation of mac address table updating device embodiment one of the present invention, and as shown in the figure, this mac address table updating device 10 comprises at least: search module 11, computing module 12 and timestamp update module 13.This mac address table updating device 10 can be arranged in the network equipment that adopts polycaryon processor, and its operation principle is as follows:
After mac address table updating device 10 receives ethernet frame, in mac address table, search corresponding list item by searching module 11 according to the source MAC of this ethernet frame, when finding corresponding source MAC, then search successfully, otherwise search failure; When searching module 11 when searching successfully, calculate the difference of the list item timestamp that writes down in system timestamp and the list item that finds when receiving described ethernet frame by computing module 12; The described difference that calculates when computing module 12 is upgraded described list item timestamp by the described system timestamp of update of time stamp module 13 usefulness during greater than preset value.
By the described device of present embodiment, have only when described difference during greater than preset value, just upgrade described list item timestamp with described system timestamp, and do not need each ethernet frame that receives is all carried out write operation, thereby significantly reduced the number of times that mac address table is carried out write operation, improved the concurrent processing ability of polycaryon processor, improved the ethernet frame forwarding performance ethernet frame.
Fig. 7 is for searching the structural representation of module among the mac address table updating device embodiment two of the present invention, described in the present embodiment mac address table is a chained list, and the explanation of relevant chained list can repeat no more referring to Fig. 2 and related content thereof herein.The module 11 of searching shown in Figure 6 can specifically comprise: chained list Read-Write Locks unit 1101, chained list traversal unit 1102 and chained list are searched unit 1103, and its operation principle is as follows:
After mac address table updating device 10 receives ethernet frame, the Read-Write Locks of pinning described chained list with read operation by the chained list Read-Write Locks unit of searching in the module 11 1101; Is starting point by chained list traversal unit 1102 with the linked list head pointer of described chained list, and described chained list is traveled through; Search unit 1103 by chained list and in described chained list, search corresponding list item according to the source MAC of described ethernet frame; Then, discharge the Read-Write Locks of described chained list by chained list Read-Write Locks unit 1101; When searching successfully, the difference of the list item timestamp that writes down in system timestamp when receiving described ethernet frame and the list item that finds by computing module 12 calculating; When described difference during greater than preset value, the Read-Write Locks of pinning chained list with write operation by chained list Read-Write Locks unit 1101 is upgraded by update of time stamp module 13 and to be upgraded described list item timestamp with described system timestamp; After finishing renewal, discharge described Read-Write Locks by chained list Read-Write Locks unit 1101 again.
The list item ageing process of relevant chained list can repeat no more referring to the related description of preceding method embodiment herein.
By the described device of present embodiment, have only when described difference during greater than preset value, just upgrade the list item timestamp of described chained list with described system timestamp, and do not need each ethernet frame that receives is all carried out write operation, thereby significantly reduced the number of times that mac address table is carried out write operation, improved the concurrent processing ability of polycaryon processor, improved the ethernet frame forwarding performance ethernet frame.
Fig. 8 is for searching the structural representation of module among the mac address table updating device embodiment three of the present invention, described in the present embodiment mac address table is a Hash table, and the explanation of relevant Hash table can repeat no more referring to Fig. 5 and related content thereof herein.The module 11 of searching shown in Figure 6 can specifically comprise: scaling unit 1111, groove position are searched unit 1112, Hash table Read-Write Locks unit 1113, Hash table traversal unit 1114 and Hash table and are searched unit 1115, and its operation principle is as follows:
After mac address table updating device 10 receives ethernet frame, utilize hash algorithm that described source MAC is scaled index value by the scaling unit of searching in the module 11 1111; The groove position is searched the described index value that unit 1112 obtains according to scaling unit 1111 and find corresponding groove position in Hash table; Hash table Read-Write Locks unit 1113 pins the Read-Write Locks that the Hash table of preserving in the described groove position of finding the unit is searched in the groove position with read operation; The head pointer that the ltsh chain table of preserving in the described groove position that unit 1112 finds is searched with the groove position in Hash table traversal unit 1114 is a starting point, and described ltsh chain table is traveled through; Hash table is searched unit 1115 and is searched corresponding list item according to the source MAC of described ethernet frame in described ltsh chain table; Then, discharge the Read-Write Locks of described Hash table by Hash table Read-Write Locks unit 1113; When searching successfully, the difference of the list item timestamp that writes down in system timestamp when receiving described ethernet frame and the list item that finds by computing module 12 calculating; When described difference during greater than preset value, the Read-Write Locks of pinning chained list with write operation by Hash table Read-Write Locks unit 1113 is upgraded by update of time stamp module 13 and to be upgraded described list item timestamp with described system timestamp; After finishing renewal, discharge described Read-Write Locks by Hash table Read-Write Locks unit 1113 again.
The list item ageing process of relevant Hash table can repeat no more referring to the related description of preceding method embodiment herein.
The described device of present embodiment has been realized searching of list item on the basis of Hash table, as previously mentioned, read operation can not influence the concurrency of polycaryon processor, and therefore, the described process of searching corresponding list item of present embodiment also can not influence the concurrency of polycaryon processor.
Fig. 9 is for searching the structural representation of module among the mac address table updating device embodiment four of the present invention, and the described device of present embodiment may further include on above-mentioned basis of respectively installing embodiment: entry updating module 14, and its operation principle is as follows:
When searching module 11 when in mac address table, searching the failure of corresponding list item, by entry updating module 14 according to described source MAC and the system timestamp when receiving described ethernet frame in described mac address table, add new list item.Concrete list item adds process can be different at chained list and Hash table, can repeat no more referring to the related description of preceding method embodiment herein.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of program command, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (9)

1. a mac address table update method is characterized in that, comprising:
After receiving ethernet frame, in mac address table, search corresponding list item according to the source MAC of this ethernet frame;
If search successfully, then calculate the difference of the list item timestamp that writes down in system timestamp and the list item that finds when receiving described ethernet frame;
When described difference during, upgrade described list item timestamp with described system timestamp greater than preset value.
2. method according to claim 1 is characterized in that, described mac address table is a chained list, and described source MAC according to this ethernet frame is searched corresponding list item and comprised in mac address table:
Pin the Read-Write Locks of described chained list with read operation;
Linked list head pointer with described chained list is a starting point, and described chained list is traveled through;
Source MAC according to this ethernet frame is searched corresponding list item in described chained list;
Search finish after, discharge the Read-Write Locks of described chained list.
3. method according to claim 1 is characterized in that, described mac address table is a Hash table, and described source MAC according to this ethernet frame is searched corresponding list item and comprised in mac address table:
Utilize hash algorithm that described source MAC is scaled index value;
In described Hash table, find corresponding groove position according to described index value;
Pin the Read-Write Locks of the Hash table of preserving in the described groove position with read operation;
Head pointer with the ltsh chain table preserved in the described groove position is a starting point, and described ltsh chain table is traveled through;
Source MAC according to described ethernet frame is searched corresponding list item in described ltsh chain table;
Search finish after, discharge the Read-Write Locks of described Hash table.
4. method according to claim 1, it is characterized in that, described source MAC according to this ethernet frame is searched in mac address table and is also comprised after the corresponding list item: if search failure, then according to described source MAC and the system timestamp when receiving described ethernet frame in described mac address table, add new list item.
5. method according to claim 1 is characterized in that, upgrades described list item timestamp with described system timestamp and comprises:
Pin the Read-Write Locks of described chained list with write operation;
Upgrade described list item timestamp with described system timestamp;
Discharge described Read-Write Locks.
6. a mac address table updating device is characterized in that, comprising:
Search module, be used for after receiving ethernet frame, in mac address table, search corresponding list item according to the source MAC of this ethernet frame;
Computing module is used for the difference of the list item timestamp that writes down in system timestamp and the list item that finds searching module searches when success, calculate when receiving described ethernet frame;
The update of time stamp module when being used for the described difference that calculates when computing module greater than preset value, is upgraded described list item timestamp with described system timestamp.
7. device according to claim 6 is characterized in that, when described mac address table was chained list, the described module of searching comprised:
Chained list traversal unit, the linked list head pointer that is used for described chained list is a starting point, and described chained list is traveled through;
Chained list is searched the unit, is used for searching corresponding list item according to the source MAC of described ethernet frame at described chained list;
Chained list Read-Write Locks unit, be used for searching module was pinned described chained list according to the source MAC of this ethernet frame with read operation before described chained list is searched corresponding list item Read-Write Locks when chained list, and search the Read-Write Locks that module discharges described chained list after searching corresponding list item according to the source MAC of this ethernet frame in described chained list when chained list.
8. device according to claim 6 is characterized in that, when described mac address table was Hash table, the described module of searching comprised:
Scaling unit is used to utilize hash algorithm that described source MAC is scaled index value;
The unit is searched in the groove position, and the described index value that is used for obtaining according to scaling unit finds corresponding groove position at Hash table;
Hash table traversal unit, the head pointer that is used for searching with the groove position ltsh chain table of described groove position that the unit finds preserving is a starting point, and described ltsh chain table is traveled through;
Hash table is searched the unit, searches corresponding list item according to the source MAC of described ethernet frame in described ltsh chain table;
Hash table Read-Write Locks unit, be used for searching the unit and before described ltsh chain table is searched corresponding list item, pin the Read-Write Locks that the Hash table of preserving in the described groove position of finding the unit is searched in the groove position, and search the Read-Write Locks that the unit discharges described Hash table after searching corresponding list item according to the source MAC of described ethernet frame in described ltsh chain table when Hash table with read operation according to the source MAC of described ethernet frame when Hash table.
9. according to arbitrary described device in the claim 6~8, it is characterized in that, also comprise: the entry updating module, be used for when searching module searches when failure, according to described source MAC and the system timestamp when receiving described ethernet frame in described mac address table, add new list item.
CN2010101455453A 2010-04-09 2010-04-09 Method and apparatus for updating MAC (Media Access Control) address table Expired - Fee Related CN101841473B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010101455453A CN101841473B (en) 2010-04-09 2010-04-09 Method and apparatus for updating MAC (Media Access Control) address table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010101455453A CN101841473B (en) 2010-04-09 2010-04-09 Method and apparatus for updating MAC (Media Access Control) address table

Publications (2)

Publication Number Publication Date
CN101841473A true CN101841473A (en) 2010-09-22
CN101841473B CN101841473B (en) 2011-12-28

Family

ID=42744606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010101455453A Expired - Fee Related CN101841473B (en) 2010-04-09 2010-04-09 Method and apparatus for updating MAC (Media Access Control) address table

Country Status (1)

Country Link
CN (1) CN101841473B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011120461A2 (en) * 2011-05-06 2011-10-06 华为技术有限公司 Method and device for improving performance for accessing forwarding table
CN102780641A (en) * 2012-08-17 2012-11-14 北京傲天动联技术有限公司 Flow table aging method and device of quick forwarding engine, and switch
WO2014127605A1 (en) * 2013-02-21 2014-08-28 烽火通信科技股份有限公司 Mac address hardware learning method and system based on hash table and tcam table
WO2014173364A1 (en) * 2013-07-23 2014-10-30 中兴通讯股份有限公司 Shared resource access method and device
CN104135435A (en) * 2013-04-30 2014-11-05 日立金属株式会社 Network relay device
CN104243417A (en) * 2013-06-18 2014-12-24 上海博达数据通信有限公司 PPPOE implementation method based on multi-core processor
WO2016082367A1 (en) * 2014-11-25 2016-06-02 中兴通讯股份有限公司 Method and device for realizing hardware table traversal based on network processor
CN106411622A (en) * 2016-12-16 2017-02-15 成都西加云杉科技有限公司 Table entry processing method and device
CN106790411A (en) * 2016-11-30 2017-05-31 武汉噢易云计算股份有限公司 The non-polymeric port cascade system and method for virtual switch and physical switches
CN107864232A (en) * 2017-10-24 2018-03-30 新华三技术有限公司 Table entry processing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101072178A (en) * 2007-06-22 2007-11-14 中兴通讯股份有限公司 Switching system routing table management method
CN101656676A (en) * 2009-09-18 2010-02-24 杭州华三通信技术有限公司 Method and equipment for updating media access control (MAC) address list items

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101072178A (en) * 2007-06-22 2007-11-14 中兴通讯股份有限公司 Switching system routing table management method
CN101656676A (en) * 2009-09-18 2010-02-24 杭州华三通信技术有限公司 Method and equipment for updating media access control (MAC) address list items

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011120461A3 (en) * 2011-05-06 2012-03-08 华为技术有限公司 Method and device for improving performance for accessing forwarding table
WO2011120461A2 (en) * 2011-05-06 2011-10-06 华为技术有限公司 Method and device for improving performance for accessing forwarding table
CN102780641A (en) * 2012-08-17 2012-11-14 北京傲天动联技术有限公司 Flow table aging method and device of quick forwarding engine, and switch
CN102780641B (en) * 2012-08-17 2015-07-08 北京傲天动联技术股份有限公司 Flow table aging method and device of quick forwarding engine, and switch
WO2014127605A1 (en) * 2013-02-21 2014-08-28 烽火通信科技股份有限公司 Mac address hardware learning method and system based on hash table and tcam table
CN104135435B (en) * 2013-04-30 2018-05-18 日立金属株式会社 Network repeater
CN104135435A (en) * 2013-04-30 2014-11-05 日立金属株式会社 Network relay device
CN104243417A (en) * 2013-06-18 2014-12-24 上海博达数据通信有限公司 PPPOE implementation method based on multi-core processor
WO2014173364A1 (en) * 2013-07-23 2014-10-30 中兴通讯股份有限公司 Shared resource access method and device
WO2016082367A1 (en) * 2014-11-25 2016-06-02 中兴通讯股份有限公司 Method and device for realizing hardware table traversal based on network processor
CN105700859A (en) * 2014-11-25 2016-06-22 中兴通讯股份有限公司 Network-processor-based hardware table traversal method and apparatus
CN106790411A (en) * 2016-11-30 2017-05-31 武汉噢易云计算股份有限公司 The non-polymeric port cascade system and method for virtual switch and physical switches
CN106790411B (en) * 2016-11-30 2019-10-25 武汉噢易云计算股份有限公司 The non-polymeric port cascade system and method for virtual switch and physical switches
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
CN107864232A (en) * 2017-10-24 2018-03-30 新华三技术有限公司 Table entry processing method and device
CN107864232B (en) * 2017-10-24 2021-01-26 新华三技术有限公司 Table entry processing method and device

Also Published As

Publication number Publication date
CN101841473B (en) 2011-12-28

Similar Documents

Publication Publication Date Title
CN101841473B (en) Method and apparatus for updating MAC (Media Access Control) address table
US9262458B2 (en) Method and system for dynamically partitioning very large database indices on write-once tables
CN105718455B (en) A kind of data query method and device
US8868926B2 (en) Cryptographic hash database
US9952783B2 (en) Data processing method and apparatus, and shared storage device
CN111338766A (en) Transaction processing method and device, computer equipment and storage medium
CN109683811B (en) Request processing method for hybrid memory key value pair storage system
US9418094B2 (en) Method and apparatus for performing multi-stage table updates
US20200213091A1 (en) Circuit and method for overcoming memory bottleneck of asic-resistant cryptographic algorithms
US20070043749A1 (en) Database fragment cloning and management
CN107832423B (en) File reading and writing method for distributed file system
CN113392126B (en) Execution plan caching and reading method based on distributed database
CN102880628A (en) Hash data storage method and device
CN107665219A (en) A kind of blog management method and device
CN105447166A (en) Keyword based information search method and system
CN101236564A (en) Mass data high performance reading display process
WO2020106635A1 (en) Presenting updated data using persisting views
WO2007087754A1 (en) Object reference method and system based on object storage library
CN115203211A (en) Unique hash sequence number generation method and system
US20180081942A1 (en) Managing Data Obsolescence in Relational Databases
US20170308444A1 (en) Method, Apparatus, and Computer Program Stored in Computer Readable Medium for Recovering Block in Database System
CN105094701B (en) A kind of adaptive pre-head method and device
CN114489480A (en) Method and system for high-concurrency data storage
CN113867626A (en) Method, system, equipment and storage medium for optimizing performance of storage system
EP3186729B1 (en) Methods for persisting data on nonvolatile memory for fast updates and instantaneous recovery and devices thereof

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: 20111228