<< Torna agli Approfondimenti Tematici


Jody Palombi
OSPF: approfondimento sull'algoritmo SPF
nella computazione di rotte esterne


Istruttore ufficiale Cisco presso Fast Lane - GKI (Certificato CCSI #34575), specializzato in tecnologie di Routing & Switching e Service Provider. Amante del Networking e della tecnologia in generale, ama condividere le proprie conoscenze ed ha scelto per tale motivo la carriera di formatore. Attualmente in possesso delle certificazioni industriali Cisco CCENT, CCNA, CCNP R&S e CCNP SP.

Il presente approfondimento delle logiche di redistribuzione di network all’interno di un dominio OSPF, provenienti dunque da domini di routing esterno, vuole mettere in luce le differenze che intercorrono realmente tra rotte External di tipo 1 (E1) ed External di tipo 2 (E2).

L’idea di tale approfondimento nasce dalla constatazione che differenti testi (guide per le certificazioni industriali relative a CCNA R&S o CCNP R&S), seppur assolutamente corretti nella formulazione delle differenze che intercorrono tra le due tipologie di rotte esterne, tralasciano invece alcuni aspetti relativi alla computazione della metrica che, sebbene non immediatamente visibili o intuibili, potrebbero condurre a comportamenti inattesi da parte dell’OSPF.

Inoltre, la diffusione dell’OSPF come protocollo di routing, e l’assenza di una risorsa di questo tipo in italiano sono le ragioni dunque che hanno portato alla stesura del presente testo. Le differenze che metterò in luce in quest’articolo saranno completamente applicabili anche aalle rotte esterne generate da aree NSSA (Not so Stubby), relativamente dunque a quelle reti che verrebbero indicate in tabella di routing OSPF come N1 e N2.


Analisi del comportamento in caso di LSA di tipo 5

PREMESSA: Partiamo dunque con il ricordare l’ordine di preferenza dei percorsi OSPF:

    1. Intra-Area (O)
    2. Inter-Area (O IA)
    3. External Type 1 (E1)
    4. External Type 2 (E2)

Ricordiamo inoltre che il succitato ordine di selezione prescinde dalla metrica (essa sarà dunque confrontabile solamente all’interno del medesimo gruppo).

Per la comprendere il tutto nel migliore dei modi, mi avvarrò della seguente topologia nell’ottica di supportare, tramite output ed esempi pratici, le differenze che mi appresto ad esporre.



Nella topologia sopra riportata, i router R2 ed R3 stanno effettuando redistribuzione del RIP all’interno di OSPF. Tutti i link sono FastEthernet, ed i costi di default (1) sono stati lasciati invariati. I due router sono configurati rispettivamente nel seguente modo (va detto per inciso che, per evitare il fenomeno del route-feedback, è stato impostato un filtro in OSPF - su R2 ed R3 - che impedisce al protocollo di accettare update per le reti appartenenti al dominio RIP):

R2#show run | sec router ospf
router ospf 1
[sp=2]router-id 2.2.2.2
[sp=2]log-adjacency-changes 
[sp=2][hl]redistribute rip subnets[/hl]
[sp=2]network 10.1.2.2 0.0.0.0 area 0
R3#show run | sec router ospf
router ospf 1
[sp=2]router-id 3.3.3.3
[sp=2]log-adjacency-changes 
[sp=2][hl]redistribute rip subnets[/hl]
[sp=2]network 10.1.3.3 0.0.0.0 area 0

Il non aver specificato alcun tipo di parametro nel comando “redistribute”, farà si che i router all’interno del dominio OSPF ricevano le rotte provenienti dal RIP come esterne di tipo 2 a metrica 20, come visibile da uno “show ip route ospf” su R6:

R6#show ip route ospf | begin Gateway
Gateway of last resort is not set

[sp=7]10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O IA [sp=4] 10.1.2.0/24 [110/3] via 10.5.6.5, 00:38:56, FastEthernet0/1
[sp=22][110/3] via 10.4.6.4, 00:39:06, FastEthernet0/0
O IA [sp=4] 10.1.3.0/24 [110/3] via 10.5.6.5, 00:38:56, FastEthernet0/1
[sp=22][110/3] via 10.4.6.4, 00:39:06, FastEthernet0/0
O IA [sp=4] 10.1.4.0/24 [110/2] via 10.4.6.4, 00:39:06, FastEthernet0/0
O IA [sp=4] 10.1.5.0/24 [110/2] via 10.5.6.5, 00:38:56, FastEthernet0/1
[sp=7]172.16.0.0/24 is subnetted, 2 subnets
O E2 [sp=4] 172.16.27.0 [110/20] via 10.5.6.5, 00:23:17, FastEthernet0/1
[sp=22][110/20] via 10.4.6.4, 00:23:17, FastEthernet0/0
O E2 [sp=4] 172.16.37.0 [110/20] via 10.5.6.5, 00:23:27, FastEthernet0/1
[sp=22][110/20] via 10.4.6.4, 00:23:27, FastEthernet0/0
[sp=7]192.168.7.0/32 is subnetted, 1 subnets
O E2 [sp=4] 192.168.7.7 [110/20] via 10.5.6.5, 00:21:43, FastEthernet0/1
[sp=22][110/20] via 10.4.6.4, 00:21:43, FastEthernet0/0
R6#

OGGETTO: Come si può notare, tutte le rotte apprese da R6 sono External di tipo 2 con metrica di default (20). Ciò che infatti si legge a tal proposito è che alle esterne di tipo 2 non viene aggiunta la metrica relativa alla distanza dall’ASBR (passata con una LSA di tipo 4 o di tipo 1), rimanendo dunque invariata lungo tutto il transito dell’update. Cosa che infatti è prefettamente in linea con l’output. Riportiamo uno show ip route parziale anche di R1 che, come R6, andrà in bilanciamento sui link verso R2 ed R3:

R1#show ip route ospf | begin Gateway
Gateway of last resort is not set

[sp=7]10.0.0.0/8 is variably subnetted, 10 subnets, 2 masks
O IA [sp=4] 10.4.6.0/24 [110/2] via 10.1.4.4, 00:31:12, FastEthernet1/0
O IA [sp=4] 10.5.6.0/24 [110/2] via 10.1.5.5, 00:31:12, FastEthernet1/1
[sp=7]172.16.0.0/24 is subnetted, 2 subnets
O E2 [sp=4] 172.16.27.0 [110/20] via 10.1.3.3, 00:13:56, FastEthernet2/1
[sp=22][110/20] via 10.1.2.2, 00:31:22, FastEthernet2/0
O E2 [sp=4] 172.16.37.0 [110/20] via 10.1.3.3, 00:31:12, FastEthernet2/1
[sp=22][110/20] via 10.1.2.2, 00:12:17, FastEthernet2/0
[sp=7]192.168.7.0/32 is subnetted, 1 subnets
O E2 [sp=4] 192.168.7.7 [110/20] via 10.1.3.3, 00:13:56, FastEthernet2/1
[sp=22][110/20] via 10.1.2.2, 00:12:17, FastEthernet2/0
R1#

La differenza con le External di tipo 1 è che queste ultime, come noto, riportano nella selezione del path anche la distanza dall’ASBR (in tabella di routing), oltre che ovviamente a venire sempre preferite a discapito delle E2, a prescindere dalla metrica impostata in fase di redistribuzione (ad esempio, anche se R2 redistribuisse con redistribute rip subnets metric-type 1 metric 1000, ed R3 redistribuisse con il semplice redistribute rip subnets, i router OSPF preferirebbero comunque uscire attraverso R2. Convertiamo adesso la redistribuzione in atto forzando l’immissione di external di tipo 1 (E1) da R2 ed R3:

R2(config)# router ospf 1
R2(config-router)# redistribute rip metric-type 1 subnets

R3(config)# router ospf 1
R3(config-router)# redistribute rip metric-type 1 subnets

Ciò che ci si attende è dunque la somma della distanza degli ASBR nel computo della metrica su base 20 (per comodità riporto solo l’output relativo alla Loopback 0 di R7):

R1#show ip route
[...output omesso...]
O E1 [sp=4] 192.168.7.7 [110/21] via 10.1.3.3, 00:04:13, FastEthernet2/1
[sp=22][110/21] via 10.1.2.2, 00:04:13, FastEthernet2/0
R4#show ip route
[...output omesso...]
O E1 [sp=4] 192.168.7.7 [110/22] via 10.1.4.1, 00:06:56, FastEthernet1/0
R5#show ip route
[...output omesso...]
O E1 [sp=4] 192.168.7.7 [110/22] via 10.1.5.1, 00:07:44, FastEthernet1/1

E dunque R6 andrà in bilanciamento verso R4 ed R5, stavolta però con metrica 23 (20 di default + 3 di distanza dagli ASBR):

R6#show ip route
[...output omesso...]
O E1 [sp=4] 192.168.7.7 [110/23] via 10.5.6.5, 00:09:18, FastEthernet0/1
[sp=22][110/23] via 10.4.6.4, 00:09:18, FastEthernet0/0

Analizzandone il dettaglio:

R6#show ip route 192.168.7.7
Routing entry for 192.168.7.7/32 
[sp=4]Known via "ospf 1", distance 110, [hl]metric 23[/hl], type extern 1
[sp=4]Last update from 10.4.6.4 on FastEthernet0/0, 00:15:02 ago
[sp=4]Routing Descriptor Blocks:
[sp=6]10.5.6.5, from 3.3.3.3, 00:15:02 ago, via FastEthernet0/1
[sp=8]Route metric is 23, traffic share count is 1
[sp=4]* 10.4.6.4, from 3.3.3.3, 00:15:02 ago, via FastEthernet0/0
[sp=8]Route metric is 23, traffic share count is 1
R6#

Altro comportamento ben noto riguarderebbe dunque la possibilità di discriminare i percorsi. Aumentando infatti il costo del link tra R1 ed R2, l’ASBR di ingresso preferito diverrà R3:

R1(config)# int fa2/0
R1(config-if)# ip ospf cost 50

R2(config)# int fa2/0
R2(config-if)# ip ospf cost 50



Segue quindi che per R1 verrà preferirà l’uscita verso R3:

R1#show ip route ospf | begin Gateway
Gateway of last resort is not set

[sp=7]10.0.0.0/8 is variably subnetted, 10 subnets, 2 masks
O IA [sp=4] 10.4.6.0/24 [110/2] via 10.1.4.4, 01:07:09, FastEthernet1/0
O IA [sp=4] 10.5.6.0/24 [110/2] via 10.1.5.5, 01:07:19, FastEthernet1/1
[sp=7]172.16.0.0/24 is subnetted, 2 subnets
O E1 [sp=4] 172.16.27.0 [110/21] via 10.1.3.3, 01:07:09, FastEthernet2/1
O E1 [sp=4] 172.16.37.0 [110/21] via 10.1.3.3, 01:07:09, FastEthernet2/1
[sp=7]192.168.7.0/32 is subnetted, 1 subnets
O E1 [sp=4] 192.168.7.7 [110/21] via 10.1.3.3, 01:07:09, FastEthernet2/1
R1#show ip ospf database external
[div w=100% class=center]OSPF Router with ID (1.1.1.1) (Process ID 1)[/div]
[div w=100% class=center]Type-5 AS External Link States[/div]
[br]
[...output omesso...][br]
[br]
LS age: 236[br]
Options: (No TOS-capability, DC)[br]
LS Type: AS External Link[br]
Link State ID: 192.168.7.7 (External Network Number )[br]
Advertising Router: 2.2.2.2[br]
LS Seq Number: 80000005[br]
Checksum: 0xDAC2[br]
Length: 36[br]
Network Mask: /32[br]
[sp=4] Metric Type: 1 (Comparable directly to link state metric)[br]
[sp=4] MTID: 0 [br]
[sp=4] [hl]Metric: 20[/hl][br]
[sp=4] Forward Address: 0.0.0.0[br]
[sp=4] External Route Tag: 0[br]
Routing Bit Set on this LSA in topology Base with MTID 0[br]
LS age: 303[br]
Options: (No TOS-capability, DC)[br]
LS Type: AS External Link[br]
Link State ID: 192.168.7.7 (External Network Number )[br]
Advertising Router: 3.3.3.3[br]
LS Seq Number: 80000005[br]
Checksum: 0xBCDC[br]
Length: 36[br]
Network Mask: /32[br]
[sp=4] Metric Type: 1 (Comparable directly to link state metric)[br]
[sp=4] MTID: 0 [br]
[sp=4] [hl]Metric: 20[/hl][br]
[sp=4] Forward Address: 0.0.0.0[br]
[sp=4] External Route Tag: 0

R1 continua a ricevere le update (LSA type 5) a metrica 20 dagli ASBR R2 ed R3 (nell’output precedente è stato riportato il DB relativo solamente alla 192.168.7.7/32), ma l’innalzamento del costo del link R1-R2 si riflette nella cancellazione della rotta passante per R2. R4, R5 ed R6 non si accorgono del cambiamento, poichè dal loro punto di vista esiste un unico punto di passaggio, ovvero R1. Configureremo adesso la rete come mostrato in figura:



R6 potrà dunque bilanciare, per tutte le destinazioni RIP, sempre tra due percorsi a metrica 72:

R6#show ip route ospf | begin Gateway
Gateway of last resort is not set
[br]
[sp=7]10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O IA [sp=4] 10.1.2.0/24 [110/52] via 10.5.6.5, 00:30:48, FastEthernet0/1
[sp=22][110/52] via 10.4.6.4, 00:30:48, FastEthernet0/0
O IA [sp=4] 10.1.3.0/24 [110/52] via 10.5.6.5, 00:30:48, FastEthernet0/1
[sp=22][110/52] via 10.4.6.4, 00:30:48, FastEthernet0/0
O IA [sp=4] 10.1.4.0/24 [110/51] via 10.4.6.4, 00:31:13, FastEthernet0/0
O IA [sp=4] 10.1.5.0/24 [110/51] via 10.5.6.5, 00:30:48, FastEthernet0/1
[sp=7]172.16.0.0/24 is subnetted, 2 subnets
O E1 [sp=4] 172.16.27.0 [110/72] via 10.5.6.5, 00:30:48, FastEthernet0/1
[sp=22][110/72] via 10.4.6.4, 00:30:48, FastEthernet0/0
O E1 [sp=4] 172.16.37.0 [110/72] via 10.5.6.5, 00:30:48, FastEthernet0/1
[sp=22][110/72] via 10.4.6.4, 00:30:48, FastEthernet0/0
[sp=7]192.168.7.0/32 is subnetted, 1 subnets
O E1 [sp=4] 192.168.7.7 [110/72] via 10.5.6.5, 00:30:48, FastEthernet0/1
[sp=22][110/72] via 10.4.6.4, 00:30:48, FastEthernet0/0

Ripristinando il link a metrica 1 tra R5 ed R6, mantenendo l’impostazione di redistribuzione in E1, sarà ovvia la sparizione del percorso in bilanciamento:



R6#show ip route ospf | begin Gateway
Gateway of last resort is not set
[br]
[sp=7]10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O IA [sp=4] 10.1.2.0/24 [110/3] via 10.5.6.5, 00:00:54, FastEthernet0/1
O IA [sp=4] 10.1.3.0/24 [110/3] via 10.5.6.5, 00:00:54, FastEthernet0/1
O IA [sp=4] 10.1.4.0/24 [110/51] via 10.4.6.4, 00:42:34, FastEthernet0/0
O IA [sp=4] 10.1.5.0/24 [110/2] via 10.5.6.5, 00:00:54, FastEthernet0/1
[sp=7]172.16.0.0/24 is subnetted, 2 subnets
O E1 [sp=4] 172.16.27.0 [110/23] via 10.5.6.5, 00:00:44, FastEthernet0/1
O E1 [sp=4] 172.16.37.0 [110/23] via 10.5.6.5, 00:00:44, FastEthernet0/1
[sp=7]192.168.7.0/32 is subnetted, 1 subnets
O E1 [sp=4] 192.168.7.7 [110/23] via 10.5.6.5, 00:00:44, FastEthernet0/1

Fin qui dunque nulla di anomalo o inatteso. Da ciò che però è possibile evincere dalla letteratura inerente le differenti tipologie di rotte esterne, seguirebbe che, convertendo il tutto nuovamente in E2,

R2(config)# router ospf 1
R2(config-router)# redistribute rip metric-type 2 subnets
[br]
R3(config)# router ospf 1
R3(config-router)# redistribute rip metric-type 2 subnets

R6 dovrebbe tornare a bilanciare tra R4 ed R5, a prescindere dalla presenza o meno del link a costo 50 tra R1 ed R4.

Di seguito l’output estratto da R6 dopo tali modifiche:

R6#show ip route ospf | begin Gateway
Gateway of last resort is not set
[br]
[sp=7]10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O IA [sp=4] 10.1.2.0/24 [110/3] via 10.5.6.5, 00:05:13, FastEthernet0/1
O IA [sp=4] 10.1.3.0/24 [110/3] via 10.5.6.5, 00:05:13, FastEthernet0/1
O IA [sp=4] 10.1.4.0/24 [110/51] via 10.4.6.4, 00:46:53, FastEthernet0/0
O IA [sp=4] 10.1.5.0/24 [110/2] via 10.5.6.5, 00:05:13, FastEthernet0/1
[sp=7]172.16.0.0/24 is subnetted, 2 subnets
O E2 [sp=4] 172.16.27.0 [110/20] via 10.5.6.5, 00:01:51, FastEthernet0/1
O E2 [sp=4] 172.16.37.0 [110/20] via 10.5.6.5, 00:01:51, FastEthernet0/1
[sp=7]192.168.7.0/32 is subnetted, 1 subnets
O E2 [sp=4] 192.168.7.7 [110/20] via 10.5.6.5, 00:01:51, FastEthernet0/1

Vero che si torna a vedere delle rotte in tabella di routing a metrica 20, ma il bilanciamento sembra in qualche modo compromesso. Cerchiamo quindi di capire perchè prendendo in esame la 192.168.7.7/32

R6#show ip route 192.168.7.7
Routing entry for 192.168.7.7/32 
[sp=2]Known via "ospf 1", distance 110, metric 20, type extern 2, [hl]forward metric 3[/hl]
[sp=2]Last update from 10.5.6.5 on FastEthernet0/1, 00:04:39 ago
[sp=2]Routing Descriptor Blocks:
[sp=2]* 10.5.6.5, from 3.3.3.3, 00:04:39 ago, via FastEthernet0/1
[sp=6]Route metric is 20, traffic share count is 1

Ciò che in realtà impedisce al percorso attraverso R4 di finire in tabella di routing è evidenziato nell’output precedente. Il “forward metric”, parametro invisibile in tabella di routing, è ciò che, sebbene in maniera non del tutto evidente ad una prima analisi, viene comunque computato nella selezione del percorso. In una rotta esterna di tipo 1, tale parametro è invece collassato all’interno del campo metric:

R6#show ip route 192.168.7.7
Routing entry for 192.168.7.7/32 
[sp=2]Known via "ospf 1", distance 110, [hl]metric 23[/hl], type extern 1
[sp=2]Last update from 10.5.6.5 on FastEthernet0/1, 00:00:05 ago
[sp=2]Routing Descriptor Blocks:
[sp=2]* 10.5.6.5, from 3.3.3.3, 00:00:05 ago, via FastEthernet0/1
[sp=6]Route metric is 23, traffic share count is 1

CONCLUSIONE: Dunque, sebbene l’OSPF “non aggiunga la metrica interna alle rotte external di tipo 2” sia tecnicamente corretto, all’atto pratico entrambi i metodi di redistribuzione considerano comunque la distanza dall’ASBR, sia in termini di costi intra-area che inter-area, a prescindere dall’utilizzo di E1 o E2.


Analisi del comportamente in casi di LSA di tipo 7

PREMESSA: Il medesimo comportamento lo si può riscontrare per quanto riguarda le LSA di tipo 7 provenienti da aree NSSA (Not so Stubby area). Il concetto è esattamente il medesimo, e per mostrarlo utilizzeremo la seguente topologia opportunamente configurata:



R7(config)# router ospf 1
R7(config-router)# area 1 nssa
R7(config-router)# redistribute eigrp 1 subnets
R8(config)# router ospf 1
R8(config-router)# area 1 nssa
R8(config-router)# redistribute eigrp 1 subnets

OGGETTO: R7 ed R8 operano redistribuzione della 172.16.0.0/16, essendo però situati all’interno di un’area dichiarata NSSA, che per definizione non ammette le LSA di tipo 5, dovranno generare delle LSA di tipo 7 come mostrato nell’output seguente:

R7#show ip ospf database[br]
[br]
[table class="intable" w=100%]

[tr]

[td colspan=6 center]OSPF Router with ID (7.7.7.7) (Process ID 1)[br][br][/td]

[/tr][tr]

[td][/td]
[td colspan=5 left]Router Link States (Area 1)[br][br][/td]

[/tr][tr]

[th w=18%]Link ID[/th]
[th w=21%]ADV Router[/th]
[th w=10%]Age[/th]
[th w=18%]Seq#[/th]
[th w=17%]Checksum [/th]
[th w=20%]Link count[/th]

[/tr][tr]

[td]4.4.4.4[/td]
[td]4.4.4.4[/td]
[td]267[/td]
[td]0x80000002[/td]
[td]0x006571[/td]
[td]1[/td]

[/tr][tr]

[td]5.5.5.5[/td]
[td]5.5.5.5[/td]
[td]268[/td]
[td]0x80000002[/td]
[td]0x003B90[/td]
[td]1[/td]

[/tr][tr]


[td]6.6.6.6 [/td]
[td]6.6.6.6 [/td]
[td]236 [/td]
[td]0x8000000C [/td]
[td]0x00D508 [/td]
[td]4[/td]

[/tr][tr]

[td]7.7.7.7[/td] 
[td]7.7.7.7[/td] 
[td]3 [/td]
[td]0x80000003 [/td]
[td]0x00EDC6 [/td]
[td]1[/td]

[/tr][tr]

[td]8.8.8.8 [/td]
[td]8.8.8.8 [/td]
[td]12 [/td]
[td]0x80000003 [/td]
[td]0x00CFD8 [/td]
[td]1[/td]

[/tr][tr]

[td][/td]
[td colspan=5 left][br]Net Link States (Area 1)[br][br][/td]

[/tr][tr]

[th]Link ID[/th]
[th]ADV Router[/th]
[th]Age[/th]
[th]Seq#[/th]
[th colspan=2]Checksum [/th]

[/tr][tr]

[td]10.4.6.6 [/td]
[td]6.6.6.6 [/td]
[td]267 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x00F4E4[/td]

[/tr][tr]

[td]10.5.6.6 [/td]
[td]6.6.6.6 [/td]
[td]268 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x001BB9[/td]

[/tr][tr]

[td]10.6.7.7 [/td]
[td]7.7.7.7 [/td]
[td]276 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x003095[/td]

[/tr][tr]

[td]10.6.8.8 [/td]
[td]8.8.8.8 [/td]
[td]237 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x001F9C[/td]

[/tr][tr]

[td][/td]
[td colspan=5 left][br]Summary Net Link States (Area 1)[br][br][/td]

[/tr][tr]

[th]Link ID[/th]
[th]ADV Router[/th]
[th]Age[/th]
[th]Seq#[/th]
[th colspan=2]Checksum [/th]

[/tr][tr]

[td]10.1.2.0 [/td] 
[td]4.4.4.4 [/td]
[td]254 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x0026F1[/td]

[/tr][tr]

[td]10.1.2.0 [/td]
[td]5.5.5.5 [/td]
[td]256 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x00080C[/td]

[/tr][tr]

[td]10.1.3.0 [/td]
[td]4.4.4.4 [/td]
[td]254 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x001BFB[/td]

[/tr][tr]

[td]10.1.3.0 [/td]
[td]5.5.5.5 [/td]
[td]256 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x00FC16[/td]

[/tr][tr]

[td]10.1.4.0[/td] 
[td]4.4.4.4[/td] 
[td]264 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x000611[/td]

[/tr][tr]

[td]10.1.4.0 [/td]
[td]5.5.5.5 [/td]
[td]256 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x00F120[/td]

[/tr][tr]

[td]10.1.5.0 [/td]
[td]4.4.4.4 [/td]
[td]254 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x000510[/td]

[/tr][tr]

[td]10.1.5.0[/td] 
[td]5.5.5.5 [/td]
[td]256 [/td]
[td]0x80000001 [/td]
[td colspan=2]0x00DC35[/td]

[/tr][tr]

[td][/td]
[td colspan=5 left][br][hl]Type-7 AS External Link States (Area 1)[/hl][br][br][/td]

[/tr][tr]

[th]Link ID[/th]
[th]ADV Router[/th]
[th]Age[/th]
[th]Seq#[/th]
[th]Checksum[/th]
[th]Tag[/th]

[/tr][tr]

[td]172.16.0.0 [/td]
[td]7.7.7.7 [/td]
[td]3 [/td]
[td]0x80000001[/td] 
[td]0x006F30 [/td]
[td]0[/td]

[/tr][tr]

[td]172.16.0.0 [/td]
[td]8.8.8.8 [/td]
[td]12 [/td]
[td]0x80000001 [/td]
[td]0x006C2D [/td]
[td]0[/td]

[/tr]

[/table]

Di seguito dunque la tabella di routing di R6:

R6#show ip route ospf | begin Gateway
Gateway of last resort is not set

[sp=7]10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks
O IA [sp=4] 10.1.2.0/24 [110/3] via 10.5.6.5, 00:10:27, FastEthernet0/1
[sp=22][110/3] via 10.4.6.4, 00:10:26, FastEthernet0/0
O IA [sp=4] 10.1.3.0/24 [110/3] via 10.5.6.5, 00:10:27, FastEthernet0/1
[sp=22][110/3] via 10.4.6.4, 00:10:26, FastEthernet0/0
O IA [sp=4] 10.1.4.0/24 [110/2] via 10.4.6.4, 00:10:35, FastEthernet0/0
O IA [sp=4] 10.1.5.0/24 [110/2] via 10.5.6.5, 00:10:27, FastEthernet0/1 
[hl]O N2 [sp] 172.16.0.0/16 [110/20] via 10.6.8.8, 00:06:19, FastEthernet2/1 [/hl]
[hl][sp=21][110/20] via 10.6.7.7, 00:06:09, FastEthernet2/0[/hl]

Non essendo stato specificato nulla in fase di redistribuzione, il default sarà, come nel caso precedente, quello relativo alle external di tipo 2, in questo caso N2. Esattamente per la stessa logica, il bilanciamento avviene tra i due link poichè gli ASBR distano da R6 20 (default) più “forward metric” 1 (link R6-R7 e R6-R8):

R6#show ip route 172.16.0.0
Routing entry for 172.16.0.0/16 
[sp=2]Known via "ospf 1", distance 110, metric 20, [hl]type NSSA extern 2[/hl], [hl]forward metric 1[/hl]
[sp=2]Last update from 10.6.7.7 on FastEthernet2/0, 00:09:01 ago
[sp=2]Routing Descriptor Blocks:
[sp=2]* 10.6.8.8, from 8.8.8.8, 00:09:11 ago, via FastEthernet2/1
[sp=6]Route metric is 20, traffic share count is 1
[sp=4]10.6.7.7, from 7.7.7.7, 00:09:01 ago, via FastEthernet2/0
[sp=6]Route metric is 20, traffic share count is 1

Aumentando quindi, come negli esempi precedenti, il costo di uno di quei due link, otterremo lo stesso effetto ottenuto in fase di analisi delle E2. Innalziamo dunque il costo del link R6-R8 e potremo riscontrare lo stesso comportamento:

R6(config)# int fa2/0
R6(config-if)# ip ospf cost
R7(config)# int fa2/0
R7(config-if)# ip ospf cost

R6 possiede informazioni circa entrambe le LSA di tipo 7 a metrica identica:

R6#show ip ospf database nssa-external
[div w=100% class=center]OSPF Router with ID (6.6.6.6) (Process ID 1)[/div]
[div w=100% class=center][hl]Type-7 AS External Link States (Area 1)[/hl][/div]
[br]
LS age: 40[br]
Options: (No TOS-capability, Type 7/5 translation, DC)[br]
LS Type: AS External Link[br]
Link State ID: 172.16.0.0 (External Network Number )[br]
Advertising Router: 7.7.7.7[br]
LS Seq Number: 80000002[br]
Checksum: 0x6D31[br]
Length: 36[br]
Network Mask: /16[br]
[sp=6]Metric Type: 2 (Larger than any link state path)[br]
[sp=6]MTID: 0 [br]
[sp=6][hl]Metric: 20[/hl][br]
[sp=6]Forward Address: 10.6.7.7[br]
[sp=6]External Route Tag: 0[br]
[br]
Routing Bit Set on this LSA in topology Base with MTID 0[br]
LS age: 936[br]
Options: (No TOS-capability, Type 7/5 translation, DC)[br]
LS Type: AS External Link[br]
Link State ID: 172.16.0.0 (External Network Number )[br]
Advertising Router: 8.8.8.8[br]
LS Seq Number: 80000001[br]
Checksum: 0x6C2D[br]
Length: 36[br]
Network Mask: /16[br]
[sp=6]Metric Type: 2 (Larger than any link state path)[br]
[sp=6]MTID: 0 [br]
[sp=6][hl]Metric: 20[/hl][br]
[sp=6]Forward Address: 10.6.8.8[br]
[sp=6]External Route Tag: 0[br]

CONCLUSIONE: Anche per le aree NSSA, prendendo in considerazione la forward metric (ricavata in questo caso il costo intra-area), R6 valuta preferibile il percorso passante per R7:

R6#show ip route ospf | begin Gateway
Gateway of last resort is not set

[sp=7]10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks
O IA [sp=4] 10.1.2.0/24 [110/3] via 10.5.6.5, 00:25:09, FastEthernet0/1
[sp=22][110/3] via 10.4.6.4, 00:25:08, FastEthernet0/0
O IA [sp=4] 10.1.3.0/24 [110/3] via 10.5.6.5, 00:25:09, FastEthernet0/1
[sp=22][110/3] via 10.4.6.4, 00:25:08, FastEthernet0/0
O IA [sp=4] 10.1.4.0/24 [110/2] via 10.4.6.4, 00:25:17, FastEthernet0/0
O IA [sp=4] 10.1.5.0/24 [110/2] via 10.5.6.5, 00:25:09, FastEthernet0/1 
[hl]O N2 [sp] 172.16.0.0/16 [110/20] via 10.6.8.8, 00:21:01, FastEthernet2/1[/hl]

Contattaci

Contattaci per qualsiasi ulteriore informazione, saremo lieti di rispondere alle tue domande e di supportarti nella definizione dei tuoi piani formativi! Puoi raggiungerci telefonicamente al numero +39 02 255081 oppure compilando il modulo di contatto.