OSPF (five) OSPF external routes

Foreword

An internal enterprise network may be due to upgrades or other reasons, with between old and new sectors is not the same routing protocol. Corporate headquarters or branches may be used is not the same routing protocol. Or a business in addition to internal communication needs, but also to communicate and external networks, different companies have needs visits.
Suppose A company deploying OSPF routing network for internal communications companies, as business needs require access to the company's WEB server B, but Company B is not necessarily the OSPF protocol used, there may be RIP, there may be static routing, or other routing protocols this time a company needs to use OSPF external route to get B's routing information.

External route calculation

FIG scene as it is described in the Preamble.
Here Insert Picture Description
FIG:
the RTA configuration:

[RTA]ip route-static 10.1.60.0 255.255.255.0 10.1.16.6
[RTA]ospf 1
[RTA-ospf-1]import-route static 

After you configure this static routing, static routing introduced these into OSPF.

Note: The actual routing up to be a two-way, here only the process OSPF to import external routes, up to two-way, RTF need to configure OSPF protocol, introduced its external routes

In this embodiment, the RTA is configured a static route, the destination network is 10.1.60.0/24, next hop RTF.
OSPF process in the RTA, the configured static route is re-advertised to OSPF network of company A, into which external routing is called the ASBR routers OSPF, RTA generates an AS-External-LSA (five the LSA), is used to describe how to reach the destination from the external ASBR; and RTC generates an RTB-ASBR-Summary-LSA (four LSA), it is used to describe how to get from the ASBR ABR. Four and five LSA LSA, will be used to calculate external routes OSPF routers.

concept

  1. ASBR:

Introducing external routes OSPF routers (Pictured RTA)

  1. APR:

Border Router: OSPF backbone area and in other regions of the junction of the router

  1. Five LSA: AS-External-LSA (AS external LSA)

Generating ASBR used to describe how to reach the destination from the external ASBR.
Advertised default routes to reach the destination autonomous system external to the OSPF or OSPF autonomous system external to the LSA. AS external LSA link-state database is unique and is not associated with a specific region of LSA advertised . Notice the external LSA flooding spread throughout the autonomous system.

  1. Four types of LSA: ASBR-Summary-LSA (ASBR Summary LSA)

ABR produced is used to describe how to achieve ASBR (ASBR the location identifier) ​​from ABR; ASBR summary LSA addition advertised a destination is outside the ASBR router instead of a network, and other network summary LSA is the same.

External Routing Configuration

  1. Configuring other routing protocols (such as: R1 opposite OSPF protocol is used, then the R1 on the declaration of an adjacent segment with OSPF protocol)
  2. View into the protocol configuration commands import-router [对方路由协议]. Note that require two-way configuration
    Here Insert Picture Description
[R1-ospf-1]network 192.168.2.0 0.0.0.255
[R1-rip-1]import-router ospf
[R2-rip-1]network 192.168.1.0 
[R2-ospf-1]import-router rip

Other routing protocols empathy.

Five and four types of LSA LSA

Here Insert Picture Description

Five LSA: AS-External-LSA

We display ospf lsdb ase self-originatesee the external route generated LSDB own router. That is, to see five LSA.

<RTA>display ospf lsdb ase self-originate 

  OSPF Process 1 with Router ID 1.1.1.1
  Link State Database
 Type : External           //LSA类型
 Ls id : 10.1.60.0         //目的网段地址
 Adv rtr : 1.1.1.1         //产生此五类LSA ASBR的Router ID (上图:RTA)
 Ls age : 1340 
 Len : 36 
 Options : E              //代表是外部路由的LSA
 seq# : 80000004
 chksum : 0xb5cc
 Net mask : 255.255.255.0   //网络掩码
 TOS 0 Metric: 1                  //开销值,外部路由到ASBR的metric值,默认情况是1
 E type : 2                           //外部路由的类型,下文详解。默认为Type 2
 Forwarding Address : 0.0.0.0      //次优路径时详细将讲解。
 Tag  : 1 
 Priority : Low      //优先级,低,因为外部路由优先级低于内部路由

Four types of LSA: ASBR-Summary-LSA

We display ospf lsdb asbr self-originatesee four types of LSA

<RTB>display ospf lsdb asbr self-originate 

​      Area: 0.0.0.1
  Link State Database 
  
 Type : Sum-Asbr   //LSA类型
 Ls id : 1.1.1.1   //ASBR的Router ID
 Adv rtr : 2.2.2.2   //产生此四类LSA ABR的Router ID(上图:RTB)
 Ls age : 15 
 Len : 28 
 Options : E 
 seq# : 80000005
 chksum : 0xf456
 Tos 0 metric: 1        //从RTB到达此ASBR的开销

At the same time why five of the LSA ABR but also send four types of LSA?

As FIG, RTA produce five LSA, the LSA flooding and five diffusion throughout the AS (autonomous region). And in the process of flooding in five LSA information will not be like three LSA changes in the same .

Combined with five LSA information:

 Ls id : 10.1.60.0         //目的网段地址
 Adv rtr : 1.1.1.1         //产生此五类LSA ASBR的Router ID (上图:RTA)
 
 TOS 0 Metric: 1     

Routers in Area 0 is sure to find the location ASBR router. But the non-backbone area. Area 2 as the RTE, ASBR clear position.
So we need to take responsibility ABR, released four types of LSA, to tell the specific location of the router ASBR non-backbone area.

External route calculation

Area 0 is calculated

At this time, four LSA not required, so the calculation need only: one LSA, LSA five

Here Insert Picture Description
Area 0 to external routes is calculated as an example in the RTB: RTB received after five LSA, according to Adv rtr field 1.1.1.1 found, ASBR with their belonging to the same area (Area 0), then according Ls id, Net mask, Metric the final destination network field generating 10.1.60.0/24 cost = 1, the next-hop routing RTA.

Non-backbone area of ​​the external route calculation

At this time, calculation requires four LSA, five LSA, a class of LSA, two types of LSA (multiaccess network)
Here Insert Picture Description
to route the RTD external Area Calculation Example 1: After five RTD received LSA, according to Adv rtr field 1.1.1.1 discovery, ASBR belongs to a region different from their own, then find Ls id 1.1.1.1 LSA into four categories and found this four types of LSA Adv rtr is 2.2.2.2. The LSA then the five LS id, Net mask, Metric field finally generated object network 10.1.60.0/24 cost = 1, the next hop for the route RTB.

RTB, RTD finally calculated route entry cost is 1, according to the physical topology can be seen, RTD significantly greater than the cost of RTB, then where is the problem then?

This is due to the type of external routes due.

External route type

In the above five LSA:E type : 2

Type Cost
The external routes (External Type-1) AS + AS internal cost of the external cost value
The external routes (External Type-2) AS external cost value

OSPF to import external routes, there are two types available:

  1. The first outer AS external route cost value is considered and AS internal cost value of the same order of magnitude, the first external route cost value of the cost value AS interior (ASBR routers to overhead) cost values ​​with the AS and external ; high credibility of such route, and therefore external route calculated internal routing cost overhead is fairly autonomous system, and OSPF routes comparable with the cost.
  2. The second type AS external cost of external routes are considered much greater than the internal cost value AS, so the cost value of the second external route contains only external overhead AS, AS ignores the internal overhead (default category II), these routes low credibility.

note:

1. 默认情况下,OSPF外部路由采用的是第二类外部路由。
2. 路由优先级:第一类外部路由>第二类外部路由
3. LSA总路由优先级:一类LSA>三类LSA>第一类外部路由>第二类外部路由(没有二类、四类的原因是它们不传递路由信息,只传递拓扑信息。)

FIG follows: In Case RTD calculating path costs. Suppose path cost values ​​are 1.
Here Insert Picture Description

Suboptimal external routes

cause

External suboptimal route generated
As shown, R1 and R2 are configured OSPF protocol, R2 and R3 arranged with RIP. At this time, the introduction of bidirectional external routing on R2.
At this point in R2 as OSPF ASBR, released five LSA advertised. Tell R1 wants to send a message to the 192.168.2.0 network segment, first through the ASBR is R2, then R2 and then send information to the R3. This time we find, in fact R1 sends a message to the gateway 192.168.2.0, there is a better path. Select a path from R1 to R2 to R3 is not optimal.

In this case R1 routing table:

<r1>dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 5        Routes : 5        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.1.0/24  Direct  0    0           D   192.168.1.1     Ethernet0/0/0
    192.168.1.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/0
    192.168.2.0/24  O_ASE   150  1           D   192.168.1.2     Ethernet0/0/0

note:192.168.2.0/24 O_ASE 150 1 D 192.168.1.2 Ethernet0/0/0

So how do we solve it?

Forwarding Address

OSPF be solved by setting Forwarding Address.

Typically, ASBR redistribute routes the LSA produced five Forwarding Address field is set to 0.0.0.0. (Reviewed above five LSA topology of RTA)

For figure above scenario, the routing table RTB-the next hop network segments 192.168.1.3.192.168.1.3 192.168.2.0/24 192.168.1.0/24 is running OSPF belongs, so five LSA RTB generated, Forwarding Address is set to 192.168.1.3.
Forwarding Address
Five LSA R2 generated:

[r2]display ospf lsdb ase self-originate 

	 OSPF Process 1 with Router ID 192.168.1.2
		 Link State Database

  Type      : External
  Ls id     : 192.168.2.0
  Adv rtr   : 192.168.1.2  
  Ls age    : 164 
  Len       : 36 
  Options   :  E  
  seq#      : 80000001 
  chksum    : 0x7f0c
  Net mask  : 255.255.255.0 
  TOS 0  Metric: 1 
  E type    : 2
  ==Forwarding Address : 192.168.1.3
  Tag       : 1 
  Priority  : Low
  Type      : External
  Ls id     : 192.168.1.0
  Adv rtr   : 192.168.1.2  
  Ls age    : 164 
  Len       : 36 
  Options   :  E  
  seq#      : 80000001 
  chksum    : 0x23d6

note: Forwarding Address : 192.168.1.3

When the RTA five received the LSA, found Forwarding Address field is not 0, a value 10.1.123.3, it calculates the next hop according RTA Forwarding Address.

R1 routing table:

<r1>dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 5        Routes : 5        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.1.0/24  Direct  0    0           D   192.168.1.1     Ethernet0/0/0
    192.168.1.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/0
    192.168.2.0/24  O_ASE   150  1           D   192.168.1.3     Ethernet0/0/0

note:192.168.2.0/24 O_ASE 150 1 D 192.168.1.3 Ethernet0/0/0

Published 20 original articles · won praise 27 · views 3190

Guess you like

Origin blog.csdn.net/qq_46254436/article/details/104732491