A Cisco traduziu este documento com a ajuda de tecnologias de tradução automática e humana para oferecer conteúdo de suporte aos seus usuários no seu próprio idioma, independentemente da localização. Observe que mesmo a melhor tradução automática não será tão precisa quanto as realizadas por um tradutor profissional. A Cisco Systems, Inc. não se responsabiliza pela precisão destas traduções e recomenda que o documento original em inglês (link fornecido) seja sempre consultado.
A finalidade deste documento é demonstrar o comportamento da seleção de trajeto do Open Shortest Path First (OSPF) quando um roteador recebe um anúncio link state do Tipo 5 (LSA) e um Type-7 LSA para uma rede externa dada. Quando a redistribução é executada em uma área NON-NSSA, o OSPF injetará um Tipo 5 LSA no domínio de OSPF. A redistribução em uma área de NSSA cria um tipo especial de LSA referido como Type-7, que pode somente existir em uma área de NSSA.
Refira o diagrama da rede em figura 1 como você usa este documento:
Figura 1
No diagrama da rede, há uma área sem backbone 1 e uns 50 pés da área de NSSA conectados ao r1. O r1 é um roteador de borda de área (ABR) conectado à área Backbone 0. O R2 e o R3 são responsáveis para redistribuir o mesmo prefixo 192.0.2.100/32 no domínio de OSPF.
Cisco recomenda que você tem o conhecimento do protocolo de OSPF.
As informações neste documento são baseadas nestas versões de software:
RFC 3101 do apoio dos dispositivos do Cisco IOS XE para o cálculo externo do trajeto. O RFC 1587 obsoleted pelo RFC 3101 mas o comportamento RFC 1587-specific pode ainda ser permitido com a configuração. Em liberações do Cisco IOS Release 15.1(2)S e Mais Recente, a saída do comando show ip ospf mostra se o dispositivo está usando o RFC 3101 ou o RFC 1587.
(e) If the current LSA is functionally the same as an installed LSA (i.e., same destination, cost and non-zero forwarding address) then apply the following priorities in deciding which LSA is preferred: 1. A Type-7 LSA with the P-bit set. 2. A Type-5 LSA. 3. The LSA with the higher router ID.
5. Otherwise, compare the cost of this new AS external path to the ones present in the table. Note that type-5 and type-7 routes are directly comparable. Type-1 external paths are always shorter than Type-2 external paths. Type-1 external paths are compared by looking at the sum of the distance to the forwarding address/ASBR and the advertised Type-1 paths (X+Y). Type-2 external paths are compared by looking at the advertised Type-2 metrics, and then if necessary, the distance to the forwarding address/ASBR. When a type-5 LSA and a type-7 LSA are found to have the same type and an equal distance, the following priorities apply (listed from highest to lowest) for breaking the tie. a. Any type 5 LSA. b. A type-7 LSA with the P-bit set and the forwarding address non-zero. c. Any other type-7 LSA. If the new path is shorter, it replaces the present paths in the routing table entry. If the new path is the same cost, it is added to the routing table entry's list of paths
Figura 2
Nesta encenação, nós estaremos olhando que comportamento é observado ao usar o RFC 3101 para o cálculo externo do trajeto. Nós estaremos interessados no prefixo 192.0.2.100/32 que é redistribuído no R3 e no R2.
O tipo-1 LSA do r1 está na saída abaixo:
R1#show ip ospf database router 1.1.1.1 OSPF Router with ID (1.1.1.1) (Process ID 1) Router Link States (Area 0) LS age: 51 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 1.1.1.1 Advertising Router: 1.1.1.1 LS Seq Number: 80000007 Checksum: 0x3BD6 Length: 48 Area Border Router AS Boundary Router Number of Links: 2 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 4.4.4.4 (Link Data) Router Interface address: 192.168.14.1 Number of MTID metrics: 0 TOS 0 Metrics: 1 Link connected to: a Stub Network (Link ID) Network/subnet number: 192.168.14.0 (Link Data) Network Mask: 255.255.255.0 Number of MTID metrics: 0 TOS 0 Metrics: 1 Router Link States (Area 1) LS age: 562 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 1.1.1.1 Advertising Router: 1.1.1.1 LS Seq Number: 8000000C Checksum: 0xEC26 Length: 48 Area Border Router AS Boundary Router Number of Links: 2 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 3.3.3.3 (Link Data) Router Interface address: 192.168.13.1 Number of MTID metrics: 0 TOS 0 Metrics: 1 Link connected to: a Stub Network (Link ID) Network/subnet number: 192.168.13.0 (Link Data) Network Mask: 255.255.255.0 Number of MTID metrics: 0 TOS 0 Metrics: 1 Router Link States (Area 50) LS age: 562 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 1.1.1.1 Advertising Router: 1.1.1.1 LS Seq Number: 80000012 Checksum: 0x42CA Length: 48 Area Border Router AS Boundary Router Number of Links: 2 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 2.2.2.2 (Link Data) Router Interface address: 192.168.12.1 Number of MTID metrics: 0 TOS 0 Metrics: 1 Link connected to: a Stub Network (Link ID) Network/subnet number: 192.168.12.0 (Link Data) Network Mask: 255.255.255.0 Number of MTID metrics: 0 TOS 0 Metrics: 1
No r1 nós temos o seguinte LSAs externo em nosso base de dados:
R1#show ip ospf database external OSPF Router with ID (1.1.1.1) (Process ID 1) Type-5 AS External Link States LS age: 706 Options: (No TOS-capability, DC, Upward) LS Type: AS External Link Link State ID: 192.0.2.100 (External Network Number ) Advertising Router: 1.1.1.1 LS Seq Number: 80000001 Checksum: 0xE617 Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) MTID: 0 Metric: 20 Forward Address: 192.168.12.2 External Route Tag: 0 LS age: 600 Options: (No TOS-capability, DC, Upward) LS Type: AS External Link Link State ID: 192.0.2.100 (External Network Number ) Advertising Router: 3.3.3.3 LS Seq Number: 80000002 Checksum: 0xBFAC Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) MTID: 0 Metric: 20 Forward Address: 0.0.0.0 External Route Tag: 0 R1#show ip ospf database nssa-external OSPF Router with ID (1.1.1.1) (Process ID 1) Type-7 AS External Link States (Area 50) LS age: 865 Options: (No TOS-capability, Type 7/5 translation, DC, Upward) LS Type: AS External Link Link State ID: 192.0.2.100 (External Network Number ) Advertising Router: 2.2.2.2 LS Seq Number: 80000002 Checksum: 0x32BC Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) MTID: 0 Metric: 20 Forward Address: 192.168.12.2 External Route Tag: 0
Deixa agora a verificação que LSA é preferido no r1:
R1#show ip ospf rib 192.0.2.100 OSPF Router with ID (1.1.1.1) (Process ID 1) Base Topology (MTID 0) OSPF local RIB Codes: * - Best, > - Installed in global RIB LSA: type/LSID/originator *> 192.0.2.100/32, NSSA2, cost 20, fwd cost 1, tag 0, area 50 SPF Instance 38, age 00:04:51 contributing LSA: 7/192.0.2.100/2.2.2.2 (area 50) contributing LSA: 5/192.0.2.100/3.3.3.3 Flags: RIB, HiPrio, ViaFwAddr, IntraNonBB, NSSA P-bit via 192.168.12.2, GigabitEthernet1 label 1048578 Flags: RIB LSA: 7/192.0.2.100/2.2.2.2
Como nós podemos ver na saída acima, o r1 prefere LSA Type-7 do R2. Isto é porque nós estamos seguindo o RFC 3101, que tem a seguinte preferência do cálculo do trajeto
1. Um Type-7 LSA com o P-bit ajustado.
2. Um Tipo 5 LSA.
3. O LSA com o Router ID mais alto.
Nota: Esteja por favor ciente que a seguinte preferência do cálculo do trajeto é aplicável se o LSA atual é funcionalmente o mesmo que um LSA instalado. Nós podemos verificar que a métrica da transmissão para ambos os LSA é a mesma que olha o tipo-1 LSA de r1.
Agora se nós cancelamos o P-bit em NSSA Type-7 LSA do R2 nós veremos que nós preferiremos o Tipo 5 LSA do R3:
Abstraia da seção 2.4 do RFC 3101
An NSSA internal AS boundary router must set the P-bit in the LSA header's option field of any Type-7 LSA whose network it wants advertised into the OSPF domain's full transit topology. The LSAs of these networks must have a valid non-zero forwarding address. If the P-bit is clear the LSA is not translated into a Type-5 LSA by NSSA border routers. When an NSSA border router originates both a Type-5 LSA and a Type-7 LSA for the same network, then the P-bit must be clear in the Type-7 LSA so that it isn't translated into a Type-5 LSA by another NSSA border router.
Antes que nós continuemos com esclarecimento o P-bit no R2, está aqui a saída de type-7 LSA do R2
R2#show ip ospf database nssa-external OSPF Router with ID (2.2.2.2) (Process ID 1) Type-7 AS External Link States (Area 50) LS age: 1215 Options: (No TOS-capability, Type 7/5 translation, DC, Upward) LS Type: AS External Link Link State ID: 192.0.2.100 (External Network Number ) Advertising Router: 2.2.2.2 LS Seq Number: 80000002 Checksum: 0x32BC Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) MTID: 0 Metric: 20 Forward Address: 192.168.12.2 External Route Tag: 0
O P-bit pode ser cancelado quando um roteador de borda NSSA origina um Tipo 5 LSA e um Type-7 LSA para a mesma rede.
R2#show ip ospf database nssa-external OSPF Router with ID (2.2.2.2) (Process ID 1) Type-7 AS External Link States (Area 50) LS age: 44 Options: (No TOS-capability, No Type 7/5 translation, DC, Upward) LS Type: AS External Link Link State ID: 192.0.2.100 (External Network Number ) Advertising Router: 2.2.2.2 LS Seq Number: 80000003 Checksum: 0xBFAD Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) MTID: 0 Metric: 20 Forward Address: 0.0.0.0 External Route Tag: 0
Estão aqui algumas características importantes sobre a saída acima mencionada abaixo:
Agora em que nós verificamos no r1 nós vemos que nós preferimos o Tipo 5 sobre Type-7 LSA.
R1#show ip ospf rib 192.0.2.100 OSPF Router with ID (1.1.1.1) (Process ID 1) Base Topology (MTID 0) OSPF local RIB Codes: * - Best, > - Installed in global RIB LSA: type/LSID/originator *> 192.0.2.100/32, Ext2, cost 20, fwd cost 1, tag 0 SPF Instance 39, age 00:03:32 contributing LSA: 7/192.0.2.100/2.2.2.2 (area 50) contributing LSA: 5/192.0.2.100/3.3.3.3 Flags: RIB, HiPrio, IntraNonBB via 192.168.13.3, GigabitEthernet2 label 1048578 Flags: RIB LSA: 5/192.0.2.100/3.3.3.3
Figura 3
Nesta encenação, nós estaremos olhando que comportamento é observado ao usar o RFC 1587 para o cálculo externo do trajeto. A conformidade do RFC 3101 é permitida automaticamente em dispositivos IOS-XE. Para substituir a compatibilidade do RFC 3101 com a compatibilidade do RFC 1587 para a seleção de rota nos roteadores de borda de área da not-so-stubby area (NSSA) (ABR), use o comando compatiblerfc1587 no modo de configuração da família do modo de configuração do roteador ou do endereço. Para restaurar a compatibilidade do RFC 3101, não use nenhum formulário deste comando.
Nós estaremos interessados no prefixo 192.0.2.100/32 que é redistribuído no R3 e no R2. Primeiramente nós devemos permitir a compatibilidade do RFC 1587 no r1
R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#router ospf 1 R1(config-router)#compatible rfc1587 R1#show ip ospf | in RFC Supports NSSA (compatible with RFC 1587)
Uma vez que nós permitimos o RFC 1587 da compatibilidade no r1 nós podemos verificar que trajetos estão em nosso base de dados e que LSA é preferido:
R1#show ip ospf database external OSPF Router with ID (1.1.1.1) (Process ID 1) Type-5 AS External Link States LS age: 115 Options: (No TOS-capability, DC, Upward) LS Type: AS External Link Link State ID: 192.0.2.100 (External Network Number ) Advertising Router: 3.3.3.3 LS Seq Number: 80000003 Checksum: 0xBDAD Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) MTID: 0 Metric: 20 Forward Address: 0.0.0.0 External Route Tag: 0 R1#show ip ospf database nssa-external OSPF Router with ID (1.1.1.1) (Process ID 1) Type-7 AS External Link States (Area 50) LS age: 48 Options: (No TOS-capability, Type 7/5 translation, DC, Upward) LS Type: AS External Link Link State ID: 192.0.2.100 (External Network Number ) Advertising Router: 2.2.2.2 LS Seq Number: 80000005 Checksum: 0x2CBF Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) MTID: 0 Metric: 20 Forward Address: 192.168.12.2 External Route Tag: 0
Deixa agora a verificação que LSA é preferido no r1:
R1#show ip ospf rib 192.0.2.100 OSPF Router with ID (1.1.1.1) (Process ID 1) Base Topology (MTID 0) OSPF local RIB Codes: * - Best, > - Installed in global RIB LSA: type/LSID/originator *> 192.0.2.100/32, Ext2, cost 20, fwd cost 1, tag 0 SPF Instance 44, age 00:01:56 contributing LSA: 7/192.0.2.100/2.2.2.2 (area 50) contributing LSA: 5/192.0.2.100/3.3.3.3 Flags: RIB, HiPrio, IntraNonBB, PartialSPF via 192.168.13.3, GigabitEthernet2 label 1048578 Flags: RIB LSA: 5/192.0.2.100/3.3.3.3
O Tipo 5 LSA é preferido.
Na saída acima, você pôde igualmente ter observado que o r1 não está traduzindo Type-7 ao Tipo 5, isto é porque somente as rotas Type-7 que foram adicionadas à tabela de roteamento são candidatos para a tradução.