CN102624619A - Method for performing message forwarding route selection based on source address under multi-default gateway condition - Google Patents

Method for performing message forwarding route selection based on source address under multi-default gateway condition Download PDF

Info

Publication number
CN102624619A
CN102624619A CN2012100606915A CN201210060691A CN102624619A CN 102624619 A CN102624619 A CN 102624619A CN 2012100606915 A CN2012100606915 A CN 2012100606915A CN 201210060691 A CN201210060691 A CN 201210060691A CN 102624619 A CN102624619 A CN 102624619A
Authority
CN
China
Prior art keywords
message
source
address
service
termination device
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
CN2012100606915A
Other languages
Chinese (zh)
Other versions
CN102624619B (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.)
DAYA SCIENCE AND TECHNOLOGY Co Ltd SHANGHAI
Original Assignee
DAYA SCIENCE AND TECHNOLOGY Co Ltd SHANGHAI
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 DAYA SCIENCE AND TECHNOLOGY Co Ltd SHANGHAI filed Critical DAYA SCIENCE AND TECHNOLOGY Co Ltd SHANGHAI
Priority to CN201210060691.5A priority Critical patent/CN102624619B/en
Publication of CN102624619A publication Critical patent/CN102624619A/en
Application granted granted Critical
Publication of CN102624619B publication Critical patent/CN102624619B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a method for performing message forwarding route selection based on a source address under a multi-default gateway condition. The method comprises the following steps of: establishing service routing tables for corresponding relationships between the source Internet protocol (IP) addresses of services and default gateways of the services, and specifying the source IP address of a service message before the forwarding of the message; and determining a corresponding service routing table according to the service type of the message marked by the source IP address and a mark, and further determining a default gateway corresponding to the message in the service routing table. By the method for performing the message forwarding route selection based on the source IP address under the multi-default gateway condition, the service type of the service message can be determined according to the source IP address of the service message, and a corresponding service routing table is selected for accurately transmitting the message of the service type, so that the shortcoming that a specific default gateway cannot be matched under a multi-service condition in the prior art is overcome; and the method is convenient to use, low in cost and wide in application range.

Description

Realize message forwarding method of routing down based on many default gateways of source address
Technical field
The present invention relates to networking technology area, particularly Route Selection technical field in the Network Transmission specifically is meant a kind of based on realizing message forwarding method of routing under many default gateways of source address.
Background technology
In the network application of prior art, the Route Selection of network message is to mate according to the purpose IP address of message usually, and carries out message according to longest match principle and transmit.
But, when having a plurality of business, user terminal exists, and these professional service ends; Be local side, when belonging to different sub-network respectively, when promptly these different business have different default gateway; Route Selection is existing problems just, because the subnet mask of default gateway all is 0.0.0.0.Therefore, in this case, utilize prior art can't match concrete which bar default gateway according to purpose IP address longest match principle.
Summary of the invention
The objective of the invention is to have overcome above-mentioned shortcoming of the prior art; Provide a kind of source IP address to confirm the class of business under this service message through service message; And select to use the corresponding business routing table to realize the correct transmission of the message of this class of business; And use easyly, with low cost, range of application is comparatively widely based on realizing under many default gateways condition of source IP address that message transmits method of routing.
In order to realize above-mentioned purpose, of the present invention based on realizing under many default gateways condition of source IP address that message transmits method of routing and may further comprise the steps:
(1) network-termination device moves multiple business, and sets up professional routing table based on described each business, and described professional routing table is this professional source IP address and this business default gateway table of comparisons;
(2) source IP address of described network-termination device specified services message;
(3) described network-termination device carries out the tagged traffic classification to described service message through appointment;
(4) described network-termination device is according to the professional routing table that class of service is selected and described service message matees of institute's mark;
(5) described network-termination device is confirmed as the professional default gateway in the selected professional routing table default gateway of described service message;
(6) described network-termination device is transmitted described service message according to determined default gateway.
Should be based on realizing under many default gateways condition of source IP address in the message forwarding method of routing; The source IP address of described network-termination device specified services message; Be specially: described network-termination device utilizes the sendmsg instruction to send service message, and imports source IP address into the service message bag.
Should transmit in the method for routing based on realization message under many default gateways condition of source IP address, described step (3) specifically may further comprise the steps:
(31) described network-termination device utilizes the iptables instruction in the OPADD chained list, to confirm to encode with the source IP address corresponding service of described appointment;
(32) described network-termination device utilizes the iptables instruction that determined operation code is marked on described service message.
Should be based on realizing under many default gateways condition of source IP address in the message forwarding method of routing; Described network-termination device is according to the professional routing table that class of service is selected and described service message matees of institute's mark, and be specially: described network-termination device is confirmed the corresponding service routing table according to the operation code of described service message mark.
Should transmit in the method for routing based on realization message under many default gateways condition of source IP address, described step (5) specifically may further comprise the steps:
(51) described network-termination device reads the professional default gateway in the operation code corresponding service routing table definite and the service message mark;
(52) described network-termination device should the business default gateway be confirmed as the default gateway of described service message.
That has adopted this invention transmits method of routing based on realization message under many default gateways condition of source IP address; Because it at first sets up the professional routing table that comprises professional source IP address and professional default gateway contrast relationship, and before E-Packeting the source IP address of specified services message; Class of service according to the message of this source IP address mark; And confirm the corresponding service routing table according to mark; And then can from this business routing table, confirm the default gateway that this message is corresponding, thus be able to confirm the class of business under this service message through the source IP address of service message, and select to use the corresponding business routing table to realize the correct transmission of the message of this class of business; Overcome in the prior art; Under multiple services situation, can't match the defective of concrete default gateway according to purpose IP address longest match principle, and of the present invention based on realizing under many default gateways condition of source IP address that message transmits method of routing and use easy; With low cost, range of application is comparatively extensive.
Description of drawings
Fig. 1 is of the present invention based on the flow chart of steps that realizes message forwarding method of routing under many default gateways condition of source IP address.
Embodiment
In order more to be expressly understood technology contents of the present invention, the special following examples of lifting specify.
See also shown in Figure 1ly, be of the present invention based on realizing under many default gateways condition of source IP address that message transmits the flow chart of steps of method of routing.
In one embodiment, should transmit method of routing based on realization message under many default gateways condition of source IP address may further comprise the steps:
(1) network-termination device moves multiple business, and sets up professional routing table based on described each business, and described professional routing table is this professional source IP address and this business default gateway table of comparisons;
(2) source IP address of described network-termination device specified services message;
(3) described network-termination device carries out the tagged traffic classification to described service message through appointment;
(4) described network-termination device is according to the professional routing table that class of service is selected and described service message matees of institute's mark;
(5) described network-termination device is confirmed as the professional default gateway in the selected professional routing table default gateway of described service message;
(6) described network-termination device is transmitted described service message according to determined default gateway.
Wherein, the source IP address of the described network-termination device specified services of step (2) message is specially: described network-termination device utilizes the sendmsg instruction to send service message, and imports source IP address into the service message bag.
In a kind of more preferably execution mode, described step (3) specifically may further comprise the steps:
(31) described network-termination device utilizes the iptables instruction in the OPADD chained list, to confirm to encode with the source IP address corresponding service of described appointment;
(32) described network-termination device utilizes the iptables instruction that determined operation code is marked on described service message.
Accordingly; The described network-termination device of step (4) is according to the professional routing table that class of service is selected and described service message matees of institute's mark, and then be specially: described network-termination device is confirmed the corresponding service routing table according to the operation code of described service message mark.
In a kind of preferred execution mode, described step (5) specifically may further comprise the steps:
(51) described network-termination device reads the professional default gateway in the operation code corresponding service routing table definite and the service message mark;
(52) described network-termination device should the business default gateway be confirmed as the default gateway of described service message.
In an application of the invention, be example with TR069 and two applied business of VoIP of user terminal, it all has independent subnet, different default gateway and by different separately source IP addresss.For solving the aforementioned problems in the prior; The solution that the present invention taked is; Create the different business routing table according to the different source IP addresss of applied business; Have only this professional default gateway in each routing table, confirm that through the source IP address of service message this service message is that which professional routing table what business, this selection use come correct this service message that sends then, the concrete applying step of this method is following:
I. the configuration of professional routing table.TR069, VoIP configuration are created professional routing table, and are disposed the list item of this professional routing table, as dispose this professional same network segment route, and dispose this professional default gateway etc. after getting access to professional relevant IP address.The establishment of professional routing table has solved a difficult problem that has a plurality of professional subnets, a plurality of default gateways simultaneously well.
As, the professional source IP of TR069 is 172.16.16.189, professional routing table table name is 51
ip?route?add?172.16.0.0/16?dev?eth4.100_1?table?51
ip?route?add?default?via?172.16.1.1?dev?eth4.100_1?table?51
The professional source IP of VoIP is 172.20.20.29, and professional routing table table name is 61
ip?route?add?172.20.0.0/16?dev?eth4.200_1?table?61
ip?route?add?default?via?172.20.1.1?dev?eth4.200_1?table?61
The modification of II.TR069, VoIP application program is specified the message source IP address before message sends.When these business are sent message; Sending message according to prior art is need not specify source IP address, if specify purpose IP address just can route, can send that (the message source IP address is according to the route entry system that chooses interpolation automatically after the route in the prior art.But the front explains, when two above default gateways were arranged, carrying out purpose IP address Route Selection separately according to prior art was to choose the correct route item).
Method of the present invention was directly specified this professional source IP address before giving out a contract for a project.Concrete grammar can be with sendmsg instruction replacement TR069, the original sendto instruction of VoIP program; Can import source IP address into because give out a contract for a project through sendmsg instruction; And sendto instruction can not be specified, and the message that sends then is before carrying out the MARK sign and source IP address all arranged before the route.
III. beat MARK tag slot separate service according to source IP operation message.Method is in mangle table OUTPUT chain, the message that source IP address equals this professional source IP address to be carried out MARK mark (mangle table OUTPUT chain is to send the place that local message must pass through) through iptables instruction; It is that the MARK mark has specifically identified for which professional message, makes things convenient for next step message is handled in the kernel Route Selection stage.
As, the professional source IP of TR069 is 172.16.16.189, professional routing table table name is 51
iptables-t?mangle-A?OUTPUT-s?172.16.16.189-j?MARK--or-mark?0x330000
The professional source IP of VoIP is 172.20.20.29, and professional routing table table name is 61
iptables-t?mangle-A?OUTPUT-s?172.20.20.29-j?MARK--or-mark?0x430000
IV. associate the MARK value with corresponding professional routing table table name.Promptly the corresponding relation of MARK value with corresponding professional routing table table name; Being configured to the kernel the inside preserves; When service message arrives the kernel Route Selection stage, just can find this professional routing table correctly to transmit then through the MARK value of service message and the route table name corresponding relation of preserving.
As, the professional source IP of TR069 is 172.16.16.189, professional routing table table name is 51
ip?rule?add?fwmark?0x330000/0xffff0000?table?51
The professional source IP of VoIP is 172.20.20.29, and professional routing table table name is 61
ip?rule?add?fwmark?0x430000/0xffff0000?table?61
That has adopted this invention transmits method of routing based on realization message under many default gateways condition of source IP address; Because it at first sets up the professional routing table that comprises professional source IP address and professional default gateway contrast relationship, and before E-Packeting the source IP address of specified services message; Class of service according to the message of this source IP address mark; And confirm the corresponding service routing table according to mark; And then can from this business routing table, confirm the default gateway that this message is corresponding, thus be able to confirm the class of business under this service message through the source IP address of service message, and select to use the corresponding business routing table to realize the correct transmission of the message of this class of business; Overcome in the prior art; Under multiple services situation, can't match the defective of concrete default gateway according to purpose IP address longest match principle, and of the present invention based on realizing under many default gateways condition of source IP address that message transmits method of routing and use easy; With low cost, range of application is comparatively extensive.
In this specification, the present invention is described with reference to its certain embodiments.But, still can make various modifications and conversion obviously and not deviate from the spirit and scope of the present invention.Therefore, specification and accompanying drawing are regarded in an illustrative, rather than a restrictive.

Claims (5)

1. one kind based on realizing under many default gateways condition of source IP address that message transmits method of routing, it is characterized in that described method may further comprise the steps:
(1) network-termination device moves multiple business, and sets up professional routing table based on described each business, and described professional routing table is this professional source IP address and this business default gateway table of comparisons;
(2) source IP address of described network-termination device specified services message;
(3) described network-termination device carries out the tagged traffic classification to described service message through appointment;
(4) described network-termination device is according to the professional routing table that class of service is selected and described service message matees of institute's mark;
(5) described network-termination device is confirmed as the professional default gateway in the selected professional routing table default gateway of described service message;
(6) described network-termination device is transmitted described service message according to determined default gateway.
2. according to claim 1 based on realizing message forwarding method of routing under many default gateways condition of source IP address, it is characterized in that the source IP address of described network-termination device specified services message is specially:
Described network-termination device utilizes the sendmsg instruction to send service message, and imports source IP address into the service message bag.
3. according to claim 2 based on realizing message forwarding method of routing under many default gateways condition of source IP address, it is characterized in that described step (3) specifically may further comprise the steps:
(31) described network-termination device utilizes the iptables instruction in the OPADD chained list, to confirm to encode with the source IP address corresponding service of described appointment;
(32) described network-termination device utilizes the iptables instruction that determined operation code is marked on described service message.
4. according to claim 3 based on realizing message forwarding method of routing under many default gateways condition of source IP address; It is characterized in that; Described network-termination device is specially according to the professional routing table that class of service is selected and described service message matees of institute's mark:
Described network-termination device is confirmed the corresponding service routing table according to the operation code of described service message mark.
5. according to claim 4 based on realizing message forwarding method of routing under many default gateways condition of source IP address, it is characterized in that described step (5) specifically may further comprise the steps:
(51) described network-termination device reads the professional default gateway in the operation code corresponding service routing table definite and the service message mark;
(52) described network-termination device should the business default gateway be confirmed as the default gateway of described service message.
CN201210060691.5A 2012-03-09 2012-03-09 Method for performing message forwarding route selection based on source address under multi-default gateway condition Expired - Fee Related CN102624619B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210060691.5A CN102624619B (en) 2012-03-09 2012-03-09 Method for performing message forwarding route selection based on source address under multi-default gateway condition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210060691.5A CN102624619B (en) 2012-03-09 2012-03-09 Method for performing message forwarding route selection based on source address under multi-default gateway condition

Publications (2)

Publication Number Publication Date
CN102624619A true CN102624619A (en) 2012-08-01
CN102624619B CN102624619B (en) 2015-05-27

Family

ID=46564310

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210060691.5A Expired - Fee Related CN102624619B (en) 2012-03-09 2012-03-09 Method for performing message forwarding route selection based on source address under multi-default gateway condition

Country Status (1)

Country Link
CN (1) CN102624619B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103036788A (en) * 2012-12-14 2013-04-10 上海斐讯数据通信技术有限公司 Implementation method of multi-interface gateway equipment data transmitting
CN103309950A (en) * 2013-05-22 2013-09-18 苏州雄立科技有限公司 Searching method for key value
CN103957572A (en) * 2014-05-20 2014-07-30 普天信息技术有限公司 Android-system-based distribution method through multi-network route policy
CN104469846A (en) * 2013-09-18 2015-03-25 华为技术有限公司 Message processing method and equipment
CN105099927A (en) * 2015-08-31 2015-11-25 上海斐讯数据通信技术有限公司 Method for realizing multi-service channel and router
CN112787940A (en) * 2021-01-27 2021-05-11 哈尔滨工业大学(威海) Multi-level VPN encryption transmission method, system, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050228894A1 (en) * 2003-05-12 2005-10-13 Kazuhiko Takabayashi Inter-device authentication system, inter-device authentication method, communication device, and computer program
WO2008079278A2 (en) * 2006-12-20 2008-07-03 Genband Inc. Methods, systems, and computer program products for source-aware ip routing at a media gateway
CN101505308A (en) * 2009-03-17 2009-08-12 中国电信股份有限公司 Authentication method and system for IP over Ethernet
CN101510900A (en) * 2008-12-19 2009-08-19 北京交通大学 Method for configuring route of mobile terminal in PMIPv4
CN101656631A (en) * 2009-09-07 2010-02-24 中兴通讯股份有限公司 Method and device for supporting multiple gateways in unified management platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050228894A1 (en) * 2003-05-12 2005-10-13 Kazuhiko Takabayashi Inter-device authentication system, inter-device authentication method, communication device, and computer program
WO2008079278A2 (en) * 2006-12-20 2008-07-03 Genband Inc. Methods, systems, and computer program products for source-aware ip routing at a media gateway
CN101510900A (en) * 2008-12-19 2009-08-19 北京交通大学 Method for configuring route of mobile terminal in PMIPv4
CN101505308A (en) * 2009-03-17 2009-08-12 中国电信股份有限公司 Authentication method and system for IP over Ethernet
CN101656631A (en) * 2009-09-07 2010-02-24 中兴通讯股份有限公司 Method and device for supporting multiple gateways in unified management platform

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103036788A (en) * 2012-12-14 2013-04-10 上海斐讯数据通信技术有限公司 Implementation method of multi-interface gateway equipment data transmitting
CN103309950A (en) * 2013-05-22 2013-09-18 苏州雄立科技有限公司 Searching method for key value
CN104469846A (en) * 2013-09-18 2015-03-25 华为技术有限公司 Message processing method and equipment
WO2015039616A1 (en) * 2013-09-18 2015-03-26 华为技术有限公司 Method and device for packet processing
CN104469846B (en) * 2013-09-18 2018-10-30 华为技术有限公司 A kind of message processing method and equipment
CN103957572A (en) * 2014-05-20 2014-07-30 普天信息技术有限公司 Android-system-based distribution method through multi-network route policy
CN105099927A (en) * 2015-08-31 2015-11-25 上海斐讯数据通信技术有限公司 Method for realizing multi-service channel and router
CN112787940A (en) * 2021-01-27 2021-05-11 哈尔滨工业大学(威海) Multi-level VPN encryption transmission method, system, equipment and storage medium

Also Published As

Publication number Publication date
CN102624619B (en) 2015-05-27

Similar Documents

Publication Publication Date Title
CN102624619A (en) Method for performing message forwarding route selection based on source address under multi-default gateway condition
CN102804693B (en) For realizing the method and apparatus of L2 VPN on ip networks
CN103259728B (en) A kind of OFS in-band communications method and OFS
CN105340217B (en) A kind of message processing method, apparatus and system
CN103597794B (en) For providing the information about array of data association and for forwarding the imagination of array of data
CN105850102A (en) Control of a chain of services
CN107749822A (en) The conversion for the hybrid network being made up of OpenFlow interchangers and other programmable switches and it is uniformly controlled
RU2010148321A (en) DECENTRALIZATION OF FUNCTIONAL CAPABILITIES OF A BASIC NETWORK
CN103731349B (en) Message forwarding method and edge device between a kind of Ethernet virtualization interconnection neighbours
RU2012152098A (en) METHOD, DEVICE AND SYSTEM FOR MAKING ACCESS TO THE MOBILE STATION SERVICE
WO2019201299A1 (en) Path identifier acquisition method and device
CN101159656B (en) Packet sampling method, system and equipment
CN102025590B (en) Method and system for realizing intercommunication between new net and internet
CN104202313A (en) Data forwarding method and gateway
CN104092790B (en) Base station master-slave communication method and system
CN103780425A (en) A method and a controller device for configuring a software-defined network
KR20120040273A (en) Method and system for implementing network intercommunication
CN105591859A (en) Method and device for dynamically adjusting blocked port for ERPS ring
CN103634214A (en) Route information generating method and device
CN101635684A (en) Method and system for classifying service flow
EP3007389A1 (en) Gre tunnel implementation method, access point and gateway
CN104079466A (en) Message processing method and equipment
CN103796191B (en) Method, device and the terminal of data are sent to user terminal
CN102291367B (en) Method, the Apparatus and system of amendment terminal network parameter
CN104205729A (en) Method, device, and system for configuring device in network

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
PP01 Preservation of patent right

Effective date of registration: 20160704

Granted publication date: 20150527

RINS Preservation of patent right or utility model and its discharge
PD01 Discharge of preservation of patent

Date of cancellation: 20170104

Granted publication date: 20150527

PP01 Preservation of patent right

Effective date of registration: 20170106

Granted publication date: 20150527

RINS Preservation of patent right or utility model and its discharge
PD01 Discharge of preservation of patent

Date of cancellation: 20170706

Granted publication date: 20150527

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

Granted publication date: 20150527

Termination date: 20170309

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