CN109861915A - Forward method, apparatus, computer equipment and the readable storage medium storing program for executing of table handling - Google Patents

Forward method, apparatus, computer equipment and the readable storage medium storing program for executing of table handling Download PDF

Info

Publication number
CN109861915A
CN109861915A CN201711240987.4A CN201711240987A CN109861915A CN 109861915 A CN109861915 A CN 109861915A CN 201711240987 A CN201711240987 A CN 201711240987A CN 109861915 A CN109861915 A CN 109861915A
Authority
CN
China
Prior art keywords
prefix
source
forwarding table
address
next hop
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.)
Withdrawn
Application number
CN201711240987.4A
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.)
Tsinghua University
ZTE Corp
Original Assignee
Tsinghua University
ZTE Corp
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 Tsinghua University, ZTE Corp filed Critical Tsinghua University
Priority to CN201711240987.4A priority Critical patent/CN109861915A/en
Publication of CN109861915A publication Critical patent/CN109861915A/en
Withdrawn legal-status Critical Current

Links

Abstract

The invention discloses a kind of method, apparatus, computer equipment and readable storage medium storing program for executing for forwarding table handling, method includes: to obtain purpose prefix and source prefix according to the received message of parsing, identical purpose prefix and source prefix are searched in forwarding table, forwarding table is two-dimentional tree construction;In the case where finding identical purpose prefix and source prefix, according to the purpose prefix and source prefix found, next hop address is obtained;In the case where not finding identical purpose prefix and source prefix, the purpose prefix and source prefix that addition analytic message obtains, to increase the list item of forwarding table;Method, apparatus, computer equipment and readable storage medium storing program for executing of the invention, it can be with the inquiry of the completion next hop address of fast accurate, also there is positive effect to the shunting of message, message blocking can effectively be alleviated, the attack message of part can also be filtered out by source address, so that attack message is just consumed in a network.Moreover, it is also possible to quickly finish the additions and deletions of the list item in forwarding table.

Description

Forward method, apparatus, computer equipment and the readable storage medium storing program for executing of table handling
Technical field
The present invention relates to field of data networks more particularly to it is a kind of forward the method, apparatus of table handling, computer equipment and Readable storage medium storing program for executing.
Background technique
It is drawn to solve the problems, such as source address spoofing present in existing network, more hosts, more fine-grained flow can not be done Propose two-dimentional Routing Protocol between domain the problems such as dividing.Two-dimentional Routing Protocol is by increasing source during routing forwarding between domain Address matching obtains more fine-grained flow cutting and more flexible load balancing.However while obtaining these, newly The source address information of increasing is also that the additions and deletions of forwarding table look into change and propose new challenge.Usually only two in traditional forwarding table, one Item is purpose prefix, and one is next hop address.Forwarding table is converted into often also only having after forwarding table purpose prefix and next Address is jumped, so new forwarding table structure is designed to a difficult point.
Summary of the invention
It is a primary object of the present invention to propose a kind of to forward the method, apparatus of table handling, computer equipment and readable deposit Storage media solves the above technical problem.
According to an aspect of the invention, there is provided a kind of method for forwarding table handling, which comprises according to parsing Received message obtains purpose prefix and source prefix, and identical purpose prefix and source prefix are searched in the forwarding table, described Forwarding table is two-dimentional tree construction;In the case where finding identical purpose prefix and source prefix, according to the purpose prefix found And source prefix, obtain next hop address;In the case where not finding identical purpose prefix and source prefix, described in addition parsing Purpose prefix, source prefix and the corresponding next hop address that message obtains, to increase the list item of the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, comprising: parse received message, obtain destination address and source address;According to destination address Purpose prefix and source address source prefix, identical purpose prefix is searched in the forwarding table;Finding identical purpose In the case where prefix, identical source prefix is searched in the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, further includes: the source prefix found is buffered into FIFO memory, with according to source prefix and The lookup of purpose prefix completion next hop address.
Optionally, purpose prefix and source prefix that the foundation is found, obtain next hop address, comprising: according to lookup The purpose prefix and source prefix arrived, finds the index of next hop address;According to the index of the next hop address, find described The storage list of next hop address, to find the next hop address.
Optionally, the storage organization of the forwarding table includes purpose prefix trees and source prefix trees, the purpose prefix trees Leaf node is directed toward the source prefix trees, and the leaf node of the source prefix trees is directed toward the index of next hop address, the next-hop The index of address is directed toward the storage list of next hop address.
Optionally, the index of the purpose prefix trees, the source prefix trees and the next hop address is stored in three respectively Memory.
Optionally, new leaf node is added on the purpose prefix trees, and adds the new of the leaf node direction Source prefix trees, be inserted into new purpose prefix to realize.
Optionally, the delete target leaf node on the purpose prefix trees, while deleting the target leaves node and referring to To source address tree, to realize delete target purpose prefix.
Optionally, it passes sequentially through the delete target purpose prefix and is inserted into new purpose prefix, to realize the purpose The update of prefix trees.
Optionally, new leaf node is added on the source prefix trees, is inserted into new source prefix to realize.
Optionally, the delete target leaf node on the source prefix trees, to realize delete target source prefix.
Optionally, it passes sequentially through delete target source prefix and is inserted into new source prefix, to realize the source prefix trees Update.
According to the second aspect of the invention, a kind of device for forwarding table handling is provided, described device includes: lookup mould Block, for obtaining purpose prefix and source prefix according to the received message of parsing, before identical purpose is searched in the forwarding table Sew and source prefix, the forwarding table are two-dimentional tree construction;Module is obtained, for finding identical purpose prefix and source prefix In the case of, according to the purpose prefix and source prefix found, obtain next hop address;Increase module, for not finding phase With purpose prefix and source prefix in the case where, addition parse the purpose prefix that the message obtains, source prefix and it is corresponding under One jumps address, to increase the list item of the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, comprising: parsing module obtains destination address and source address for parsing received message; Purpose lookup module, for being looked into the forwarding table according to the purpose prefix of destination address and the source prefix of source address Look for identical purpose prefix;Source lookup module, in the case where finding identical purpose prefix, in the forwarding table It is middle to search identical source prefix.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, further includes: cache module, the source prefix for will find buffer into FIFO memory, To complete the lookup of next hop address according to source prefix and purpose prefix.
Optionally, purpose prefix and source prefix that the foundation is found, obtain next hop address, comprising: index module, For finding the index of next hop address according to the purpose prefix and source prefix found;List block, for according under described One jumps the index of address, the storage list of the next hop address is found, to find the next hop address.
According to the third aspect of the present invention, a kind of computer equipment, including processor and memory are provided;It is described to deposit Reservoir is for storing computer instruction, and the processor is used to run the computer instruction of the memory storage, on realizing The method for the forwarding table handling stated.
The described method includes: obtaining purpose prefix and source prefix according to received message is parsed, looked into the forwarding table Identical purpose prefix and source prefix are looked for, the forwarding table is two-dimentional tree construction;Finding identical purpose prefix and source prefix In the case where, according to the purpose prefix and source prefix found, obtain next hop address;Do not finding identical purpose prefix And in the case where the prefix of source, addition parses purpose prefix, source prefix and the corresponding next hop address that the message obtains, to increase Add the list item of the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, comprising: parse received message, obtain destination address and source address;According to destination address Purpose prefix and source address source prefix, identical purpose prefix is searched in the forwarding table;Finding identical purpose In the case where prefix, identical source prefix is searched in the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, further includes: the source prefix found is buffered into FIFO memory, with according to source prefix and The lookup of purpose prefix completion next hop address.
Optionally, purpose prefix and source prefix that the foundation is found, obtain next hop address, comprising: according to lookup The purpose prefix and source prefix arrived, finds the index of next hop address;According to the index of the next hop address, find described The storage list of next hop address, to find the next hop address.
Optionally, the storage organization of the forwarding table includes purpose prefix trees and source prefix trees, the purpose prefix trees Leaf node is directed toward the source prefix trees, and the leaf node of the source prefix trees is directed toward the index of next hop address, the next-hop The index of address is directed toward the storage list of next hop address.
Optionally, the index of the purpose prefix trees, the source prefix trees and the next hop address is stored in three respectively Memory.
Optionally, new leaf node is added on the purpose prefix trees, and adds the new of the leaf node direction Source prefix trees, be inserted into new purpose prefix to realize.
Optionally, the delete target leaf node on the purpose prefix trees, while deleting the target leaves node and referring to To source address tree, to realize delete target purpose prefix.
Optionally, it passes sequentially through the delete target purpose prefix and is inserted into new purpose prefix, to realize the purpose The update of prefix trees.
Optionally, new leaf node is added on the source prefix trees, is inserted into new source prefix to realize.
Optionally, the delete target leaf node on the source prefix trees, to realize delete target source prefix.
Optionally, it passes sequentially through delete target source prefix and is inserted into new source prefix, to realize the source prefix trees Update.
According to the fourth aspect of the present invention, a kind of computer readable storage medium is provided, it is described computer-readable to deposit Storage media is stored with one or more program, and one or more of programs can be executed by one or more processor, Method to realize above-mentioned forwarding table handling.
The described method includes: obtaining purpose prefix and source prefix according to received message is parsed, looked into the forwarding table Identical purpose prefix and source prefix are looked for, the forwarding table is two-dimentional tree construction;Finding identical purpose prefix and source prefix In the case where, according to the purpose prefix and source prefix found, obtain next hop address;Do not finding identical purpose prefix And in the case where the prefix of source, addition parses purpose prefix, source prefix and the corresponding next hop address that the message obtains, to increase Add the list item of the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, comprising: parse received message, obtain destination address and source address;According to destination address Purpose prefix and source address source prefix, identical purpose prefix is searched in the forwarding table;Finding identical purpose In the case where prefix, identical source prefix is searched in the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, further includes: the source prefix found is buffered into FIFO memory, with according to source prefix and The lookup of purpose prefix completion next hop address.
Optionally, purpose prefix and source prefix that the foundation is found, obtain next hop address, comprising: according to lookup The purpose prefix and source prefix arrived, finds the index of next hop address;According to the index of the next hop address, find described The storage list of next hop address, to find the next hop address.
Optionally, the storage organization of the forwarding table includes purpose prefix trees and source prefix trees, the purpose prefix trees Leaf node is directed toward the source prefix trees, and the leaf node of the source prefix trees is directed toward the index of next hop address, the next-hop The index of address is directed toward the storage list of next hop address.
Optionally, the index of the purpose prefix trees, the source prefix trees and the next hop address is stored in three respectively Memory.
Optionally, new leaf node is added on the purpose prefix trees, and adds the new of the leaf node direction Source prefix trees, be inserted into new purpose prefix to realize.
Optionally, the delete target leaf node on the purpose prefix trees, while deleting the target leaves node and referring to To source address tree, to realize delete target purpose prefix.
Optionally, it passes sequentially through the delete target purpose prefix and is inserted into new purpose prefix, to realize the purpose The update of prefix trees.
Optionally, new leaf node is added on the source prefix trees, is inserted into new source prefix to realize.
Optionally, the delete target leaf node on the source prefix trees, to realize delete target source prefix.
Optionally, it passes sequentially through delete target source prefix and is inserted into new source prefix, to realize the source prefix trees Update.
The present invention has the beneficial effect that: through the above technical solutions, in the case where completing purpose prefix and source prefix double condition Inquiry when, can the more completion next hop address of fast accurate inquiry, meanwhile, have positive work to the shunting of message With, can effectively alleviate message blocking, moreover it is possible to the attack message of part is filtered out by source address, so that attack message is in network In be just consumed.Moreover, the list item in the forwarding table includes source prefix and purpose prefix, and forwarding table is two-dimentional tree construction, Wherein level-one tree is purpose prefix, and the leaf node of a series has the pointer for being directed toward second level tree, before storage is by source in second level tree Sew, being associated with for purpose prefix and source prefix is completed in forwarding table, the list item in forwarding table can be quickly finished with regard to this Additions and deletions.
Detailed description of the invention
Fig. 1 is the flow diagram of first embodiment of the invention;
Fig. 2 is the structural schematic diagram of forwarding table;
Fig. 3 is the storage organization of forwarding table;
Fig. 4 is the lookup flow chart of next hop address;
Fig. 5 is the flow diagram of second embodiment of the invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In subsequent description, it is only using the suffix for indicating such as " module ", " component " or " unit " of element Be conducive to explanation of the invention, itself there is no a specific meaning.Therefore, " module ", " component " or " unit " can mix Ground uses.
Embodiment to facilitate the understanding of the present invention, to a kind of side for forwarding table handling that first embodiment of the invention provides Method.
First embodiment:
Fig. 1 is the principle process block diagram of the present embodiment.According to Fig. 1, first embodiment of the invention provides a kind of turn The operating method delivered, which comprises
S1: purpose prefix and source prefix are obtained according to received message is parsed, identical mesh is searched in the forwarding table Prefix and source prefix, the forwarding table is two-dimentional tree construction;
S2: in the case where finding identical purpose prefix and source prefix, the purpose prefix and source prefix that foundation is found, Obtain next hop address;
S3: in the case where not finding identical purpose prefix and source prefix, addition parses the mesh that the message obtains Prefix, source prefix and corresponding next hop address, to increase the list item of the forwarding table.
A kind of method for forwarding table handling that first embodiment of the invention provides, it is dual in completion purpose prefix and source prefix Under the conditions of inquiry when, can the more completion next hop address of fast accurate inquiry, meanwhile, have product to the shunting of message Pole effect can effectively alleviate message blocking, moreover it is possible to the attack message of part is filtered out by source address, so that attack message exists It is just consumed in network.Moreover, the list item in the forwarding table includes source prefix and purpose prefix, and forwarding table is two dimensional trees knot Structure, wherein level-one tree is purpose prefix, and the leaf node of a series has the pointer for being directed toward second level tree, and storage is by source in second level tree Prefix completes being associated with for purpose prefix and source prefix in forwarding table, the list item in forwarding table can be quickly finished with regard to this Additions and deletions.
Specifically, according to Fig. 1, this method comprises:
S1: purpose prefix and source prefix are obtained according to received message is parsed, identical mesh is searched in the forwarding table Prefix and source prefix, the forwarding table is two-dimentional tree construction;
Optionally, received message is parsed, destination address and source address are obtained;Purpose prefix and source according to destination address The source prefix of address searches identical purpose prefix in the forwarding table;Specifically, needing to solve the message received Analysis, to obtain corresponding destination address and source address.Before including corresponding purpose prefix and source because of purpose prefix and source prefix Sew, searches whether the list item of meet demand, the purpose prefix in the list item in forwarding table according to destination address and source address And source prefix is identical as the purpose prefix and source prefix of the purpose prefix and the source address.Furthermore, it is necessary to indicate, in the present embodiment In, it needs first to search purpose prefix in forwarding table, in the case where purpose lookup is successful, then from the forwarding table Lookup source prefix.
Optionally, after finding source prefix, the source prefix for needing to find buffers into FIFO memory, according to source Prefix and purpose prefix complete the lookup of next hop address.
Fig. 2 is the structural schematic diagram of forwarding table.According to Fig.2, for forwarding table, before each of which list item is by source Sew, the index of purpose prefix and next hop address is constituted.The generation of initial forwarding table thinks that configuration file is completed, i.e., initially The generation of forwarding table is completed by importing configuration files or command interaction, needs to indicate using keyword in configuration process The two dimension routing an of default could be successfully arranged in source address and mask.And the storage of forwarding table uses two-dimentional tree construction, such as Shown in Fig. 2, level-one tree is purpose prefix, is embodied using purpose prefix as preferential principle, and leaf node has the pointer of second level tree, Storage is searched, the leaf node found refers to down hop by source prefix according to the matched principle of longest in second level tree Address.Two-stage tree is made of Trie tree, usually by y-bend (0 and 1) storage of linked list.
S2: in the case where finding identical purpose prefix and source prefix, the purpose prefix and source prefix that foundation is found, Obtain next hop address;
Fig. 4 is the lookup flow chart of next hop address.As can be seen from FIG. 4, optionally, according to the purpose prefix that finds and Source prefix finds the index of next hop address;According to the index of the next hop address, depositing for the next hop address is found Table is emplaced, to find the next hop address.
S3: in the case where not finding identical purpose prefix and source prefix, addition parses the mesh that the message obtains Prefix, source prefix and corresponding next hop address, to increase the list item of the forwarding table.
It, just will be from mesh obtained in message when not finding with the purpose prefix and the identical list item of source prefix protected in text Prefix and source prefix be added in forwarding table and form new list item, complete the foundation and study of forwarding table.
With regard to this, the method for a kind of forwarding table handling that first embodiment of the invention provides, before completing purpose prefix and source When sewing the inquiry under double condition, can the more completion next hop address of fast accurate inquiry, meanwhile, the shunting to message There is positive effect, can effectively alleviate message blocking, moreover it is possible to the attack message of part is filtered out by source address, so that attack Message is just consumed in a network.Moreover, the list item in the forwarding table includes source prefix and purpose prefix, and forwarding table is two Tree construction is tieed up, wherein level-one tree is purpose prefix, and the leaf node of a series has the pointer for being directed toward second level tree, deposits in second level tree It puts by source prefix, being associated with for purpose prefix and source prefix is completed in forwarding table, can be quickly finished in forwarding table with regard to this List item additions and deletions.
Fig. 3 is the storage organization of forwarding table.According to Fig.3, it for forwarding table, realizes in the router, is by one It opens table and is split as source table, purpose table, particular content is prefix, mask and index.Matrix can be being forwarded by source, purpose index In find the index of next-hop, the port numbers being forwarded to can be found by going to search in next-hop list according to index.
Optionally, according to Fig.2, the storage organization of the forwarding table includes level-one tree and second level tree, i.e. forwarding table packet Purpose prefix trees and source prefix trees are included, the leaf node of the purpose prefix trees is directed toward the source prefix trees, the source prefix trees Leaf node is directed toward the index of next hop address, and the index of the next hop address is directed toward the storage list of next hop address.
Optionally, the index of the purpose prefix trees, the source prefix trees and the next hop address is stored in three respectively Memory.Preferably, according to Fig.3, it is deposited on data plane using three-state content addressing memory and static random-access Reservoir forwarding table memory.The purpose prefix trees and the source prefix trees are stored in two three-state content addressing memories, institute respectively The index for stating next hop address is stored in static random access memory.The tri-state of storage purpose prefix is searched according to destination address Content adressable memory and three-state content addressing memory address where the prefix of source is found, then passes through source address and search storage The three-state content addressing memory of source prefix, in the static random access memory of storage next-hop index with finding next-hop The index (since next hop information is long, what is stored in static random access memory is a mapping table) of location, Next hop address is found further according to the index stored in static random access memory.
Fig. 4 is the lookup flow chart of next hop address.Optionally, according to Fig.4, when a data packet (message) reaches When router, router parses destination address and source address in data packet using three-state content addressing memory, then exists Identical purpose prefix and source prefix are successively searched in forwarding table, obtain the mapping value of next hop address whereby.In order to avoid quiet The problem of state random access memory and the asynchronous extraction of three-state content addressing memory clock, these information caches are entered into FIFO In memory, in order to complete the lookup of next hop address according to source prefix and purpose prefix.Using silent if index is sky Recognize mapping value.Using the separated structure of static random access memory and three-state content addressing memory, these steps can be with It is synchronous to carry out, reduce completion and searches the clock cycle required for next hop address.
Optionally, it in forwarding table in the first embodiment of the invention, need to only be added on the purpose prefix trees newly Leaf node, and add the new source prefix trees that the leaf node is directed toward, so that it may it realizes and is inserted into new purpose prefix.
Optionally, the delete target leaf node on the purpose prefix trees, while deleting the target leaves node and referring to To source address tree, be also achieved that delete target purpose prefix.
Optionally, it passes sequentially through the delete target purpose prefix and is inserted into new purpose prefix, be also achieved that described The update of purpose prefix trees.Certainly, the deletion and target that operation includes the addition of target purpose prefix, target purpose prefix are updated Three kinds of the modification of purpose prefix.
Optionally, new leaf node is added on the source prefix trees, is inserted into new source prefix to realize.
Optionally, the delete target leaf node on the source prefix trees, to realize delete target source prefix.
Optionally, it passes sequentially through delete target source prefix and is inserted into new source prefix, to realize the source prefix trees Update.Certainly, three kinds of modification that operation includes the addition of source prefix, the deletion of mesh source prefix and source prefix are updated.
Optionally, next-hop insertion then needs newly to index in next-hop concordance list and list item, if having there is the table The corresponding counter of the list item is added one by Xiang Ze.
Optionally, next-hop deletion is then needed to check counter, if being directed toward the index without source address tree, indexed The list item is deleted in table, counter subtracts one if going back source address and being directed toward the index.
With regard to this as can be seen that the update operation of the forwarding table in the present embodiment and conventional router it is maximum it is different be exactly one Secondary update is no longer simple single numerical value modification, and may be the numerical value modification of a line or a column.
Embodiment to facilitate the understanding of the present invention fills a kind of operation for forwarding table that second embodiment of the invention provides It sets.
Second embodiment:
Fig. 5 is the distance block diagram of the present embodiment.According to Fig.5, second embodiment of the invention provides a kind of forwarding table The device of operation, described device include:
Searching module is looked into the forwarding table for obtaining purpose prefix and source prefix according to the received message of parsing Identical purpose prefix and source prefix are looked for, the forwarding table is two-dimentional tree construction;Module is obtained, for finding identical purpose In the case where prefix and source prefix, according to the purpose prefix and source prefix found, next hop address is obtained;Increase module, uses In in the case where not finding identical purpose prefix and source prefix, addition parses purpose prefix, the source that the message obtains Prefix and corresponding next hop address, to increase the list item of the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, comprising: parsing module obtains destination address and source address for parsing received message; Purpose lookup module, for being looked into the forwarding table according to the purpose prefix of destination address and the source prefix of source address Look for identical purpose prefix;Source lookup module, in the case where finding identical purpose prefix, in the forwarding table It is middle to search identical source prefix.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, further includes: cache module, the source prefix for will find buffer into FIFO memory, To complete the lookup of next hop address according to source prefix and purpose prefix.
Optionally, purpose prefix and source prefix that the foundation is found, obtain next hop address, comprising: index module, For finding the index of next hop address according to the purpose prefix and source prefix found;List block, for according under described One jumps the index of address, the storage list of the next hop address is found, to find the next hop address.
Optionally, the storage organization of the forwarding table includes purpose prefix trees and source prefix trees, the purpose prefix trees Leaf node is directed toward the source prefix trees, and the leaf node of the source prefix trees is directed toward the index of next hop address, the next-hop The index of address is directed toward the storage list of next hop address.
Optionally, the index of the purpose prefix trees, the source prefix trees and the next hop address is stored in three respectively Memory.Preferably, the purpose prefix trees and the source prefix trees are stored in two three-state content addressing memories respectively, described The index of next hop address is stored in static random access memory.
Optionally, new leaf node is added on the purpose prefix trees, and adds the new of the leaf node direction Source prefix trees, be inserted into new purpose prefix to realize.
Optionally, the delete target leaf node on the purpose prefix trees, while deleting the target leaves node and referring to To source address tree, to realize delete target purpose prefix.
Optionally, it passes sequentially through the delete target purpose prefix and is inserted into new purpose prefix, to realize the purpose The update of prefix trees.
Optionally, new leaf node is added on the source prefix trees, is inserted into new source prefix to realize.
Optionally, the delete target leaf node on the source prefix trees, to realize delete target source prefix.
Optionally, it passes sequentially through delete target source prefix and is inserted into new source prefix, to realize the source prefix trees Update.
A kind of device for forwarding table handling that second embodiment of the invention provides, using searching module, obtains module and increasing Add module, when completing the inquiry under purpose prefix and source prefix double condition, can more fast accurate completion next-hop The inquiry of address, meanwhile, there is positive effect to the shunting of message, can effectively alleviate message blocking, moreover it is possible to pass through source address The attack message of part is filtered out, so that attack message is just consumed in a network.Moreover, the list item in the forwarding table includes Source prefix and purpose prefix, and forwarding table is two-dimentional tree construction, wherein level-one tree is purpose prefix, and the leaf node of a series is deposited There is the pointer for being directed toward second level tree, storage completes the pass of purpose prefix Yu source prefix by source prefix in forwarding table in second level tree Connection, the additions and deletions of the list item in forwarding table can be quickly finished with regard to this.
Embodiment to facilitate the understanding of the present invention, a kind of computer equipment that third embodiment of the invention is provided.
3rd embodiment:
Third embodiment of the invention provides a kind of computer equipment, including processor and memory;The memory is used In storage computer instruction, the processor is used to run the computer instruction of the memory storage, to realize above-mentioned turn The method for delivering operation.
The described method includes: obtaining purpose prefix and source prefix according to received message is parsed, looked into the forwarding table Identical purpose prefix and source prefix are looked for, the forwarding table is two-dimentional tree construction;Finding identical purpose prefix and source prefix In the case where, according to the purpose prefix and source prefix found, obtain next hop address;Do not finding identical purpose prefix And in the case where the prefix of source, addition parses purpose prefix, source prefix and the corresponding next hop address that the message obtains, to increase Add the list item of the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, comprising: parse received message, obtain destination address and source address;According to destination address Purpose prefix and source address source prefix, identical purpose prefix is searched in the forwarding table;Finding identical purpose In the case where prefix, identical source prefix is searched in the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, further includes: the source prefix found is buffered into FIFO memory, with according to source prefix and The lookup of purpose prefix completion next hop address.
Optionally, purpose prefix and source prefix that the foundation is found, obtain next hop address, comprising: according to lookup The purpose prefix and source prefix arrived, finds the index of next hop address;According to the index of the next hop address, find described The storage list of next hop address, to find the next hop address.
Optionally, the storage organization of the forwarding table includes purpose prefix trees and source prefix trees, the purpose prefix trees Leaf node is directed toward the source prefix trees, and the leaf node of the source prefix trees is directed toward the index of next hop address, the next-hop The index of address is directed toward the storage list of next hop address.
Optionally, the index of the purpose prefix trees, the source prefix trees and the next hop address is stored in three respectively Memory.Preferably, the purpose prefix trees and the source prefix trees are stored in two three-state content addressing memories respectively, described The index of next hop address is stored in static random access memory.
Optionally, new leaf node is added on the purpose prefix trees, and adds the new of the leaf node direction Source prefix trees, be inserted into new purpose prefix to realize.
Optionally, the delete target leaf node on the purpose prefix trees, while deleting the target leaves node and referring to To source address tree, to realize delete target purpose prefix.
Optionally, it passes sequentially through the delete target purpose prefix and is inserted into new purpose prefix, to realize the purpose The update of prefix trees.
Optionally, new leaf node is added on the source prefix trees, is inserted into new source prefix to realize.
Optionally, the delete target leaf node on the source prefix trees, to realize delete target source prefix.
Optionally, it passes sequentially through delete target source prefix and is inserted into new source prefix, to realize the source prefix trees Update.
Embodiment to facilitate the understanding of the present invention, a kind of computer-readable storage medium that fourth embodiment of the invention is provided Matter.
Fourth embodiment:
Fourth embodiment of the invention provides a kind of computer readable storage medium, the computer-readable recording medium storage There is one or more program, one or more of programs can be executed by one or more processor, above-mentioned to realize Forwarding table handling method.
The described method includes: obtaining purpose prefix and source prefix according to received message is parsed, looked into the forwarding table Identical purpose prefix and source prefix are looked for, the forwarding table is two-dimentional tree construction;Finding identical purpose prefix and source prefix In the case where, according to the purpose prefix and source prefix found, obtain next hop address;Do not finding identical purpose prefix And in the case where the prefix of source, addition parses purpose prefix, source prefix and the corresponding next hop address that the message obtains, to increase Add the list item of the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, comprising: parse received message, obtain destination address and source address;According to destination address Purpose prefix and source address source prefix, identical purpose prefix is searched in the forwarding table;Finding identical purpose In the case where prefix, identical source prefix is searched in the forwarding table.
Optionally, described that purpose prefix and source prefix are obtained according to the received message of parsing, it is searched in the forwarding table Identical purpose prefix and source prefix, further includes: the source prefix found is buffered into FIFO memory, with according to source prefix and The lookup of purpose prefix completion next hop address.
Optionally, purpose prefix and source prefix that the foundation is found, obtain next hop address, comprising: according to lookup The purpose prefix and source prefix arrived, finds the index of next hop address;According to the index of the next hop address, find described The storage list of next hop address, to find the next hop address.
Optionally, the storage organization of the forwarding table includes purpose prefix trees and source prefix trees, the purpose prefix trees Leaf node is directed toward the source prefix trees, and the leaf node of the source prefix trees is directed toward the index of next hop address, the next-hop The index of address is directed toward the storage list of next hop address.
Optionally, the index of the purpose prefix trees, the source prefix trees and the next hop address is stored in three respectively Memory.Preferably, the purpose prefix trees and the source prefix trees are stored in two three-state content addressing memories respectively, described The index of next hop address is stored in static random access memory.
Optionally, new leaf node is added on the purpose prefix trees, and adds the new of the leaf node direction Source prefix trees, be inserted into new purpose prefix to realize.
Optionally, the delete target leaf node on the purpose prefix trees, while deleting the target leaves node and referring to To source address tree, to realize delete target purpose prefix.
Optionally, it passes sequentially through the delete target purpose prefix and is inserted into new purpose prefix, to realize the purpose The update of prefix trees.
Optionally, new leaf node is added on the source prefix trees, is inserted into new source prefix to realize.
Optionally, the delete target leaf node on the source prefix trees, to realize delete target source prefix.
Optionally, it passes sequentially through delete target source prefix and is inserted into new source prefix, to realize the source prefix trees Update.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service Device, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much Form, all of these belong to the protection of the present invention.

Claims (18)

1. a kind of method for forwarding table handling, which is characterized in that the described method includes:
Obtain purpose prefix and source prefix according to received message is parsed, searched in the forwarding table identical purpose prefix and Source prefix, the forwarding table are two-dimentional tree construction;
In the case where finding identical purpose prefix and source prefix, according to the purpose prefix and source prefix found, obtain down One jumps address;
In the case where not finding identical purpose prefix and source prefix, addition parse the purpose prefix that the message obtains, Source prefix and corresponding next hop address, to increase the list item of the forwarding table.
2. the method according to claim 1, wherein
It is described that purpose prefix and source prefix are obtained according to the received message of parsing, before identical purpose is searched in the forwarding table Sew and source prefix, comprising:
Received message is parsed, destination address and source address are obtained;
According to the purpose prefix of destination address and the source prefix of source address, identical purpose prefix is searched in the forwarding table;
In the case where finding identical purpose prefix, identical source prefix is searched in the forwarding table.
3. according to the method described in claim 2, it is characterized in that,
It is described that purpose prefix and source prefix are obtained according to the received message of parsing, before identical purpose is searched in the forwarding table Sew and source prefix, further includes:
The source prefix found is buffered into FIFO memory, to complete looking into for next hop address according to source prefix and purpose prefix It looks for.
4. the method according to claim 1, wherein
The purpose prefix and source prefix that the foundation is found, obtain next hop address, comprising:
According to the purpose prefix and source prefix found, the index of next hop address is found;
According to the index of the next hop address, the storage list of the next hop address is found, to find the next-hop Address.
5. the method according to claim 1, wherein
The storage organization of the forwarding table includes purpose prefix trees and source prefix trees, and the leaf node of the purpose prefix trees is directed toward institute Source prefix trees are stated, the leaf node of the source prefix trees is directed toward the index of next hop address, and the index of the next hop address refers to The storage list of down hop address.
6. according to the method described in claim 5, it is characterized in that, the purpose prefix trees, the source prefix trees and it is described under The index of one jump address is stored in three memories respectively.
7. according to the method described in claim 5, it is characterized in that, add new leaf node on the purpose prefix trees, And the new source prefix trees that the addition leaf node is directed toward, new purpose prefix is inserted into realize.
8. the method according to the description of claim 7 is characterized in that the delete target leaf node on the purpose prefix trees, The source address tree that the target leaves node is directed toward is deleted, simultaneously to realize delete target purpose prefix.
9. according to the method described in claim 8, it is characterized in that, passing sequentially through the delete target purpose prefix and insertion newly Purpose prefix, to realize the update of the purpose prefix trees.
10. according to the method described in claim 5, it is characterized in that, add new leaf node on the source prefix trees, with It realizes and is inserted into new source prefix.
11. according to the method described in claim 10, it is characterized in that, on the source prefix trees delete target leaf node, To realize delete target source prefix.
12. according to the method for claim 11, which is characterized in that pass sequentially through delete target source prefix and insertion is new Source prefix, to realize the update of the source prefix trees.
13. a kind of device for forwarding table handling, which is characterized in that described device includes:
Searching module searches phase in the forwarding table for obtaining purpose prefix and source prefix according to the received message of parsing Same purpose prefix and source prefix, the forwarding table are two-dimentional tree construction;
Obtain module, in the case where finding identical purpose prefix and source prefix, according to the purpose prefix found and Source prefix, obtains next hop address;
Increase module, in the case where not finding identical purpose prefix and source prefix, addition to parse the message and obtains Purpose prefix, source prefix and the corresponding next hop address arrived, to increase the list item of the forwarding table.
14. device according to claim 13, which is characterized in that
It is described that purpose prefix and source prefix are obtained according to the received message of parsing, before identical purpose is searched in the forwarding table Sew and source prefix, comprising:
Parsing module obtains destination address and source address for parsing received message;
Purpose lookup module, for foundation the purpose prefix of destination address and the source prefix of source address, in the forwarding table It is middle to search identical purpose prefix;
Source lookup module, for being searched in the forwarding table identical in the case where finding identical purpose prefix Source prefix.
15. device according to claim 14, which is characterized in that
It is described that purpose prefix and source prefix are obtained according to the received message of parsing, before identical purpose is searched in the forwarding table Sew and source prefix, further includes:
Cache module, the source prefix for will find buffer into FIFO memory, according to source prefix and the completion of purpose prefix The lookup of next hop address.
16. device according to claim 13, which is characterized in that
The purpose prefix and source prefix that the foundation is found, obtain next hop address, comprising:
Index module, for finding the index of next hop address according to the purpose prefix and source prefix found;
List block finds the storage list of the next hop address, for the index according to the next hop address to look for To the next hop address.
17. a kind of computer equipment, which is characterized in that including processor and memory;
The memory refers to for storing computer instruction, the computer that the processor is used to run the memory storage It enables, to realize the method for forwarding table handling described in any one of claims 1 to 12.
18. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage have one or Multiple programs, one or more of programs can be executed by one or more processor, to realize in claim 1 to 12 The method of described in any item forwarding table handlings.
CN201711240987.4A 2017-11-30 2017-11-30 Forward method, apparatus, computer equipment and the readable storage medium storing program for executing of table handling Withdrawn CN109861915A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711240987.4A CN109861915A (en) 2017-11-30 2017-11-30 Forward method, apparatus, computer equipment and the readable storage medium storing program for executing of table handling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711240987.4A CN109861915A (en) 2017-11-30 2017-11-30 Forward method, apparatus, computer equipment and the readable storage medium storing program for executing of table handling

Publications (1)

Publication Number Publication Date
CN109861915A true CN109861915A (en) 2019-06-07

Family

ID=66888492

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711240987.4A Withdrawn CN109861915A (en) 2017-11-30 2017-11-30 Forward method, apparatus, computer equipment and the readable storage medium storing program for executing of table handling

Country Status (1)

Country Link
CN (1) CN109861915A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971527A (en) * 2019-11-29 2020-04-07 新华三半导体技术有限公司 Routing information determination method and device
CN112134805A (en) * 2020-09-23 2020-12-25 中国人民解放军陆军工程大学 Fast route updating circuit structure and updating method based on hardware implementation
CN113872863A (en) * 2021-08-25 2021-12-31 优刻得科技股份有限公司 Path searching method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739518A (en) * 2012-05-30 2012-10-17 杭州华三通信技术有限公司 Flow load sharing method and equipment
CN103780493A (en) * 2014-01-20 2014-05-07 清华大学 Method and system for data forwarding
CN105471747A (en) * 2015-11-25 2016-04-06 武汉烽火网络有限责任公司 Intelligent router routing method and apparatus thereof
CN105763454A (en) * 2016-02-25 2016-07-13 比威网络技术有限公司 Data message forwarding method and device based on two-dimensional routing policy

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739518A (en) * 2012-05-30 2012-10-17 杭州华三通信技术有限公司 Flow load sharing method and equipment
CN103780493A (en) * 2014-01-20 2014-05-07 清华大学 Method and system for data forwarding
CN105471747A (en) * 2015-11-25 2016-04-06 武汉烽火网络有限责任公司 Intelligent router routing method and apparatus thereof
CN105763454A (en) * 2016-02-25 2016-07-13 比威网络技术有限公司 Data message forwarding method and device based on two-dimensional routing policy

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SHU YANG等: "《Two Dimensional Router:Design and Implemention》", 《HTTP://CN.BING.COM/SEARCH?Q=TWO+DIMENSIONAL+ROUTER%3A+DESIGN+AND+IMPLEMENTATION&GO=%E6%8F%90%E4%BA%A4&QS=N&FORM=QBRE&PQ=TWO+DIMENSIONAL+ROUTER%3A+DESIGN+AND+IMPLEMENTATION&SC=0-0&SP=-1&SK=&CVID=05CCBD8A7AEB4B758AB7F8E18385A37C》 *
陈启等: "《一种新型二维路由器的设计与实现》", 《中国科技论文在线》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971527A (en) * 2019-11-29 2020-04-07 新华三半导体技术有限公司 Routing information determination method and device
CN110971527B (en) * 2019-11-29 2020-10-16 新华三半导体技术有限公司 Routing information determination method and device
CN112134805A (en) * 2020-09-23 2020-12-25 中国人民解放军陆军工程大学 Fast route updating circuit structure and updating method based on hardware implementation
CN112134805B (en) * 2020-09-23 2022-07-08 中国人民解放军陆军工程大学 Fast route updating circuit structure and updating method based on hardware implementation
CN113872863A (en) * 2021-08-25 2021-12-31 优刻得科技股份有限公司 Path searching method and device

Similar Documents

Publication Publication Date Title
US8750144B1 (en) System and method for reducing required memory updates
CN101594319B (en) Entry lookup method and entry lookup device
US9461907B2 (en) Data routing
Quan et al. Scalable name lookup with adaptive prefix bloom filter for named data networking
CN105224692B (en) Support the system and method for the SDN multilevel flow table parallel searchs of multi-core processor
US10003533B2 (en) SDN packet forwarding
EP2933961A1 (en) Method and apparatus for routing and forwarding, building routing tables, and obtaining contents
US20070171911A1 (en) Routing system and method for managing rule entry thereof
CN103873371A (en) Name routing fast matching search method and device
CN109861915A (en) Forward method, apparatus, computer equipment and the readable storage medium storing program for executing of table handling
US8990492B1 (en) Increasing capacity in router forwarding tables
CN107431660B (en) Search device, search method, and recording medium
US20080133494A1 (en) Method and apparatus for searching forwarding table
US8015195B2 (en) Modifying entry names in directory server
CN102035738A (en) Method and device for acquiring routing information
CN109815238A (en) The dynamic adding method and device of database are realized with strict balanced binary tree
CN106416151A (en) Multi-table hash-based lookups for packet processing
CN105656786B (en) A kind of router look-up method based on fast, slow table
CN106453091B (en) The equivalent route management method and device of router Forwarding plane
US20170012874A1 (en) Software router and methods for looking up routing table and for updating routing entry of the software router
CN106796588B (en) The update method and equipment of concordance list
CN109754021B (en) Online packet classification method based on range tuple search
CN104063442A (en) Service processing method and system of information center network
CN112769748B (en) DPDK-based ACL packet filtering method
CN110661892B (en) Domain name configuration information processing method and device

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20190607