CN105207904A - Message processing method, device and router - Google Patents

Message processing method, device and router Download PDF

Info

Publication number
CN105207904A
CN105207904A CN201410293381.7A CN201410293381A CN105207904A CN 105207904 A CN105207904 A CN 105207904A CN 201410293381 A CN201410293381 A CN 201410293381A CN 105207904 A CN105207904 A CN 105207904A
Authority
CN
China
Prior art keywords
gateway
message
module
address
source address
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
CN201410293381.7A
Other languages
Chinese (zh)
Other versions
CN105207904B (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.)
Alibaba China Co Ltd
Original Assignee
Guangzhou Dongjing Computer Technology 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 Guangzhou Dongjing Computer Technology Co Ltd filed Critical Guangzhou Dongjing Computer Technology Co Ltd
Priority to CN201410293381.7A priority Critical patent/CN105207904B/en
Publication of CN105207904A publication Critical patent/CN105207904A/en
Application granted granted Critical
Publication of CN105207904B publication Critical patent/CN105207904B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a message processing method, a message processing device and a router. The method includes the following steps that: a first gateway corresponding to a first message can be obtained, wherein the first message includes a source address, and the first gateway is a next-hop gateway for first message forwarding; a second gateway satisfying preset conditions is searched according to the source address of the first message, message parameters and the first gateway; and the first message is forwarded to the second gateway. With the message processing method and device provided by the embodiment of the invention adopted, the problem of incapability of setting different routing exits for different source addresses in the prior art can be solved, and gateways can be determined for messages according to the source addresses of the messages.

Description

The processing method of message, device and router
Technical field
The present invention relates to data processing field, in particular to a kind of processing method of message, device and router.
Background technology
Egress gateways router has and carries out the business functions such as NAT (NetworkAddressTranslation, network address translation), Firewall (i.e. fire compartment wall) filtration to the flow of inner access to netwoks external network server.For the networking of many up links, need configuring static route or policybased routing to realize correct routing, namely select corresponding link according to destination address operator (telecommunications, movement, UNICOM etc.).
But different internal network user has different outlet routing demands, such as:
1) from Intranet 192.168.1.0/24 outlet request, if destination address belongs to telecommunications, telecommunication link is selected.
2) from all outlet ports request of Intranet 192.168.2.0/24, all communication links is selected.
3) from Intranet 192.168.3.0/24 outlet request, if destination address belongs to telecommunications, communication links is selected.
Following outlet route selecting method is provided in prior art:
(1) outlet is searched in static routing, although very high by static routing search performance, can only carry out routing according to destination address, the egress policy that different business needs is different, and said method cannot be that homologous address does not arrange different egress policys.
(2) policybased routing routing.Although policybased routing is relatively more flexible, can carry out routing according to source address, destination address, policybased routing uses linear search algorithm, and performance is very low.If realize complicated routing policy, because the network address of operator is too many, need to add a large amount of routing rules, cause forwarding performance low.
Such as, time Intranet 192.168.3.0/24 outlet request destination address belongs to telecommunications, communication links is selected.Telecommunication network address has 2000, needs increase by 2000 policybased routing, as follows:
from192.168.3.0/24toip1/16lookupunicom
from192.168.3.0/24toip2/11lookupunicom
.....
from192.168.3.0/24toip2000/24lookupunicom
If there be n inner-mesh network address to realize above-mentioned strategy, will increase n*2000 bar policybased routing, maintenance cost is high, and performance cannot satisfy the demands at all.
For being the problem that different source addresses arranges different route outlets in prior art, at present effective solution is not yet proposed.
Summary of the invention
For in correlation technique being the problem that different source addresses arranges different route outlets, at present effective solution is not yet proposed, for this reason, main purpose of the present invention is to provide a kind of processing method of message, device and router, to solve the problem.
To achieve these goals, according to an aspect of the present invention, a kind of processing method of message is provided, the method comprises: obtain first gateway corresponding with the first message, wherein, the first message comprises source address, and the first gateway is the down hop gateway of the first message repeating; Search according to the source address of the first message, message parameter and the first gateway and meet the second pre-conditioned gateway; By the first message repeating to the second gateway.
Further, obtain first gateway corresponding with the first message to comprise: receive the first message, wherein, with destination address in the first message; From default routing table, inquiry obtains first gateway corresponding with destination address.
Further, search according to the source address of the first message, message parameter and the first gateway and meet the second pre-conditioned gateway and comprise: in default gateway table, find the route data consistent with message parameter, source address and the first gateway, wherein, message parameter comprises: destination address, entrance network interface card and outlet network interface card; The gateway pointed to by route data is as the second gateway; When searching in default gateway table less than the route data consistent with message parameter, source address and the first gateway, using the first gateway as the second gateway.
Further, the first message repeating to the second gateway is comprised: network address translation is carried out to the first message and obtains the first message after changing; By the first message repeating to the second gateway after conversion.
Further, while by the first message repeating to the second gateway after conversion, processing method also comprises: record the source address, source port, destination address, destination interface and the down hop gateway that carry out before and after network address translation to the first message, generate and forward connection table, wherein, down hop gateway is the first gateway or the second gateway.
Further, after generation forwards connection table, processing method also comprises: receive new message; From forwarding connection table, inquire about whether there is the message accounting identical with new message; When forwarding the message accounting that in connection table, existence is identical with new message, read the down hop gateway corresponding with new message from forwarding connection table.
To achieve these goals, according to a further aspect in the invention, a kind of processing unit of message is provided, this device comprises: acquisition module, for obtaining first gateway corresponding with the first message, wherein, first message comprises source address, and the first gateway is the down hop gateway of the first message repeating; Searching module, meeting the second pre-conditioned gateway for searching according to the source address of the first message, message parameter and the first gateway; Forwarding module, for by the first message repeating to the second gateway.
Further, acquisition module comprises: the first receiver module, for receiving the first message, wherein, with destination address in the first message; Gateway searches module, obtains first gateway corresponding with destination address for inquiry from default routing table.
Further, search module and comprise: first searches submodule, for finding the route data consistent with message parameter, source address and the first gateway in default gateway table, wherein, message parameter comprises: destination address, entrance network interface card and outlet network interface card; First determination module, for the gateway that pointed to by route data as the second gateway; Second determination module, for searching in default gateway table less than the route data consistent with message parameter, source address and the first gateway, using the first gateway as the second gateway.
Further, forwarding module comprises: address conversion module, obtains the first message after changing for carrying out network address translation to the first message; Forward submodule, for by conversion after the first message repeating to the second gateway.
Further, processing unit also comprises: logging modle, for by conversion after the first message repeating to the second gateway while, record carries out source address, source port, destination address, destination interface and the down hop gateway before and after network address translation to the first message, generate and forward connection table, wherein, down hop gateway is the first gateway or the second gateway.
Further, gateway is searched module and is comprised: the second receiver module, for receiving new message; Second searches submodule, for inquiring about whether there is the message accounting identical with new message from forwarding connection table; Read module, for when forwarding the message accounting that in connection table, existence is identical with new message, reads the down hop gateway corresponding with new message from forwarding connection table.
To achieve these goals, according to a further aspect in the invention, provide a kind of router, this router comprises: the processing unit of message.
Adopt the embodiment of the present invention, after the first gateway getting the first message, according to the source address of the first message, message parameter and the first gateway are searched and are met the second pre-conditioned gateway, and the first message is sent to the second gateway, achieve the flexible selection of the outlet to the first message, and above-mentioned processing method, with low cost, general linux server just can be disposed, safeguard simple, only need a small amount of rule (pre-conditioned namely in above-described embodiment) just can meet internal network user complexity outlet routing demand, and there is higher forwarding performance, solving in prior art cannot be the problem that different source addresses arranges different route outlets, realization can be that it determines the effect of gateway according to the source address of message.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, and form a application's part, schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the structural representation of the processing unit of message according to the embodiment of the present invention;
Fig. 2 is the structural representation of the router according to the embodiment of the present invention;
Fig. 3 is the flow chart of the processing method of message according to the embodiment of the present invention; And
Fig. 4 is the flow chart of the processing method of a kind of optional message according to the embodiment of the present invention.
Embodiment
The present invention program is understood better in order to make those skilled in the art person, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a part of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, should belong to the scope of protection of the invention.
It should be noted that, term " first ", " second " etc. in specification of the present invention and claims and above-mentioned accompanying drawing are for distinguishing similar object, and need not be used for describing specific order or precedence.Should be appreciated that the data used like this can be exchanged in the appropriate case, so as embodiments of the invention described herein can with except here diagram or describe those except order implement.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, such as, contain those steps or unit that the process of series of steps or unit, method, system, product or equipment is not necessarily limited to clearly list, but can comprise clearly do not list or for intrinsic other step of these processes, method, product or equipment or unit.
Fig. 1 is the structural representation of the processing unit of message according to the embodiment of the present invention.As shown in Figure 1, this device can comprise: acquisition module 10, search module 20 and forwarding module 30.
Wherein, acquisition module, for obtaining first gateway corresponding with the first message, wherein, the first message comprises source address, and the first gateway is the down hop gateway of the first message repeating.
Searching module, meeting the second pre-conditioned gateway for searching according to the source address of the first message, message parameter and the first gateway.
Forwarding module, for by the first message repeating to the second gateway.
Adopt the embodiment of the present invention, after the first gateway getting the first message, according to the source address of the first message, message parameter and the first gateway are searched and are met the second pre-conditioned gateway, and the first message is sent to the second gateway, achieve the flexible selection of the outlet to the first message, and above-mentioned processing method, with low cost, general linux server just can be disposed, safeguard simple, only need a small amount of rule (pre-conditioned namely in above-described embodiment) just can meet internal network user complexity outlet routing demand, and there is higher forwarding performance, solving in prior art cannot be the problem that different source addresses arranges different route outlets, realization can be that it determines the effect of gateway according to source address.
The request of E-Packeting that the first message in above-described embodiment can send for inner-mesh network user, carry the first message in this request of E-Packeting, the method in above-described embodiment can be applied on gateway router.
In the above embodiment of the present invention, acquisition module can comprise: the first receiver module, for receiving the first message, wherein, with destination address in the first message; Gateway searches module, obtains first gateway corresponding with destination address for inquiry from default routing table.
Particularly, after gateway router receives the first message by the first receiver module, search module searches first gateway corresponding with destination address by gateway.Wherein, with the gateway in the destination address queries static routing table of the first message (the default routing table namely in above-described embodiment), obtain the down hop gateway (next gateway of the first message in this embodiment is the first gateway) of the first message.
Wherein, down hop gateway is a crucial condition, because the quantity of the down hop gateway of gateway router is little, therefore only needs a small amount of rule (pre-conditioned namely in above-described embodiment) just can realize complicated routing demand.
Need to further illustrate, down hop gateway is obtained by queries static routing table (the default routing table namely in above-described embodiment).When initialization gateway router, can be each operator configuring static route on gateway router.Such as, if the destination address of message belongs to telecommunications, the down hop gateway of message is exactly telecommunications gateway.
In the above embodiment of the present invention, search module can comprise: first searches submodule, for finding the route data consistent with message parameter, source address and the first gateway in default gateway table, wherein, message parameter comprises: destination address, entrance network interface card and outlet network interface card; First determination module, for the gateway that pointed to by route data as the second gateway; Second determination module, for searching in default gateway table less than the route data consistent with message parameter, source address and the first gateway, using the first gateway as described second gateway.The gateway determining the first message down hop is in the above-described embodiments the first gateway or the second gateway.
Particularly, find the route data all consistent with the source address of the first message, message parameter and the first gateway in default gateway table, the gateway that this route data is corresponding is the second gateway of the first message.
Above-mentioned pre-conditioned can be custom rule.Wherein, custom rule uses source address, destination address, entrance network interface card, outlet network interface card and pre-conditioned, specifically as shown in table 1 as routing of down hop gateway.When the above-mentioned data of the first message meet the condition in custom rule, revise the down hop gateway (the first gateway namely in above-described embodiment) of the first message for appointment gateway (the second gateway namely in above-described embodiment), to realize the selection of link.
Table 1:
Particularly, if the source address of the first message meets 192.168.1.0/24, particularly, source address is 192.168.1.0/X, X is the natural number of 0 to 32, because ipv4 address size is 4 bytes, namely 32, and destination address does not limit, and (destination address in table is for empty, represent and destination address is not limited), entrance network interface card is eth0, outlet network interface card does not limit, first gateway (namely above-mentioned original down hop gateway) is 115.238.228.193, then determine the source address of the first message, message parameter and the first gateway meet the route data of Article 1, the i.e. source address of the first message, message parameter is consistent with the route data of Article 1 with the first gateway, the new down hop gateway (gateway that the route data namely in above-described embodiment points to) that then route data of Article 1 points to is the second gateway, if the data of the gateway found in default gateway table are for empty, then using the first initial gateway as the second gateway, forward it to the first gateway when forwarding the first message.
Wherein, the default gateway table in above-described embodiment realizes in the mode of Hash table, can improve route inquiring data and the second gateway speed.
In the above embodiment of the present invention, forwarding module can comprise: address conversion module, obtains the first message after changing for carrying out network address translation to the first message; Forward submodule, for by conversion after the first message repeating to the second gateway.
Particularly, network address translation is done to the first message, namely the source address of the first message and source port are converted to public network address and the public network port of gateway router, then, the first message after address transition is sent to network interface card queue by gateway router, and the first message after this conversion is sent to the second gateway.
What needs further illustrated is, processing unit can also comprise: logging modle, for by conversion after the first message repeating to the second gateway while, record carries out source address, source port, destination address, destination interface and the down hop gateway before and after network address translation to the first message, generates and forwards connection table.Wherein, down hop gateway is the first gateway or the second gateway in this embodiment.Down hop gateway in this embodiment is also the new down hop gateway in table 1.
Particularly, while forwarding first message, set up and forward connection table, to accelerate the processing speed to the first message.
Setting up when forwarding the first message and forward connection table, the source address before and after record network address translation and source port, for doing network address translation to reply message, is namely address and the port of Intranet user reply message public network destination address and port translation.Forward connection table content as shown in table 2.
Table 2:
As shown in table 2, this table, except record source address, source port, destination address, destination interface, also have recorded the down hop gateway (this down hop gateway can be the first gateway in above-described embodiment or the second gateway) of every bar link (corresponding each first message).
Wherein, this table realizes with Hash table, to improve inquiry velocity.For same link, only have first the first message to need queries static routing table and coupling routing rule, the first follow-up message directly uses the down hop gateway of this table record, improves forwarding speed.
Particularly, the down hop gateway recorded in forwarding connection table may be the first gateway also may be the second gateway.If match the second gateway before the first message in custom rule table, then forwarding in connection table what record is the second gateway, if do not matched before, then what record here is exactly the first gateway of the first message.That is, as long as forward connection table find record, illustrate and go coupling to cross, the rule in custom rule table may be met, also may not meet rule, no matter originally whether meet rule, do not need to have matched again, because remove matching result more too, as long as so find connection table have record, just directly with the down hop gateway of record in table.
In the above embodiment of the present invention, gateway is searched module and can be comprised: the second receiver module, for receiving new message; Second searches submodule, for inquiring about whether there is the message accounting identical with new message from forwarding connection table; Read module, for when forwarding the message accounting that in connection table, existence is identical with new message, reads the down hop gateway corresponding with new message from forwarding connection table.Wherein, the first message that new message did not receive before being router.
Identical message accounting in embodiments of the present invention refers to source address, source port, destination address, destination interface are identical.
Pass through above-described embodiment, forwarding connection table is preserved in gateway router, often forward first message and the relevant information of this first message is recorded generation forwarding connection table, thus can when receiving the message identical with the first message next time, this the first message to the second gateway of direct forwarding, and without the need to repeating the above-mentioned process of searching, changing, cost savings the processing time, improve Consumer's Experience.
Present invention also offers a kind of router, this router can comprise the processing unit of any one the message in above-described embodiment.
Adopt the embodiment of the present invention, after the first gateway getting the first message, according to the source address of the first message, message parameter and the first gateway are searched and are met the second pre-conditioned gateway, and the first message is sent to the second gateway, achieve the flexible selection of the outlet to the first message, and above-mentioned processing method, with low cost, general linux server just can be disposed, safeguard simple, only need a small amount of rule (pre-conditioned namely in above-described embodiment) just can meet internal network user complexity outlet routing demand, and there is higher forwarding performance, solving in prior art cannot be the problem that different source addresses arranges different route outlets, realization can be that it determines the effect of gateway according to source address.
As shown in Figure 2, this router can comprise: message input module 40, route judge module 50, routing policy module 60, message output module 70, the machine input module 80, respond module 90 and the machine output module 100.
Wherein, the first receiver module of acquisition module can be arranged in message input module, and search module and can be arranged in routing policy module 60, forwarding module is arranged in message output module 70.
Particularly, above-mentioned router can be arranged in the kernel of Linux system.
PRE_ROUTING and message input module 40, the input front checkpoint of route.First module of the first message process also namely received, this module polls forwards link, if there is the message accounting consistent with the first message in table, directly read the down hop gateway (i.e. the second gateway) of the first message, and by the routing state mark position 1 of the first message.Through route judge module, if find that the route indication position of the first message is labeled as 1, then without the need to carrying out route judgement to it.
RoutingDecision and route judge module 50, this module is for judging whether the destination address of the first message is the machine, if be the machine, send it to the machine input module, if the destination address of the first message does not point to the machine, then send it to routing policy module.
Particularly, in the flow process of RouteDecision (route judgement), routing table can be preset by inquiry, comprise static routing and policybased routing, determine whether the destination address of the first message points to the machine.
INPUT and the machine input module, through RouteDecision (route judgement), if the destination address of message is the machine, then the first message enters this module.
LocalProcess and above-mentioned respond module, this module can be systematic difference program, for making response to the first message, generates response message.
The machine output module 100 in OUTPUT and above-described embodiment, is exported response message by the machine output module.
FORWARD and above-mentioned routing policy module 60, judge the routing state flag bit of the first message, if be set to 1, just do not process, be directly sent to message output module with regard to it.Otherwise judge that whether source address, entrance network interface card, down hop gateway be eligible, if meet pre-conditioned, obtain the second gateway, and upgrade forwarding connection table.
POST_ROUTING and the machine output module 100, for the first message after OPADD conversion.
There are three up links with network router below, are telecommunications respectively, movement, UNICOM be that example introduces the present invention.
Can be gateway router configuring static route, if telecommunication network address has 2000, mobile network address has 500, and the UNICOM network address has 500, then for gateway router configures 3000 static routing, also namely preset in routing table and have 3000 data.
By the above embodiment of the present invention, if the destination address of the first message request of Intranet outlet belongs to certain operator, the link that gateway router will select this operator corresponding, the first message is sent to gateway corresponding to this operator.
Such as, if " from Intranet 192.168.3.0/24 outlet request, if entrance network interface card is eth0, destination address belongs to telecommunications, selects communication links " this demand will be realized, only need interpolation custom rule as follows:
LBG_CHROUTE-s192.168.3.0/24-ieth0--old-gw telecommunications gateway--new-gw UNICOM gateway
If n inner-mesh network address needs to realize similar demand, only need to increase n rule (namely above-mentioned pre-conditioned).And if use policybased routing realizes, need to increase 2000*n rule.Because the regular quantity of the number ratio conventional method of rule is a lot of less, so forward efficiency improves.
In search performance, the hash algorithm of the static routing of Linux system is more much better than the linear search algorithm of policybased routing.Forward HTTPGET request by gateway router, HTTP reply data length is 65 bytes.
Article 3000, static routing, forwarding performance data: newly-built linking number 6.3W/s, flow 500Mbps.
Article 3000, policybased routing, forwarding performance data: newly-built linking number 4600/s, flow 140Mbps.
By the above embodiment of the present invention, the down hop gateway based on message carries out Route Selection, and realize complicated routing by a small amount of rule, forwarding performance is high, with low cost.
Fig. 3 is the flow chart of the processing method of a kind of message according to the embodiment of the present invention.As shown in Figure 3, the method can comprise the steps:
Step S302: obtain first gateway corresponding with the first message, wherein, the first message comprises source address, the first gateway is the down hop gateway of the first message repeating.
Step S304: search according to the source address of the first message, message parameter and the first gateway and meet the second pre-conditioned gateway.
Step S306: by the first message repeating to the second gateway.
Adopt the embodiment of the present invention, after the first gateway getting the first message, according to the source address of the first message, message parameter and the first gateway are searched and are met the second pre-conditioned gateway, and the first message is sent to the second gateway, achieve the flexible selection of the outlet to the first message, and above-mentioned processing method, with low cost, general linux server just can be disposed, safeguard simple, only need a small amount of rule (pre-conditioned namely in above-described embodiment) just can meet internal network user complexity outlet routing demand, and there is higher forwarding performance, solving in prior art cannot be the problem that different source addresses arranges different route outlets, realization can be that it determines the effect of gateway according to source address.
The request of E-Packeting that the first message in above-described embodiment can send for inner-mesh network user, carry the first message in this request of E-Packeting, the method in above-described embodiment can be applied on gateway router.
According to the abovementioned embodiments of the present invention, obtain first gateway corresponding with the first message can comprise: receive the first message, wherein, with destination address in the first message; From default routing table, inquiry obtains first gateway corresponding with destination address.
Particularly, from default routing table, inquiry obtains first gateway corresponding with destination address and comprises: inquire about whether there is the message accounting identical with the first message from forwarding connection table; When forwarding the message accounting that in connection table, existence is identical with the first message, from forwarding connection table, read the first gateway; When there is not the message accounting identical with the first message in forwarding connection table, from default routing table, inquiry obtains first gateway corresponding with destination address.
Wherein, down hop gateway is a crucial condition, because the quantity of the down hop gateway of gateway router is little, therefore only needs a small amount of rule (pre-conditioned namely in above-described embodiment) just can realize complicated routing demand.
Need to further illustrate, down hop gateway is obtained by queries static routing table (the default routing table namely in above-described embodiment).When initialization gateway router, can be each operator configuring static route on gateway router.Such as, if the destination address of message belongs to telecommunications, the down hop gateway of message is exactly telecommunications gateway.
According to the above embodiment of the present invention, find according to the source address of the first message, message parameter and the first gateway and meet the second pre-conditioned gateway and can comprise: in default gateway table, search the route data consistent with message parameter, source address and the first gateway, wherein, message parameter comprises: destination address, entrance network interface card and outlet network interface card; The gateway pointed to by route data is as the second gateway; When searching in default gateway table less than the route data consistent with message parameter, source address and the first gateway, using the first gateway as described second gateway.The gateway determining the first message down hop is in the above-described embodiments the first gateway or the second gateway.
Particularly, find the route data all consistent with the source address of the first message, message parameter and the first gateway in default gateway table, the gateway that this route data is corresponding is the second gateway of the first message.
Above-mentioned pre-conditioned can be custom rule.Wherein, custom rule uses source address, destination address, entrance network interface card, outlet network interface card and pre-conditioned, specifically as shown in table 1 as routing of down hop gateway.When the above-mentioned data of the first message meet the condition in custom rule, revise the down hop gateway (the first gateway namely in above-described embodiment) of the first message for appointment gateway (the second gateway namely in above-described embodiment), to realize the selection of link.
In the above embodiment of the present invention, the first message repeating to the second gateway can be comprised: network address translation is carried out to the first message and obtains the first message after changing; By the first message repeating to the second gateway after conversion.
Particularly, while by the first message repeating to the second gateway after conversion, processing method can also comprise: logging modle, for by conversion after the first message repeating to the second gateway while, record carries out source address, source port, destination address, destination interface and the down hop gateway before and after network address translation to the first message, generates and forwards connection table.Wherein, down hop gateway is the first gateway or the second gateway in this embodiment.Down hop gateway in this embodiment is also the new down hop gateway in table 1.
Particularly, while forwarding first message, set up and forward connection table, to accelerate the processing speed to the first message.
Set up when forwarding Intranet outlet request message and forward connection table, source address before and after record network address translation and source port, for doing network address translation to reply message, be namely address and the port of Intranet user reply message public network destination address and port translation.
The present invention is introduced in detail below in conjunction with Fig. 4.As shown in Figure 4, the present invention can realize as follows:
Step S401: receive the first message.
Particularly, the first message is received by gateway router.
Step S402: obtain first gateway corresponding with the first message.
Particularly, with the destination address queries static route of the first message, obtain the down hop gateway (i.e. the first gateway) of the first message.
Wherein down hop gateway is a crucial condition, because the down hop gateway quantity of gateway router is little, therefore only needs a small amount of rule just can realize the routing demand of complexity.
Down hop gateway is obtained by queries static routing table.When initialization gateway router, need to be each operator configuring static route on gateway router.Such as, if the destination address of message belongs to telecommunications, the down hop gateway of message is exactly telecommunications gateway.
Step S403: detect the source address of the first message, the first gateway and message parameter and whether meet pre-conditioned.
Wherein, when the source address of the first message, the first gateway and message parameter meet pre-conditioned, step S404 is performed; When the source address of the first message, the first gateway and message parameter do not meet pre-conditioned, perform step S405.
In the above-described embodiments, if so, then new down hop gateway is determined; If not, then new down hop gateway is the first gateway.
Step S404: determine the second gateway.
Particularly, revising down hop gateway is pre-conditioned gateway of specifying.
Step S405: network address translation is carried out to the first message and obtains the first message after changing.
Particularly, network address translation is done to message, namely the source address of message and source port are converted to public network address and the public network port of gateway router.
Step S406: send the first message after conversion.
Particularly, message is sent to network interface card queue by gateway router.
It should be noted that, can perform in the computer system of such as one group of computer executable instructions in the step shown in the flow chart of accompanying drawing, and, although show logical order in flow charts, but in some cases, can be different from the step shown or described by order execution herein.
As can be seen from the above description, present invention achieves following technique effect:
Adopt the embodiment of the present invention, after the first gateway getting the first message, according to the source address of the first message, message parameter and the first gateway are searched and are met the second pre-conditioned gateway, and the first message is sent to the second gateway, achieve the flexible selection of the outlet to the first message, and above-mentioned processing method, with low cost, general linux server just can be disposed, safeguard simple, only need a small amount of rule (pre-conditioned namely in above-described embodiment) just can meet internal network user complexity outlet routing demand, and there is higher forwarding performance, solving in prior art cannot be the problem that different source addresses arranges different route outlets, realization can be that it determines the effect of gateway according to source address.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (13)

1. a processing method for message, is characterized in that, comprising:
Obtain first gateway corresponding with the first message, wherein, described first message comprises source address, and described first gateway is the down hop gateway of described first message repeating;
Search according to the source address of described first message, message parameter and described first gateway and meet the second pre-conditioned gateway;
By described first message repeating to described second gateway.
2. processing method according to claim 1, is characterized in that, obtains first gateway corresponding with the first message and comprises:
Receive described first message, wherein, with destination address in described first message;
From default routing table, inquiry obtains described first gateway corresponding with described destination address.
3. processing method according to claim 2, is characterized in that, searches meet the second pre-conditioned gateway and comprise according to the source address of described first message, message parameter and described first gateway:
In default gateway table, find the route data consistent with described message parameter, described source address and described first gateway, wherein, described message parameter comprises: described destination address, entrance network interface card and outlet network interface card;
The gateway pointed to by described route data is as described second gateway;
When searching in default gateway table less than the route data consistent with described message parameter, described source address and described first gateway, using described first gateway as described second gateway.
4. processing method as claimed in any of claims 1 to 3, is characterized in that, is comprised by described first message repeating to described second gateway:
Network address translation is carried out to described first message and obtains the first message after changing;
By the first message repeating after described conversion to described second gateway.
5. processing method according to claim 4, is characterized in that, while by the first message repeating after described conversion to described second gateway, described processing method also comprises:
Record carries out source address, source port, destination address, destination interface and the down hop gateway before and after network address translation to described first message, and generate and forward connection table, wherein, described down hop gateway is described first gateway or described second gateway.
6. processing method according to claim 5, is characterized in that, after generation forwards connection table, described processing method also comprises:
Receive new message;
Inquire about from described forwarding connection table and whether there is the message accounting identical with described new message;
When there is the message accounting identical with described new message in described forwarding connection table, from described forwarding connection table, read the down hop gateway corresponding with described new message.
7. a processing unit for message, is characterized in that, comprising:
Acquisition module, for obtaining first gateway corresponding with the first message, wherein, described first message comprises source address, and described first gateway is the down hop gateway of described first message repeating;
Searching module, meeting the second pre-conditioned gateway for searching according to the source address of described first message, message parameter and described first gateway;
Forwarding module, for by described first message repeating to described second gateway.
8. processing unit according to claim 7, is characterized in that, described acquisition module comprises:
First receiver module, for receiving described first message, wherein, with destination address in described first message;
Gateway searches module, obtains described first gateway corresponding with described destination address for inquiry from default routing table.
9. processing unit according to claim 8, is characterized in that, described in search module and comprise:
First searches submodule, and for finding the route data consistent with described message parameter, described source address and described first gateway in default gateway table, wherein, described message parameter comprises: described destination address, entrance network interface card and outlet network interface card;
First determination module, for the gateway that pointed to by described route data as described second gateway;
Second determination module, for searching in default gateway table less than the route data consistent with described message parameter, described source address and described first gateway, using described first gateway as described second gateway.
10. according to the processing unit in claim 7 to 9 described in any one, it is characterized in that, described forwarding module comprises:
Address conversion module, obtains the first message after changing for carrying out network address translation to described first message;
Forward submodule, for by the first message repeating after described conversion to described second gateway.
11. processing unit according to claim 10, is characterized in that, described processing unit also comprises:
Logging modle, for by the first message repeating after described conversion to while described second gateway, record carries out source address, source port, destination address, destination interface and the down hop gateway before and after network address translation to described first message, generate and forward connection table, wherein, described down hop gateway is described first gateway or described second gateway.
12. processing unit according to claim 11, is characterized in that, described gateway is searched module and comprised:
Second receiver module, for receiving new message;
Second searches submodule, whether there is the message accounting identical with described new message for inquiring about from described forwarding connection table;
Read module, for there is the message accounting identical with described new message in described forwarding connection table, reads the down hop gateway corresponding with described new message from described forwarding connection table.
13. 1 kinds of routers, is characterized in that, comprise the processing unit of the message in claim 7 to 12 described in any one.
CN201410293381.7A 2014-06-25 2014-06-25 Processing method, device and the router of message Active CN105207904B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410293381.7A CN105207904B (en) 2014-06-25 2014-06-25 Processing method, device and the router of message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410293381.7A CN105207904B (en) 2014-06-25 2014-06-25 Processing method, device and the router of message

Publications (2)

Publication Number Publication Date
CN105207904A true CN105207904A (en) 2015-12-30
CN105207904B CN105207904B (en) 2018-07-17

Family

ID=54955348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410293381.7A Active CN105207904B (en) 2014-06-25 2014-06-25 Processing method, device and the router of message

Country Status (1)

Country Link
CN (1) CN105207904B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707478A (en) * 2017-09-30 2018-02-16 迈普通信技术股份有限公司 Data forwarding method and equipment
CN109495461A (en) * 2018-11-01 2019-03-19 北京车和家信息技术有限公司 Data access request processing method, device and vehicle-mounted central control system
CN114697186A (en) * 2022-03-03 2022-07-01 中国电子科技集团公司第二十八研究所 Plug-in network management system based on dual routing

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060182118A1 (en) * 2005-02-01 2006-08-17 Hong Kong Applied Science and Technology Research Institute Company Limited System And Method For Efficient Traffic Processing
CN101217465A (en) * 2007-12-28 2008-07-09 北京锐安科技有限公司 A route selecting method for multi-exit server and router
CN101383778A (en) * 2008-10-27 2009-03-11 杭州华三通信技术有限公司 Packet transmission method based on network dual exit and exit router
US20090323693A1 (en) * 2006-09-07 2009-12-31 Qin Yin Method and apparatus for managing route information and forwarding data in access devices
CN101668010A (en) * 2009-09-22 2010-03-10 中兴通讯股份有限公司 Method and device for sharing multi-interface data stream load in WiMAX system
CN101938399A (en) * 2009-06-30 2011-01-05 华为技术有限公司 Routing method and device
CN102186221A (en) * 2011-04-25 2011-09-14 北京星网锐捷网络技术有限公司 Method and device for updating routing table item
CN102664804A (en) * 2012-04-24 2012-09-12 汉柏科技有限公司 Method and system for achieving network bridge function of network equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060182118A1 (en) * 2005-02-01 2006-08-17 Hong Kong Applied Science and Technology Research Institute Company Limited System And Method For Efficient Traffic Processing
US20090323693A1 (en) * 2006-09-07 2009-12-31 Qin Yin Method and apparatus for managing route information and forwarding data in access devices
CN101217465A (en) * 2007-12-28 2008-07-09 北京锐安科技有限公司 A route selecting method for multi-exit server and router
CN101383778A (en) * 2008-10-27 2009-03-11 杭州华三通信技术有限公司 Packet transmission method based on network dual exit and exit router
CN101938399A (en) * 2009-06-30 2011-01-05 华为技术有限公司 Routing method and device
CN101668010A (en) * 2009-09-22 2010-03-10 中兴通讯股份有限公司 Method and device for sharing multi-interface data stream load in WiMAX system
CN102186221A (en) * 2011-04-25 2011-09-14 北京星网锐捷网络技术有限公司 Method and device for updating routing table item
CN102664804A (en) * 2012-04-24 2012-09-12 汉柏科技有限公司 Method and system for achieving network bridge function of network equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707478A (en) * 2017-09-30 2018-02-16 迈普通信技术股份有限公司 Data forwarding method and equipment
CN109495461A (en) * 2018-11-01 2019-03-19 北京车和家信息技术有限公司 Data access request processing method, device and vehicle-mounted central control system
CN109495461B (en) * 2018-11-01 2021-07-23 北京车和家信息技术有限公司 Data access request processing method and device and vehicle-mounted central control system
CN114697186A (en) * 2022-03-03 2022-07-01 中国电子科技集团公司第二十八研究所 Plug-in network management system based on dual routing
CN114697186B (en) * 2022-03-03 2023-08-15 中国电子科技集团公司第二十八研究所 Plug-and-play network management system based on dual routing

Also Published As

Publication number Publication date
CN105207904B (en) 2018-07-17

Similar Documents

Publication Publication Date Title
US9338079B2 (en) Method of routing multicast traffic
US7260096B2 (en) Method and router for forwarding internet data packets
CN107925613A (en) It is used for the methods, devices and systems to E-Packet in business function chain SFC
EP2984798B1 (en) Identification of paths taken through a network of interconnected devices
CN106470158B (en) Message forwarding method and device
CN104821890A (en) Realization method for OpenFlow multi-level flow tables based on ordinary switch chip
WO2017107814A1 (en) Method, apparatus and system for propagating qos policies
CN109714274B (en) Method for acquiring corresponding relation and routing equipment
CN107547346B (en) Message transmission method and device
CN111010329B (en) Message transmission method and device
CN105515992A (en) Method and device for processing flow table items of VXLAN network
CN102857428A (en) Message transmitting method and message transmitting equipment on basis of access control list
CN105471747A (en) Intelligent router routing method and apparatus thereof
US20130124721A1 (en) Detected IP Link and Connectivity Inference
CN113726653B (en) Message processing method and device
CN105207904A (en) Message processing method, device and router
CN110022263B (en) Data transmission method and related device
CN110391984B (en) Message forwarding method and device
CN108777654B (en) Message forwarding method and routing equipment
CN102739519B (en) Rooted multipoint service implementation method, device and system, and provider edge equipment
Cisco ISO CLNS Commands
CN109005120B (en) Message processing method and network equipment
CN106656810B (en) MAC address learning method and device
CN101989946A (en) Compression method of communication equipment route forwarding table
CN109714259B (en) Traffic 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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200713

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping B radio 14 floor tower square

Patentee before: Guangzhou Dongjing Computer Technology Co.,Ltd.

TR01 Transfer of patent right