CN1406073A - Method for selecting route based on user' IP address route - Google Patents

Method for selecting route based on user' IP address route Download PDF

Info

Publication number
CN1406073A
CN1406073A CN 01126456 CN01126456A CN1406073A CN 1406073 A CN1406073 A CN 1406073A CN 01126456 CN01126456 CN 01126456 CN 01126456 A CN01126456 A CN 01126456A CN 1406073 A CN1406073 A CN 1406073A
Authority
CN
China
Prior art keywords
space
user
pointer
address
route
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
CN 01126456
Other languages
Chinese (zh)
Other versions
CN1330190C (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.)
Haimen science and Technology Development General Corporation
Original Assignee
Shanghai No 2 Research Institute of ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai No 2 Research Institute of ZTE Corp filed Critical Shanghai No 2 Research Institute of ZTE Corp
Priority to CNB01126456XA priority Critical patent/CN1330190C/en
Publication of CN1406073A publication Critical patent/CN1406073A/en
Application granted granted Critical
Publication of CN1330190C publication Critical patent/CN1330190C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention includes following steps. (1) Based on the number of user to be allowed switching in by the device, the route information table is initiated. (2) The coincidence relation is built. (3) Whether the user relationship is added or not is determined. If no, jumping to step (5). (4) The user relationship is added. (5) Whether the user relationship is searched is determined. (6) Searching the user relationship. (7) Whether the user relationship is deleted or not is determined. If no, jumping to step (9). (8) Deleting the user relationship. (9)The end. Since the three layer of the space are setup to store user' IP route addresses and the mode of the static index list is adopted, the relevant route list item can be found by three time of reading at most.

Description

A kind of route selection method based on the IP address route
Technical field:
The present invention relates to the data communication field, relate in particular to a kind of route selection method in this field.
Background technology:
Along with developing rapidly of broadband network, the user sharply increases, and telecom operators more and more feel needs a user management center of concentrating relatively to come the user is managed concentratedly and charges, and like this, wideband network access server arises at the historic moment.One of topmost characteristics of wideband network access server are exactly to have adopted and the diverse routing mode of conventional router---based on user's source IP address route.At the initial stage of network development, the placement of this access server is more concentrated, generally all is to come user's route is searched by hardware search engine fast.Along with increasing of user, the method of this concentrated placement exposes the too high shortcoming of hardware cost gradually, in order to reduce cost, telecom operators have accepted the mode that a kind of access server disperses placement gradually, but this mode requires the number of users of each access service management can not be too many, and performance can not reduce again, what often adopt at present is the longest matching process in IP address, promptly decide the forward-path of packet according to the matching degree of the prefix of purpose IP address and the IP address in the route table items, it is higher that this method implements complexity, take a large amount of cpu resources, cause performance obviously to reduce.So the contradiction on a cost and the performance occurred: adopt the hardware search engine cost too high, and adopt traditional the longest matching process in IP address can make that performance reduces greatly.
Summary of the invention:
A kind of route selection method that the present invention proposes based on the IP address routing mode, not only save hardware search engine but also have identical search efficiency, realize saving required hardware search engine in traditional Access Layer and the convergence layer equipment, reduce the hardware cost of whole system greatly, and realize accurately mating fast the IP address.
Institute of the present invention extracting method may further comprise the steps:
The first step: the number of users initialization route information table that allow to insert according to equipment is labeled as a1, a2, a3, a4 from high to low successively with four fields of IP address;
Second step: set up corresponding relation: set up the ground floor space,, make a3, a4 field and this ground floor space of IP address set up one-to-one relationship with the a3 of IP address, a memory space in the unique definite ground floor of the a4 field space;
The 3rd step: judged whether that new active user adds, if not then changeing for the 5th step;
The 4th step: add customer relationship:
1. the route table items information that pointer PTR (x) points to this new active user is set; Then according to the a3 (x) of the IP address of this new active user, a4 (x) field is determined and its memory space N one to one, if this memory space N does not have the record of another former active user, is then deposited pointer PTR (x) in this memory space N;
2., then set up second layer space if this memory space N has had the record of another former active user; In memory space N, insert simultaneously an information of pointing to this second layer space; One-to-one relationship is set up in the IP address a2 field and the second layer space of new active user; If the position neither one that pointer PTR (x) points to or the information of a plurality of active users are then inserted corresponding position in the second layer space to the pointer PTR (x) that points to new active user route table items information;
3. if there has been the information of one or more active users the position of pointer PTR (x) sensing, then set up the 3rd sheaf space, the IP address a1 field and the 3rd sheaf space of new active user are set up one-to-one relationship, insert the information of pointing to new active user route table items;
The 5th step: the packet that judges whether active user is come in, if not then changeing for the 7th step;
The 6th step: search customer relationship, decide the forward-path of packet according to the IP address of packet;
1. at first in the ground floor space, find the position of correspondence,, illustrate that this user does not exist, and abandons this packet if this position is empty with a3, the a4 field of this address;
2. if this position has had a pointer that points to route table items, accurately mate with the IP address in the route table items of this pointed, if meet, can think that the routing iinformation of this pointed is this user, carry out the forwarding of packet according to this information;
3. if deposit this position is the pointer that points to a second layer space, then takes out another pointer in the position with this pointer and this user's a2 field location, if this another pointer is certain user's route table items information of sensing, and the operation in can carry out step 2;
If in 3 once more the pointer of location be the pointer that points to the 3rd sheaf space, then continue the location with this pointer and a1 field, take out the pointer that the content of depositing this position is sensing x user's routing iinformation;
The 7th step: need to judge whether the deletion customer relationship, if not, then changeed for the 9th step;
The 8th step: the deletion customer relationship, when needs are deleted the record of an active user, at first carry out customer relationship and search with this user's IP address, find this user's routing table information, be labeled as sky;
1. if this pointer finds in the ground floor space, delete procedure can finish;
2. if this pointer is in second layer space or the 3rd sheaf space, also need to judge also have what active user records in this space, with a temporary variable record, when dosing, user record adds one when setting up in the space, when record deletion, subtract one;
3. if this temporary variable is 1, illustrate that this space does not need, will write down taking-up, turn back to the last layer space, this record is left in the relevant position in last layer space;
The 9th step: finish.
Described ground floor space, second layer space and the 3rd sheaf space all are meant continuous memory space in the internal memory.
In described step 2, one-to-one relationship is set up by pointer in the a3 of IP address, a4 field and ground floor space.
Method of the present invention is stored the User IP routing address by setting three sheaf spaces, and adopts the mode of static index table, at most only need read just to find corresponding route table items for three times, makes that searching of any list item is very quick.Especially in the allocative decision of present user's IP address, the user little for capacity inserts, the probability that low 16bit repeats in the IP address is very little, even we can say do not have, so secondary table and three grades of tables of needing to set up can be considerably less, do not need the outer memory space of occupying volume, can think in the 64K magnitude.Adopt the hardware search engine that needs in the low capacity tandem equipment of source address route thereby saved greatly, the hardware complexity and the cost of whole system have been reduced, have simultaneously and the identical search efficiency of hardware search engine, improved the performance of whole system.
Description of drawings:
Fig. 1 is the flow chart of the method for the invention.
The present invention is described further below in conjunction with drawings and Examples.
According to the management method of global ip address, the IP address that general a certain ISP or a certain region allocation obtain all is to belong to same category-B address or more limited several category-Bs address.So Access Layer and convergence layer equipment based on the IP address route can utilize this particularity, adopt method of the present invention to realize searching fast the IP address.In Fig. 1, at first allow the number of users initialization route information table of access according to equipment.Because the IP address is made up of four bytes, and these four bytes are labeled as a1 from high to low successively, a2, a3, a4, purpose is to find corresponding routing iinformation according to the user's IP address in the packet of receiving.After the intact route information table of initialization, just begin to set up the corresponding relation between IP address and the memory space, (size of each memory space depends on actual need and decides to set up 64K continuous memory space, be generally several bytes), this space is called the ground floor space, sets up one-to-one relationship with a3, a4 field and this 64K memory space of IP address.Judge whether to add customer relationship then, add fashionable as a new active user x, just carry out the interpolation of customer relationship, obtain the route table items information that a pointer PTR (x) points to this user earlier, again according to the a3 (x) of this user's IP address, a4 (x) field finds and its memory space N one to one, and PTR (x) is deposited in this memory space N; If this memory space N has had the record of an active user y, a3, a4 field that x user and y user are described are identical, at this time will distinguish this two users, set up second layer space again, in memory space N, insert an information of pointing to this space with the a2 field.Set up one-to-one relationship with a2 field and this two sheaf space; The pointer that points to x user and y user's route table items is inserted corresponding position respectively; If this position does not have the information of other active users, then in two sheaf spaces, insert the pointer that points to x user's route table items on the relevant position; If there has been the information of one or active user position pointed in two sheaf spaces, then in like manner set up three sheaf spaces with a1, find corresponding three sheaf spaces, insert the information of pointing to x user's route table items.
For searching of customer relationship, this method is handled by following mode: when the packet of an active user is come in, decide the forward-path of packet according to the IP address of packet, and employing and front are added the same localization method of customer relationship and are searched; If not searching customer relationship, then judge whether to carry out the deletion of customer relationship, when the record of an active user of needs deletions, at first find this user's routing table information by the step of searching customer relationship with this user's IP address, it is labeled as sky; If this pointer finds in the ground floor space, delete procedure can finish; If this pointer is the space the second layer or the 3rd layer, also need to judge also have what active user records in this space, when can setting up in the space, this, when user record is dosed, adds one with a temporary variable record, when record deletion, subtract one; If this temporary variable is 1, illustrate that this space does not need, will write down taking-up, turn back to the last layer space, leave this record the relevant position of last layer space in, thereby finish delete procedure.
Embodiment:
Be a specific embodiment of the method for the invention below, the number in pre-set 64K space and 8K space in internal memory is safeguarded by a managing process.Whenever there being new user to add, when needing to apply for new memory space, just distribute by this process; And giving back of memory space also discharged by this process; Increasing at every turn, when deletion, search operation, all will carry out same search procedure; Will pay special attention to giving back of memory space when deletion, promptly the record when current memory space has only one, will give back.Whole process is as follows:
The first step: suppose that the number of users that the low capacity tandem equipment based on broadband user's source IP address route allows to insert simultaneously is 2000, four bytes of IP address are labeled as a1, a2, a3, a4 from high to low successively; Also have the routing iinformation of 2000 active users in addition, exist to show as 2000 list items in the memory, locate with 2000 address pointers respectively.The purpose of doing like this is to find corresponding pointer as early as possible according to the source IP address in the User IP packet of receiving, thereby finds corresponding routing iinformation.
Second step: corresponding relation is set up the memory space M of a 64K 32bit, the i.e. space of 64K 32bit size.One-to-one relationship (size of a3, a4 field is 65535, just is 64K, can realize this corresponding relation) is set up in 64K position with a3, a4 field and the memory space M of source IP address.
The 3rd step: judge whether to carry out the interpolation of customer relationship, if not, then changeed for the 5th step;
The 4th step: customer relationship adds:
1. add fashionablely as a new active user x, at first obtain the route table items information that a pointer PTRx points to this user.According to the a3x of this user's IP address, the a4x field finds corresponding 32bit space then, if this position is empty, illustrates that the IP address of present active user is not identical with a3x and a4x.Like this, just directly PTRx is deposited in this position;
2., illustrate that x user and y user's a3, a4 field are identical, at this time will distinguish this two users with the a2 field if this position has had the record of an active user y;
3. set up the space of 256 32bit sizes, this space is called second layer space, and the initial address in this space is inserted in the record among the memory space M.Set up one-to-one relationship with a2 field and these 256 positions then; The pointer that points to x user and y user's route table items is inserted corresponding position respectively;
4. if what deposited this position is the pointer that points to one 256 32bit memory space, illustrating has plural active user and x user to have identical a3, a4 field this moment, and the position of pointing to altogether according to this pointer and x user's a1 field then is used to deposit the pointer that points to x user's route table items;
5. if there has been the pointer of an active user position pointed or has pointed to the pointer of another 25632bit memory space in 4, illustrate that have a plurality of active users and x user's a2, a3, a4 field all identical this moment, 3 or 4 carry out identical location together, insert the pointer that points to x user's route table items;
The 5th step: judge whether to search customer relationship, if not, then changeed for the 7th step;
The 6th step: customer relationship is searched: when the packet of an active user x is come in, decide the forward-path of packet according to the source IP address of packet;
1. at first in memory space M, find the position of correspondence,, illustrate that x user does not exist, abandon this packet if this position is empty with a3, the a4 field of this address;
2. if this position has had a pointer that points to route table items, accurately mate with the IP address in the route table items of this pointed, if meet, can think that the routing iinformation of this pointed is x user, can carry out the forwarding of packet according to this information;
3. if deposit this position is the pointer that points to one 256 32bit memory space, takes out another pointer in the position with this pointer and x user's a2 field location, if this pointer is certain user's of sensing a route table items information, can carry out the operation in 3;
If in 3 once more the pointer of location be still the pointer that points to one 256 32bit memory space, continue the location with this pointer and a1 field, take out the pointer that the content of depositing this position is sensing x user's routing iinformation;
The 7th step: customer relationship deletion
1. when needing the record of an active user of deletion, at first find the pointer that points to this user's routing iinformation by the 4th step that goes on foot, this route table items is labeled as sky with this user's IP address;
2. if this pointer finds in M, delete procedure can finish
3. if this pointer is the space the second layer or the 3rd layer, also need to judge also have what active user records in this space, when can setting up in the space, this, when user record is dosed, adds one with a temporary variable record, when record deletion, subtract one;
4. if this temporary variable is 1, illustrate that this space does not need, will write down taking-up, turn back to the last layer space, this record is left in the relevant position in last layer space.

Claims (3)

1, a kind of route selection method based on the IP address route may further comprise the steps:
The first step: the number of users initialization route information table that allow to insert according to equipment is labeled as a1, a2, a3, a4 from high to low successively with four fields of IP address;
Second step: set up corresponding relation: set up the ground floor space,, make a3, a4 field and this ground floor space of IP address set up one-to-one relationship with the a3 of IP address, a memory space in the unique definite ground floor of the a4 field space;
The 3rd step: judged whether that new active user adds, if not then changeing for the 5th step;
The 4th step: add customer relationship:
1. the route table items information that pointer PTR (x) points to this new active user is set; Then according to the a3 (x) of the IP address of this new active user, a4 (x) field is determined and its memory space N one to one, if this memory space N does not have the record of another former active user, is then deposited pointer PTR (x) in this memory space N;
2., then set up second layer space if this memory space N has had the record of another former active user; In memory space N, insert simultaneously an information of pointing to this second layer space; One-to-one relationship is set up in the IP address a2 field and the second layer space of new active user; If the position neither one that pointer PTR (x) points to or the information of a plurality of active users are then inserted corresponding position in the second layer space to the pointer PTR (x) that points to new active user route table items information;
3. if there has been the information of one or more active users the position of pointer PTR (x) sensing, then set up the 3rd sheaf space, the IP address a1 field and the 3rd sheaf space of new active user are set up one-to-one relationship, insert the information of pointing to new active user route table items;
The 5th step: the packet that judges whether active user is come in, if not then changeing for the 7th step;
The 6th step: search customer relationship, decide the forward-path of packet according to the IP address of packet;
1. at first in the ground floor space, find the position of correspondence,, illustrate that this user does not exist, and abandons this packet if this position is empty with a3, the a4 field of this address;
2. if this position has had a pointer that points to route table items, accurately mate with the IP address in the route table items of this pointed, if meet, can think that the routing iinformation of this pointed is this user, carry out the forwarding of packet according to this information;
3. if deposit this position is the pointer that points to a second layer space, then takes out another pointer in the position with this pointer and this user's a2 field location, if this another pointer is certain user's route table items information of sensing, and the operation in can carry out step 2;
If in 3 once more the pointer of location be the pointer that points to the 3rd sheaf space, then continue the location with this pointer and a1 field, take out the pointer that the content of depositing this position is sensing x user's routing iinformation;
The 7th step: need to judge whether the deletion customer relationship, if not, then changeed for the 9th step;
The 8th step: the deletion customer relationship, when needs are deleted the record of an active user, at first carry out customer relationship and search with this user's IP address, find this user's routing table information, be labeled as sky;
1. if this pointer finds in the ground floor space, delete procedure can finish;
2. if this pointer is in second layer space or the 3rd sheaf space, also need to judge also have what active user records in this space, with a temporary variable record, when dosing, user record adds one when setting up in the space, when record deletion, subtract one;
3. if this temporary variable is 1, illustrate that this space does not need, will write down taking-up, turn back to the last layer space, this record is left in the relevant position in last layer space;
The 9th step: finish.
2, the route selection method based on the IP address route according to claim 1 is characterized in that, described ground floor space, second layer space and the 3rd sheaf space all are meant a continuous memory space.
3, the route selection method based on the IP address route according to claim 1 is characterized in that, in described the 3rd step, one-to-one relationship is set up by pointer in the a3 of IP address, a4 field and ground floor space.
CNB01126456XA 2001-08-14 2001-08-14 Method for selecting route based on user' IP address route Expired - Fee Related CN1330190C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB01126456XA CN1330190C (en) 2001-08-14 2001-08-14 Method for selecting route based on user' IP address route

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB01126456XA CN1330190C (en) 2001-08-14 2001-08-14 Method for selecting route based on user' IP address route

Publications (2)

Publication Number Publication Date
CN1406073A true CN1406073A (en) 2003-03-26
CN1330190C CN1330190C (en) 2007-08-01

Family

ID=4666472

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB01126456XA Expired - Fee Related CN1330190C (en) 2001-08-14 2001-08-14 Method for selecting route based on user' IP address route

Country Status (1)

Country Link
CN (1) CN1330190C (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1314249C (en) * 2004-02-20 2007-05-02 华为技术有限公司 Method of three-layer conversion information down transmitting hardware LPM table
CN100456840C (en) * 2003-11-25 2009-01-28 华为技术有限公司 Method for splitting LPM algorithm to two CPU
WO2009103225A1 (en) * 2008-02-18 2009-08-27 华为技术有限公司 A packet forwarding method and equipment
CN101404620B (en) * 2008-11-17 2011-01-05 杭州华三通信技术有限公司 Method for creating routing list item and switching equipment
CN101340386B (en) * 2008-08-12 2011-08-10 华为技术有限公司 Method and router for establishing and searching route table items
CN106223425A (en) * 2016-07-25 2016-12-14 柳州合科技有限公司 A kind of new and effective garbage treatment device
CN107493233A (en) * 2016-06-12 2017-12-19 上海斯远计算机网络信息科技有限公司 A kind of method for routing and system based on user terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6266706B1 (en) * 1997-09-15 2001-07-24 Effnet Group Ab Fast routing lookup system using complete prefix tree, bit vector, and pointers in a routing table for determining where to route IP datagrams
SE9903460L (en) * 1999-09-22 2001-03-23 Effnet Group Ab Method and system for fast routing lookups
US6996559B1 (en) * 1999-12-23 2006-02-07 Nortel Networks Limited IP address resolution methods and apparatus
CN1134177C (en) * 2000-09-28 2004-01-07 国家数字交换***工程技术研究中心 Segmental looking-up method for line speed of IP route

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100456840C (en) * 2003-11-25 2009-01-28 华为技术有限公司 Method for splitting LPM algorithm to two CPU
CN1314249C (en) * 2004-02-20 2007-05-02 华为技术有限公司 Method of three-layer conversion information down transmitting hardware LPM table
WO2009103225A1 (en) * 2008-02-18 2009-08-27 华为技术有限公司 A packet forwarding method and equipment
CN101340386B (en) * 2008-08-12 2011-08-10 华为技术有限公司 Method and router for establishing and searching route table items
CN101404620B (en) * 2008-11-17 2011-01-05 杭州华三通信技术有限公司 Method for creating routing list item and switching equipment
CN107493233A (en) * 2016-06-12 2017-12-19 上海斯远计算机网络信息科技有限公司 A kind of method for routing and system based on user terminal
CN106223425A (en) * 2016-07-25 2016-12-14 柳州合科技有限公司 A kind of new and effective garbage treatment device

Also Published As

Publication number Publication date
CN1330190C (en) 2007-08-01

Similar Documents

Publication Publication Date Title
CN101594319B (en) Entry lookup method and entry lookup device
US20040177165A1 (en) Dynamic allocation of a pool of threads
CN101009656A (en) Routing system and method for managing rule entry thereof
CN1465014A (en) Selective routing of data flows using a tcam
CN102971732A (en) System architecture for integrated hierarchical query processing for key/value stores
CN1432947A (en) Multimedia object searchine device and method
CN1482548A (en) Method and system for partitioning filter rules for multi-search enforcement
US5577246A (en) Database memory compaction and reclamation method
CN101043421A (en) Memory based method for searching quickly the longest matching of IP address
US20080133494A1 (en) Method and apparatus for searching forwarding table
CN111984835B (en) IPv4 mask quintuple rule storage compression method and device
CN1949907A (en) Mobile terminal and network searching method thereof
CN100486212C (en) Method for improving routing list capacity
CN1406073A (en) Method for selecting route based on user' IP address route
US20120008760A1 (en) Method and system for routing a telephone call
CN1192835A (en) Arrangement and method relating to information managing system
CN100397816C (en) Method for classifying received data pocket in network apparatus
CN1665314A (en) Method for prior triggering of multi-service for mobile intelligent network
CN1255748C (en) Metadata hierarchy management method and system of storage virtualization system
CN1859208A (en) Method and system for managing TCAM route list
CN101430741A (en) Short sequence mapping method and system
CN1897562A (en) Method for storing routing hop and next skip list by routing hop
CN100487697C (en) Searching method by using modified hash method
CN100352233C (en) Route list organizing and searching method
CN1805435A (en) IPv6 multi-domain classification processing method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
ASS Succession or assignment of patent right

Owner name: SHENZHENG CITY ZTE CO., LTD.

Free format text: FORMER OWNER: SHENZHENG CITY ZTE CO., LTD. SHANGHAI SECOND INSTITUTE

Effective date: 20030722

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20030722

Applicant after: Zhongxing Communication Co., Ltd., Shenzhen City

Applicant before: Shanghai Inst. of No.2, Zhongxing Communication Co., Ltd., Shenzhen City

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: HAIMEN TECHNOLOGY DEVELOPMENT CORP.

Free format text: FORMER OWNER: ZTE CORPORATION

Effective date: 20130507

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 518057 SHENZHEN, GUANGDONG PROVINCE TO: 226144 NANTONG, JIANGSU PROVINCE

TR01 Transfer of patent right

Effective date of registration: 20130507

Address after: 226144, No. 600, Beijing Road, Haimen, Jiangsu, Nantong province (room 0212 of administrative center)

Patentee after: Haimen science and Technology Development General Corporation

Address before: 518057 Nanshan District high tech Industrial Park, Guangdong, South Road, science and technology, ZTE building, legal department

Patentee before: ZTE Corporation

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070801

Termination date: 20160814

CF01 Termination of patent right due to non-payment of annual fee