免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 7261 | 回复: 0
打印 上一主题 下一主题

Common Routing Problem with OSPF Forwarding Address [复制链接]

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2002-10-03 09:46 |只看该作者 |倒序浏览
Common Routing Problem with OSPF Forwarding Address

This Tech Note describes the basic concept of the Open Shortest Path First (OSPF) forwarding address and describe a common problem associated with the forwarding address. See Why Are Some OSPF Routes in the Database but Not the Routing Table? for more information about troubleshooting OSPF.

Description of OSPF Forwarding Address
The concept of the OSPF forwarding address was introduced to avoid extra hops when routing traffic to an external autonomous system (AS), as shown in the figure below.



In the figure, there are two routers in the OSPF domain that connect to the external domain. However, only Router 1 is exchanging routing information with Router 100. Router 1 redistributes the information learned from Router 100 into OSPF and advertises the information to the rest of the OSPF domain. In doing this, Router 1 becomes the next hop (or forwarding address) for the information that it redistributes to the OSPF domain. When Router 2 receives a packet from the OSPF domain destined for an address in the external domain, it forwards the packet to Router 1, which forwards it to Router 100. The forwarding address concept allows this extra hop to be avoided by allowing Router 1 to specify another router's IP address as the forwarding address. In the figure above, Router 1 can specify Router 100 as the forwarding address for external information that Router 1 is redistributing into the OSPF domain. This way, when Router 2 receives a packet from the OSPF domain destined for an address in the external domain, it will forward the packet to Router 100, thus avoiding the extra hop through Router 1.

The value of the forwarding address specified by the autonomous system boundary router(ASBR) (Router 1 in the figure above) can be either 0.0.0.0 or non-zero. The 0.0.0.0 address indicates that the originating router (the ASBR) is the next hop. The forwarding address is determined by the following conditions:

The forwarding address is set to 0.0.0.0 if the ASBR is redistributing routes and OSPF is not enabled on the next hop interface for those routes. This would be true in the figure above if Router 1 didn't have OSPF enabled on the Ethernet interface.

The following condition sets the forwarding address field to a non-zero address:

OSPF is enabled on the ASBR's next hop interface AND
ASBR's next hop interface is non-passive under OSPF AND
ASBR's next hop interface is not point-to-point AND
ASBR's next hop interface is not point-to-multipoint AND
ASBR's next hop interface address falls under the network range specified in the router ospf command.

Any other conditions besides these set the forwarding address to 0.0.0.0.
Common OSPF Routing Problem Related to the Forwarding Address


The R2513 router, which is only running RIP (and may be connected to a RIP-only network), has been added to the Token Ring network in the figure above. When the routes learned from R2513 are redistributed into OSPF by the ASBR (R2515), some of the routes are not installed into the routing table of some of the routers. The relevant configuration information of each of the routers is given in the table below.

hostname R2507
         
interface Serial0
ip address 1.1.1.1 255.255.255.0
         
interface Serial1
ip address 7.7.7.1 255.255.255.0
         
router ospf 1
network 1.1.1.1 0.0.0.0 area 0
default- information originate metric 20
         
ip route 0.0.0.0 0.0.0.0 Serial1


hostname R2504
         
interface Serial0
ip address 1.1.1.2 255.255.255.0
         
interface TokenRing0
ip address 3.3.4.2 255.255.255.0
         
router ospf 1
network 1.1.1.0 0.0.0.255 area 0
network 3.0.0.0 0.255.255.255 area 1
area 1 range 3.0.0.0 255.0.0.0

hostname R2515

interface Serial1
ip address 4.4.4.3 255.255.255.0
      
interface TokenRing0
ip address 3.3.4.3 255.255.255.0
      
interface ethernet 0
ip address 3.44.66.3 255.255.255.0
      
interface ethernet 1
ip address 3.22.88.3 255.255.255.0
      
router ospf 1
redistribute rip metric 20 subnets
network 0.0.0.0 255.255.255.255 area 1
      
router rip
network 3.0.0.0
hostname R2513      

interface TokenRing0
ip address 3.3.4.4 255.255.255.0
      
interface ethernet 0
ip address 200.1.1.4 255.255.255.0
      
router rip
network 3.0.0.0
network 200.1.1.0
      
      
      
      
      
      
      
      
        


Notice from the configurations listed above that R2515 is redistributing RIP into OSPF and that R2504 (the area border router (ABR)) is creating a summarized network 3.0.0.0/8.

Following are the routing tables for each of the OSPF enabled routers:

R2507# show ip route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
         1.0.0.0/ 24 is subnetted, 1 subnets
C          1.1.1.0 is directly connected, Serial0
         3.0.0.0/ 8 is variably subnetted, 4 subnets, 2 masks
O IA        3.0.0.0/ 8 [110/ 70] via 1.1.1.2, 00: 15: 37, Serial0
O E2        3.3.4.0/ 24 [110/ 20] via 1.1.1.2, 00: 06: 37, Serial0
O E2        3.22.88.0/ 24 [110/ 20] via 1.1.1.2, 00: 06: 37, Serial0
O E2        3.44.66.0/ 24 [110/ 20] via 1.1.1.2, 00: 06: 37, Serial0
          7.0.0.0/ 24 is subnetted, 1 subnets
C           7.7.7.0 is directly connected, Serial1
S*     0.0.0.0/ 0 is directly connected, Serial1


R2504# show ip route
Gateway of last resort is 1.1.1.1 to network 0.0.0.0
            1.0.0.0/ 24 is subnetted, 1 subnets
C             1.1.1.0 is directly connected, Serial0
            3.0.0.0/ 8 is variably subnetted, 4 subnets, 2 masks
S             3.0.0.0/ 8 is directly connected, Null0
C             3.3.4.0/ 24 is directly connected, TokenRing0
O             3.22.88.0/ 24 [110/ 11117] via 3.3.4.3, 00: 15: 16, TokenRing0
O             3.44.66.0/ 24 [110/ 11117] via 3.3.4.3, 00: 15: 16, TokenRing0
O  E2 200.1.1.0/ 24 [110/ 20] via 3.3.4.4, 00: 06: 16, TokenRing0
O* E2 0.0.0.0/ 0 [110/ 20] via 1.1.1.1, 00: 15: 16, Serial0

R2515# show ip route
Gateway of last resort is 3.3.4.2 to network 0.0.0.0
            1.0.0.0/ 24 is subnetted, 1 subnets
O IA         1.1.1.0 [110/ 70] via 3.3.4.2, 00: 10: 28, TokenRing0
            3.0.0.0/ 24 is subnetted, 3 subnets
C            3.3.4.0 is directly connected, TokenRing0
R          200.1.1.0/ 24 [120/ 1] via 3.3.4.4, 00: 00: 10, TokenRing0
O* E2 0.0.0.0/ 0 [110/ 20] via 3.3.4.2, 00: 10: 28, TokenRing0

Network Missing from the Routing Table
Notice that R2515 has a RIP (R) derived route for network 200.1.1.0/24. R2515 is the ASBR and is redistributing the RIP protocol into OSPF. R2504 learns about network 200.1.1.0/24 from R2515 and installs it in its routing table as an OSPF external type 2 (E2) route. The problem is that R2507 does not have network 200.1.1.0/24 in its routing table.

Notice also that R2507 has external routes for networks 3.3.4.0/24, 3.22.88.0/24 and 3.44.66.0/24, even though all of these networks should be included in the summary of 3.0.0.0/8.

The reason these external routes show up is that the ASBR, which is redistributing RIP into OSPF, has RIP running on these three subnets and therefore redistributes the subnets as external routes into OSPF. Since these subnets are external routes, they aren't summarized by the ABR (R2504). External OSPF routes can only be summarized by the ASBR, in this case, R2515. The ABR is summarizing only internal OSPF routes from area 1 into area 0.

Now let's take a look at the external link-state advertisement (LSA) for network 200.1.1.0/24 in the OSPF database of R2507:

R2507# show ip ospf data external 200.1.1.0
       OSPF Router with ID (7.7.7.1) (Process ID 1)
       Type- 5 AS External Link States
       LS age: 72
       Options: (No TOS- capability, DC)
       LS Type: AS External Link
       Link State ID: 200.1.1.0 (External Network Number )
       Advertising Router: 3.44.66.3
       LS Seq Number: 80000001
       Checksum: 0xF161
       Length: 36
       Network Mask: /24
                   Metric Type: 2 (Larger than any link state path)
                   TOS: 0
                   Metric: 20
                   Forward Address: 3.3.4.4
                   External Route Tag: 0
As mentioned above, OSPF allows the ASBR to specify another router as the forwarding address to external routes. In this case, the ASBR (R2515) has specified 3.3.4.4 as the forwarding address for the external network 200.1.1.0.

RFC 2328  , section 16.4 (Calculating AS external routes), states the following:

"If the forwarding address is non-zero, look up the forwarding address in the routing table. The matching routing table entry must specify an intra-area or inter-area path&#59; if no such path exists, do nothing with the LSA and consider the next in the list."

In the case of our example, the route to the forwarding address 3.3.4.4 is as follows:

R2507# show ip route 3.3.4.4
       Routing entry for 3.3.4.0/ 24
           Known via "ospf 1", distance 110, metric 20,type extern 2, forward metric 70
           Redistributing via ospf 1
           Last update from 1.1.1.2 on Serial0, 00: 00: 40 ago
           Routing Descriptor Blocks:
           * 1.1.1.2, from 3.44.66.3, 00: 00: 40 ago, via Serial0
              Route metric is 20, traffic share count is 1
The router doesn?t have an internal OSPF route to the forwarding address, so it doesn't install the route in the routing table. Using an external route to reach another external route may lead to loops, therefore OSPF doesn?t permit it.

Don't Summarize on the ABR
How can we ensure that the non-zero forwarding address exists in the routing table as an intra-area or inter-area route?

The first solution is not to summarize on the ABR, in our case, R2504. This causes routers in area 0 to have inter-area routes (instead of external routes) for all the specific subnets in other areas.

Use the following commands to remove the summarization on the ABR:

R2504(config)# router ospf 1
R2504(config- router)# no area 1 range 3.0.0.0 255.0.0.0
The results of this command in the routing table on R2507 are shown below:

R2507# show ip route
       Gateway of last resort is 0.0.0.0 to network 0.0.0.0
                 1.0.0.0/ 24 is subnetted,        1 subnets
       C            1.1.1.0        is directly connected, Serial0
                 3.0.0.0/ 24 is subnetted,        3 subnets
       O IA      3.3.4.0 [110/ 70] via 1.1.1.2, 00: 00:        48, Serial0
       O IA      3.22.88.0 [110/ 11181] via 1.1.1.2, 00:        00: 48, Serial0
       O IA      3.44.66.0 [110/ 11181] via 1.1.1.2, 00:        00: 48, Serial0
                 7.0.0.0/ 24 is subnetted,        1 subnets
       C           7.7.7.0 is        directly connected, Serial1
       O E2 200.1.1.0/ 24 [110/ 20] via 1.1.1.2, 00: 00: 48, Serial0
       S*     0.0.0.0/ 0 is directly connected, Serial1
Notice that R2507 now has an intra-area route for the forwarding address 3.3.4.1, and network 200.1.1.0/24 is in the routing table.

Prevent the Subnet from Being Redistributed into OSPF as an External Route
Another solution is to prevent the subnet 3.3.4.0 from being redistributed into OSPF as an external route, since we're running OSPF on it anyway.  The following configuration commands in the ASBR (R2515) create a route-map, which is used by the redistribute command to allow only network 200.1.1.0/24 to be redistributed into OSPF.

R2515#conf t
R2515#router ospf 1
R2515#redistribute rip metric 20 subnets route- map rip_ to_ ospf_ filter
   
R2515#access- list 28 permit 200.1.1.0 0.0.0.255
   
R2515#route- map rip_ to_ ospf_ filter permit 10
R2515#match ip address 28
The results of this command in the routing table on R2507 are shown below:

R2507# show ip route
       Gateway of last resort is 0.0.0.0 to network 0.0.0.0
                 1.0.0.0/ 24 is subnetted,        1 subnets
       C            1.1.1.0        is directly connected, Serial0
       O IA  3.0.0.0/ 8 [110/ 70] via 1.1.1.2, 00: 07: 05, Serial0
                 7.0.0.0/ 24 is subnetted,        1 subnets
       C            7.7.7.0        is directly connected, Ethernet0
       O E2  200.1.1.0/ 24 [110/ 20] via 1.1.1.2, 00: 00: 21, Serial0
       S*      0.0.0.0/ 0 is directly connected, Ethernet0
As you can see from the above routing table output, the only external route in the routing table is 200.1.1.0/24.  This network is in the routing table because the forwarding address of this external network (3.3.4.1) is covered by the summary route 3.0.0.0/8, which is an intra-area route.



您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP