CN102655476B - Internet protocol flow transmitting method and device - Google Patents

Internet protocol flow transmitting method and device Download PDF

Info

Publication number
CN102655476B
CN102655476B CN201210116220.1A CN201210116220A CN102655476B CN 102655476 B CN102655476 B CN 102655476B CN 201210116220 A CN201210116220 A CN 201210116220A CN 102655476 B CN102655476 B CN 102655476B
Authority
CN
China
Prior art keywords
forwarding
keyword
data message
stream
forwards
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.)
Active
Application number
CN201210116220.1A
Other languages
Chinese (zh)
Other versions
CN102655476A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210116220.1A priority Critical patent/CN102655476B/en
Publication of CN102655476A publication Critical patent/CN102655476A/en
Application granted granted Critical
Publication of CN102655476B publication Critical patent/CN102655476B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention discloses an internet protocol flow transmitting method and device. The internet protocol flow transmitting method comprises the following steps of: receiving data messages; inquiring a flow transmission list according to obtained first flow transmission keywords in the data messages; transmitting the data messages according to export information in first flow transmission records when keywords in the first flow transmission records in the flow transmission list are the same as the first flow transmission keywords; and inquiring the flow transmission list according to obtained second flow transmission keywords of the data messages when any recorded keyword in the flow transmission list is not the same as the first flow transmission keywords, and the data messages are internet protocol (IP) messages passing through GRE (Generic Routing Encapsulation), or transmitting the data messages according to import information in second flow transmission records when keywords in the second flow transmission records in the flow transmission list are the same with the second flow transmission keywords. The internet protocol flow transmitting method and the internet protocol flow transmitting device can be used for solving the problem of low flow transmission success rate in the flow transmission of the IP data messages encapsulated in a GRE tunnel.

Description

A kind of Internet protocol stream forwarding method, and equipment
Technical field
The present invention relates to communication technical field, particularly a kind of Internet protocol stream forwarding method, and equipment.
Background technology
Routing forwarding generally comprises two kinds of forms, one is forward data packets one by one (that is: bag forwards), the implementation forwarding data packets one by one is: each data message mates according to data message content, delete Internet protocol (the Internet Protocol of data message, IP) encapsulation before head, outgoing interface address and the message encapsulated type of looking into route forwarding table and obtain data message according to the flow forwarding keyword of data message, obtain outlet information; Then forward above-mentioned data message according to above-mentioned outlet information.Another kind is flow forwarding, and the implementation of flow forwarding is: the flow forwarding of exact matching, the route that namely we often say repeatedly forwards.Flow forwarding is to receive after first data message of data flow, outgoing interface address and the protocol type of this data message is recorded, while receiving the data message of this data flow afterwards as again, directly according to the forwarding behavior processing of record before.Data flow refers to the set of the data message with same stream feature.
Conventionally, IP flow forwarding comprises:
(1), receiving data packets, extract flow forwarding keyword;
Extract flow forwarding keyword specifically: according to handling process need to extract relevant flow forwarding keyword at data message IP head, as: extract data message source internet protocol IP address, data message object IP address, next layer protocol type of IP etc.
(2), search stream forwarding list, if search unsuccessfully, enter (3), search successfully and enter (7);
In the time of initial condition, stream forwarding list is empty, and step (2) is searched stream forwarding list can failure.
(3), entrance processing; Entrance processing is specially: resolve and delete before IP head link layer message encapsulation.
(4), search route; Specifically according to flow forwarding keyword search route forwarding table.
(5), outlet is processed; Be specially: add data message link layer packaging.
(6), add stream forwarding list, enter (8); Adding stream forwarding list is specially: the information finding in (4) is joined to stream forwarding list.
(7), carry out flow forwarding, enter (8);
(8), send datagram.
But for IP datagram literary composition by generic route encapsulation (Generic Routing Extension, GRE) data message of tunnel encapsulation, have inside and outside two-layer IP head, outer IP identical data message may be due to internal layer IP data difference, and does different forwarding behaviors.Existing IP flow forwarding is to set up stream forwarding list based on outermost layer IP head, cannot distinguish the difference of GRE internal layer data message.If use existing method, many different data flow with identical gre tunneling encapsulation only can be set up an IP stream forwarding list item, and cause a part of IP flow forwarding mistake.
Inventor finds in the process that realizes the embodiment of the present invention: by generic route encapsulation (Generic Routing Extension,, in the process forwarding according to existing IP flow forwarding technology, often there is forwarding wrong situation in GRE) the IP datagram literary composition of tunnel encapsulation.
Summary of the invention
The embodiment of the present invention provides a kind of Internet protocol stream forwarding method, and equipment, while carrying out flow forwarding, occurs forwarding mistake for solving the IP datagram literary composition of gre tunneling encapsulation, causes the problem that flow forwarding success rate is low.
A kind of message forwarding method, comprising:
Receiving data packets;
Obtain the first-class forwarding keyword of described data message, source internet protocol IP address and object IP address that described first-class forwarding keyword comprises the outer encapsulation of described data message, and protocol type;
According to described first-class forwarding keyword query stream forwarding list, in described stream forwarding list, comprise the corresponding relation of keyword and outlet information; In the time that the keyword of the first-class forwarding record in described stream forwarding list is identical with described first-class forwarding keyword, the outlet information recording according to described first-class forwarding forwards described data message;
In the time that the keyword of any existing record in described stream forwarding list and described first-class forwarding keyword are all not identical, if described data message is the Internet protocol IP message through generic route encapsulation GRE, the second that obtains described data message forwards keyword, described second forwards source IP address and the object IP address that keyword comprises described data message internal layer encapsulation, according to stream forwarding list described in described second forwarding keyword query;
The keyword that forwards record when second in described stream forwarding list and described second forward keyword when identical, forward the outlet information recording forward described data message according to described second.
A kind of Internet protocol flow forwarding equipment, comprising:
Message receiving element, for receiving data packets;
First Characteristic extraction unit, for obtaining the first-class forwarding keyword of described data message, source internet protocol IP address and object IP address that described first-class forwarding keyword comprises the outer encapsulation of described data message, and protocol type;
Flow stream searching unit, for according to described first-class forwarding keyword query stream forwarding list, comprises the corresponding relation of keyword and outlet information in described stream forwarding list; According to stream forwarding list described in described second forwarding keyword query;
Flow forwarding control unit, in the time that the keyword of the first-class forwarding record of described stream forwarding list is identical with described first-class forwarding keyword, the outlet information recording according to described first-class forwarding forwards described data message;
Second Characteristic extraction unit, for in the time that any existing keyword recording of described stream forwarding list and described first-class forwarding keyword are all not identical, if described data message is the Internet protocol IP message through generic route encapsulation GRE, the second that obtains described data message forwards keyword, and described second forwards source IP address and the object IP address that keyword comprises described data message internal layer encapsulation;
Described flow stream searching unit, also for forwarding stream forwarding list described in keyword query according to described second;
Described flow forwarding control unit, also forwards keyword when identical for the keyword that forwards record when the second of described stream forwarding list and described second, forwards the outlet information recording forward described data message according to described second.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages: the internal layer IP head of the IP datagram literary composition encapsulating by gre tunneling is distinguished a different IP data flow in gre tunneling, and stream forwarding list is set up and searched to the flow forwarding keyword obtaining according to internal layer IP head, realize the flow forwarding of the IP datagram literary composition of gre tunneling encapsulation, when the IP datagram literary composition that can solve gre tunneling encapsulation carries out flow forwarding, occur forwarding mistake, cause the problem that flow forwarding success rate is low.
Brief description of the drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing of required use during embodiment is described is briefly introduced, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is embodiment of the present invention method flow schematic diagram;
Fig. 2 is embodiment of the present invention flow forwarding example schematic;
Fig. 3 is embodiment of the present invention other method schematic flow sheet;
Fig. 4 is embodiment of the present invention other method schematic flow sheet;
Fig. 5 A is the IP datagram literary composition encapsulation format schematic diagram of embodiment of the present invention gre tunneling encapsulation;
Fig. 5 B is the IP datagram literary composition encapsulation format schematic diagram of another gre tunneling encapsulation of the embodiment of the present invention;
Fig. 6 is embodiment of the present invention Internet protocol flow forwarding device structure schematic diagram;
Fig. 7 is another Internet protocol flow forwarding device structure schematic diagram of the embodiment of the present invention.
Embodiment
In order to make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, the present invention is described in further detail, and obviously, described embodiment is only a part of embodiment of the present invention, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making all other embodiment that obtain under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention provides a kind of Internet protocol stream forwarding method, as shown in Figure 1, comprising:
101: receiving data packets; Obtain the first-class forwarding keyword of above-mentioned data message, source internet protocol IP address and object IP address that above-mentioned first-class forwarding keyword comprises the outer encapsulation of above-mentioned data message, and protocol type;
102: according to above-mentioned first-class forwarding keyword query stream forwarding list, in above-mentioned stream forwarding list, comprise the corresponding relation of keyword and outlet information;
103: in the time that the keyword of the first-class forwarding record in above-mentioned stream forwarding list is identical with above-mentioned first-class forwarding keyword, the outlet information recording according to above-mentioned first-class forwarding forwards above-mentioned data message;
Above-mentioned outlet packets of information is containing message outgoing interface address and message encapsulation header type.Optionally, outlet information can also comprise: port numbers, subnet mask field etc.
104: in the time that the keyword of any existing record in above-mentioned stream forwarding list and above-mentioned first-class forwarding keyword are all not identical, if above-mentioned data message is the Internet protocol IP message through generic route encapsulation GRE, the second that obtains above-mentioned data message forwards keyword, above-mentioned second forwards source IP address and the object IP address that keyword comprises above-mentioned data message internal layer encapsulation, forwards the above-mentioned stream forwarding list of keyword query according to above-mentioned second;
Alternatively, the above-mentioned second that obtains above-mentioned data message forwards keyword and comprises: above-mentioned data message is carried out generic route encapsulation decapsulation and obtained the internal layer IP head of above-mentioned data message, the second that extracts above-mentioned data message according to above-mentioned internal layer IP head forwards keyword.In subsequent embodiment, will be described in more detail with regard to message repeating and the decapsulation of gre tunneling encapsulation.
Further, in order to strengthen identification to data message and the matching degree with stream forwarding list, the information that flow forwarding keyword comprises can also further expand, and comprising: source port number, destination slogan, at least one item in tunnel index and Virtual Private Network index.It should be noted that the open-ended information of flow forwarding keyword can also have a lot, be not limited in above seven kinds, as long as can all be fine for the flow forwarding keyword of unique definite IP stream, the embodiment of the present invention will not limit this.
105: the keyword that forwards record when second in above-mentioned stream forwarding list and above-mentioned second forward keyword when identical, forward the outlet information recording forward above-mentioned data message according to above-mentioned second.
Illustrate: as shown in Figure 2, suppose to have two data flow, object IP address is respectively 192.168.1.1 and 192.168.2.1, by network boundary equipment 1 (Provider Edge 1, PE1) carry out gre tunneling encapsulation forwarding, article two, the source IP of data stream after GRE encapsulation is 1.1.1.1, and object IP is 2.2.2.2, and passing through network arrives PE2.If carry out flow forwarding on PE2, according to prior art scheme implementation be: PE2 can extract flow forwarding keyword according to the outer IP of gre tunneling encapsulation, source IP is 1.1.1.1, object IP is 2.2.2.2, and set up stream forwarding list, hypothesis goal is that the data flow of 192.168.1.1 is first set up stream forwarding list, and the forwarding behavior of recording in stream forwarding list---outgoing interface is FE 0/0.When the data flow that is 192.168.2.1 when object like this arrives PE2, because the outer IP head of GRE is the same, the flow forwarding keyword extracting is identical, the stream forwarding list that the data flow that destination is 192.168.2.1 is like this set up before also can hitting, cause forwarding to FE0/0 of data message mistake, and unexpected interface FE0/1.And use embodiment of the present invention method, in the time that the data flow that is 192.168.2.1 when object arrives PE2, use the IP head of internal layer to extract flow forwarding keyword, the stream forwarding list of setting up before can not hitting, can newly set up the list item of an other stream forwarding list, thereby this data flow correctly can be sent to 192.168.2.1, promote and forward success rate.
Therefore adopt above method, distinguish the different IP stream of a gre tunneling by the internal layer IP head of gre tunneling encapsulation of data message, and search stream forwarding list with the flow forwarding keyword that internal layer IP head obtains, realize the flow forwarding of gre tunneling encapsulation of data message, when the data message that can solve gre tunneling encapsulation carries out IP flow forwarding, occur forwarding mistake, cause the problem that flow forwarding success rate is low.
Alternatively, above-mentioned flow forwarding keyword is for the IP stream under unique differentiation data message, flow forwarding keyword can be that multiple set of properties are synthetic, for example: former IP address+object IP address, also can be that multiple attributes are carried out to Hash (HASH), for example HASH (source IP address+object IP address), the value obtaining.
As shown in Figure 3, the embodiment of the present invention provides the method for another kind of Internet protocol flow forwarding, comprising:
301: receiving data packets; Obtain the first-class forwarding keyword of above-mentioned data message, source internet protocol IP address and object IP address that above-mentioned first-class forwarding keyword comprises the outer encapsulation of above-mentioned data message, and protocol type;
302: according to above-mentioned first-class forwarding keyword query stream forwarding list, in above-mentioned stream forwarding list, comprise the corresponding relation of keyword and outlet information;
303: in the time that the keyword of the first-class forwarding record in above-mentioned stream forwarding list is identical with above-mentioned first-class forwarding keyword, the outlet information recording according to above-mentioned first-class forwarding forwards above-mentioned data message;
Above-mentioned outlet packets of information is containing message outgoing interface address and message encapsulation header type.Optionally, outlet information can also comprise: port numbers, subnet mask field etc.
304: in the time that the keyword of any existing record in above-mentioned stream forwarding list and above-mentioned first-class forwarding keyword are all not identical, if above-mentioned data message is the Internet protocol IP message through generic route encapsulation GRE, the second that obtains above-mentioned data message forwards keyword, above-mentioned second forwards source IP address and the object IP address that keyword comprises above-mentioned data message internal layer encapsulation, forwards the above-mentioned stream forwarding list of keyword query according to above-mentioned second;
305: the keyword that forwards record when second in above-mentioned stream forwarding list and above-mentioned second forward keyword when identical, forward the outlet information recording forward above-mentioned data message according to above-mentioned second.
Alternatively, the above-mentioned second that obtains above-mentioned data message forwards keyword and comprises: above-mentioned data message is carried out generic route encapsulation decapsulation and obtained the internal layer IP head of above-mentioned data message, the second that extracts above-mentioned data message according to above-mentioned internal layer IP head forwards keyword.In subsequent embodiment, will be described in more detail with regard to message repeating and the decapsulation of gre tunneling encapsulation.
Further, in order to strengthen identification to data message and the matching degree with stream forwarding list, the information that flow forwarding keyword comprises can also further expand, and comprising: source port number, destination slogan, at least one item in tunnel index and Virtual Private Network index.It should be noted that the open-ended information of flow forwarding keyword can also have a lot, be not limited in above seven kinds, as long as can all be fine for the flow forwarding keyword of unique definite IP stream, the embodiment of the present invention will not limit this.
306: in the time that the keyword of any existing record in above-mentioned stream forwarding list and above-mentioned second forwarding keyword are all not identical, forward keyword query route forwarding table according to above-mentioned second, in above-mentioned route forwarding table, comprise the corresponding relation of keyword and forwarding information; The keyword that forwards record when secondary route in above-mentioned route forwarding table and above-mentioned second forward keyword when identical, forward the above-mentioned data message of record forwarding according to above-mentioned secondary route; And forward according to above-mentioned secondary route the second outlet information of obtaining that records, and above-mentioned second forwarding keyword and above-mentioned second is exported to information updating in above-mentioned stream forwarding list, the message so that follow-up with same stream forwarding keyword forwards according to above-mentioned stream forwarding list.
It should be noted that, above-mentioned according to above-mentioned secondary route forwarding record, forward above-mentioned data message, forward according to above-mentioned secondary route the second outlet information of obtaining that records with above-mentioned, and above-mentioned second forwarding keyword and above-mentioned the second outlet information updating are arrived to above-mentioned stream forwarding list, also can carry out simultaneously; Or, first, according to above-mentioned secondary route forwarding record, forward above-mentioned data message, then forward according to above-mentioned secondary route the second outlet information of obtaining that records, and above-mentioned second forwarding keyword and above-mentioned the second outlet information updating are arrived to above-mentioned stream forwarding list.To this, the present invention does not limit.
306: in the time that the keyword of any existing record in above-mentioned stream forwarding list and above-mentioned first-class forwarding keyword are all not identical, if above-mentioned data message is not the Internet protocol IP message through generic route encapsulation GRE, according to above-mentioned first-class forwarding keyword query route forwarding table, the corresponding relation that above-mentioned route forwarding table comprises keyword and forwarding information; In the time that the keyword of the first routing forwarding record in above-mentioned route forwarding table is identical with above-mentioned first-class forwarding keyword, according to above-mentioned the first routing forwarding record, forward above-mentioned data message; And obtain the first outlet information according to above-mentioned the first routing forwarding record, and above-mentioned first-class forwarding keyword and above-mentioned first is exported to information updating in above-mentioned stream forwarding list, the message so that follow-up with same stream forwarding keyword forwards according to above-mentioned stream forwarding list.
It should be noted that, above-mentioned according to the above-mentioned data message of above-mentioned the first routing forwarding record forwarding, obtain the first outlet information with above-mentioned according to above-mentioned the first routing forwarding record, and above-mentioned first-class forwarding keyword and above-mentioned the first outlet information updating are arrived to above-mentioned stream forwarding list, also can carry out simultaneously; Or, first forward above-mentioned data message according to above-mentioned the first routing forwarding record, then obtain the first outlet information according to above-mentioned the first routing forwarding record, and above-mentioned first-class forwarding keyword and above-mentioned first is exported to information updating to above-mentioned stream forwarding list.To this, the present invention does not limit.
The embodiment of the present invention can be in the case of the flow forwarding keyword that does not roll up stream forwarding list, realizes the identification to different IP stream in gre tunneling, thereby in IP flow forwarding, distinguishes the forwarding behavior of different IP stream.Realize the flow forwarding of gre tunneling encapsulation of data message, when the data message that can solve gre tunneling encapsulation carries out IP flow forwarding, occurred forwarding mistake, caused the problem that flow forwarding success rate is low.
For instance, as shown in Figure 4, be elaborated with the message repeating of other packaged types beyond gre tunneling encapsulation and gre tunneling encapsulation.Comprise as shown in Figure 4:
401: receiving data packets.
Above-mentioned data message can be as the encapsulation format in Fig. 5 A left side, comprises from outside to inside: outer IP head, GRE, internal layer IP head and data load can be also as the encapsulation format of Fig. 5 B rightmost side, comprise from outside to inside: internal layer IP head and IP data.
402: the first-class forwarding keyword that extracts above-mentioned data message from the outermost layer IP head of above-mentioned data message.First-class forwarding keyword comprises: source IP address and object IP address, and protocol type.
403: use above-mentioned first-class forwarding keyword search stream forwarding list.If search successfully, that is: in stream forwarding list, there is the list item identical with above-mentioned first-class forwarding keyword, enter 407, if search unsuccessfully, that is: in stream forwarding list, there is no the list item identical with above-mentioned first-class forwarding keyword, enter 404.
Because stream forwarding list has been stored the corresponding relation of keyword with outlet information, so can obtain the outlet information corresponding with first-class forwarding keyword after searching successfully.
Above-mentioned outlet packets of information is containing message outgoing interface address and message encapsulation header type.Optionally, outlet information can also comprise: port numbers, subnet mask field etc.
404: judge whether above-mentioned data message is the data message of gre tunneling encapsulation.If so, enter 405, if not, enter 408.
405: extract second according to the internal layer IP head of above-mentioned data message and forward keyword.While resolving GRE in this step, can remove outer IP head and GRE, the protocol header as shown in Fig. 5 B centre and IP data, remaining internal layer IP head and IP data as shown in Fig. 5 B rightmost, then extract second from internal layer IP head and forward keyword.
406: forward keyword search stream forwarding list according to second.If search successfully, enter 407, if search unsuccessfully, enter 408.
Because stream forwarding list has been stored the corresponding relation of keyword with outlet information, so can obtain forwarding with second the outlet information that keyword is corresponding after searching successfully.
407: carry out flow forwarding, be specially: the outlet information corresponding according to flow forwarding keyword forwards above-mentioned data message.
It should be noted that, if enter this step from 403, flow forwarding keyword is in this step first-class forwarding keyword; If enter this step from 406, flow forwarding keyword is in this step that second forwards keyword.
408: wrap forwarding, be specially: according to flow forwarding keyword query route forwarding table, and forward above-mentioned data message according to inquiring routing forwarding record.
In above-mentioned route forwarding table, comprise the corresponding relation of keyword and forwarding information.
It should be noted that, if enter this step from 404, the flow forwarding keyword in this step is first-class forwarding keyword.Correspondingly, bag forwards and is specially:
According to above-mentioned first-class forwarding keyword query route forwarding table, and according to the routing forwarding record finding, forward above-mentioned data message.
If enter this step from 406, the flow forwarding keyword in this step is that second forwards keyword.Correspondingly, bag forwards and is specially:
Forward keyword query route forwarding table according to above-mentioned second, and according to the routing forwarding record finding, forward above-mentioned data message.
409: upgrade stream forwarding list.
Specifically, if enter 408 from 404, the flow forwarding keyword in this step is first-class forwarding keyword.Correspondingly, upgrading stream forwarding list is specially:
Obtain the first outlet information according to the routing forwarding record finding in 408, and above-mentioned first-class forwarding keyword and above-mentioned first is exported to information updating in above-mentioned stream forwarding list.
If enter 408 from 406, the flow forwarding keyword in this step is that second forwards keyword.Correspondingly, upgrading stream forwarding list is specially:
Obtain the second outlet information according to the routing forwarding record finding in 408, and above-mentioned second forwarding keyword and above-mentioned second is exported to information updating in above-mentioned stream forwarding list.The internal layer IP head of the IP datagram literary composition that above embodiment encapsulates by gre tunneling is distinguished a different IP data flow in gre tunneling, and stream forwarding list is set up and searched to the flow forwarding keyword obtaining according to internal layer IP head, realize the flow forwarding of the IP datagram literary composition of gre tunneling encapsulation, when the IP datagram literary composition that can solve gre tunneling encapsulation carries out flow forwarding, there is forwarding mistake, cause the problem that flow forwarding success rate is low, promote and forward success rate.
According to the flow process shown in Fig. 3, stream forwarding list process of establishing is as follows:
Realize stream forwarding method of the present invention, the flow forwarding key field of setting up stream forwarding list can comprise three: source IP address, object IP address and protocol type.In the time that stream forwarding list is not set up, collect stream forwarding list feature field by once wrapping forwarding process.In the time that the network equipment terminates equipment and tunnel transmission equipment as gre tunneling respectively, bag forwards carries out following basic forwarding behavior: for gre tunneling sealed in unit, as the PE1 in Fig. 2, IP datagram literary composition can be added to GRE head; For gre tunneling transmission equipment, as the router in network between PE1 in Fig. 2 and PE2, can be by the data message of GRE encapsulation as common IP datagram literary composition, whether nonrecognition is GRE data message, as shown in Figure 5A, search after route agreement and IP data unchanged.For gre tunneling termination equipment, as the PE2 in Fig. 2, and refer to Fig. 5 B, whether PE2 can identify GRE data message, and PE2 needs to resolve GRE before carrying out and searching route, when PE2 resolves GRE, the GRE head in GRE data message can be deleted, that is: can remove outer IP head and GRE, obtain only comprising internal layer IP head and IP data as Fig. 5 B right side, then from the IP head of internal layer, extract keyword, thereby complete resolving GRE.
The embodiment of the present invention also provides a kind of Internet protocol flow forwarding equipment, as shown in Figure 6, and for realizing the Internet protocol stream forwarding method shown in Fig. 1 of the present invention.The said equipment comprises message receiving element 501, First Characteristic extraction unit 502, flow stream searching unit 503, flow forwarding control unit 504 and Second Characteristic extraction unit 505.Wherein:
Above-mentioned message receiving element 501, for receiving data packets;
Above-mentioned First Characteristic extraction unit 502, for obtaining the first-class forwarding keyword of above-mentioned data message, source internet protocol IP address and object IP address that above-mentioned first-class forwarding keyword comprises the outer encapsulation of above-mentioned data message, and protocol type;
Above-mentioned flow stream searching unit 503, for according to above-mentioned first-class forwarding keyword query stream forwarding list, comprises the corresponding relation of keyword and outlet information in above-mentioned stream forwarding list;
Above-mentioned flow forwarding control unit 504, in the time that the keyword of the first-class forwarding record of above-mentioned stream forwarding list is identical with above-mentioned first-class forwarding keyword, the outlet information recording according to above-mentioned first-class forwarding forwards above-mentioned data message;
Above-mentioned Second Characteristic extraction unit 505, for in the time that any existing keyword recording of above-mentioned stream forwarding list and above-mentioned first-class forwarding keyword are all not identical, if above-mentioned data message is the Internet protocol IP message through generic route encapsulation GRE, the second that obtains above-mentioned data message forwards keyword, and above-mentioned second forwards source IP address and the object IP address that keyword comprises above-mentioned data message internal layer encapsulation;
Above-mentioned flow stream searching unit 503, also for forwarding the above-mentioned stream forwarding list of keyword query according to above-mentioned second;
Above-mentioned flow forwarding control unit 504, also forwards keyword when identical for the keyword that forwards record when the second of above-mentioned stream forwarding list and above-mentioned second, forwards the outlet information recording forward above-mentioned data message according to above-mentioned second.
More specifically, above-mentioned Second Characteristic extraction unit 505, specifically in the time that the keyword of any existing record in above-mentioned stream forwarding list and above-mentioned first-class forwarding keyword are all not identical, if above-mentioned data message is the Internet protocol IP message through generic route encapsulation GRE, above-mentioned data message is carried out to generic route encapsulation GRE decapsulation, obtain the internal layer IP head of above-mentioned data message, the second that extracts above-mentioned data message according to above-mentioned internal layer IP head forwards keyword.
Adopt the scheme of the embodiment of the present invention, distinguish the different IP stream of a gre tunneling by the internal layer IP head of gre tunneling encapsulation of data message, and search stream forwarding list with the flow forwarding keyword that internal layer IP head obtains, realize the flow forwarding of gre tunneling encapsulation of data message, the data message that can solve gre tunneling encapsulation carries out the low problem of IP flow forwarding success rate, promotes and forwards success rate.
Further, as shown in Figure 7, the said equipment also comprises routing table lookup unit 601, stream table updating block 602, routing forwarding control unit 603 and acquiring unit 604, for realizing the Internet protocol stream forwarding method shown in Fig. 3 of the present invention and Fig. 4.
Above-mentioned routing table lookup unit 601, in the time that the keyword of any existing record of above-mentioned stream forwarding list and above-mentioned second forwarding keyword are all not identical; Forward keyword query route forwarding table according to above-mentioned second, in above-mentioned route forwarding table, comprise the corresponding relation of keyword and forwarding information;
Above-mentioned acquiring unit 604, forwards keyword when identical for the keyword and the above-mentioned second that forward record when the secondary route of above-mentioned route forwarding table, forwards according to above-mentioned secondary route the second outlet information of obtaining that records; Above-mentioned outlet packets of information is containing message outgoing interface address and message encapsulation header type;
Above-mentioned routing forwarding control unit 603, forwards keyword when identical for the keyword and the above-mentioned second that forward record when the secondary route of above-mentioned route forwarding table, according to above-mentioned secondary route forwarding record, forwards above-mentioned data message;
Above-mentioned stream table updating block 602, for above-mentioned second being forwarded to keyword and above-mentioned the second outlet information updating to above-mentioned stream forwarding list, the message so that follow-up with same stream forwarding keyword forwards according to above-mentioned stream forwarding list.
Further, above-mentioned routing table lookup unit 601, also in the time that the keyword of any existing record of above-mentioned stream forwarding list and above-mentioned first-class forwarding keyword are all not identical, if above-mentioned data message is not the Internet protocol IP message through generic route encapsulation GRE, according to above-mentioned first-class forwarding keyword query route forwarding table, the corresponding relation that above-mentioned route forwarding table comprises keyword and forwarding information;
Above-mentioned acquiring unit 604, also, in the time that the keyword of the first routing forwarding record of above-mentioned route forwarding table is identical with above-mentioned first-class forwarding keyword, records according to above-mentioned the first routing forwarding the first outlet information of obtaining;
Above-mentioned routing forwarding control unit 603, also, in the time that the keyword of the first routing forwarding record of above-mentioned route forwarding table is identical with above-mentioned first-class forwarding keyword, according to above-mentioned the first routing forwarding record, forwards above-mentioned data message;
Above-mentioned stream table updating block 602, also for above-mentioned first-class forwarding keyword and above-mentioned first is exported to information updating to above-mentioned stream forwarding list, the message so that follow-up with same stream forwarding keyword forwards according to above-mentioned stream forwarding list.
The embodiment of the present invention, the internal layer IP head of the IP datagram literary composition encapsulating by gre tunneling is distinguished a different IP data flow in gre tunneling, and stream forwarding list is set up and searched to the flow forwarding keyword obtaining according to internal layer IP head, realize the flow forwarding of the IP datagram literary composition of gre tunneling encapsulation, when the IP datagram literary composition that can solve gre tunneling encapsulation carries out flow forwarding, occur forwarding mistake, cause the problem that flow forwarding success rate is low, promote and forward success rate.
It should be noted that above-mentioned Internet protocol flow forwarding equipment, in embodiment, included unit is just divided according to function logic, but is not limited to above-mentioned division, as long as can realize corresponding function; In addition, the concrete title of each functional unit also, just for the ease of mutual differentiation, is not limited to protection scope of the present invention.
In addition, one of ordinary skill in the art will appreciate that all or part of step realizing in above-mentioned each embodiment of the method is can carry out the hardware that instruction is relevant by program to complete, corresponding program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
These are only preferably embodiment of the present invention; but protection scope of the present invention is not limited to this; any be familiar with those skilled in the art the embodiment of the present invention disclose technical scope in, the variation that can expect easily or replacement, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.

Claims (7)

1. a message forwarding method, is characterized in that, comprising:
Receiving data packets;
Obtain the first-class forwarding keyword of described data message, source internet protocol IP address and object IP address that described first-class forwarding keyword comprises the outer encapsulation of described data message, and protocol type;
According to described first-class forwarding keyword query stream forwarding list, in described stream forwarding list, comprise the corresponding relation of keyword and outlet information;
In the time that the keyword of the first-class forwarding record in described stream forwarding list is identical with described first-class forwarding keyword, the outlet information recording according to described first-class forwarding forwards described data message;
In the time that the keyword of any existing record in described stream forwarding list and described first-class forwarding keyword are all not identical, if described data message is the Internet protocol IP message through generic route encapsulation GRE, the second that obtains described data message forwards keyword, and described second forwards source IP address and the object IP address that keyword comprises described data message internal layer encapsulation;
According to stream forwarding list described in described second forwarding keyword query;
The keyword that forwards record when second in described stream forwarding list and described second forward keyword when identical, forward the outlet information recording forward described data message according to described second;
In the time that the keyword of any existing record in described stream forwarding list and described first-class forwarding keyword are all not identical, if described data message is not the Internet protocol IP message through generic route encapsulation GRE, according to described first-class forwarding keyword query route forwarding table, the corresponding relation that described route forwarding table comprises keyword and forwarding information;
In the time that the keyword of the first routing forwarding record in described route forwarding table is identical with described first-class forwarding keyword,
According to described the first routing forwarding record, forward described data message;
Obtain the first outlet information according to described the first routing forwarding record, and described first-class forwarding keyword and described first is exported to information updating in described stream forwarding list, the message so that follow-up with same stream forwarding keyword forwards according to described stream forwarding list.
2. method according to claim 1, is characterized in that, described method also comprises:
In the time that the keyword of any existing record in described stream forwarding list and described second forwarding keyword are all not identical;
Forward keyword query route forwarding table according to described second, in described route forwarding table, comprise the corresponding relation of keyword and forwarding information;
The keyword that forwards record when secondary route in described route forwarding table and described second forward keyword when identical, according to described secondary route forwarding record, forward described data message;
Forward record according to described secondary route and obtain the second outlet information, and described second forwarding keyword and described second is exported to information updating in described stream forwarding list, the message so that follow-up with same stream forwarding keyword forwards according to described stream forwarding list.
3. according to method described in claim 1 or 2, it is characterized in that, described in obtain described data message second forward keyword specifically comprise:
Described data message is carried out to generic route encapsulation GRE decapsulation, obtain the internal layer IP head of described data message, the second that extracts described data message according to described internal layer IP head forwards keyword.
4. according to method described in claim 1 or 2, it is characterized in that, described second forwards keyword and also comprises:
The source port number of described data message internal layer IP head encapsulation, destination slogan, at least one item in tunnel index and Virtual Private Network index.
5. an Internet protocol flow forwarding equipment, is characterized in that, described equipment comprises:
Message receiving element, for receiving data packets;
First Characteristic extraction unit, for obtaining the first-class forwarding keyword of described data message, source internet protocol IP address and object IP address that described first-class forwarding keyword comprises the outer encapsulation of described data message, and protocol type;
Flow stream searching unit, for according to described first-class forwarding keyword query stream forwarding list, comprises the corresponding relation of keyword and outlet information in described stream forwarding list;
Flow forwarding control unit, in the time that the keyword of the first-class forwarding record of described stream forwarding list is identical with described first-class forwarding keyword, the outlet information recording according to described first-class forwarding forwards described data message;
Second Characteristic extraction unit, for in the time that any existing keyword recording of described stream forwarding list and described first-class forwarding keyword are all not identical, if described data message is the Internet protocol IP message through generic route encapsulation GRE, the second that obtains described data message forwards keyword, and described second forwards source IP address and the object IP address that keyword comprises described data message internal layer encapsulation;
Described flow stream searching unit, also for forwarding stream forwarding list described in keyword query according to described second;
Described flow forwarding control unit, also forwards keyword when identical for the keyword that forwards record when the second of described stream forwarding list and described second, forwards the outlet information recording forward described data message according to described second;
Described routing table lookup unit, also in the time that the keyword of any existing record of described stream forwarding list and described first-class forwarding keyword are all not identical, if described data message is not the Internet protocol IP message through generic route encapsulation GRE, according to described first-class forwarding keyword query route forwarding table, the corresponding relation that described route forwarding table comprises keyword and forwarding information;
Described acquiring unit, also, in the time that the keyword of the first routing forwarding record of described route forwarding table is identical with described first-class forwarding keyword, records according to described the first routing forwarding the first outlet information of obtaining;
Described routing forwarding control unit, also, in the time that the keyword of the first routing forwarding record of described route forwarding table is identical with described first-class forwarding keyword, according to described the first routing forwarding record, forwards described data message;
Described stream table updating block, also for described first-class forwarding keyword and described first is exported to information updating to described stream forwarding list, the message so that follow-up with same stream forwarding keyword forwards according to described stream forwarding list.
6. equipment according to claim 5, is characterized in that, described equipment also comprises:
Routing table lookup unit, in the time that the keyword of any existing record of described stream forwarding list and described second forwarding keyword are all not identical; Forward keyword query route forwarding table according to described second, in described route forwarding table, comprise the corresponding relation of keyword and forwarding information;
Acquiring unit, forwards keyword when identical for the keyword and the described second that forward record when the secondary route of described route forwarding table, forwards according to described secondary route the second outlet information of obtaining that records;
Routing forwarding control unit, forwards keyword when identical for the keyword and the described second that forward record when the secondary route of described route forwarding table, according to described secondary route forwarding record, forwards described data message;
Stream table updating block, for described second being forwarded to keyword and described the second outlet information updating to described stream forwarding list, the message so that follow-up with same stream forwarding keyword forwards according to described stream forwarding list.
7. according to equipment described in claim 5 or 6, it is characterized in that,
Described Second Characteristic extraction unit, specifically in the time that the keyword of any existing record in described stream forwarding list and described first-class forwarding keyword are all not identical, if described data message is the Internet protocol IP message through generic route encapsulation GRE, described data message is carried out to generic route encapsulation GRE decapsulation, obtain the internal layer IP head of described data message, the second that extracts described data message according to described internal layer IP head forwards keyword.
CN201210116220.1A 2012-04-19 2012-04-19 Internet protocol flow transmitting method and device Active CN102655476B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210116220.1A CN102655476B (en) 2012-04-19 2012-04-19 Internet protocol flow transmitting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210116220.1A CN102655476B (en) 2012-04-19 2012-04-19 Internet protocol flow transmitting method and device

Publications (2)

Publication Number Publication Date
CN102655476A CN102655476A (en) 2012-09-05
CN102655476B true CN102655476B (en) 2014-11-05

Family

ID=46731003

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210116220.1A Active CN102655476B (en) 2012-04-19 2012-04-19 Internet protocol flow transmitting method and device

Country Status (1)

Country Link
CN (1) CN102655476B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102882789B (en) * 2012-09-17 2016-03-30 华为技术有限公司 A kind of data message processing method, system and equipment
CN103825831A (en) * 2014-02-28 2014-05-28 神州数码网络(北京)有限公司 Packet transmitting method and switch
CN104618211A (en) * 2014-12-31 2015-05-13 杭州华三通信技术有限公司 Tunnel based message processing method and headquarters gateway device
CN106992915B (en) * 2016-01-21 2020-11-03 中兴通讯股份有限公司 Message de-encapsulation processing and data writing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009661A (en) * 2007-01-25 2007-08-01 华为技术有限公司 Method and device for updating stream forward table content based on the stream forward
CN101051986A (en) * 2006-05-15 2007-10-10 华为技术有限公司 Method and device for realizing quick switch
CN101938415A (en) * 2010-08-30 2011-01-05 北京傲天动联技术有限公司 Rapid forwarding method for network forwarding device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7519079B2 (en) * 2004-09-08 2009-04-14 Telefonaktiebolaget L M Ericsson (Publ) Generic routing encapsulation over point-to-point protocol

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101051986A (en) * 2006-05-15 2007-10-10 华为技术有限公司 Method and device for realizing quick switch
CN101009661A (en) * 2007-01-25 2007-08-01 华为技术有限公司 Method and device for updating stream forward table content based on the stream forward
CN101938415A (en) * 2010-08-30 2011-01-05 北京傲天动联技术有限公司 Rapid forwarding method for network forwarding device

Also Published As

Publication number Publication date
CN102655476A (en) 2012-09-05

Similar Documents

Publication Publication Date Title
US9019837B2 (en) Packet modification to facilitate use of network tags
CN101247308B (en) Tunnel packet processing method for implementing IPv6 traversing IPv4 based on network processor
CN109962847B (en) Method and device for encapsulating service function chain message and computer readable storage medium
WO2018054397A1 (en) Service function chain detection path method and device
CN109561021A (en) A kind of method and the network equipment of message forwarding
CN105827495B (en) The message forwarding method and equipment of VXLAN gateway
CN104380658A (en) Stream classifier, service routing trigger, and message processing method and system
CN102696205A (en) Communication control system and communication control method
CN104144156A (en) Message processing method and device
CN102655476B (en) Internet protocol flow transmitting method and device
CN101969404B (en) Method and equipment for processing messages
CN112311643B (en) EVPN message forwarding method, system, storage medium and terminal
CN107026790B (en) A kind of transmission control method and equipment
CN109120492B (en) Storage unit, source switch, message forwarding method and mirror image system
CN107306220A (en) Message forwarding method and device
CN109412927B (en) Multi-VPN data transmission method and device and network equipment
CN107733765B (en) Mapping method, system and related equipment
CN105939216B (en) The method and device of message transmissions
CN109218176B (en) Message processing method and device
CN102647343B (en) The flow control methods of secure networking device and system
CN111447131B (en) Message de-encapsulation method and device and message encapsulation method and device
CN101873250A (en) Data retransmission method and device
CN104394081B (en) A kind of data processing method and device
CN104780089B (en) Message partition method and device
US10917502B2 (en) Method for using metadata in internet protocol packets

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