The present invention relates to a communication technology, and more particularly to a method and device for realizing unicast reverse path forwarding.
IP source address spoofing is a common attack in IP network; that is, the attacker attacks the IP network by altering the source IP address.
In order to prevent the malicious attack on the IP network of the attacker by using the method of altering the source IP address structure, the commonly adopted defending measurement is unicast reverse path forwarding (URPF).
Recently, two methods for realizing URPF are used.
In the first method, URPF is enabled at relevant interface. That is, URPF is enabled at a forward interface on the network device, so that URPF is implemented while the message passing the forward interface.
Hereinafter, the process of realizing URPF by the first method is illustrated with reference to
In
In the second method, URPF is realized by means of traffic classification.
Hereinafter, the process of realizing URPF by the second method is also illustrated with reference to
In
The method for realizing URPF by means of traffic classification usually requires a large amount of complicated static configurations on the network device, such as an access control list (ACL) configuration. In addition, the network device needs to search for the above configuration information when forwarding a message. Therefore, the workload for maintaining the network device is increased, the process of forwarding the message by the network device is complicated, and the forwarding performance of the network device is also reduced.
Based on the above, the current methods all fail to realize URPF on messages simply and effectively, so that the forwarding performance of the network device is reduced.
In an embodiment, the present invention is directed to a method and network device for realizing unicast reverse path forwarding, which simplifies the realizing process of implementing URPF on messages by the network device, so as to improve the forwarding performance of the network device.
In the method of realizing the unicast reverse path forwarding provided in the embodiment of the present invention, information about that a unicast reverse path forwarding (URPF) needs to be implemented is set in a route table item of a route table, and the method includes the following steps.
A message to be forwarded is received.
The route table item corresponding to the message is acquired.
After confirming that the acquired route table item contains the information about that URPF needs to be implemented, URPF is implemented on the message.
In an embodiment, the present invention also provides a network device, which includes a route table unit, a determination unit, and a URPF unit.
The route table unit is adapted to store a route table item containing information about that URPF needs to be implemented.
The determination unit is adapted to determine whether the route table item corresponding to a message contains the information about that URPF needs to be implemented during the process of forwarding the message by the network device, and trigger the URPF unit when confirming that the message contains the information about that URPF needs to be implemented.
The URPF unit is adapted to implement URPF on the message to be forwarded by the network device after being triggered by the determination unit.
It can be known from the technical solution provided in the aforementioned embodiment of the present invention, a URPF flag is set in the route table, so that the network device may directly implement URPF on the received data message according to the flag. It is unnecessary to implement URPF on all the messages forwarded from the interface, thus avoiding the process of searching traffic classification table items. In the embodiment of the present invention, the URPF flag in the network device's route table is set in static or dynamic manner, and so on, thereby realizing the purpose of implementing URPF on IP network easily and effectively and improving the forwarding performance of the network device.
The present invention will become more fully understood from the detailed description given herein below for illustration only, and thus are not limitative of the present invention, and wherein:
In the embodiment of the present invention, URPF is realized by setting information about that URPF needs to be implemented, i.e., a URPF flag, in the route table item.
In the embodiment of the present invention, the URPF flag needs to be set for a route table item in a network device's route table, so that the network device may implement URPF on the message to be forwarded by the route table item carrying the URPF flag.
The URPF flag in the item of the network device's route table may be generated in static or dynamic manner. The static setting is, for example, statically adding the URPF flag into the relevant route table item, and the dynamic setting is, for example, dynamically generating the URPF flag by the network device according to the received routing information.
Hereinafter the technical solution provided in the embodiment of the present invention is illustrated assuming that the URPF flag is set in dynamic manner.
The local network device sets condition for additional information, generates a corresponding route table item according to routing information transmitted a peer network device, and sets the URPF flag in the route table item when confirming that the additional information in the routing information satisfies the condition for the additional information in URPF policy.
The local network device receives a message to be forwarded, and searches the route table. When finding that the searched route table item contains the URPF flag, the local network device implements URPF on the message to be forwarded, otherwise, the local network device forwards the message according to a normal process.
With reference to
In
URPF policy is configured on the network device A to indicate that, if the additional information of the routing information satisfies the condition, a URPF flag needs to be set in the route table item generated by the network device A according to the routing information. For example, if the condition for the additional information in URPF policy is X equals Y, and if the additional information in the routing information is X equals Y, a URPF flag needs to be set in the route table item generated by the network device A according to the routing information. The condition may also be in other forms. The additional information may be one or more pieces of information in the routing information, and the condition may also be one or more. For example, in the embodiment of the present invention, when one piece of additional information satisfies one condition, the URPF flag is set for the corresponding route table item. When one piece of additional information satisfies multiple conditions, the URPF flag is set for the corresponding route table item. Or, when multiple pieces of additional information respectively satisfies the condition, the URPF flag is set for the corresponding route table item. In the embodiment of the present invention, the specific form of the condition of the additional information is not limited. Since URPF needs to be implemented on the message transmitted to the network segment F by the network device A as shown in
If URPF policy configured in the network device A is that the additional information in the routing information satisfies X equals Y, after the URPF policy is configured, when the network device A receives the routing information of the network segment F transmitted by the network device B, a corresponding route table item is generated for the routing information. Since the additional information in the routing information of the network segment F satisfies X equals Y, the URPF flag is set in the route table item generated by the network device A for the routing information of the network segment F. When the network device A receives the routing information of the network segment R transmitted by the network device B, a corresponding route table item is generated for the routing information. Since the additional information in the routing information of the network segment R satisfies X does not equal Y, the URPF flag fails to be set in the route table item generated by the network device A for the routing information of the network segment R. Herein, two different realizing processes of realizing not setting the URPF flag are illustrated. In the first process, no information on URPF is added in the route table item, i.e., the route table item generated by the network device A excludes “flag information about that URPF needs not to be implemented.” In the second process, information about URPF is added in the route table item, i.e., the route table item generated by the network device A includes “flag information about that URPF needs to be implemented.” For example, when 1 indicates that URPF needs to be implemented, 0 indicates that URPF needs not to be implemented, the network device A adds 0 into the route table item of the network segment R.
Since the URPF flag is set in the corresponding item of the route table of the network device A, the network device A may have the following process when intending to forward a message to the network segment F or the network segment R.
If other network segments intend to transmit a message to the network segment F, and the message needs to be forwarded through the network device A, the network device A receives the message to be forwarded to the network segment F, and searches the route table. When the network device A finds that the route table item contains a URPF flag, URPF is implemented on the message, and the message on which URPF is implemented is forwarded to the network device B.
If other network segments intend to transmit a message to the network segment R, and the message needs to be forwarded through the network device A, the network device A receives the message to be forwarded to the network segment F, and searches the route table. When the network device A finds that the route table item does not contain the URPF flag, URPF is not implemented on the message, and the message is forwarded according to the searched route table item as normal.
With reference to
In
In Step 30, the loc al network device configures a URPF policy. For example, the condition in the URPF policy configured in the local network device A is AS (autonomous system) number=100, and if the additional information in the routing information transmitted by the peer network device B satisfies the condition, the URPF flag is set in the route table item generated by the network device A.
In Step 31, the local network device receives the routing information transmitted by the peer network device.
In Step 32, the local network device generates the corresponding route table item according to the routing information.
In Step 33, the additional information in the routing information is compared with the condition in the URPF policy concerning the additional information.
In Step 34, whether the additional information in the routing information satisfies the condition in the URPF policy or not is determined, if yes, Step 35 is executed, otherwise, Step 36 is executed.
In Step 35, the network device A sets a URPF flag in the generated route table item.
In Step 36, the network device A does not set the URPF flag in the generated route table item.
In
The specific process of implementing URPF by the network device according to the URPF flag in the embodiment of the present invention is shown in
Referring to
In Step 42, the local network device searches for the corresponding route table item from the route table.
In Step 43, if the local network device finds that the searched route table item contains the URPF flag, Step 44 is executed, otherwise, Step 45 is executed;
In Step 44, the local network device implements URPF on the message, and forwards the message according to the result of URPF.
In Step 45, the network device does not implement URPF on the message, and forwards the message as normal.
In
The aforementioned embodiment is described in the example that the network device implements URPF on the message transmitted to a network segment. The technical solution in the embodiment of the present invention is also applicable when the network device needs to implement URPF on the messages transmitted to multiple network segments.
With reference to
In
The embodiment of the present invention may make an improvement on the aforementioned embodiment, that is, the embodiment of the present invention may also set at least one interface in the local network device as an interface where URPF needs to be implemented on the message, and save the interface information in the local network device's route table, in which the interface information in the route table may also be referred to as an interface list.
After the local network device finds that the searched route table item contains the URPF flag, whether the interface corresponding to the message belongs to the interface in the interface list or not needs to be further determined. If yes, URPF is implemented on the message to be forwarded, otherwise, the message is forwarded according to the normal process.
More specifically, when a URPF policy is configured, at least one interface on the network device A may also be designated as the interface where URPF needs to be implemented. Any one of the interfaces may be a physical interface such as a physical ingress and a physical egress, or a logic interface such as a logic ingress and a logic egress. The embodiment of the present invention may save the interface information in the route table of the network device. The interface may match with the ingress of the message, or an egress of the message, or the ingress and the egress of the message at the same time.
Therefore, after the local network device finds a URPF flag in the route table, whether the ingress and/or egress of the message is in the interface list or not is further determined. If yes, URPF is implemented, and the message is forwarded according to URPF result, otherwise, URPF is not implemented, and the message is forwarded according to the normal process.
The network device provided in the embodiment of the present invention includes a route table unit, a URPF flag setting unit, a URPF unit, and a determination unit.
The route table unit is mainly adapted to store the route table item, in which the corresponding route table item contains a URPF flag. The route table item stored in the route table unit may be configured in a static manner, or generated in a dynamic manner according to the routing information received by the network device. The URPF flag in the route table item may be configured by the URPF flag setting unit in a static manner, or generated in a dynamic manner by the URPF flag setting unit according to the routing information received by the network device.
The URPF flag setting unit is mainly adapted to set a URPF flag in the generated route table item when the additional information of the routing information satisfies the condition in the URPF policy concerning additional information, in the process of generating the corresponding route table item by the network device according to the routing information transmitted from the peer network device. When the additional information in the routing information can not satisfy the condition in the URPF policy concerning additional information, the URPF flag setting unit may not set the URPF flag in the route table item. The additional information, the URPF policy, the condition concerning the additional information, and two specific process of realizing not setting the URPF flag for the route table item are identical to those described in the aforementioned process embodiment.
The determination unit is mainly adapted to forward messages at the network device, and trigger a URPF unit when determining that the route table item in the route table unit corresponding to the message contains a URPF flag, so that the URPF unit implements URPF on the forwarded message. The determination unit does not trigger the URPF unit when determining that the route table item in the route table unit corresponding to the message to be forwarded by the network device does not contain the URPF flag, the network device forwards the message according to the normal process.
The URPF unit is mainly adapted to implement URPF on the message to be forwarded by the network device after being triggered by the determination unit.
In addition, the route table item stored in the route table unit disclosed in the embodiment of the present invention further includes an interface list where URPF needs to be implemented. Meanwhile, the determination unit triggers the URPF unit when finding that the searched route table item contains the URPF flag, and the interface corresponding to the message is contained in the interface information list where URPF needs to be implemented.
It can be known from the description in the aforementioned embodiment that, the embodiment of the present invention sets a URPF flag for the relevant table item in the route table, so that it is not necessary to implement URPF on all the messages to be forwarded through the interface, thus avoiding the process of searching traffic classification table item, simplifying the process of realizing URPF, improving the forwarding performance of the network device, and overcoming the problems in the prior art.
Though the present invention has been disclosed above by the preferred embodiments, they are not intended to limit the present invention. Anybody skilled in the art can make some modifications and variations without departing from the spirit and scope of the present invention. Therefore, the protecting range of the present invention falls in the appended claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
200610103836.X | Aug 2006 | CN | national |
PCT/CN2007/070145 | Jun 2007 | CN | national |
This application is a continuation application of, and claims priority to, PCT/CN2007/070145, filed on Jun. 21, 2007, which claims priority to Chinese Patent Application No. 200610103836.X entitled METHOD AND DEVICE FOR REALIZING UNICAST REVERSE PATH FORWARDING and filed on Aug. 2, 2006 the disclosures of which are hereby incorporated by reference herein in their entirety.