A kind of method for searching route and device
Technical field
The present invention relates to the communications field, more particularly to a kind of method for searching route and device.
Background technology
With the lifting of Internet protocol (Internet Protocol, IP) version, the capacity of routing address is also with carrying
Rise.In Internet Protocol version 6 (Internet Protocol Version 6, IPv6), the capacity of routing address is
128 bits (bit) are reached.
In the prior art, the routing address of large capacity is generally split into the identical two parts of capacity, is respectively high-order ground
Location and low order address, and be retained separately.By taking the routing address in IPv6 as an example, the routing address in IPv6 has 128bit, can be with
It is divided into the high address of 64bit and the low order address of 64bit.Since routing address generally has convergence, most of route ground
The high-order portion of location is all that identical, different part is more in low portion.For example, routing address A:And road 192.168.1.1
By address B:192.168.12.18 in, high address is identical, is 192.168.Routing address with identical high address exists
It will not repeat to store during storage.For example, the forwarding unit storage routing address A and routing address B of routing address is stored in network,
Only need to store an identical high address and two low order address.That is, in the storage organization of storage routing address
Generally comprise small number of high address and greater number of low order address.
During for larger routing address, routing address is stored using the mode of the prior art, same forwarding unit is deposited
The amount of the IPv6 routing address of storage will be substantially less that the amount of storage IPv4 routing address, cause forwarding unit to can not achieve due place
Reason ability, is unable to reach the requirement of system, and resource utilization ratio is relatively low.
The content of the invention
In order to solve the above-mentioned technical problem, an embodiment of the present invention provides a kind of method for searching route, route ground is being split
The size for the high address that location obtains is more than low order address so that and the total size of a fairly large number of low order address reduces during storage,
Improve the quantity of the storage routing address of forwarding unit.
In a first aspect, an embodiment of the present invention provides a kind of method for searching route, including:
Forwarding unit splits the first routing address, and the first high address and the first low order address are obtained after fractionation,
First high address capacity is more than half of the first via by address capability, and first high address capacity is more than institute
The first low order address capacity is stated, the first via is in first interval by address capability;
First low order address is stored in second look-up table by the forwarding unit, by first high address and
Two look-up tables mark correspondence is stored in the first look-up table, and the second look-up table is identified as the corresponding mark of the second look-up table
Know;
The forwarding unit obtains the first search request, and first search request includes the first routing address;
The forwarding unit according to the first via by the first look-up table of address search, obtain first high address and
The second look-up table mark of corresponding storage;
Forwarding unit second look-up table according to the second look-up table identifier lookup, obtains corresponding described first
The lookup result of search request.
In the first possible implementation of first aspect, further include:
The forwarding unit splits secondary route address, the second high address and the second low level are obtained after fractionation
Location, second high address capacity are more than the half of the secondary route address capability, and second high address capacity is big
In the second low order address capacity, the secondary route address capability is in second interval, and the second interval is more than described
First interval;
Second low order address is stored in the 3rd look-up table by the forwarding unit, by second high address and
Three look-up tables mark correspondence is stored in the first look-up table, and the 3rd look-up table is identified as the corresponding mark of the 3rd look-up table
Know;
The forwarding unit obtains the second search request, and second search request includes secondary route address;
The forwarding unit according to first look-up table of secondary route address search, obtain second high address and
The 3rd look-up table mark of corresponding storage;
The forwarding unit the 3rd look-up table according to the 3rd look-up table identifier lookup, obtains corresponding described second
The lookup result of search request.
With reference to first aspect or first aspect the first possible implementation, in second of possible implementation
In, further include:
For the forwarding unit using the 3rd routing address as the 3rd high address, the 3rd routing address capacity is in the
Three sections, the 3rd interval are less than the first interval;
3rd high address is stored in the first look-up table by the forwarding unit;
The forwarding unit obtains the 3rd search request, and the 3rd search request includes the 3rd routing address;
For the forwarding unit according to first look-up table of secondary route address search, obtaining corresponding 3rd lookup please
The lookup result asked.
With reference to first aspect or first aspect the first possible implementation, in the third possible implementation
In,
First low order address is identical with the capacity of second low order address.
In the 4th kind of possible implementation of first aspect,
The corresponding high address mark in first high address is further included in first look-up table;
The forwarding unit according to the first via by the first look-up table of address search, obtain first high address and
The second look-up table mark of corresponding storage, specifically includes:
The forwarding unit according to the first via by the first look-up table of address search, obtain first high address and
The second look-up table mark and corresponding high address mark of corresponding storage;
Forwarding unit second look-up table according to the second look-up table identifier lookup, obtains corresponding described first
The lookup result of search request, specifically includes:
The forwarding unit forms search key according to high address mark and the first via by address;
The forwarding unit searches the second look-up table according to second look-up table mark and the search key,
Obtain corresponding to the lookup result of first search request.
Second aspect, an embodiment of the present invention provides a kind of device for searching route, including:
Split cells, for being split to the first routing address, obtains the first high address and the first low level after fractionation
Address, first high address capacity are more than the first via by the half of address capability, first high address capacity
More than the first low order address capacity, the first via is in first interval by address capability;
Storage unit, for first low order address to be stored in second look-up table, by first high address and
Second look-up table mark correspondence is stored in the first look-up table, and the second look-up table is identified as the corresponding mark of the second look-up table
Know;
Receiving unit, for obtaining the first search request, first search request includes the first routing address;
Searching unit, for, by the first look-up table of address search, it is high-order to obtain described first according to the first via
Address and the second look-up table mark of corresponding storage;
Quadratic search unit, for the second look-up table according to the second look-up table identifier lookup, obtains corresponding institute
State the lookup result of the first search request.
In the first possible implementation of second aspect,
The split cells is additionally operable to split secondary route address, and the second high address and second are obtained after fractionation
Low order address, second high address capacity are more than the half of the secondary route address capability, second high address
Capacity is more than the second low order address capacity, and the secondary route address capability is in second interval, and the second interval is big
In the first interval;
The storage unit is additionally operable to second low order address being stored in the 3rd look-up table, by the described second high-order ground
Location and the 3rd look-up table mark correspond to and are stored in the first look-up table, and the 3rd look-up table is identified as the 3rd look-up table and corresponds to
Mark;
The receiving unit is additionally operable to obtain the second search request, and second search request includes secondary route address;
Searching unit is additionally operable to, according to first look-up table of secondary route address search, obtain described second
High address and the 3rd look-up table mark of corresponding storage;
The quadratic search unit is additionally operable to the 3rd look-up table according to the 3rd look-up table identifier lookup, obtains pair
Answer the lookup result of second search request.
With reference to the possible implementation of the first of second aspect or second aspect, in second of possible implementation
In,
The split cells is additionally operable to using the 3rd routing address as the 3rd high address, the 3rd routing address capacity
In 3rd interval, the 3rd interval is less than the first interval;
The storage unit is additionally operable to the 3rd high address being stored in the first look-up table;
The receiving unit is additionally operable to obtain the 3rd search request, and the 3rd search request includes the 3rd routing address;
Searching unit is additionally operable to according to first look-up table of secondary route address search, corresponded to described in
The lookup result of 3rd search request.
With reference to the possible implementation of the first of second aspect or second aspect, in the third possible implementation
In,
First low order address is identical with the capacity of second low order address.
In the 4th kind of possible implementation of second aspect,
The corresponding high address mark in first high address is further included in first look-up table;
Searching unit, is specifically used for:
According to the first via by the first look-up table of address search, first high address and the corresponding institute stored are obtained
State second look-up table mark and corresponding high address mark;
The quadratic search unit, is specifically used for:
Search key is formed by address according to high address mark and the first via;
The second look-up table is searched according to second look-up table mark and the search key, corresponded to described in
The lookup result of first search request.
Forwarding unit can be more than institute by splitting the first obtained high address capacity it can be seen from above-mentioned technical proposal
Half of the first via by address capability is stated, and it is relatively small to split the first obtained low order address capacity.When forwarding unit stores
During routing address after fractionation, since the low order address split out is smaller compared with the prior art, so the quantity in storage organization
The total capacity of more low order address opposite can be reduced, and thereby reduce storage of the forwarding unit when storing larger routing address
Pressure, and the quantity that forwarding unit stores larger routing address is improved, to realize the due disposal ability of forwarding unit, improve
Resource utilization ratio.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is attached drawing needed in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, without having to pay creative labor, may be used also
To obtain other attached drawings according to these attached drawings.
Fig. 1 is a kind of method flow diagram of method for searching route provided in an embodiment of the present invention;
Fig. 2 is a kind of method flow diagram of method for searching route provided in an embodiment of the present invention;
Fig. 3 splits storage schematic diagram for a kind of routing address provided in an embodiment of the present invention;
Fig. 4 is a kind of method flow diagram of method for searching route provided in an embodiment of the present invention;
Fig. 5 is a kind of structure drawing of device of device for searching route provided in an embodiment of the present invention;
Fig. 6 is a kind of hardware architecture diagram of forwarding unit provided in an embodiment of the present invention.
Embodiment
Currently used is capacity in Internet Protocol version 4 (Internet Protocol Version 4, IPv4)
For the routing address of 32bit, but with the lifting of network technology, in current forwarding unit such as on router, to great Rong
The routing address of amount has larger demand.For example the routing address in IPv6 is exactly a kind of typical large capacity routing address.Phase
Compared with IPv4, routing address capacity in ipv 6 reaches 128bit, can carry more information, but deposit for identical
Store up capacity, it is assumed that 400 IPv4 routing address can be stored, but may can only store 100 IPv6 routing address, still
100 IPv6 routing address may can not reach normal data handling requirements, thus need forwarding unit to divide bigger
Memory capacity store more IPv6 routing address, very big storage pressure brought to the forwarding unit for storing routing address
Power.
The mode of prior art storage routing address is that routing address is split into the identical two parts of size, is respectively height
Bit address and low order address, and be retained separately.Since routing address generally has the characteristics that constringent, that is, most of route
The high-order portion of address is all that identical, different part is more in low portion.Thus the storage knot for storing routing address is caused
Small number of high address and greater number of low order address are generally comprised in structure.Such as storage 400 routing address are deposited
Store up in capacity, may there was only 100 high addresses, and there are 300 low order address.During for larger routing address, use
The mode of the prior art stores routing address, and the quantity of the IPv6 routing address of same forwarding unit storage will be substantially less that storage
The quantity of IPv4 routing address, causes forwarding unit to can not achieve due disposal ability, is unable to reach the requirement of system, system
Resource utilization is relatively low.
For this reason, an embodiment of the present invention provides a kind of method for searching route and device, forwarding unit is obtained by fractionation
First high address capacity can be more than half of the first via by address capability, and split the first obtained low order address capacity
It is relatively small.When the routing address after forwarding unit storage is split, due to the low order address that splits out compared with the prior art compared with
It is small, so the total capacity of a fairly large number of low order address opposite can be reduced in storage organization, thereby reduce forwarding unit and exist
Storage pressure during larger routing address is stored, and improves the quantity that forwarding unit stores larger routing address, is turned with realizing
The due disposal ability of equipment is sent out, improves resource utilization ratio.
Further, according to the difference of routing address capacity, the embodiment of the present invention, which additionally provides, a variety of is directed to large capacity road
By the fractionation mode of address style, and the low order address that different fractionation modes are split out is respectively stored in different look-up tables
In.Which thereby enhance the memory capacity in the case of routing address type is more.
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete
Whole description, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other without making creative work
Embodiment, belongs to the scope of protection of the invention.
Embodiment one
Fig. 1 is a kind of method flow diagram of method for searching route provided in an embodiment of the present invention, including:
S101:Forwarding unit splits the first routing address, and the first high address and the first low level are obtained after fractionation
Address, first high address capacity are more than the first via by the half of address capability, first high address capacity
More than the first low order address capacity, the first via is in first interval by address capability.
For example, the fractionation to routing address is average fractionation in the prior art, such as the routing address in IPv6
There is 128bit, the high address of 64bit and the low order address of 64bit can be divided into.And in the embodiment of the present invention, from described first
The first high address capacity that routing address is split out is more than half of the first via by address capability.The route of 128bit
The high address that location is split out will be greater than (128/2) bit, that is to say, that more than 64bit.Correspondingly, low order address is also less than
64bit.While it is noted that the first via is defined to be in the first interval by address capability, for described
The restriction of one route address capability will illustrate in embodiment two, and which is not described herein again.
The capacity minimum value of the first interval should be more than the first via described in the embodiment of the present invention by address capability
Half.
S102:First low order address is stored in second look-up table by the forwarding unit, by the described first high-order ground
Location and second look-up table mark correspond to and are stored in the first look-up table, and the second look-up table is identified as the second look-up table and corresponds to
Mark.
For example, on the high-low position address that storage routing address is split out, storage rule requirement is stored separately.
It is exactly that high address is stored together, low order address is stored together.When storing the first high address, storage institute is first determined
The second look-up table mark (Table ID) of the second look-up table (Table) of the first low order address is stated, by the described first high-order ground
Location and the corresponding storage of second look-up table mark are into first look-up table.When requiring to look up first routing address
When, first high address is found out in first look-up table, while described the second of corresponding storage can be obtained and looked into
Look for table to identify, identified according to the second look-up table and determine that first low order address is stored in the second look-up table, thus
Second follow-up of lookup can be carried out in the second look-up table.
S103:The forwarding unit obtains the first search request, and first search request includes the first routing address.
For example, when searching first routing address, the forwarding unit can receive first lookup please
Ask.
S104:The forwarding unit, by the first look-up table of address search, it is high-order to obtain described first according to the first via
Address and the second look-up table mark of corresponding storage.
For example, it is quadratic search mode that the routing address used in the embodiment of the present invention, which searches mode,.It is described
Quadratic search mode can be understood as first finding the high address corresponding to routing address, be searched further according to the high address
The mode of corresponding low order address.
The forwarding unit can be identified by the second look-up table of storage corresponding with first high address, be determined
In first search request, look-up table that the corresponding low order address of first routing address is stored.
S105:Forwarding unit second look-up table according to the second look-up table identifier lookup, obtains corresponding institute
State the lookup result of the first search request.
For example, after second look-up table that first low order address is stored is determined, the embodiment of the present invention is simultaneously
Do not limit and how to be searched in the second look-up table.The lookup result can be understood as first routing address and exist
Next hop address on the forwarding unit.
Having above-described embodiment to can be seen that forwarding unit can be more than described by splitting the first obtained high address size
The first via is by the half of address size, and it is relatively small to split obtained the first low order address size.When forwarding unit storage is torn open
Point after routing address when, since the low order address split out is smaller compared with the prior art, thus in storage organization quantity compared with
The total size of more low order address opposite can be reduced, and thereby reduce storage pressure of the forwarding unit when storing larger routing address
Power, and the quantity that forwarding unit stores larger routing address is improved, to realize the due disposal ability of forwarding unit, improve
Resource utilization ratio.
Embodiment two
On the basis of embodiment corresponding to Fig. 1, Fig. 2 is a kind of side of method for searching route provided in an embodiment of the present invention
Method flow chart, including:
S201:The forwarding unit splits secondary route address, and the second high address and second are obtained after fractionation
Low order address, second high address capacity are more than the half of the secondary route address capability, second high address
Capacity is more than the second low order address capacity, and the secondary route address capability is in second interval, and the second interval is big
In the first interval.
For example, the present invention does not limit the execution sequencing of S101 in embodiment corresponding to S201 and Fig. 1, can also
It is to perform at the same time.
S202:Second low order address is stored in the 3rd look-up table by the forwarding unit, by the described second high-order ground
Location and the 3rd look-up table mark correspond to and are stored in the first look-up table, and the 3rd look-up table is identified as the 3rd look-up table and corresponds to
Mark.
S203:The forwarding unit obtains the second search request, and second search request includes secondary route address.
S204:It is high-order to obtain described second according to first look-up table of secondary route address search for the forwarding unit
Address and the 3rd look-up table mark of corresponding storage.
S205:The forwarding unit the 3rd look-up table according to the 3rd look-up table identifier lookup, obtains corresponding institute
State the lookup result of the second search request.
Searched for example, the high address for splitting out routing address in the embodiment of the present invention is stored in described first
In table, and the different sections according to residing for routing address capacity, the low order address splitted out is respectively stored in and is looked into accordingly
Look in table, the first low order address gone out for instance in the first via of the first interval by address dividing is stored in described
In two look-up tables, the second low order address that the secondary route address dividing in the second interval goes out is stored in described
Three look-up tables.
It should be noted that the first interval and the secondary route residing for the capacity of first routing address
The second interval residing for the capacity of location can be understood as distinguishing respectively the distinguishing condition of routing address type.The first via
Size of the first via by address mask can be understood as by the capacity of address.The capacity of the secondary route address can be managed
Solve the size for the secondary route address mask.Can be according at routing address mask size in the embodiment of the present invention
Section, to determine corresponding routing address type.First routing address and the secondary route address can be understood as
Different types of routing address.
By attached drawing, by exemplified by specific application scenarios to illustrating in a manner of fractionation provided in an embodiment of the present invention.Fig. 3
Storage schematic diagram is split for a kind of routing address provided in an embodiment of the present invention, drawn with three kinds of different sections shown in Fig. 3
Divide the fractionation mode carried out.Three kinds of different sections are respectively section 1, section 2 and section 3, wherein, the section 1 can be set
It is set to 65 to 81bit, the section 2 can be set as 82 to 111bit, and the section 3 can be set as 112 to 142bit.
If the capacity that the forwarding unit obtains routing address 1 is 75bit, determine to fall into the section 1, to routing address
1 is split, and high address 1 and low order address 1 are obtained after fractionation.The capacity of the high address 1 can be the section 1
Minimum value 65bit, the capacity of low order address 1 can be the difference that 75bit subtracts 65bit:10bit.It is described low in order to be managed collectively
The capacity of bit address 1 can also be fixed as 30bit, wherein carrying the 10bit low order address that the routing address 1 is split out.Institute
State forwarding unit and the mark of the high address 1 and look-up table 2 is corresponded into storage into look-up table 1, the low order address 1 is deposited
Store up in look-up table 2.
If the capacity that the forwarding unit obtains routing address 2 is 108bit, determine to fall into the section 2, to route ground
Location 2 is split, and high address 2 and low order address 2 are obtained after fractionation.The capacity of the high address 2 can be the section 2
Minimum value 82bit, the capacity of the low order address 2 can be the difference that 108bit subtract 82bit:23bit.In order to uniformly manage
Reason, the capacity of the low order address 2 can also be fixed as 30bit, wherein it is low to carry the 23bit that the routing address 2 is split out
Bit address.The mark of the high address 2 and look-up table 3 is corresponded to storage into look-up table 1 by the forwarding unit, will be described low
Bit address 2 is stored in look-up table 3.
If the capacity that the forwarding unit obtains routing address 3 is 131bit, determine to fall into the section 3, to route ground
Location 3 is split, and high address 3 and low order address 3 are obtained after fractionation.The capacity of the high address 3 can be the section 3
Minimum value 112bit, the capacity of the low order address 3 can be the difference that 131bit subtract 112bit:19bit.In order to uniformly manage
Reason, the capacity of the low order address 3 can also be fixed as 30bit, wherein it is low to carry the 19bit that the routing address 3 is split out
Bit address.The mark of the high address 3 and look-up table 4 is corresponded to storage into look-up table 1 by the forwarding unit, will be described low
Bit address 3 is stored in look-up table 4.It is also to be noted that the maximum 142bit in the section 3 can be understood as at present often
The maximum 128bit of routing address adds Virtual Private Network (the Virtual Private of corresponding 14bit in IPv6
Network, VPN) capacity.
When the forwarding unit carries out route querying, if search request includes routing address 2, when searching first time
The mark of the look-up table 3 of the corresponding high address 2 of the routing address 2 and corresponding storage is found in the look-up table 1, by
This determines that the low order address of the routing address 2 to be found is stored in look-up table 3, passes through the in the look-up table 3
Quadratic search obtains lookup result, that is, next hop address of the routing address 2 on the forwarding unit.
It is also to be noted that when the routing address capacity for needing to store is smaller, it can not be split, and it is straight
Connect and be stored in the look-up table for storing high address.
Optionally, on the basis of embodiment corresponding to Fig. 1 or Fig. 2, Fig. 4 is a kind of route provided in an embodiment of the present invention
The method flow diagram of lookup method, including:
S401:The forwarding unit is using the 3rd routing address as the 3rd high address, the 3rd routing address capacity
In 3rd interval, the 3rd interval is less than the first interval.
S402:3rd high address is stored in the first look-up table by the forwarding unit.
S403:The forwarding unit obtains the 3rd search request, and the 3rd search request includes the 3rd routing address.
S404:The forwarding unit obtains the corresponding described 3rd according to first look-up table of secondary route address search
The lookup result of search request.
For example, when the forwarding unit searches three routing address, search for the first time in the first look-up table
In when finding three high address, can determine whether to search by judging the value of high-order flag (hpart flag)
Finish.Such as under some concrete application scenes, when the value of the high-order flag is 0, it can be understood as complete to search,
When the value of the high-order flag is 1, it can be understood as do not complete also and search, the forwarding unit can be according to the lookup of acquisition
Table mark is come the specific look-up table to be searched when determining to search for second.When searching three routing address, described turn
The value for the high-order flag that hair equipment obtains after being searched in first time can be 0, and the forwarding unit determines that lookup finishes, and obtains
To the lookup result of correspondence the 3rd search request.In embodiment and the embodiment as corresponding to Fig. 2 as corresponding to Fig. 1, institute
Forwarding unit is stated during the first routing address and secondary route address is searched, the high position obtained after searching for the first time
The value of flag all can be 1.
3rd routing address can be understood as and first routing address and secondary route address inhomogeneity
The routing address of type.
Capacity for the low order address split out, it is in embodiments of the present invention, optionally, described for the ease of management
First low order address is identical with the capacity of second low order address.For example, difference is respectively in the embodiment as corresponding to Fig. 3
The low order address 1, low order address 2 and the low order address that routing address 1, routing address 2 and the routing address 3 in section are split out
3 can be 30bit.
As it can be seen that an embodiment of the present invention provides a variety of fractionation modes for large capacity routing address type, and by difference
The low order address that fractionation mode is split out is respectively stored in different look-up tables.Which thereby enhance more in routing address type
In the case of memory capacity.
Next the concrete mode of quadratic search is described, the forwarding unit is deposited by first high address
When storing up in first look-up table, in addition to storing corresponding second look-up table mark, a corresponding high position can also be stored
Address identifies (hpart ID), when the forwarding unit searches first routing address according to the first search request, the
The high address obtained in being searched during quadratic search using first time is identified to carry out second of lookup.
Optionally, on the basis of the embodiment as corresponding to Fig. 1, it is high-order that described first is further included in first look-up table
The corresponding high address mark in address.
The forwarding unit according to the first via by the first look-up table of address search, obtain first high address and
The second look-up table mark of corresponding storage, specifically includes:
The forwarding unit according to the first via by the first look-up table of address search, obtain first high address and
The second look-up table mark and corresponding high address mark of corresponding storage;
Forwarding unit second look-up table according to the second look-up table identifier lookup, obtains corresponding described first
The lookup result of search request, specifically includes:
The forwarding unit forms search key according to high address mark and the first via by address
(key)。
For example, here form search key concrete mode can be by the high address mark and it is described
The first LAP Lower Address Part composition in first routing address is used for second of search key searched.
The forwarding unit searches the second look-up table according to second look-up table mark and the search key,
Obtain corresponding to the lookup result of first search request.
Embodiment three
Fig. 5 is a kind of structure drawing of device of device for searching route provided in an embodiment of the present invention, the device for searching route
500 include:
Split cells 501, for being split to the first routing address, obtains the first high address and first low after fractionation
Bit address, first high address capacity are more than half of the first via by address capability, and first high address holds
Amount is more than the first low order address capacity, and the first via is in first interval by address capability.
For example, the fractionation to routing address is average fractionation in the prior art, such as the routing address in IPv6
There is 128bit, the high address of 64bit and the low order address of 64bit can be divided into.And in the embodiment of the present invention, from described first
The first high address capacity that routing address is split out is more than half of the first via by address capability.The route of 128bit
The high address that location is split out will be greater than 64bit.Correspondingly, low order address is also less than 64bit.While it is noted that
The first via is defined to be in the first interval by address capability, will be by limiting for address capability for the first via
Illustrated in embodiment two, which is not described herein again.
The capacity minimum value of the first interval should be more than the first via described in the embodiment of the present invention by address capability
Half.
Storage unit 502, for first low order address to be stored in second look-up table, by first high address
Corresponding with second look-up table mark to be stored in the first look-up table, it is corresponding that the second look-up table is identified as the second look-up table
Mark.
For example, on the high-low position address that storage routing address is split out, storage rule requirement is stored separately.
It is exactly that high address is stored together, low order address is stored together.When storing the first high address, storage institute is first determined
The second look-up table mark of the second look-up table of the first low order address is stated, by first high address and the second look-up table
The corresponding storage of mark is into first look-up table.When requiring to look up first routing address, in first look-up table
In find out first high address, while the second look-up table mark of corresponding storage can be obtained, according to described the
Two look-up tables mark determines that first low order address is stored in the second look-up table, it is possible thereby in the second look-up table
It is middle to carry out second follow-up of lookup.
Receiving unit 503, for obtaining the first search request, first search request includes the first routing address.
For example, when searching first routing address, the receiving unit 503 can receive described first and search
Request.
Searching unit 504, for, by the first look-up table of address search, it is high to obtain described first according to the first via
Bit address and the second look-up table mark of corresponding storage.
For example, it is quadratic search mode that the routing address used in the embodiment of the present invention, which searches mode,.It is described
Quadratic search mode can be understood as first finding the high address corresponding to routing address, be searched further according to the high address
The mode of corresponding low order address.
Searching unit 504 can pass through the second look-up table mark of storage corresponding with first high address
Know, determine in first search request, the look-up table that the corresponding low order address of first routing address is stored.
Quadratic search unit 505, for the second look-up table according to the second look-up table identifier lookup, is corresponded to
The lookup result of first search request.
For example, after second look-up table that first low order address is stored is determined, the embodiment of the present invention is simultaneously
Do not limit and how to be searched in the second look-up table.The lookup result can be understood as first routing address and exist
Next hop address on the forwarding unit.
Having above-described embodiment to can be seen that forwarding unit can be more than described by splitting the first obtained high address size
The first via is by the half of address size, and it is relatively small to split obtained the first low order address size.When forwarding unit storage is torn open
Point after routing address when, since the low order address split out is smaller compared with the prior art, thus in storage organization quantity compared with
The total size of more low order address opposite can be reduced, and thereby reduce storage pressure of the forwarding unit when storing larger routing address
Power, and the quantity that forwarding unit stores larger routing address is improved, to realize the due disposal ability of forwarding unit, improve
Resource utilization ratio.
Example IV
The split cells 501 is additionally operable to split secondary route address, obtained after fractionation the second high address and
Second low order address, second high address capacity are more than the half of the secondary route address capability, and described second is high-order
Address capability is more than the second low order address capacity, and the secondary route address capability is in second interval, secondth area
Between be more than the first interval.
For example, the present invention does not limit the split cells 501 and splits first routing address and second tunnel
By address order or split at the same time.
The storage unit 502 is additionally operable to second low order address being stored in the 3rd look-up table, high by described second
Bit address and the 3rd look-up table mark correspondence are stored in the first look-up table, and the 3rd look-up table is identified as the 3rd look-up table
Corresponding mark.
The receiving unit 503 is additionally operable to obtain the second search request, and second search request is with including secondary route
Location.
Searching unit 504 is additionally operable to according to first look-up table of secondary route address search, described in acquisition
Second high address and the 3rd look-up table mark of corresponding storage.
The quadratic search unit 505 is additionally operable to the 3rd look-up table according to the 3rd look-up table identifier lookup, obtains
To the lookup result of correspondence second search request.
Searched for example, the high address for splitting out routing address in the embodiment of the present invention is stored in described first
In table, and the different sections according to residing for routing address capacity, the low order address splitted out is respectively stored in and is looked into accordingly
Look in table, the first low order address gone out for instance in the first via of the first interval by address dividing is stored in described
In two look-up tables, the second low order address that the secondary route address dividing in the second interval goes out is stored in described
Three look-up tables.
It should be noted that the first interval and the secondary route residing for the capacity of first routing address
The second interval residing for the capacity of location can be understood as distinguishing respectively the distinguishing condition of routing address type.The first via
Size of the first via by address mask can be understood as by the capacity of address.The capacity of the secondary route address can be managed
Solve the size for the secondary route address mask.Can be according at routing address mask size in the embodiment of the present invention
Section, to determine corresponding routing address type.First routing address and the secondary route address can be understood as
Different types of routing address.
It is also to be noted that when the routing address capacity for needing to store is smaller, the split cells 501 can not be right
It is split, and the storage unit 502 is stored directly in the look-up table for storing high address.Optionally:
The split cells 501 is additionally operable to using the 3rd routing address as the 3rd high address, the 3rd routing address
Capacity is in 3rd interval, and the 3rd interval is less than the first interval.
The storage unit 502 is additionally operable to the 3rd high address being stored in the first look-up table.
The receiving unit 503 is additionally operable to obtain the 3rd search request, and the 3rd search request includes the 3rd route ground
Location.
Searching unit 504 is additionally operable to, according to first look-up table of secondary route address search, be corresponded to
The lookup result of 3rd search request.
For example, when a searching unit 504 searches three routing address, looked into the first look-up table
When finding three high address, it can determine whether to have searched by judging the value of high-order flag (hpart flag)
Finish.Such as under some concrete application scenes, when the value of the high-order flag is 0, it can be understood as complete to search, when
When the value of the high position flag is 1, it can be understood as do not complete also and search, the quadratic search unit 505 can be according to acquisition
Look-up table mark come determine for the second time lookup when the specific look-up table to be searched.When searching three routing address,
The value for the high-order flag that searching unit 504 obtains after being searched in first time can be 0, determine that lookup finishes,
Obtain corresponding to the lookup result of the 3rd search request.In embodiment and the embodiment as corresponding to Fig. 2 as corresponding to Fig. 1,
Searching unit 504 obtains during the first routing address and secondary route address is searched after searching for the first time
The value of the high-order flag all can be 1.
3rd routing address can be understood as and first routing address and secondary route address inhomogeneity
The routing address of type.
Capacity for the low order address split out, it is in embodiments of the present invention, optionally, described for the ease of management
First low order address is identical with the capacity of second low order address.For example, difference is respectively in the embodiment as corresponding to Fig. 3
The low order address 1, low order address 2 and the low order address that routing address 1, routing address 2 and the routing address 3 in section are split out
3 can be 30bit.
As it can be seen that an embodiment of the present invention provides a variety of fractionation modes for large capacity routing address type, and by difference
The low order address that fractionation mode is split out is respectively stored in different look-up tables.Which thereby enhance more in routing address type
In the case of memory capacity.
Next the concrete mode of quadratic search is described, the storage unit 502 is by described first high position
When location storage is into first look-up table, in addition to storing corresponding second look-up table mark, it can also store corresponding
High address identifies, described when a searching unit 504 searches first routing address according to the first search request
The high address that quadratic search unit 505 is obtained in being searched when searching for second using first time is identified to carry out second
Secondary lookup.
Optionally, the corresponding high address mark in first high address is further included in first look-up table.
Searching unit 504, is specifically used for:
According to the first via by the first look-up table of address search, first high address and the corresponding institute stored are obtained
State second look-up table mark and corresponding high address mark;
The quadratic search unit 505, is specifically used for:
Search key is formed by address according to high address mark and the first via;
The second look-up table is searched according to second look-up table mark and the search key, corresponded to described in
The lookup result of first search request.
For example, here form search key concrete mode can be by the high address mark and it is described
The first LAP Lower Address Part composition in first routing address is used for second of search key searched.
The quadratic search unit 505 searches described second according to second look-up table mark and the search key
Look-up table, obtains corresponding to the lookup result of first search request.
Embodiment five
Refering to Fig. 6, Fig. 6 is a kind of hardware architecture diagram of forwarding unit provided in an embodiment of the present invention, the forwarding
Equipment 600 includes memory 601 and receiver 602, and be connected respectively with the memory 601 and the receiver 602
Processor 603, the memory 601 are used to store batch processing instruction, and the processor 603 is used to call the memory
The programmed instruction of 601 storages performs following operation:
Turn to split the first routing address, obtain the first high address and the first low order address after fractionation, described the
One high address capacity is more than half of the first via by address capability, and first high address capacity is more than described first
Low order address capacity, the first via are in first interval by address capability;
First low order address is stored in second look-up table, first high address and second look-up table are identified
Correspondence is stored in the first look-up table, and the second look-up table is identified as the corresponding mark of the second look-up table;
Trigger the receiver 602 and obtain the first search request, first search request includes the first routing address;
According to the first via by the first look-up table of address search, first high address and the corresponding institute stored are obtained
State second look-up table mark;
According to second look-up table described in the second look-up table identifier lookup, obtain corresponding to looking into for first search request
Look for result.
Alternatively, the processor 603 can be central processing unit (Central Processing Unit, CPU), institute
State the internal storage that memory 601 can be random access memory (Random Access Memory, RAM) type, institute
General Physics interface can be included by stating receiver 602, and the physical interface can be ether (Ethernet) interface or asynchronous biography
Defeated pattern (Asynchronous Transfer Mode, ATM) interface.The processor 603, receiver 602 and memory 601
One or more independent circuits or hardware can be integrated into, such as:Application-specific integrated circuit (Application Specific
Integrated Circuit, ASIC).
The first routing address for being mentioned in the embodiment of the present invention, the first high address, the first low order address, first interval and
" first " of first look-up table is used only to do name mark, does not represent first sequentially.The rule is equally applicable to "
Two ", " the 3rd ".
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through
The relevant hardware of programmed instruction is completed, and foregoing routine can be stored in a computer read/write memory medium, which exists
During execution, execution the step of including above method embodiment;And foregoing storage medium can be in following media at least one
Kind:Read-only storage (Read-Only Memory, ROM), RAM, magnetic disc or CD etc. are various can be with store program codes
Medium.
It should be noted that each embodiment in this specification is described by the way of progressive, each embodiment it
Between identical similar part mutually referring to what each embodiment stressed is the difference with other embodiment.
For equipment and system embodiment, since it is substantially similar to embodiment of the method, so describe fairly simple,
The relevent part can refer to the partial explaination of embodiments of method.Equipment and system embodiment described above is only schematic
, wherein may or may not be as the unit that separating component illustrates physically separate, shown as unit
Component may or may not be physical location, you can with positioned at a place, or can also be distributed to multiple networks
On unit.Some or all of module therein can be selected to realize the purpose of this embodiment scheme according to the actual needs.
Those of ordinary skill in the art are without creative efforts, you can to understand and implement.
The above is only the preferred embodiment of the present invention, is not intended to limit the scope of the present invention.It should refer to
Go out, for those skilled in the art, without departing from the principle of the present invention, can also make some
Improvements and modifications, these improvements and modifications also should be regarded as protection scope of the present invention.