CN102624619B - 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
CN102624619B
CN102624619B CN201210060691.5A CN201210060691A CN102624619B CN 102624619 B CN102624619 B CN 102624619B CN 201210060691 A CN201210060691 A CN 201210060691A CN 102624619 B CN102624619 B CN 102624619B
Authority
CN
China
Prior art keywords
message
business
source
address
network
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.)
Expired - Fee Related
Application number
CN201210060691.5A
Other languages
Chinese (zh)
Other versions
CN102624619A (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

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

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

Based on the method realizing message repeating Route Selection under many default gateways of source address
Technical field
The present invention relates to networking technology area, particularly routing technology field in Internet Transmission, specifically referring to a kind of method based on realizing message repeating Route Selection under many default gateways of source address.
Background technology
In the network application of prior art, the Route Selection of usual network message carries out mating according to the object IP address of message, and carry out message repeating according to longest match principle.
But, when user terminal has multiple business to exist, and the service end of these business, i.e. local side, when belonging to different sub-network respectively, when namely these different business have a different default gateway, Route Selection is existing problems just, because the subnet mask of default gateway is all 0.0.0.0.Therefore, in this case, prior art is utilized cannot to match which bar default gateway concrete according to object IP address longest match principle.
Summary of the invention
The object of the invention is to overcome above-mentioned shortcoming of the prior art, the class of business that a kind of source IP address by service message is determined belonging to this service message is provided, and choice for use corresponding business routing table realizes the correct transmission of the message of this class of business, and apply easy, with low cost, range of application is comparatively widely based on the method realizing message repeating Route Selection under many default gateways condition of source IP address.
In order to realize above-mentioned object, the method realizing message repeating Route Selection under the condition of the many default gateways based on source IP address of the present invention comprises the following steps:
(1) network-termination device runs multiple business, and sets up business routing table based on described each business, and described business routing table is source IP address and this business default gateway table of comparisons of this business;
(2) source IP address of the network-termination device specified services message described in;
(3) network-termination device described in carries out tagged traffic classification to the described service message through specifying;
(4) network-termination device described in selects the business routing table of mating with described service message according to marked class of service;
(5) the business default gateway in selected business routing table is defined as the default gateway of described service message by the network-termination device described in;
(6) service message described in the network-termination device described in forwards according to determined default gateway.
Should realize in the method for message repeating Route Selection based under many default gateways condition of source IP address, the source IP address of described network-termination device specified services message, be specially: described network-termination device utilizes sendmsg instruction to send service message, and imports source IP address into service message bag.
Should realize in the method for message repeating Route Selection based under many default gateways condition of source IP address, described step (3) specifically comprises the following steps:
(31) network-termination device described in utilizes iptables instruction to determine the operation code corresponding with the described source IP address of specifying in OPADD chained list;
(32) network-termination device described in utilizes iptables instruction that determined operation code is marked on described service message.
Should realize in the method for message repeating Route Selection based under many default gateways condition of source IP address, described network-termination device selects the business routing table of mating with described service message according to marked class of service, be specially: described network-termination device determines corresponding business routing table according to the operation code that described service message marks.
Should realize in the method for message repeating Route Selection based under many default gateways condition of source IP address, described step (5) specifically comprises the following steps:
(51) network-termination device described in reads the business default gateway in the business routing table corresponding with the operation code that service message marks determined;
(52) this business default gateway is defined as the default gateway of described service message by the network-termination device described in.
The method of message repeating Route Selection is realized under have employed the condition of the many default gateways based on source IP address of this invention, because first it set up the business routing table comprising business source IP address and business default gateway contrast relationship, and before E-Packeting the source IP address of specified services message, according to the class of service of the message that this source IP address marks, and determine corresponding business routing table according to mark, and then the default gateway that this message is corresponding can be determined from this business routing table, thus be able to the class of business determining belonging to this service message by the source IP address of service message, and choice for use corresponding business routing table realizes the correct transmission of the message of this class of business, overcome in prior art, in multiple services situation, the defect of concrete default gateway cannot be matched according to object IP address longest match principle, and the method application realizing message repeating Route Selection under the condition of the many default gateways based on source IP address of the present invention is easy, with low cost, range of application is comparatively extensive.
Accompanying drawing explanation
Fig. 1 is the flow chart of steps realizing the method for message repeating Route Selection under the many default gateways based on source IP address of the present invention condition.
Embodiment
In order to more clearly understand technology contents of the present invention, describe in detail especially exemplified by following examples.
Refer to shown in Fig. 1, for realizing the flow chart of steps of the method for message repeating Route Selection under the condition of the many default gateways based on source IP address of the present invention.
In one embodiment, should comprise the following steps based on the method realizing message repeating Route Selection under many default gateways condition of source IP address:
(1) network-termination device runs multiple business, and sets up business routing table based on described each business, and described business routing table is source IP address and this business default gateway table of comparisons of this business;
(2) source IP address of the network-termination device specified services message described in;
(3) network-termination device described in carries out tagged traffic classification to the described service message through specifying;
(4) network-termination device described in selects the business routing table of mating with described service message according to marked class of service;
(5) the business default gateway in selected business routing table is defined as the default gateway of described service message by the network-termination device described in;
(6) service message described in the network-termination device described in forwards according to determined default gateway.
Wherein, the source IP address of the network-termination device specified services message described in step (2), is specially: described network-termination device utilizes sendmsg instruction to send service message, and imports source IP address into service message bag.
In one more preferably execution mode, described step (3) specifically comprises the following steps:
(31) network-termination device described in utilizes iptables instruction to determine the operation code corresponding with the described source IP address of specifying in OPADD chained list;
(32) network-termination device described in utilizes iptables instruction that determined operation code is marked on described service message.
Accordingly, network-termination device described in step (4) selects the business routing table of mating with described service message according to marked class of service, be then specially: described network-termination device determines corresponding business routing table according to the operation code that described service message marks.
In the preferred execution mode of one, described step (5) specifically comprises the following steps:
(51) network-termination device described in reads the business default gateway in the business routing table corresponding with the operation code that service message marks determined;
(52) this business default gateway is defined as the default gateway of described service message by the network-termination device described in.
In an application of the invention, for TR069 and the VoIP two methods business of user terminal, it has independent subnet, different default gateway and by source IP addresss different separately.For solving the aforementioned problems in the prior, the solution that the present invention takes is, according to applied business not source IP address establishment different business routing table, the default gateway of this business is only had in each routing table, then determine that what business this service message is, which business routing table of this choice for use correctly sends this service message by the source IP address of service message, the embody rule step of the method is as follows:
I. the configuration of business routing table.TR069, VoIP configuration gets business and is correlated with behind IP address, creates business routing table, and configures the list item of this business routing table, as configured the same network segment route of this business, and the default gateway etc. of configuration this business.The establishment of business routing table solves the difficult problem that simultaneously there is multiple business subnet, multiple default gateway well.
As, the source IP of TR069 business is 172.16.16.189, and business 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 source IP of VoIP business is 172.20.20.29, and business 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 amendment of II.TR069, VoIP application program, specifies message source IP address before message sends.When these business send message, conventionally sending message is do not need to specify source IP address, if specify object IP address just can route, can send that (in prior art, message source IP address is that the route entry system that basis is chosen after route is added automatically.But illustrate above, when having two or more default gateway, conventionally carrying out separately object IP address Route Selection is to choose correct route item).
Method of the present invention directly specified the source IP address of this business before giving out a contract for a project.Concrete grammar can be replace the original sendto instruction of TR069, VoIP program with sendmsg instruction, because give out a contract for a project can import source IP address into by sendmsg instruction, and sendto instruction can not be specified, the message then sent is all source IP address before carrying out MARK mark and before route.
III. MARK tag slot separate service is beaten according to source IP operation message.Method carries out MARK mark (it is the place sending local message inherently process that mangle shows OUTPUT chain) by iptables instruction at the message that mangle shows to equal this business source IP address to source IP address in OUTPUT chain, it is the message of which business that MARK mark specifically identifies, and facilitates next step processing message in the kernel Route Selection stage.
As, the source IP of TR069 business is 172.16.16.189, and business routing table table name is 51
iptables-t mangle-A OUTPUT-s 172.16.16.189-j MARK--or-mark 0x330000
The source IP of VoIP business is 172.20.20.29, and business routing table table name is 61
iptables-t mangle-A OUTPUT-s 172.20.20.29-j MARK--or-mark 0x430000
IV. MARK value is associated with corresponding business routing table table name.Namely the corresponding relation of MARK value with corresponding business routing table table name, be configured to inside kernel and save, then, when service message arrives the kernel Route Selection stage, the routing table of this business just can be found correctly to forward by the MARK value of service message and the route table name corresponding relation of preservation.
As, the source IP of TR069 business is 172.16.16.189, and business routing table table name is 51
ip rule add fwmark 0x330000/0xffff0000 table 51
The source IP of VoIP business is 172.20.20.29, and business routing table table name is 61
ip rule add fwmark 0x430000/0xffff0000 table 61
The method of message repeating Route Selection is realized under have employed the condition of the many default gateways based on source IP address of this invention, because first it set up the business routing table comprising business source IP address and business default gateway contrast relationship, and before E-Packeting the source IP address of specified services message, according to the class of service of the message that this source IP address marks, and determine corresponding business routing table according to mark, and then the default gateway that this message is corresponding can be determined from this business routing table, thus be able to the class of business determining belonging to this service message by the source IP address of service message, and choice for use corresponding business routing table realizes the correct transmission of the message of this class of business, overcome in prior art, in multiple services situation, the defect of concrete default gateway cannot be matched according to object IP address longest match principle, and the method application realizing message repeating Route Selection under the condition of the many default gateways based on source IP address of the present invention is easy, with low cost, range of application is comparatively extensive.
In this description, the present invention is described with reference to its specific embodiment.But, still can make various amendment 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 (3)

1., based on the method realizing message repeating Route Selection under many default gateways condition of source IP address, it is characterized in that, described method comprises the following steps:
(1) network-termination device runs multiple business, and sets up each self-corresponding business routing table respectively based on each business, and described business routing table is source IP address and this business default gateway table of comparisons of this corresponding business;
(2) source IP address of the network-termination device specified services message described in;
(3) network-termination device described in carries out tagged traffic classification to the service message through specifying;
(4) network-termination device described in selects the business routing table of mating with described service message according to marked class of service;
(5) the business default gateway in selected business routing table is defined as the default gateway of described service message by the network-termination device described in;
(6) service message described in the network-termination device described in forwards according to determined default gateway;
Described step (3) specifically comprises the following steps:
(31) network-termination device described in utilizes iptables instruction to determine the operation code corresponding with the described source IP address of specifying in OPADD chained list;
(32) network-termination device described in utilizes iptables instruction that determined operation code is marked on described service message;
Described network-termination device selects the business routing table of mating with described service message according to marked class of service, be specially:
Described network-termination device determines corresponding business routing table according to the operation code that described service message marks.
2. realize the method for message repeating Route Selection under the condition of the many default gateways based on source IP address according to claim 1, it is characterized in that, the source IP address of described network-termination device specified services message, is specially:
Described network-termination device utilizes sendmsg instruction to send service message, and imports source IP address into service message bag.
3. realize the method for message repeating Route Selection under the condition of the many default gateways based on source IP address according to claim 2, it is characterized in that, described step (5) specifically comprises the following steps:
(51) network-termination device described in reads the business default gateway in the business routing table corresponding with the operation code that service message marks determined;
(52) this business default gateway is defined as the default gateway of described service message by the network-termination device described in.
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 CN102624619A (en) 2012-08-01
CN102624619B true 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)

Families Citing this family (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
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
CN105099927B (en) * 2015-08-31 2018-04-06 上海斐讯数据通信技术有限公司 A kind of method and router for realizing multi-service passage
CN112787940A (en) * 2021-01-27 2021-05-11 哈尔滨工业大学(威海) Multi-level VPN encryption transmission method, system, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4161791B2 (en) * 2003-05-12 2008-10-08 ソニー株式会社 Inter-device authentication system, inter-device authentication method, communication device, and computer program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN102624619A (en) 2012-08-01

Similar Documents

Publication Publication Date Title
CN102624619B (en) Method for performing message forwarding route selection based on source address under multi-default gateway condition
CN108234235B (en) Method, network device and computer-readable storage medium for data monitoring
CN103259728B (en) A kind of OFS in-band communications method and OFS
JP5864618B2 (en) MPLS path looping at the transfer level of connectionless MPLS networks
US11050657B2 (en) Method, device and node for message transmission, and computer storage medium
CN111294236B (en) Communication method and device based on Service Function Chain (SFC)
US20140351452A1 (en) Chaining Service Zones by way of Route Re-Origination
CN110224935B (en) Method and device for processing multicast data message
CN104579954B (en) The cross-domain retransmission method of message, device and communication equipment
WO2016082588A1 (en) Link connectivity checking method and apparatus
CN104518972A (en) Dynamic area filtering for link-state routing protocols
CN102273177A (en) Neighbour discovery protocol mediation
WO2017198131A1 (en) Method and system for redirecting data stream, and network device and control device
CN104683210A (en) Automatic tunnel establishing method and device
CN104468351A (en) SDN-based CCN route assisting management method, CCN forwarding device and network controller
CN103326918A (en) Message forwarding method and message forwarding equipment
CN106576049B (en) It is configured as the network equipment of tracking multicast receiver
US20150181499A1 (en) Communication apparatus, communication method, and communication system
TW201240398A (en) Gateway equipment
CN104202313A (en) Data forwarding method and gateway
CN108512669A (en) It is used for transmission the method and system of broadcast data
CN102857429A (en) Method and device for carrying route in transparent interconnection of lots of links (TRILL) network
CN102546409B (en) Method and RB (route bridge) for processing message based on TRILL (Transparent Interconnection of Lots of Links) network
CN105429901A (en) Uplink data package forwarding method and device, and downlink data package forwarding method and device
CN103401788B (en) A kind of SPT method for building up and equipment

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
PD01 Discharge of preservation of patent

Date of cancellation: 20170706

Granted publication date: 20150527

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

Granted publication date: 20150527

Termination date: 20170309