CN103986656A - Searching method and searching device - Google Patents

Searching method and searching device Download PDF

Info

Publication number
CN103986656A
CN103986656A CN201310049635.6A CN201310049635A CN103986656A CN 103986656 A CN103986656 A CN 103986656A CN 201310049635 A CN201310049635 A CN 201310049635A CN 103986656 A CN103986656 A CN 103986656A
Authority
CN
China
Prior art keywords
list item
index
bit
low
address
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
CN201310049635.6A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310049635.6A priority Critical patent/CN103986656A/en
Publication of CN103986656A publication Critical patent/CN103986656A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provide a searching method which includes the following steps: using a high part of an address as key words to search for a first table item which matches the high part in a first table; obtaining information according to the first table item; using high M bits of the low part of the address as key words to search for a second table item which matches the high M bits in the information, wherein the second table item includes a first index and the width of the low part is X bits, and the low part includes the high M bits and low N bits, and X plug M is N and all of X, M and N are positive integers; obtaining the first index if the second table item is found; and using the first index and the low N bits as key words to search for a table item which matches the first index and the low N bits in a second table. Moreover, the embodiment of the invention also provides a corresponding searching device. The searching method and the searching device can be used for expanding the range of the searched address.

Description

Lookup method and search device
Technical field
The present invention relates to the communications field, particularly lookup method and search device.
Background technology
In the communications field, while carrying out address search, likely use longest prefix match.For example, in routing table, can store Internet Protocol Version 4 (Internet Protocol version4, IPV4) address and IPv6 (Internet Protocol version6, IPV6) address.In practical application, the width of address may be wider, in a table, cannot carry whole address.Therefore, longest prefix match may be used quadratic search.In technique scheme, the scope of the address that can search is subject to certain restrictions.
Take IPv6 address below describes as example.The high part(of described IPv6 address is hereinafter to be referred as a high part) be stored in the first table.For example, the width of a described high part is 64 bits.The low part(of described IPv6 address is hereinafter to be referred as a low part) be stored in the second table.For example, the width of a described low part is 64 bits.For example, when the network equipment (router) is searched described IPv6 address, first in the first table, search the first list item mating with a described high part.If find described the first list item, according to described the first list item, obtain the first index.In described the second table, search the second list item that comprises described the first index and a described low part.In technique scheme, in the matching domain in described the second list item (match field), need to store described the first index and a described low part.
In practical application, the width of the match field of described the second table is more limited.Therefore, in described the second list item, can be used in storage described the first index space be limited.For example, some application scenarios regulations, the width of the match field of described the second table is 80 bits.The width of considering a described low part is 64 bits, and the width of described the first index can not surpass 16 bits.In addition, in actual applications, in described the first table, may need to store a plurality of high part, respectively corresponding a plurality of index.In described the first table, store under the scene of a plurality of mutual unequal high part, described a plurality of index are unequal mutually.Therefore, in described the second table, need to store a plurality of mutual unequal index.
When the high part of storage is more in described the first table, may occur that described the second table cannot configure for the part high part in described the first table the situation of corresponding index.For example, if the width that the width of the match field in described the second table is 80 bits and low part is 64 bits, the Breadth Maximum of the index in described the second table is 16 bits.Therefore, in the mutual unequal situation of a plurality of index, 16 powers that the number of the index that can store in described the second table is 2.If be stored in 16 powers that the quantity of the high part in described the first table is greater than 2, in described the second table, cannot configure corresponding index for the part high part of storage in described the first table.For example, the width of the high part of IPv6 address may be 64 bits, and described the first table needs the number of the high part of storage can reach 2 64 powers in theory.But the number of the index that can store in described the second table can only be at most 2 16 powers.
In technique scheme, in described the second table, cannot configure corresponding index for the part high part of storage in described the first table.Therefore, cannot in described the second table, search the corresponding low part of part highpart of storage in described the first table.More than mean, the scope of the address that can search has been subject to certain limitation.
Summary of the invention
The invention provides lookup method and search device, can be for expanding the scope of the address that can search.
First aspect, provides a kind of lookup method, comprising:
The high part of address of take is keyword, searches the first list item mating with described high part in the first table;
According to described the first list item acquired information;
The high M bit of low part of described address of take is keyword, in described information, search the second list item with described high M bits match, described the second list item comprises the first index, the width of described low part is X bit, described low part comprises described high M bit and low N bit, X equals M and adds N, and X, M and N are positive integer;
If find described the second list item, obtain described the first index;
Take described the first index and described low N bit is keyword, searches the list item with described the first index and described low N bits match in the second table.
In the possible implementation of the first of first aspect,
If do not find described the second list item, determine that with the longest-prefix of described matching addresses be described high part.
In conjunction with the possible implementation of the first of first aspect or first aspect, in the possible implementation of the second of first aspect,
If there is not described the second list item in described information, take basic address and side-play amount and be keyword, in described information, search the second index, described basic address is carried in described information, described side-play amount is described high M bit;
Take described the second index and described low N bit is keyword, searches the list item with described the second index and described low N bits match in described the second table.
In conjunction with the possible implementation of the second of first aspect, in the third possible implementation of first aspect,
In described information, comprise the first sign, described the first sign is used to indicate and in described information, does not have described the second list item.
In conjunction with the third possible implementation of the possible implementation of the second of the possible implementation of the first of first aspect, first aspect, first aspect or first aspect, in the 4th kind of possible implementation of first aspect,
In described information, comprise the second sign, described the second sign is used to indicate in described the second table and does not have described list item.
In conjunction with the third possible implementation of the possible implementation of the second of the possible implementation of the first of first aspect, first aspect, first aspect, first aspect or the 4th kind of possible implementation of first aspect, in the 5th kind of possible implementation of first aspect
In described the first table, search before described the first list item, described method also comprises:
Receive message, described message comprises described address.
In the technical scheme that the embodiment of the present invention provides, for searching the keyword of described the second table, be described the first index and described low N bit.In prior art, for searching the keyword of the second table, be the first index and the low part that described the first table returns.The width of the described low N bit in the technical scheme that the embodiment of the present invention provides is less than the width of described low part of the prior art.If identical for searching the width of the described second keyword of showing for searching width and the prior art of keyword of described the second table in the technical scheme that the embodiment of the present invention provides, the width of described the first index in the technical scheme that embodiment of the present invention provides can be greater than the width of described the first index of the prior art.
According to the description of background technology, can determine, the maximum quantity of the list item in described the first table in the technical scheme that the embodiment of the present invention provides is 2 powers of the width of described the first index.The maximum quantity of the list item in described the first table in the technical scheme that therefore, the embodiment of the present invention provides can be greater than the maximum quantity of the list item in the first table described in prior art.Described the first table in the technical scheme that the embodiment of the present invention provides can be for the high part of memory address, and the maximum quantity of the list item in described the first table is more, more contributes to expand the scope of the address that can search.
In sum, the technical scheme that the embodiment of the present invention provides can be for expanding the scope of the address that can search.
Second aspect, provides a kind of device of searching, described in search device and comprise circuits for triggering and search circuit,
Described circuits for triggering are searched circuit described in being used for triggering;
Described search circuit for:
The high part of address of take is keyword, searches the first list item mating with described high part in the first table;
According to described the first list item acquired information;
The high M bit of low part of described address of take is keyword, in described information, search the second list item with described high M bits match, described the second list item comprises the first index, the width of described low part is X bit, described low part comprises described high M bit and low N bit, X equals M and adds N, and X, M and N are positive integer;
If find described the second list item, obtain described the first index;
Take described the first index and described low N bit is keyword, searches the list item with described the first index and described low N bits match in the second table.
In the possible implementation of the first of second aspect, described in search circuit also for:
If do not find described the second list item, determine that with the longest-prefix of described matching addresses be described high part.
In conjunction with the possible implementation of the first of second aspect or second aspect, in the possible implementation of the second of second aspect, described in search circuit also for:
If there is not described the second list item in described information, take basic address and side-play amount and be keyword, in described information, search the second index, described basic address is carried in described information, described side-play amount is described high M bit;
Take described the second index and described low N bit is keyword, searches the list item with described the second index and described low N bits match in described the second table.
In conjunction with the possible implementation of the second of second aspect, in the third possible implementation of second aspect,
In described information, comprise the first sign, described the first sign is used to indicate and in described information, does not have described the second list item.
In conjunction with the third possible implementation of the possible implementation of the second of the possible implementation of the first of second aspect, second aspect, second aspect or second aspect, in the 4th kind of possible implementation of second aspect,
In described information, comprise the second sign, described the second sign is used to indicate in described the second table and does not have described list item.
In conjunction with the third possible implementation of the possible implementation of the second of the possible implementation of the first of second aspect, second aspect, second aspect, second aspect or the 4th kind of possible implementation of second aspect, in the 5th kind of possible implementation of second aspect
Described device also comprises receiving circuit, and described receiving circuit is used for:
Receive message, described message comprises described address.
In the technical scheme that the embodiment of the present invention provides, for searching the keyword of described the second table, be described the first index and described low N bit.In prior art, for searching the keyword of the second table, be the first index and the low part that described the first table returns.The width of the described low N bit in the technical scheme that the embodiment of the present invention provides is less than the width of described low part of the prior art.If identical for searching the width of the described second keyword of showing for searching width and the prior art of keyword of described the second table in the technical scheme that the embodiment of the present invention provides, the width of described the first index in the technical scheme that embodiment of the present invention provides can be greater than the width of described the first index of the prior art.
According to the description of background technology, can determine, the maximum quantity of the list item in described the first table in the technical scheme that the embodiment of the present invention provides is 2 powers of the width of described the first index.The maximum quantity of the list item in described the first table in the technical scheme that therefore, the embodiment of the present invention provides can be greater than the maximum quantity of the list item in the first table described in prior art.Described the first table in the technical scheme that the embodiment of the present invention provides can be for the high part of memory address, and the maximum quantity of the list item in described the first table is more, more contributes to expand the scope of the address that can search.
In sum, the technical scheme that the embodiment of the present invention provides can be for expanding the scope of the address that can search.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The schematic flow sheet of a kind of lookup method that Fig. 1 provides for the embodiment of the present invention;
The schematic flow sheet of a kind of lookup method that Fig. 2 provides for the embodiment of the present invention;
A kind of structural representation of searching device that Fig. 3 provides for the embodiment of the present invention;
A kind of structural representation of searching device that Fig. 4 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making all other embodiment that obtain under creative work prerequisite, belong to the scope of protection of the invention.
For making the advantage of technical solution of the present invention clearer, below in conjunction with drawings and Examples, the present invention is elaborated.
The schematic flow sheet of a kind of lookup method that Fig. 1 provides for the embodiment of the present invention.The executive agent of described method can be the network equipment.The described network equipment can be router, switch, fire compartment wall or load equalizer.Specifically, the executive agent of described method can be network processing unit (network processor, NP) or the application-specific integrated circuit (ASIC) (application specificintegrated circuit, ASIC) in the described network equipment.Referring to Fig. 1, described method comprises:
102, take the high part of address is keyword, searches the first list item mating with described high part in the first table.
For instance, described address can be that (MediaAccess Control, MAC) protocol address is controlled in IPv4 address, IPv6 address or media interviews.
For instance, if described address is IPv6 address, the width of described high part can be any one in 1 bit to 127 bit.For example, the width of described high part can be 64 bits.
For instance, described the first table can be stored in dynamic random access memory (dynamic randomaccess memory, DRAM).
104, according to described the first list item acquired information.
For instance, the structure of described the first table can be binary tree.Described binary tree can comprise a plurality of branches, and each branch comprises a plurality of nodes.The Yi Ge branch that described the first list item can be described binary tree.Described NP finds after last node in described branch, and described NP can obtain described information according to the indicated memory space of described last node.Described last node can be indicated described memory space by a pointer.Described information is stored in described memory space.
106, take the high M bit of low part of described address is keyword, in described information, search the second list item with described high M bits match, described the second list item comprises the first index, the width of described low part is X bit, described low part comprises described high M bit and low N bit, X equals M and adds N, and X, M and N are positive integer.
For instance, if described address is IPv6 address.The width of described low part can be 64 bits.The width of described high M bit can be 8 bits, and the width of described low N bit can be 56 bits.
If 108 find described the second list item, obtain described the first index.
110, take described the first index and described low N bit is keyword, searches the list item with described the first index and described low N bits match in the second table.
For instance, described the second table can be stored in DRAM.The structure of described the second table can be binary tree.
For instance, described address can be IPv6 address.The width of described high part, described low part, described high M bit and described low N bit can be respectively 64 bits, 64 bits, 8 bits and 56 bits.If the Breadth Maximum of the match field in described the second table is 80 bits, the Breadth Maximum of described the first index is 24 bits.Therefore, the maximum quantity of the list item in described the first table can be 2 24 powers.
In the technical scheme that the embodiment of the present invention provides, for searching the keyword of described the second table, be described the first index and described low N bit.In prior art, for searching the keyword of the second table, be the first index and the low part that described the first table returns.The width of the described low N bit in the technical scheme that the embodiment of the present invention provides is less than the width of described low part of the prior art.If identical for searching the width of the described second keyword of showing for searching width and the prior art of keyword of described the second table in the technical scheme that the embodiment of the present invention provides, the width of described the first index in the technical scheme that embodiment of the present invention provides can be greater than the width of described the first index of the prior art.
According to the description of background technology, can determine, the maximum quantity of the list item in described the first table in the technical scheme that the embodiment of the present invention provides is 2 powers of the width of described the first index.The maximum quantity of the list item in described the first table in the technical scheme that therefore, the embodiment of the present invention provides can be greater than the maximum quantity of the list item in the first table described in prior art.Described the first table in the technical scheme that the embodiment of the present invention provides can be for the high part of memory address, and the maximum quantity of the list item in described the first table is more, more contributes to expand the scope of the address that can search.
In sum, the technical scheme that the embodiment of the present invention provides can be for expanding the scope of the address that can search.
Alternatively, the method shown in Fig. 1 can also comprise:
If do not find described the second list item, determine that with the longest-prefix of described matching addresses be described high part.
Alternatively, the method shown in Fig. 1 can also comprise:
If there is not described the second list item in described information, take basic address and side-play amount and be keyword, in described information, search the second index, described basic address is carried in described information, described side-play amount is described high M bit;
Take described the second index and described low N bit is keyword, searches the list item with described the second index and described low N bits match in described the second table.
Alternatively, in the method shown in Fig. 1,
In described information, comprise the first sign, described the first sign is used to indicate and in described information, does not have described the second list item.
Alternatively, in the method shown in Fig. 1,
In described information, comprise the second sign, described the second sign is used to indicate in described the second table and does not have described list item.
Alternatively, in described the first table, search before described the first list item, described method also comprises:
112, receive message, described message comprises described address.
For instance, 112 executive agent can be the receiving circuit in the described network equipment.Described message can be Internet protocol (Internet Protocol, IP) message.
For instance, described address can be the object IP address of described IP message.
The schematic flow sheet of a kind of lookup method that Fig. 2 provides for the embodiment of the present invention.About 112, can be referring to Fig. 2.
A kind of structural representation of searching device that Fig. 3 provides for the embodiment of the present invention.Described device can be the network equipment.The described network equipment can be router, switch, fire compartment wall or load equalizer.Specifically, described device can be NP or the ASIC in the described network equipment.Device shown in Fig. 3 can be for the method shown in execution graph 1.Referring to Fig. 3, described device comprises: described in search device and comprise circuits for triggering 302 and search circuit 304.
Described trigger is searched circuit described in being used for triggering.
Described search circuit for:
The high part of address of take is keyword, searches the first list item mating with described high part in the first table;
According to described the first list item acquired information;
The high M bit of low part of described address of take is keyword, in described information, search the second list item with described high M bits match, described the second list item comprises the first index, the width of described low part is X bit, described low part comprises described high M bit and low N bit, X equals M and adds N, and X, M and N are positive integer;
If find described the second list item, obtain described the first index;
Take described the first index and described low N bit is keyword, searches the list item with described the first index and described low N bits match in the second table.
For instance, described address can be IPv4 address, IPv6 address or MAC protocol address.
For instance, if described address is IPv6 address, the width of described high part can be any one in 1 bit to 127 bit.For example, the width of described high part can be 64 bits.
For instance, described the first table can be stored in DRAM.
For instance, the structure of described the first table can be binary tree.Described binary tree can comprise a plurality of branches, and each branch comprises a plurality of nodes.The Yi Ge branch that described the first list item can be described binary tree.Described NP finds after last node in described branch, and described NP can obtain described information according to the indicated memory space of described last node.Described last node can be indicated described memory space by a pointer.Described information is stored in described memory space.
For instance, if described address is IPv6 address.The width of described low part can be 64 bits.The width of described high M bit can be 8 bits, and the width of described low N bit can be 56 bits.
For instance, described the second table can be stored in DRAM.The structure of described the second table can be binary tree.
For instance, described address can be IPv6 address.The width of described high part, described low part, described high M bit and described low N bit can be respectively 64 bits, 64 bits, 8 bits and 56 bits.If the Breadth Maximum of the match field in described the second table is 80 bits, the Breadth Maximum of described the first index is 24 bits.Therefore, the maximum quantity of the list item in described the first table can be 2 24 powers.
In the technical scheme that the embodiment of the present invention provides, for searching the keyword of described the second table, be described the first index and described low N bit.In prior art, for searching the keyword of the second table, be the first index and the low part that described the first table returns.The width of the described low N bit in the technical scheme that the embodiment of the present invention provides is less than the width of described low part of the prior art.If identical for searching the width of the described second keyword of showing for searching width and the prior art of keyword of described the second table in the technical scheme that the embodiment of the present invention provides, the width of described the first index in the technical scheme that embodiment of the present invention provides can be greater than the width of described the first index of the prior art.
According to the description of background technology, can determine, the maximum quantity of the list item in described the first table in the technical scheme that the embodiment of the present invention provides is 2 powers of the width of described the first index.The maximum quantity of the list item in described the first table in the technical scheme that therefore, the embodiment of the present invention provides can be greater than the maximum quantity of the list item in the first table described in prior art.Described the first table in the technical scheme that the embodiment of the present invention provides can be for the high part of memory address, and the maximum quantity of the list item in described the first table is more, more contributes to expand the scope of the address that can search.
In sum, the technical scheme that the embodiment of the present invention provides can be for expanding the scope of the address that can search.
Alternatively, in the device shown in Fig. 3, described in search circuit can also be for:
If do not find described the second list item, determine that with the longest-prefix of described matching addresses be described high part.
Alternatively, in the device shown in Fig. 3, described in search circuit can also be for:
If there is not described the second list item in described information, take basic address and side-play amount and be keyword, in described information, search the second index, described basic address is carried in described information, described side-play amount is described high M bit;
Take described the second index and described low N bit is keyword, searches the list item with described the second index and described low N bits match in described the second table.
Alternatively, in the device shown in Fig. 3,
In described information, comprise the first sign, described the first sign is used to indicate and in described information, does not have described the second list item.
Alternatively, in the device shown in Fig. 3,
In described information, comprise the second sign, described the second sign is used to indicate in described the second table and does not have described list item.
Alternatively, in the device shown in Fig. 3, can also comprise receiving circuit 306, described receiving circuit 306 for:
Receive message, described message comprises described address.
For instance, described message can be IP message.
For instance, described address can be the object IP address of described IP message.
A kind of structural representation of searching device that Fig. 4 provides for the embodiment of the present invention.About receiving circuit 306, can be referring to Fig. 4.
The embodiment of the present invention provides a kind of device of searching.Can be for the lookup method shown in execution graph 1.Shown in search device and comprise:
First module, is keyword for take the high part of address, searches the first list item mating with described highpart in the first table;
Second unit, for according to described the first list item acquired information;
Unit the 3rd, for take the high M bit of low part of described address, it is keyword, in described information, search the second list item with described high M bits match, described the second list item comprises the first index, the width of described low part is X bit, described low part comprises described high M bit and low N bit, and X equals M and adds N, and X, M and N are positive integer;
Unit the 4th, if for finding described the second list item, obtain described the first index;
Unit the 5th, is keyword for take described the first index and described low N bit, searches the list item with described the first index and described low N bits match in the second table.
Alternatively, described in, searching device can also comprise:
Unit the 6th, if for not finding described the second list item, determines that with the longest-prefix of described matching addresses be described high part.
Alternatively, described in, searching device can also comprise:
Unit the 7th, if there is not described the second list item for described information, take basic address and side-play amount and be keyword, in described information, search the second index, described basic address is carried in described information, described side-play amount is described high M bit;
Unit the 8th, is keyword for take described the second index and described low N bit, searches the list item with described the second index and described low N bits match in described the second table.
Alternatively, described in, searching device can also comprise:
In described information, comprise the first sign, described the first sign is used to indicate and in described information, does not have described the second list item.
Alternatively, described in, searching device can also comprise:
In described information, comprise the second sign, described the second sign is used to indicate in described the second table and does not have described list item.
Alternatively, described in, searching device can also comprise:
Unit the 9th, for receive message before described the first table is searched described the first list item, described message comprises described address.
Alternatively, described in, search unit and can also comprise treatment circuit and the computer-readable recording medium being coupled with described processor.
Alternatively, described computer-readable recording medium comprises described first module, described second unit, described Unit the 3rd, described Unit the 4th and described Unit the 5th.
Alternatively, described computer-readable recording medium also comprises described Unit the 4th and described Unit the 5th.
Alternatively, described computer-readable recording medium also comprises described Unit the 6th.
Alternatively, described computer-readable recording medium also comprises described Unit the 7th and described Unit the 8th.
Alternatively, described computer-readable recording medium also comprises described Unit the 9th.
Those of ordinary skills can recognize, unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein, can realize with the combination of electronic hardware or computer software and electronic hardware.These functions are carried out with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can specifically should be used for realizing described function with distinct methods to each, but this realization should not thought and exceeds scope of the present invention.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the specific works process of the system of foregoing description, device and unit, can, with reference to the corresponding process in preceding method embodiment, not repeat them here.
In the several embodiment that provide in the application, should be understood that disclosed system, apparatus and method can realize by another way.For example, device embodiment described above is only schematic, for example, the division of described unit, can be only that a kind of logic function is divided, during actual realization, can have other dividing mode, for example a plurality of unit or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, indirect coupling or the communication connection of device or unit can be electrically, machinery or other form.
The described unit as separating component explanation can or can not be also physically to separate, and the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in a plurality of network element.Can select according to the actual needs some or all of unit wherein to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can be also that the independent physics of unit exists, and also can be integrated in a unit two or more unit.
If described function usings that the form of SFU software functional unit realizes and during as production marketing independently or use, can be stored in a computer read/write memory medium.Understanding based on such, the part that technical scheme of the present invention contributes to prior art in essence in other words or the part of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprise that some instructions are with so that a computer equipment (can be personal computer, server, or the network equipment etc.) carry out all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium comprises: various media that can be program code stored such as USB flash disk, portable hard drive, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disc or CDs.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion by the described protection range with claim.

Claims (12)

1. a lookup method, is characterized in that, comprising:
The high part of address of take is keyword, searches the first list item mating with described high part in the first table;
According to described the first list item acquired information;
The high M bit of low part of described address of take is keyword, in described information, search the second list item with described high M bits match, described the second list item comprises the first index, the width of described low part is X bit, described low part comprises described high M bit and low N bit, X equals M and adds N, and X, M and N are positive integer;
If find described the second list item, obtain described the first index;
Take described the first index and described low N bit is keyword, searches the list item with described the first index and described low N bits match in the second table.
2. method according to claim 1, is characterized in that,
If do not find described the second list item, determine that with the longest-prefix of described matching addresses be described high part.
3. method according to claim 1 and 2, is characterized in that,
If there is not described the second list item in described information, take basic address and side-play amount and be keyword, in described information, search the second index, described basic address is carried in described information, described side-play amount is described high M bit;
Take described the second index and described low N bit is keyword, searches the list item with described the second index and described low N bits match in described the second table.
4. method according to claim 3, is characterized in that,
In described information, comprise the first sign, described the first sign is used to indicate and in described information, does not have described the second list item.
5. according to arbitrary described method in claim 1 to 4, it is characterized in that,
In described information, comprise the second sign, described the second sign is used to indicate in described the second table and does not have described list item.
6. according to arbitrary described method in claim 1 to 5, it is characterized in that, in described the first table, search before described the first list item, described method also comprises:
Receive message, described message comprises described address.
7. search a device, it is characterized in that, described in search device and comprise circuits for triggering and search circuit,
Described circuits for triggering are searched circuit described in being used for triggering;
Described search circuit for:
The high part of address of take is keyword, searches the first list item mating with described high part in the first table;
According to described the first list item acquired information;
The high M bit of low part of described address of take is keyword, in described information, search the second list item with described high M bits match, described the second list item comprises the first index, the width of described low part is X bit, described low part comprises described high M bit and low N bit, X equals M and adds N, and X, M and N are positive integer;
If find described the second list item, obtain described the first index;
Take described the first index and described low N bit is keyword, searches the list item with described the first index and described low N bits match in the second table.
8. device according to claim 7, is characterized in that, described in search circuit also for:
If do not find described the second list item, determine that with the longest-prefix of described matching addresses be described high part.
9. according to the device described in claim 7 or 8, it is characterized in that, described in search circuit also for:
If there is not described the second list item in described information, take basic address and side-play amount and be keyword, in described information, search the second index, described basic address is carried in described information, described side-play amount is described high M bit;
Take described the second index and described low N bit is keyword, searches the list item with described the second index and described low N bits match in described the second table.
10. device according to claim 9, is characterized in that,
In described information, comprise the first sign, described the first sign is used to indicate and in described information, does not have described the second list item.
11. according to arbitrary described device in claim 7 to 10, it is characterized in that,
In described information, comprise the second sign, described the second sign is used to indicate in described the second table and does not have described list item.
12. according to arbitrary described device in claim 7 to 11, it is characterized in that, described device also comprises receiving circuit, and described receiving circuit is used for:
Receive message, described message comprises described address.
CN201310049635.6A 2013-02-07 2013-02-07 Searching method and searching device Pending CN103986656A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310049635.6A CN103986656A (en) 2013-02-07 2013-02-07 Searching method and searching device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310049635.6A CN103986656A (en) 2013-02-07 2013-02-07 Searching method and searching device

Publications (1)

Publication Number Publication Date
CN103986656A true CN103986656A (en) 2014-08-13

Family

ID=51278483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310049635.6A Pending CN103986656A (en) 2013-02-07 2013-02-07 Searching method and searching device

Country Status (1)

Country Link
CN (1) CN103986656A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104539537A (en) * 2014-12-25 2015-04-22 北京华为数字技术有限公司 Routing lookup method and device
CN110753133A (en) * 2018-07-23 2020-02-04 华为技术有限公司 Method for processing address and network equipment
CN112637070A (en) * 2020-12-21 2021-04-09 杭州迪普信息技术有限公司 Method and equipment for searching table item

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104539537A (en) * 2014-12-25 2015-04-22 北京华为数字技术有限公司 Routing lookup method and device
CN104539537B (en) * 2014-12-25 2018-04-20 北京华为数字技术有限公司 A kind of method for searching route and device
CN110753133A (en) * 2018-07-23 2020-02-04 华为技术有限公司 Method for processing address and network equipment
CN110753133B (en) * 2018-07-23 2022-03-29 华为技术有限公司 Method for processing address and network equipment
US11570106B2 (en) 2018-07-23 2023-01-31 Huawei Technologies Co., Ltd. Address processing method and network device
CN112637070A (en) * 2020-12-21 2021-04-09 杭州迪普信息技术有限公司 Method and equipment for searching table item
CN112637070B (en) * 2020-12-21 2022-07-01 杭州迪普信息技术有限公司 Method and equipment for searching table item

Similar Documents

Publication Publication Date Title
US8750297B2 (en) Ascertaining per-hop network characteristics
US9253090B2 (en) System and method for reduced forwarding information storage
CN107506310B (en) Address searching and keyword storing method and equipment
US20120246163A1 (en) Hash table storage and search methods and devices
CN103077208B (en) URL(uniform resource locator) matched processing method and device
EP3280104B1 (en) Ip routing lookup
CN102035727A (en) Method and equipment for processing routing
CN111680489B (en) Target text matching method and device, storage medium and electronic equipment
CN109905413B (en) IP address matching method and device
CN103001878A (en) Determination method and device for media access control (MAC) address Hash collision
CN103986656A (en) Searching method and searching device
CN103873464A (en) Message processing method and forwarding equipment
US8095677B1 (en) Configuration rule generation with compressed address sets
CN103825824A (en) Message processing method and message processing device
CN104205745A (en) Method and device for processing message
CN102164080B (en) Routing address inquiry method and device
CN102682112B (en) Storage method and device
CN104504038A (en) Hash search method for reducing hash collision
US20160301658A1 (en) Method, apparatus, and computer-readable medium for efficient subnet identification
CN104012053A (en) Searching device and method
US9294399B2 (en) Method for learning media access control address, network device, and system
CN106709045B (en) Node selection method and device in distributed file system
CN103368852A (en) Method and system for processing hash conflict
CN113114574A (en) Message forwarding method and device
CN103399920A (en) Key value searching method, key value searching device and chip

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140813