CN104009922A - IPV4/IPV6 routing capacity sharing method based on TCAM - Google Patents

IPV4/IPV6 routing capacity sharing method based on TCAM Download PDF

Info

Publication number
CN104009922A
CN104009922A CN201410195141.3A CN201410195141A CN104009922A CN 104009922 A CN104009922 A CN 104009922A CN 201410195141 A CN201410195141 A CN 201410195141A CN 104009922 A CN104009922 A CN 104009922A
Authority
CN
China
Prior art keywords
route
ipv6
ipv4
tcam
leading portion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410195141.3A
Other languages
Chinese (zh)
Other versions
CN104009922B (en
Inventor
袁炳根
徐剑辉
董晶晶
饶冀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication 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 Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN201410195141.3A priority Critical patent/CN104009922B/en
Publication of CN104009922A publication Critical patent/CN104009922A/en
Application granted granted Critical
Publication of CN104009922B publication Critical patent/CN104009922B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to an IPV4/IPV6 routing capacity sharing method based on a TCAM and relates to the technology of TCAMs. The method includes the steps that a TCAM hardware table is divided into a front section area and a rear section area; a single IPV6 routing prefix is divided into an IPV6 front half part and an IPV6 rear half part; for IPV4 routing, matching of the front section area is carried out, and matching of the rear section area is carried out if matching of the front section area fails; for IPV6 routing, matching between the IPV6 front half part and the front section area is carried out firstly, and if matching between the PV6 front half part and the front section area succeeds, matching between the IPV6 rear half part and the rear section area is carried out continuously. By the IPV4/IPV6 routing capacity sharing method, items of the hardware table in IPV4 routing and IPV6 routing can be allocated dynamically and flexibly, it is unnecessary to make different software versions for two routers, the specification index of the routers is increased, and requirements of more routers are met.

Description

IPV4/IPV6 routing capacity based on TCAM is shared method
Technical field
The present invention relates to three-state content addressing memory technology, is specifically that a kind of IPV4/IPV6 routing capacity based on TCAM is shared method.
Background technology
Along with the development of modern network, the universal use of VPN (Virtual Private Network, VPN (virtual private network)) technology, modern high performance router proposes higher requirement to the number of routes of supporting.Simultaneously, along with developing rapidly of the Internet, the limited address space of original IPV4 network protocol defining exhausts, the deficiency of address space will hinder further developing of the Internet, support IPV6 agreement to solve the problem of network address resources quantity, also for the equipment except computer is connected into the Internet, cleared away obstacle in restricted number, network supports IPV6 agreement to become inevitable trend comprehensively simultaneously.
Therefore, current router, when requiring a large amount of IPV4 routing capacity of compatible support, also requires to support a large amount of IPV6 number of routes; But both are generally the relations of competition hardware, if meet more IPV4 number of routes, can only meet less IPV6 number of routes, and vice versa.Explosive increase with respect to route need, router supports the hardware advances speed of matched routings but relatively to lag behind, and price is high all the time, therefore this has caused the relatively rare of hardware resource, how better to utilize the hardware resource of router to meet routing forwarding very valuable.
As previously mentioned, IPV4 number of routes and the IPV6 number of routes of modern router generally all form hardware competitive relation, both shared use TCAM (Ternary Content Addressable Memory, three-state content addressing memory) hardware are natural ways so.But traditional way is that TCAM is divided into two clear and definite pieces, be respectively used to storing IP V4 and IPV6 route content.Due to the characteristic of hardware, the size of these two pieces must be determined in advance, can not dynamically adjust, and so just makes the route of IPV4 and IPV6 mix underaction in dividing of number.An extreme example is, certain a router requires at least to support the IPV4 route that total entry capacity is 512K, and only needs the IPV6 route of supporting that total entry capacity is 40K; Other a router requires the IPV6 route of at least supporting that total entry capacity is 256K, and only needs the IPV4 route of supporting that total entry capacity is 80K.Just need to customize different software versions to two router in this case, bring very large problem to the management of product version.
Summary of the invention
For the defect existing in prior art, the object of the present invention is to provide a kind of IPV4/IPV6 routing capacity based on TCAM to share method, the dynamic flexible of realizing hardware table item in IPV4/IPV6 route distributes, without two router is customized to different software versions, improve route specification index, met the more demand of multi-router.
For reaching above object, the technical scheme that the present invention takes is: a kind of IPV4/IPV6 routing capacity based on TCAM is shared method, comprise: TCAM hardware list is divided into leading portion region and back segment region, each region is used 80bit as the matching field of route, and wall scroll IPV6 route prefix is decomposed into IPV6 first half and IPV6 latter half; For IPV4 route, first mate described leading portion region, if do not match, continue coupling back segment region; Described leading portion region and back segment region be the 32bit IP value, route forwarding table and the route-type at route place of a Match IP V4 route all; For IPV6 route, first Match IP V6 first half, to described leading portion region, if match, continues Match IP V6 latter half to described back segment region; The front 67bit IP value of described leading portion Region Matching IPV6 route, route forwarding table and the route-type at route place; The id field of returning after rear 61bit IP value, route-type and the leading portion area stores of described back segment Region Matching IPV6 route, described id field is for indicating IPV6 first half at the storage ID of program internal maintenance.
On the basis of technique scheme, in the matching field of described 80bit route, comprise that is distinguished a field, for distinguishing the route-type of hardware list list item coupling.
On the basis of technique scheme, if described differentiation field value is 1, this list item is for Match IP V6 route; If described differentiation field value is 0, this list item is for Match IP V4 route.
On the basis of technique scheme, when described bag handling process is received IPV4 message or IPV6 message, before entering matched routings, need to be by the IP address extraction in the route forwarding table at this route place and message out, and distinguish field with variable save.
On the basis of technique scheme, in described route prefix, for each route mask-length is redistributed new inside mask-length, it is 95~162bit that the mask of IPV6 first half distributes interval; It is 62~94bit that the mask of IPV4 distributes interval; It is 0~61bit that the mask of IPV6 latter half distributes interval.
On the basis of technique scheme, for IPV4 route, first with the 32bit IP value of route and the route forwarding table at route place, mate the leading portion region of hardware list, if list item is not mated in leading portion region, enter the back segment Region Matching of hardware list, if all do not mate list item, discarding traffic bag; If on leading portion region or back segment Region Matching, enter follow-up repeating process.
On the basis of technique scheme, for IPV6 route, first with the front 67bit IP value of route and the route forwarding table at route place, mate the leading portion region of hardware list, if leading portion region has coupling list item, obtain id field, route forwarding table coupling back segment region with rear 61bit IP value and route place, if the match is successful, enters follow-up repeating process.
On the basis of technique scheme, if described leading portion region does not have the coupling list item of IPV6 first half, or back segment region does not have the coupling list item of IPV6 latter half, discarding traffic bag.
Beneficial effect of the present invention is: according to the basic principle of matched routings, efficient processing business repeating process, that system can be adjusted IPV4/IPV6 number of routes more flexibly, having realized IPV4 route dynamically shares and takies TCAM hardware resource by 2:1 IPV6 route, give full play to the level of resources utilization, the IPV6 route specification index that has significantly improved router, has met more router applications scene.
Accompanying drawing explanation
Fig. 1 is the route processing flow chart that the present invention forwards IPV4 business;
Fig. 2 is the route processing flow chart that the present invention forwards IPV6 business.
Embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.
The IPV4/IPV6 routing capacity that the present invention is based on TCAM is shared method, comprising:
TCAM hardware list is divided into leading portion region (part_hi) and back segment region (part_lo) manages, each region is used 80bit as the matching field of route.Matching way to traditional IPV4 and IPV6 route is made improvement, in hardware setting, add IPV4 and IPV6 Route Distinguisher, in the matching field of described 80bit route, comprise that is distinguished a field (v6_flag), be specifically designed to the route-type of distinguishing list item coupling in hardware list, if distinguishing field value is 1, this list item is for Match IP V6 route; If described differentiation field value is 0, this list item is for Match IP V4 route.
Wall scroll IPV6 route prefix is decomposed into IPV6 first half (ipv6_hi) and IPV6 latter half (ipv6_lo), is stored in respectively in described leading portion region (part_hi) and back segment region (part_lo); Meanwhile, these two regions for IPV4 route to search and mate be equivalent.Part_hi and part_lo are as broad as long when for Match IP V4 route, all only mate the 32bit IP value of route, the VRF at route place (Virtual Routing Forwarding, route forwarding table) and route-type.When part_hi is used for Match IP V6, the front 67bit IP value of Match IP V6 route, VRF and the route-type at route place; In result after coupling, can return to an id field (ipv6_idx), for indicating the ipv6_hi of IPV6 route when the storage ID of program internal maintenance (figure place of this ID has determined the maximum IPV6 entry number that can support) part_lo is used for Match IP V6, the rear 61bit IP value of Match IP V6 route, ipv6_idx value and the route-type that first half section is returned.
Depositing in design of route prefix, for each route mask-length is redistributed new inside mask-length, the arrangement for inner route in hardware list memory location, to realize the matched routings primitive rule of long code mask coupling.Basic allocation rule is set to:
It is 95~162bit that the mask of IPV6 first half distributes interval;
It is 62~94bit that the mask of IPV4 distributes interval;
It is 0~61bit that the mask of IPV6 latter half distributes interval.
Owing to doing the router of matched routings based on TCAM, the matching order that must guarantee route is strictly followed long code mask matched rule, so in the situation that not revising the original routing configuration algorithm of router, utilize new route mask allocation rule, program can be adjusted route dynamically in the position of hardware store, and the matching order of strict guarantee route is as follows:
(1) for the coupling of IPV4 route, maintenance and original route arrangement are constant.
(2) for the coupling of IPV6 route, can guarantee that ipv6_hi is arranged in the part_hi of TCAM, ipv6_lo is partly arranged in the ipv6_lo of TCAM, meets and first mates ipv6_hi part, then mate the matched rule of ipv6_lo part.
As shown in Figure 1, when service message is an IPV4 message, by carrying out following service message coupling and forwarding, the normal repeating process of the business that realized, concrete steps are as follows:
S101. when an IPV4 message is received in the identification of bag handling process, enter before matched routings, IP address in the VRF at route place and message (32bit IP value) need to be extracted, and distinguish field (v6_flag) with variable save, be that set is 0, and the keyword using these three values as IPV4 matched routings.
S102. the part_hi that the keyword of IPV4 route is sent into hardware list mates.
S103. judge in part_hi whether have coupling list item, if had, enter S104; If no, enter S105.
S104.IPV4 matched routings finishes, and carries out normal business forwarding, and finishes this flow process.
S105. the part_lo that the keyword of IPV4 route is sent into hardware list mates.
S106. judge in part_lo whether have coupling list item, if had, proceed to S104; If no, enter S107.
S107. business packet is done to discard processing, and finish this flow process.
As shown in Figure 2, when service message is an IPV6 message, by carrying out following service message coupling and forwarding, realized the normal process forwarding of business, concrete steps are as follows:
S201. when an IPV6 message is received in the identification of bag handling process, enter before matched routings, first 67 of the VRF at route place and message IP address (front 67bit IP values) need to be extracted, and distinguish field (v6_flag) with inner variable save, be that set is 1, the keyword using these three value combinations as ipv6_hi coupling.
S202. the part_hi that the keyword of ipv6_hi coupling is sent into hardware list mates.
S203. judge the list item that whether matches IPV6 route in part_hi, if not, enter S204; If so, enter S205.
S204. in whole hardware list, there is no the IPV6 route that can match, business packet is done to discard processing, and finish this flow process.
S205. access corresponding SRAM (Static RAM, static random access memory), obtain ipv6_idx value, for follow-up matching process.
S206. latter 61 of ipv6_idx value and message IP address (rear 61bit IP values) are extracted, and distinguish field (v6_flag) with variable save, i.e. set is 1, the keyword using these three value combinations as ipv6_lo coupling.
S207. the ipv6_lo that the keyword of ipv6_lo coupling is sent into hardware list mates.
S208. judge the list item that whether matches ipv6_lo route in part_lo, if not, enter S204; If so, enter S209.
S209. carry out normal business forwarding, and finish this flow process.
Because the embodiment of the present invention is after completing routing configuration, coupling business is completed by hardware completely, with respect to original operation flow, have more business matching process one time, but because whole coupling flow process can complete within a forwarding cycle, therefore do not affect the forwarding performance of router completely.
The present invention is not limited to above-mentioned execution mode, for those skilled in the art, under the premise without departing from the principles of the invention, can also make some improvements and modifications, within these improvements and modifications are also considered as protection scope of the present invention.The content not being described in detail in this specification belongs to the known prior art of professional and technical personnel in the field.

Claims (8)

1. the IPV4/IPV6 routing capacity based on TCAM is shared a method, it is characterized in that, comprising:
TCAM hardware list is divided into leading portion region and back segment region, and each region is used 80bit as the matching field of route, and wall scroll IPV6 route prefix is decomposed into IPV6 first half and IPV6 latter half;
For IPV4 route, first mate described leading portion region, if do not match, continue coupling back segment region; Described leading portion region and back segment region be the 32bit IP value, route forwarding table and the route-type at route place of a Match IP V4 route all;
For IPV6 route, first Match IP V6 first half, to described leading portion region, if match, continues Match IP V6 latter half to described back segment region; The front 67bit IP value of described leading portion Region Matching IPV6 route, route forwarding table and the route-type at route place; The id field of returning after rear 61bit IP value, route-type and the leading portion area stores of described back segment Region Matching IPV6 route, described id field is for indicating IPV6 first half at the storage ID of program internal maintenance.
2. the IPV4/IPV6 routing capacity based on TCAM as claimed in claim 1 is shared method, it is characterized in that: in the matching field of described 80bit route, comprise that is distinguished a field, for distinguishing the route-type of hardware list list item coupling.
3. the IPV4/IPV6 routing capacity based on TCAM as claimed in claim 2 is shared method, it is characterized in that: if described differentiation field value is 1, this list item is for Match IP V6 route; If described differentiation field value is 0, this list item is for Match IP V4 route.
4. the IPV4/IPV6 routing capacity based on TCAM as claimed in claim 2 is shared method, it is characterized in that: when described bag handling process is received IPV4 message or IPV6 message, before entering matched routings, need to be by the IP address extraction in the route forwarding table at this route place and message out, and distinguish field with variable save.
5. the IPV4/IPV6 routing capacity based on TCAM as claimed in claim 1 is shared method, it is characterized in that: in described route prefix, for each route mask-length is redistributed new inside mask-length, it is 95~162bit that the mask of IPV6 first half distributes interval; It is 62~94bit that the mask of IPV4 distributes interval; It is 0~61bit that the mask of IPV6 latter half distributes interval.
6. the IPV4/IPV6 routing capacity based on TCAM as claimed in claim 1 is shared method, it is characterized in that: for IPV4 route, first with the 32bit IP value of route and the route forwarding table at route place, mate the leading portion region of hardware list, if list item is not mated in leading portion region, enter the back segment Region Matching of hardware list, if all do not mate list item, discarding traffic bag; If on leading portion region or back segment Region Matching, enter follow-up repeating process.
7. the IPV4/IPV6 routing capacity based on TCAM as claimed in claim 1 is shared method, it is characterized in that: for IPV6 route, first with the front 67bit IP value of route and the route forwarding table at route place, mate the leading portion region of hardware list, if leading portion region has coupling list item, obtain id field, route forwarding table coupling back segment region with rear 61bit IP value and route place, if the match is successful, enters follow-up repeating process.
8. the IPV4/IPV6 routing capacity based on TCAM as described in claim 1 or 7 is shared method, it is characterized in that: if described leading portion region does not have the coupling list item of IPV6 first half, or back segment region does not have the coupling list item of IPV6 latter half, discarding traffic bag.
CN201410195141.3A 2014-05-09 2014-05-09 IPV4/IPV6 routing capacity sharing methods based on TCAM Active CN104009922B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410195141.3A CN104009922B (en) 2014-05-09 2014-05-09 IPV4/IPV6 routing capacity sharing methods based on TCAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410195141.3A CN104009922B (en) 2014-05-09 2014-05-09 IPV4/IPV6 routing capacity sharing methods based on TCAM

Publications (2)

Publication Number Publication Date
CN104009922A true CN104009922A (en) 2014-08-27
CN104009922B CN104009922B (en) 2017-03-15

Family

ID=51370417

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410195141.3A Active CN104009922B (en) 2014-05-09 2014-05-09 IPV4/IPV6 routing capacity sharing methods based on TCAM

Country Status (1)

Country Link
CN (1) CN104009922B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104639448A (en) * 2014-12-18 2015-05-20 北京北方烽火科技有限公司 Method and system for forwarding base stations in LTE-A (Long Term Evolution-Advanced) system
WO2016090848A1 (en) * 2014-12-11 2016-06-16 中兴通讯股份有限公司 Method and device for managing table space of ternary content addressable memory
CN107896193A (en) * 2017-12-29 2018-04-10 湖南恒茂高科股份有限公司 A kind of creation method, lookup method and the look-up table of the look-up table of interchanger

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050195812A1 (en) * 2004-03-05 2005-09-08 Samsung Electronics Co., Ltd. Apparatus and method for performing forwarding table searches using consecutive symbols tables
CN101039252A (en) * 2006-03-15 2007-09-19 中兴通讯股份有限公司 Method for managing route table of ternary content addressable memory
US7571156B1 (en) * 2003-03-28 2009-08-04 Netlogic Microsystems, Inc. Network device, storage medium and methods for incrementally updating a forwarding database
CN101582851A (en) * 2009-06-12 2009-11-18 中兴通讯股份有限公司 Method and system for realizing sharing route capacity on dual-stacker router
US20100023727A1 (en) * 2008-07-24 2010-01-28 Ewha University-Industry Collaboration Foundation Ip address lookup method and apparatus by using bloom filter and multi-hashing architecture
US8059658B1 (en) * 2005-12-23 2011-11-15 Extreme Networks, Inc. Method and system for automatic expansion and contraction of IP host forwarding database
CN102291296A (en) * 2011-08-04 2011-12-21 中兴通讯股份有限公司 Updating method and system of routing table

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7571156B1 (en) * 2003-03-28 2009-08-04 Netlogic Microsystems, Inc. Network device, storage medium and methods for incrementally updating a forwarding database
US20050195812A1 (en) * 2004-03-05 2005-09-08 Samsung Electronics Co., Ltd. Apparatus and method for performing forwarding table searches using consecutive symbols tables
US8059658B1 (en) * 2005-12-23 2011-11-15 Extreme Networks, Inc. Method and system for automatic expansion and contraction of IP host forwarding database
CN101039252A (en) * 2006-03-15 2007-09-19 中兴通讯股份有限公司 Method for managing route table of ternary content addressable memory
US20100023727A1 (en) * 2008-07-24 2010-01-28 Ewha University-Industry Collaboration Foundation Ip address lookup method and apparatus by using bloom filter and multi-hashing architecture
CN101582851A (en) * 2009-06-12 2009-11-18 中兴通讯股份有限公司 Method and system for realizing sharing route capacity on dual-stacker router
CN102291296A (en) * 2011-08-04 2011-12-21 中兴通讯股份有限公司 Updating method and system of routing table

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016090848A1 (en) * 2014-12-11 2016-06-16 中兴通讯股份有限公司 Method and device for managing table space of ternary content addressable memory
CN104639448A (en) * 2014-12-18 2015-05-20 北京北方烽火科技有限公司 Method and system for forwarding base stations in LTE-A (Long Term Evolution-Advanced) system
CN107896193A (en) * 2017-12-29 2018-04-10 湖南恒茂高科股份有限公司 A kind of creation method, lookup method and the look-up table of the look-up table of interchanger
CN107896193B (en) * 2017-12-29 2020-10-16 湖南恒茂高科股份有限公司 Switch, and creation method and search method of lookup table of switch

Also Published As

Publication number Publication date
CN104009922B (en) 2017-03-15

Similar Documents

Publication Publication Date Title
US11102120B2 (en) Storing keys with variable sizes in a multi-bank database
US10496680B2 (en) High-performance bloom filter array
US10021026B2 (en) Incremental update of a shape graph
CN106713144B (en) Reading and writing method of message outlet information and forwarding engine
CN109639579B (en) Multicast message processing method and device, storage medium and processor
US10798000B2 (en) Method and apparatus of compressing network forwarding entry information
US11362948B2 (en) Exact match and ternary content addressable memory (TCAM) hybrid lookup for network device
CN107645431B (en) Message forwarding method and device
US10313154B2 (en) Packet forwarding
US11762826B2 (en) Search apparatus, search method, program and recording medium
US9960995B2 (en) Packet forwarding using a physical unit and a virtual forwarding unit
CN109714274B (en) Method for acquiring corresponding relation and routing equipment
CN104009921B (en) The data message forwarding method matched based on arbitrary fields
CN106031104A (en) Data packet forwarding method, apparatus and device
US10193804B2 (en) Method of forwarding data packets, method of creating merged FIB key entry and method of creating a search key
US9485179B2 (en) Apparatus and method for scalable and flexible table search in a network switch
CN106533947A (en) Message processing method and apparatus
CN108199947B (en) Designated forwarder DF election method and device
CN104009922A (en) IPV4/IPV6 routing capacity sharing method based on TCAM
CN106453091B (en) The equivalent route management method and device of router Forwarding plane
CN112187636B (en) ECMP route storage method and device
US20230041395A1 (en) Method and Device for Processing Routing Table Entries
CN105227468B (en) A kind of lookup device, lookup method and configuration method
CN105207904A (en) Message processing method, device and router
CN105704035B (en) Message matching processing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant