CN109327396A - The gradual update method of Hash table in routing table look-up circuit - Google Patents

The gradual update method of Hash table in routing table look-up circuit Download PDF

Info

Publication number
CN109327396A
CN109327396A CN201811463388.3A CN201811463388A CN109327396A CN 109327396 A CN109327396 A CN 109327396A CN 201811463388 A CN201811463388 A CN 201811463388A CN 109327396 A CN109327396 A CN 109327396A
Authority
CN
China
Prior art keywords
update
list item
hash table
hash
circuit
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
CN201811463388.3A
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.)
Army Engineering University of PLA
Original Assignee
Army Engineering University of PLA
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 Army Engineering University of PLA filed Critical Army Engineering University of PLA
Priority to CN201811463388.3A priority Critical patent/CN109327396A/en
Publication of CN109327396A publication Critical patent/CN109327396A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/748Address table lookup; Address filtering using longest matching prefix
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC

Abstract

The invention discloses the gradual update methods of Hash table in a kind of routing table look-up circuit, and there are two types of modes for the update of Hash table;A kind of mode is normally to update, and each list item has a life cycle, and hash circuit automatically initiates update according to the pulse per second (PPS) that circuit generates and checks, the list item matched removing will be not carried out in life cycle;Another way is to force to update, and after trie tree updates, existing list item is slowly emptied.The present invention is provided with a delay counter when carrying out Hash table null clear operation, the counter has a delay counter thresholding, each count value removes a hash table when reaching count threshold, so that the renewal speed of Hash table slows down, remaining list item still can carry out high-speed searching during update, to which the speed of route lookup in renewal process be effectively ensured, packet loss is avoided.

Description

The gradual update method of Hash table in routing table look-up circuit
Technical field
The present invention relates to network communication fields, specifically, being a kind of update machine of Hash table in High Performance IP interchanger System.
Background technique
Longest prefix match lookup algorithm based on trie tree is widely used in high-performance router, they generally have There is the features such as implementation complexity is low, required memory space is smaller, realization flexibility is high.Hash lookup is a kind of more commonly used reality Now accurate matched lookup algorithm, Hash lookup is a kind of high speed inquiring arithmetic, is easy to realize on hardware, and is had fine Scalability.In order to realize the high-speed searching under low hardware resource consumption, usually two kinds of lookup algorithms are combined.Carry out It is general that Hash table is updated using the method directly removed when trie tree updates, but in the process, mass data packet will do it Trie tree is searched, and network performance is caused to decline or even packet loss.
Summary of the invention
It is applied to longest prefix match the purpose of the present invention is to provide one kind and Hash hash matching combines routing and looks into The gradual update method of Hash table in watch circuit can still keep the performance of high-speed searching when Hash table updates.
The technical solution for realizing the aim of the invention is as follows: the gradual update side of Hash table in a kind of routing table look-up circuit Method, a kind of mode are normally to update, and each list item has a life cycle, the pulse per second (PPS) that hash circuit is generated according to circuit from It is dynamic to initiate to update inspection, the list item matched removing will be not carried out in life cycle;Another way is to force to update, trie After tree updates, existing list item is slowly emptied.During Hash table is forced to update, it is provided with a delay counter, The counter has a delay counter thresholding;Every time when counter values are greater than thresholding, resets counter and remove a Kazakhstan Uncommon list item, until the update of all hash tables finishes.
Compared with prior art, the present invention its remarkable advantage: the present invention is in Hash table null clear operation by being provided with one A delay counter, so that the renewal speed of Hash table slows down, remaining list item still can carry out high quick checking during update It looks for, so that the speed of route lookup in renewal process be effectively ensured, avoids packet loss.
Detailed description of the invention
Fig. 1 is lookup table circuit overall structure.
Fig. 2 is to look for circuit and mainly executes step.
Fig. 3 is Hash lookup circuit top layer encapsulation port figure.
Specific embodiment
Present invention combination path compression trie algorithm and Hash lookup algorithm, while supporting the lookup of longest mask matches and essence True matched and searched.Realize the exact-match lookup function of the hash search algorithm based on 4 Hash buckets, list item addition function, List item deletes function and Hash table more new function.
Using circuit of the invention, Routing Protocol is run on CPU, completes the information exchange with surrounding router, is established With maintenance routing table, the forwarding table for being suitble to hardware searching is then obtained according to certain algorithm according to routing table, and write by bus Enter to trie tree node memory block and index mapping table memory block.CPU has the function of the direct-connected host of management simultaneously, for direct-connected Hash table is written in host, is directly added by CPU or delete operation.After data packet enters Lookup engine, lookup is drawn It holds up the purpose IP address for extracting each data packet and carries out Hash lookup and path compression trie lookup to it simultaneously.Ordinary circumstance Under, be faster than based on accurate matched Hash lookup speed based on LPM(longest prefix match) path compression tire search.If Purpose IP address realizes accurate matching in Hash table, then routing iinformation and notification path the compression trie returned in Hash table is looked into It looks for circuit to terminate to search, entire search procedure terminates.If purpose IP address is not carried out matching in Hash table, continue To the lookup result of path compression trie, and as final route searching result, while Hash table management circuit is base Route results (including output end slogan, next-hop mac address and the other routings letter searched in path compression trie Breath) it updates into Hash table.Using two kinds of update modes, a kind of mode is normally to update, and each list item has an existence week Phase, hash circuit automatically initiate update according to the pulse per second (PPS) that circuit generates and check, by do not carry out matching in life cycle List item is removed.Another way is to force to update, i.e., after trie tree updates, needs to empty existing list item.When passing through setting Between spacing parameter, Hash table renewal speed can be effectively controlled, to avoid the reduction of search speed.The master created by CPU Machine list item will not be updated, and can only be deleted by CPU.The hash table learnt by ctrie tree, can be by two kinds more New mechanism is eliminated, to save storage resource.
The invention is further explained in the following combination with the attached drawings of the specification.
As shown in Figure 1, lut circuits of the present invention, CPU controls the Hash table read-write operation of direct-connected host, trie tree node To addition operation, trie tree node memory block and the read-write operation for indexing memory block of Hash table.IP route querying engine control The destination address that Hash lookup circuit and trie tree search the complete paired data packet of circuit is searched.More new management circuit connection Hash is looked into It looks for circuit and trie tree to search circuit control Hash table and updates operation.
As shown in Fig. 2, whole process, which can be divided into, reads data, IP lookup, Hash table three flow line stages of update.It is right In the data packet of arrival, longest prefix match is first carried out, hash table, subsequent identical destination IP then is written into matching result The data packet of address can only look into hash table.If binary tree is updated, need to empty hash table simultaneously Whole list items are re-established according to new routing table.At this point, existing a large number of services stream requires first to look into binary tree, further according to looking into Result is looked for establish hash table item.When carrying out Hash table null clear operation, by the way that a delay counter is arranged, count every time Value removes a hash table when reaching count threshold, so that the renewal speed of Hash table slows down, remaining table during update Item still can carry out high-speed searching and avoid packet loss so that the speed of route lookup in renewal process be effectively ensured.
Stage 1: the stage mainly carries out data read operation, and the data packet header that will require look up is read in from outside.First The idle indication signal ptr_fifo_empty of the FIFO of external storing data packet header is judged.If the signal is It is low, indicate there is the data packet header required to look up.The data packet header then is read from data-in port ptr_fifo_din, And it is parsed, extract the purpose IP address required to look up.It is parsed the high flag bit ptr_rdy of postposition, to lookup It is ready that engine circuit shows that data are ready for, and waits its answer signal ptr_ack.When detecting ptr_ack is high level, number Lookup engine processing of circuit is transferred to according to packet, the stage 1 is finished at this time.
Stage 2: the stage is mainly to carry out route querying to the purpose IP address obtained from the stage 1, according to acquisition IP address and corresponding cryptographic Hash search circuit to path compression trie and Hash lookup circuit issues search request.If breathed out It is uncommon to search successfully, then it include that output end slogan and next-hop mac address are written to junior the output result based on Hash lookup In the data buffer zone of module, next stage module is waited to be read out work, while returning to Hash lookup answer signal se_ack_ Hash does not need to be updated Hash table at this time.If Hash lookup fails, the road for waiting path compression trie to search By as a result, since trie is searched in circuit, there are default routes, so searching the success that is bound to.When Hash lookup failure, explanation The corresponding routing iinformation of the IP address is not present in Hash bucket, then the result for searching circuit according to trie is needed to add into Hash bucket Enter the list item, then next time can fast implement exact-match lookup when reaching comprising the data packet of same purpose IP address.It is logical Cross the buffer area c2h_fifo_wr(write enable signal) set the high route results c2h_ that path compression trie is searched and is obtained Fifo_din(includes purpose IP address, cryptographic Hash, output end slogan and next-hop mac address) it is written to buffer area c2h_fifo In, Hash table update, which is carried out, for the stage 3 is ready.
Stage 3: the stage is mainly the update operation for carrying out Hash table.The stage mainly carries out three data buffer zones Operation, respectively be store trie lookup result the buffer area c2h_fifo, storage from cpu need hash table to be added The hash table buffer area clear_fifo that buffer area cpu2h_fifo, storage are removed from the needs of CPU.Work as c2h_fifo Buffer area is not sky, then the high Hash table addition request signal add_req of data juxtaposition of the buffer area is read, then according to list item Addition request is completed the update to Hash table and is operated.The buffer area cpu2h_fifo includes the routing iinformation of direct-connected host terminal.When Add_req can also be equally triggered when the buffer area cpu2h_fifo is not sky, and direct-connected host is completed according to table item adding request The addition of list item operates.When the buffer area clear_fifo be not it is empty, then trigger Hash table and remove request signal clear_req, so The clear operation to direct-connected host entries is completed according to list item removal request afterwards.Entire data handling procedure is mainly buffered by three The depth in area is controlled, and after the completion of addition, delete operation and when buffer area is empty, the stage 3 terminates.
Fig. 3 is the port map of Hash lookup circuit, is related to the lookup, addition, delete operation of Hash table.For arrival Data packet, route querying engine carry out longest prefix match lookup and exact-match lookup to the IP address of extraction simultaneously.Work as Kazakhstan Uncommon circuit of searching receives after search request signal (se_req is high level), and Hash lookup circuit is using hash index value as 4 The address of Hash bucket reads simultaneously the list item stored in Hash bucket.If in purpose IP address and one of hash table IP address is equal, then returns to the routing iinformation that the list item is stored, including next-hop mac address and output end slogan, set simultaneously High successful match signal se_ack.When route querying engine detects that se_ack signal is high level, illustrate Hash lookup It realizes accurate matching, then stops LPM by setting high LPM lookup termination signal comp_stop come notification path compression tire tree It searches.If the precise IP Address that purpose IP address and 4 hash tables are stored all mismatches, illustrate to search failure, and Return to it fails to match signal se_nak.
Hash table insertion is there are mainly two types of mode, and path compression trie searches knot when a kind of mode is Hash lookup failure Addition of the fruit to hash table, another way are the additions of direct-connected host entries.For first way, when Hash lookup loses When losing, route querying engine can be packaged and trigger according to the format of hash table according to the routing iinformation that LPM is found Add_req signal.When Hash lookup circuit discovery add_req signal is read for high level then using hash index value as address simultaneously The list item stored in Hash bucket out.4 Hash buckets have priority, wherein the highest priority of first Hash bucket, and so on. The high Hash bucket of priority preferentially stores the list item of insertion.Therefore, if there is the item_ of multiple list items in 4 hash tables The effective list item flag bit of valid() it is low level, illustrate that these list items all in invalid state, meet the condition of list item insertion, But list item insertion only is carried out to the Hash bucket of highest priority in these list items, and is added according to format packaged before Add, while setting high item_valid mark, illustrate that list item is inserted into successfully, sets high addition pass signal add_ack;If 4 Kazakhstan The item_valid mark of uncommon list item is all low level, then illustrates that this 4 list items are all effectively, to be unsatisfactory for list item insertion item High addition failure signal add_nak is set in part, list item addition failure, and the IP address can only be looked by trie tree progress LPM at this time It looks for.For the second way, list item insertion request is initiated by CPU, this kind of list item is directly to carry out maintenance and management by CPU, can It is distinguished by the add_direct signal in list item, if add_direct signal is high level, illustrates that the list item is straight Even host entries.
It is for removing specified IP address list item for CPU that list item, which removes function,.Since direct-connected host has networking and logout Operation, by CPU sending table item adding request when networking, so that hash table (also referred to as direct-connected host entries), logout be added When by CPU initiate list item removal request, specified list item is deleted.When Hash lookup circuit discovery clear_req is When high level, uses the IP address clear_ip mapped hash index value for needing to remove as the address of 4 Hash buckets, read 4 corresponding contents in table, if clear_ip is identical as one of them precise IP Address stored of 4 list items, that Just the list item is purged, i.e., the direct-connected Host Identity position the direct_host(of the list item) and item_valid signal It is set to low level, while returning to add_ack signal, list item reset procedure terminates.
Hash table update have it is normal update and force to update two ways, respectively normally more with aging_normal_req( New request) and aging_force_req(pressure update request) indicated.When Hash lookup circuit receives aging_ When normal_req, it can check list item all in 4 Hash buckets, i.e., to address 0 to 0xFFF list item successively into Row check, by live_th(specified time thresholding) in without data frame transmitting-receiving hash table be purged, i.e., list item Item_valid signal is set low.After being updated inspection to the list item that address is 0xFFF, normal renewal process terminates.When receiving When aging_force_req, no matter whether the life span of list item in live_th, Hash lookup circuit to address from 0 to The list item of 0xFFF is all successively purged.Entire Hash table can be made to empty due to forcing to update, carry out LPM lookup IP data packet can increase suddenly, and search speed is caused significantly to slow down.So we introduce aging_gap letter in this design Number, aging_gap indicates that two list items update the time interval (clock periodicity) between update, i.e., every to pass through an aging_ The gap time removes a list item, and value size can be controlled by CPU.The introducing of aging_gap has slowed down the update of Hash table Speed thus it can be prevented that Hash table is largely removed in a short time, avoid the fluctuation in search speed.aging_ The value of gap should be fluctuated in a reasonable horizontal extent according to practical situations, be worth excessive or too small all can Search performance is impacted.It is noted here that the list item learnt automatically from ctrie can only be removed by updating, it is right It can only then be deleted by clear_req in the direct-connected host entries of CPU addition.

Claims (4)

1. the gradual update method of Hash table in a kind of routing table look-up circuit, it is characterised in that: the update of the Hash table has two Kind mode;A kind of mode is normally to update, and each list item has a life cycle, the second arteries and veins that hash circuit is generated according to circuit Punching automatically initiates update and checks, the list item matched removing will be not carried out in life cycle;Another way is to force to update, After trie tree updates, existing list item is slowly emptied.
2. the gradual update method of Hash table according to claim 1, it is characterised in that: force the process updated in Hash table In, a delay counter is set, which has a delay counter thresholding;Every time when counter values are greater than thresholding, It resets counter and removes a hash table, until the update of all hash tables finishes.
3. the gradual update method of Hash table according to claim 1, which is characterized in that the normal update mode of Hash table has Body are as follows:
When Hash lookup circuit receives normal update request, list item all in 4 Hash buckets is checked, i.e., to address 0 to 0xFFF list item is successively checked, will be purged in specified time thresholding without the hash table of data frame transmitting-receiving, The useful signal of list item is set low;After being updated inspection to the list item that address is 0xFFF, normal renewal process terminates.
4. the gradual update method of Hash table according to claim 1 or 2, it is characterised in that: force update mode specifically:
When receive force to update request when, no matter at the appointed time whether the life span of list item in thresholding, Hash lookup circuit List item to address from 0 to 0xFFF is all successively purged;It introduces Hash table and forces the interval time updated, i.e., every process One interval time removes a list item, and value size is controlled by CPU.
CN201811463388.3A 2018-12-03 2018-12-03 The gradual update method of Hash table in routing table look-up circuit Pending CN109327396A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811463388.3A CN109327396A (en) 2018-12-03 2018-12-03 The gradual update method of Hash table in routing table look-up circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811463388.3A CN109327396A (en) 2018-12-03 2018-12-03 The gradual update method of Hash table in routing table look-up circuit

Publications (1)

Publication Number Publication Date
CN109327396A true CN109327396A (en) 2019-02-12

Family

ID=65256171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811463388.3A Pending CN109327396A (en) 2018-12-03 2018-12-03 The gradual update method of Hash table in routing table look-up circuit

Country Status (1)

Country Link
CN (1) CN109327396A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112118186A (en) * 2020-08-28 2020-12-22 深圳市风云实业有限公司 Exchange chip routing table entry storage method, forwarding method and configuration method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1493969A (en) * 2002-10-31 2004-05-05 深圳市中兴通讯股份有限公司 Storage table renewing method
CN1787477A (en) * 2004-12-09 2006-06-14 北京三星通信技术研究有限公司 Method for searching IPv6 routing table
CN104468381A (en) * 2014-12-01 2015-03-25 国家计算机网络与信息安全管理中心 Implementation method for multi-field rule matching
CN106549872A (en) * 2016-10-31 2017-03-29 西安空间无线电技术研究所 The spaceborne fast routing lookups system combined with accurately mate by longest prefix match
US20180276139A1 (en) * 2017-03-23 2018-09-27 Intel Corporation Least recently used-based hotness tracking mechanism enhancements for high performance caching

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1493969A (en) * 2002-10-31 2004-05-05 深圳市中兴通讯股份有限公司 Storage table renewing method
CN1787477A (en) * 2004-12-09 2006-06-14 北京三星通信技术研究有限公司 Method for searching IPv6 routing table
CN104468381A (en) * 2014-12-01 2015-03-25 国家计算机网络与信息安全管理中心 Implementation method for multi-field rule matching
CN106549872A (en) * 2016-10-31 2017-03-29 西安空间无线电技术研究所 The spaceborne fast routing lookups system combined with accurately mate by longest prefix match
US20180276139A1 (en) * 2017-03-23 2018-09-27 Intel Corporation Least recently used-based hotness tracking mechanism enhancements for high performance caching

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112118186A (en) * 2020-08-28 2020-12-22 深圳市风云实业有限公司 Exchange chip routing table entry storage method, forwarding method and configuration method

Similar Documents

Publication Publication Date Title
US10389633B2 (en) Hash-based address matching
US10135734B1 (en) Pipelined evaluations for algorithmic forwarding route lookup
US20050171937A1 (en) Memory efficient hashing algorithm
US9065724B2 (en) Managing a flow table
US6449256B1 (en) Fast level four switching using crossproducting
CN108521378A (en) Retransmission method, device and the network switching equipment of heterogeneous protocol message
US7567561B2 (en) Packet communication node apparatus with extension modules
US9363234B2 (en) Fast update filter
CN108306835B (en) Input caching and data forwarding method of Ethernet switch
US20180270153A1 (en) Increasing entropy across routing table segments
CN103220255B (en) It is a kind of to realize the method and device that reversal path of unicast forwarding URPF is checked
US8923301B1 (en) Fixed latency priority classifier for network data
CN112565090B (en) High-speed forwarding method and device
US10587516B1 (en) Hash lookup table entry management in a network device
US11456961B1 (en) Method to accelerate packet detection rule (PDR) matching and data packet processing in a user plane function (UPF) module in a communications network
CN106453091B (en) The equivalent route management method and device of router Forwarding plane
US8488489B2 (en) Scalable packet-switch
CN109327396A (en) The gradual update method of Hash table in routing table look-up circuit
CN101232508B (en) Equipment and method for speeding up poly spanning tree protocol network topological convergence
CN108111422B (en) DPDK-based data high-speed multi-path forwarding method and device
CN109861915A (en) Forward method, apparatus, computer equipment and the readable storage medium storing program for executing of table handling
US9979650B1 (en) Forwarding packets using a probabilistic filter and a grouping technique
US11775342B2 (en) System and method for processing information hierarchy management
CN109743260A (en) A kind of device and method that network flow is filtered based on improved ACBM algorithm
WO2019084805A1 (en) Method and apparatus for distributing message

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for 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: 20190212