OSPF

 

 

 OSPF

        OSPF is a routing protocol based on the mathematical concept of graph. A graph is a bidimensional structure made by nodes (also called vertex) connected together via links aldo called branches or arches. A graph could be weighed if every branch has an associate numerical value. Every link could also be bidirectional and therefore it is possible to have two different connection between two nodes and two weight values. In this case the graph is called oriented.

       Therefore a graph is a natural way to represent a network that infact is a bidirectional structure made of router connected together with bidirectional links. The links are weighed with a number that could be, for example, the bandwidth available on it.

       If OSPF is enabled a router mantein a topological graph of the entire network. This graph is bidirectional and weighted. In reality the graph is limited to the OSPF area to which the router belong. With OSPF is possible to split a big network in parts called area. So we are going to have some routers that are connected to different areas. This routers are called ABR and normally the do a summarization of the network prefix.    

          This behaviour is different from what we have in protocols like RIP, EIGRP and IGRP.  With OSPF are propaged only the topology changes in the network, this is way OSPF is a link-state algorithm. This is why OSPF is able to scale to big networks.    

          With OSPF a router extract a tree from the graph using an shortest-path algorithm (like Dijkstra). In this way a router is able to determine the best path to reach a destination.             

      Questo grafo ha link bidirezionali con peso. Pertanto ogni router della rete ha visibilita’ su tutta la struttura di rete. In RIP, EIGRP, IGRP un router non ha idea dell’intera struttura topologica della rete in cui si trova ma soltanto di quella relativa ad esso e ai suoi suoi vicini. Per questa ragione OSPF si chiama protocollo   “link-state”. La presenza del grafo dell’intera rete consente ad ogni router, applicando l’algoritmo di Dijkstra (shortest-path), di estrarre un albero dal grafo cosi’ da determinare il percorso ottimale per raggiungere ogni destinazione evitando loop e senza fare uso di hold-down timer che sono causa della lenta la convergenza in RIP e IGRP. Ogni router estrae un albero di cui lui stesso  e’ la radice. Se due percorsi hanno lo stesso costo OSPF distribuisce il carico tra i due. Nella configurazione di OSPF non si fa uso di AS number ma di process-id che e' cosa differente in quanto si puo' avere differente process-id in router differenti. OSPF ha pieno supporto della netmask, invia solo aggiornamenti e non l’intera tabella di routing ai suoi vicini, e’ piu’ CPU intensive di RIP, IGRP ed EIGRP, ed e’ scalabile.

      Poiche’ ogni router ha un grafo dell’intera rete col crescere della stessa il ricalcolo con Dijstra puo' impiegare eccessive risorse di CPU e memoria. Per questa ragione sono state introdotte le AREE. Ogni router ha in realta' consapevolezza della struttura dell’area a cui appartiene. Alcuni router, gli ABR, hanno interfacce su aree diverse. L’area 0 e’ speciale ed e’ sempre presente in una rete OSPF. Gli ASBR sono invece quei router che ridistribuiscono in OSPF informazioni provenienti da statiche o da altri algoritmi di routing.

       Tutte le informazioni di routing vengono scambiate tramite messaggi chiamati LSA. RFC1247definisce gli LSA ‘link-state advertisements’ e vengono inviati all'indirizzo multicast 224.0.0.5.  Gli LSA piu' importanti sono 5.

Gli LSA type 1 e type 2 sono di fatto quelli che permettono la costruzione del grafo in quanto sono relativi all'area di appartenenza di un router.

type 1

Propaga informazioni relative a  tutte le reti collegate ad un  router e appartenenti alla sua stessa area. Gli LSA type 1 vengono inviati ai router di un'area e non ne superano i confini. Gli LSA di tipo 1 contengono uno di qu

type 2

 Quando piu' router hanno un'interfaccia sullo stesso segmento di LAN ne viene eletto uno, chiamato DR (Designated Router), che ha il compito di inviare informazioni per conto di tutti i router connessi al segmento.  Gli LSA type 2 vengono inviati ai router di un'area e non ne superano i confini;

type 3,4

 Questi messaggi passano da un'area ad un'altra adiacente. Sono originati dagli ABR (Area Border Router). ABR invia ad un’area informazioni relative ad un’altra area, sempre di cui fa parte. I type 3 contengono informazioni relative a route verso reti presenti nelle aree. I type 4 contengono informazioni di routing in direzione degli ASBR, ovvero router che inseriscono in OSPF route di altri protocolli come BGP;

type 5

 
Originati dagli ASBR e contenti informazioni per route relative a destinazioni su AS esterni. Sono di due tipi: E1 e E2. Di default E2.  Le route esterne (external routes) vengono propagate dagli ASBR tramite gli LSA Type 5. Le route esterne si classificano a loro volta in:

   ·        external type 1 (E1)
   ·        external type 2 (E2)
 
 
 
La tipologia E1 propaga la route nella nuvola OSPF aggiornandone il costo con la propagazione. La tipologia E2 propaga la route nella nuvola OSPF lasciandone inalterato il costo. 
    Per default gli LSA sono propagati attraverso tutte le interfacce su una stessa area con esclusione dell’interfacce da cui sono arrivati.
   Due neighbor, anche adiacenti, si scambiano pacchetti Hello ogni 10 secondi (Hello interval). Se dopo quattro volte questo tempo (Dead interval) non arrivano Hello la vicinanza col neighbor passa dallo stato “FULL” allo stato “DOWN”.  Hello e’ 30 secondi per NBMA (Non Broadcast Multi Access come ATM e Frame Relay).  Col comando "show ip ospf neighbor" e' possibile individuare i router OSPF vicini con i quali si ha una sessione attiva:

RTA#sh ip ospf nei
 
Neighbor ID      Pri   State         Dead Time    Address         Interface
172.121.139.253    1   FULL/  -      00:00:36    172.121.139.90  Serial2/0


 
Gli LSA hanno un aging time di 1h oltre la quale sono cancellati. In ogni caso i router inviano ogni 30 minuti dei refresh indipendentemente da eventuali cambiamenti di topologia.

   C’e’ da considerare che nelle versioni di OSPF meno recenti si inviano refresh indiscriminatamente per tutti gli LSA generati. In seguito si e' adottato un TIMER per ogni LSA. Cio’ consente di inviare solo gli LSA effettivamente vecchi. Comunque questi ultimi vengono raggruppati per intervalli di 4 minuti di default (pacing timer) per generare 1 solo pacchetto di aggiornamento per piu’ LSA e meno spreco di banda e CPU.

OSPF funziona in modalita' diverse a seconda della rete su cui opera. Si distingue:

point-to-point 

   E’ il caso dei collegamenti punto-punto tra router come un seriale con PPP o HDLC o un ISDN. L’interfaccia puo’ essere unnumbered. Se c’e’ l’ip il link e’ trattato come una stub network;

broadcast networks

   E’ il caso in cui il router e’ collegato ad esempio ad una rete ethernet. Se nella ethernet vi e’ un solo router con OSPF questa e’ trattata come stub network altrimenti si procede con l’elezione di un DR e la rete e trattata come transit network;

point-to-multipoint non-broadcast

  
Si tratta delle reti Non Broadcast Multi Access come ATM e Frame Relay. Col point-to-multipoint la rete e vista come un insieme di collegamenti point-to-point. E’ il meno efficiente per l'elevata bandwidth utilizzata per gli aggiornamenti. Con il non-broadcast invece la rete viene vista come una rete ethernet. Si elegge un DR. In questo caso pero’ ogni router nella NBMA deve vedere gli altri cioe’ ci vuole una configurazione full-mesh;

Esempi

Questo esempio mostra una tipica configurazione OSPF nel caso di un router lato customer di una rete:

router ospf 4
  log-adjacency-changes
  network 192.168.65.12 0.0.0.3 area 0.0.5.0      <--- le interfacce che cadono in questa network avranno OSPF attivo
  distribute-list 82 out
  distribute-list 81 in

access-list 81 permit 172.16.20.50
access-list 81 deny any
access-list 82 deny any

 

 Per resettare il processo OSPF e rigenerare la tabella di routing si usa "clear ip ospf process". Ecco l'invio di un comando clear ad un router con OSPF. La sequenza mostra tutto il processo
di avvio di una sessione OSPF e scambio di LSA:

prova-ct# clear ip ospf process
Reset ALL OSPF processes? [no]: yes

prova-ct#

*Mar 10 16:07:06.810: OSPF: Flushing External Links
*Mar 10 16:07:06.814: OSPF: Inc retrans unit nbr count index 1 (0/1) to 1/1

#
#  10.121.139.253 e' il nostro unico Neighbor ID
#

*Mar 10 16:07:06.814: OSPF: Set Nbr 10.121.139.253 1 first flood info from 0 (0)
 to 62D48788 (792)
*Mar 10 16:07:06.814: OSPF: Init Nbr 10.121.139.253 1 next flood info to 62D48788

#
#  192.13.19.80 sono gli ip per la navigazione internet assegnati, definiti
#  mediante statica e sono type 5 in quanto provengono da rete esterna
#

    # Quando si manda un LSA questo viene conservato in attesa dell'ACK
    # Se questo non arriva entro il "retransmit-interval", di default 5 sec.,
    # e selezionabile tra 1 a 65535 con "ip ospf retransmit-interval T"
    # Gli LSA sono in una retransmission-list finche' non arriva ACK

*Mar 10 16:07:06.814: OSPF: Add Type 5 LSA ID 192.13.19.80 Adv rtr 10.121.139.89
 Seq 80000023 to Serial2/0 10.121.139.253 retransmission list
*Mar 10 16:07:06.814: OSPF: Start Serial2/0 10.121.139.253 retrans timer
*Mar 10 16:07:06.814: OSPF: Set idb next flood info from 0 (0) to 62D48788 (792)
*Mar 10 16:07:06.814: OSPF: Add Type 5 LSA ID 192.13.19.80 Adv rtr 10.121.139.89
 Seq 80000023 to Serial2/0 flood list
*Mar 10 16:07:06.814: OSPF: Start Serial2/0 pacing timer for 33 msecs
*Mar 10 16:07:06.814: OSPF: Flushing Opaque AS Links

    # Si trasmette LSA type 5 (si noti che siamo nello stesso istante di prima)

*Mar 10 16:07:06.814: OSPF: Flooding update on Serial2/0 to 224.0.0.5 Area 0
*Mar 10 16:07:06.814: OSPF: Send Type 5, LSID 192.13.19.80, Adv rtr 10.121.139.8
9, age 3600, seq 0x80000023 (0)
*Mar 10 16:07:06.814: OSPF: Create retrans unit 0x62D47E14/0x62D46CD4 1 (0/1) 1
*Mar 10 16:07:06.814: OSPF: Set nbr 1 (0/1) retrans to 4968 count to 1
*Mar 10 16:07:06.814: OSPF: Set idb next flood info from 62D48788 (792) to 0 (0)
*Mar 10 16:07:06.814: OSPF: Remove Type 5 LSA ID 192.13.19.80 Adv rtr 10.121.139
.89 Seq 80000023 from Serial2/0 flood list
*Mar 10 16:07:06.814: OSPF: Stop Serial2/0 flood timer

#
#  LSA type 5 per la rete 192.13.90.80 e' stato inviato
#
#  Finiti gli LSA type 5 adesso manda quello della seriale in questo caso 10.121.139.89
#  che e' LSA type 1
#

*Mar 10 16:07:06.854: OSPF: Flushing Link states in area 0
*Mar 10 16:07:06.854: OSPF: Inc retrans unit nbr count index 1 (0/1) to 1/1
*Mar 10 16:07:06.854: OSPF: Set Nbr 10.121.139.253 1 first flood info from 0 (0)
 to 62D49024 (1000)
*Mar 10 16:07:06.854: OSPF: Init Nbr 10.121.139.253 1 next flood info to 62D49024
*Mar 10 16:07:06.854: OSPF: Add Type 1 LSA ID 10.121.139.89 Adv rtr 10.121.139.89 Seq 80000036 to Serial2/0 10.121.139.253 retransmission list
*Mar 10 16:07:06.854: OSPF: Set idb next flood info from 0 (0) to 62D49024 (1000)
*Mar 10 16:07:06.854: OSPF: Add Type 1 LSA ID 10.121.139.89 Adv rtr 10.121.139.89 Seq 80000036 to Serial2/0 flood list
*Mar 10 16:07:06.854: OSPF: Start Serial2/0 pacing timer for 33 msecs
*Mar 10 16:07:06.854: OSPF: Flooding update on Serial2/0 to 224.0.0.5 Area 0
*Mar 10 16:07:06.854: OSPF: Send Type 1, LSID 10.121.139.89, Adv rtr 10.121.139.89, age 3600, seq 0x80000036 (0)
*Mar 10 16:07:06.854: OSPF: Create retrans unit 0x62D47E44/0x62D46B94 1 (0/1) 1
*Mar 10 16:07:06.854: OSPF: Set nbr 1 (0/1) retrans to 4736 count to 1
*Mar 10 16:07:06.854: OSPF: Set idb next flood info from 62D49024 (1000) to 0 (0)
*Mar 10 16:07:06.854: OSPF: Remove Type 1 LSA ID
10.121.139.89 Adv rtr 10.121.139.89 Seq 80000036 from Serial2/0 flood list

*Mar 10 16:07:06.854: OSPF: Stop Serial2/0 flood timer
*Mar 10 16:07:06.894: OSPF: Interface Serial2/0 going Down
*Mar 10 16:07:06.894: %OSPF-5-ADJCHG: Process 10, Nbr 10.121.139.253 on Serial2/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Mar 10 16:07:06.894: OSPF: Dec retrans unit nbr count index 1 (0/1) to 0/0
*Mar 10 16:07:06.894: OSPF: Free nbr retrans unit 0x62D47E44/0x62D46B94 0 total
0. Also Free nbr retrans block
*Mar 10 16:07:06.894: OSPF: Set Nbr 10.121.139.253 1 first flood info from 62D49024 (1000) to 0 (0)
*Mar 10 16:07:06.894: OSPF: Adjust Nbr 10.121.139.253 1 next flood info to 0
*Mar 10 16:07:06.894: OSPF: Remove Type 1 LSA ID 10.121.139.89 Adv rtr 10.121.139.89 Seq 80000036 from 10.121.139.253 retransmission list
*Mar 10 16:07:06.894: OSPF: Dec retrans unit nbr count index 1 (0/1) to 0/0
*Mar 10 16:07:06.894: OSPF: Free nbr retrans unit 0x62D47E14/0x62D46CD4 0 total0. Also Free nbr retrans block
*Mar 10 16:07:06.894: OSPF: Set Nbr 10.121.139.253 1 first flood info from 62D48788 (792) to 0 (0)
*Mar 10 16:07:06.894: OSPF: Adjust Nbr 10.121.139.253 1 next flood info to 0
*Mar 10 16:07:06.894: OSPF: Remove Type 5 LSA ID 192.13.19.80 Adv rtr 10.121.139.89 Seq 80000023 from 10.121.139.253 retransmission list
*Mar 10 16:07:06.894: OSPF: Stop nbr 10.121.139.253 retransmission timer
*Mar 10 16:07:06.894: OSPF: Interface Loopback1 going Down

*Mar 10 16:07:06.962: OSPF: Interface Serial2/0 going Up
*Mar 10 16:07:06.966: OSPF: Interface Loopback1 going Up

*Mar 10 16:07:07.394: OSPF: Build router LSA for area 0, router ID 10.121.139.89, seq 0x80000001

 

#
#  Si passa allo stato 2WAY dopo che arriva hello dal vicino
#
#  Si passa allo stato EXSTART quando si stabilisce chi e' master e chi slave
#  Il router con il piu' alto IP address diviene il master
#  E si manda un numero di sequenza che consente di determinare i vecchi LSA
#
# DBD sta per DataBaseDescriptor

# EXCHANGE: In questo stato il router scambia pacchetti DBD, che
# descrivono l'intero link-state database 

*Mar 10 16:07:08.274: OSPF: Rcv hello from 10.121.139.253 area 0 from Serial2/0
10.121.139.90
*Mar 10 16:07:08.274: OSPF: 2 Way Communication to 10.121.139.253 on Serial2/0,state 2WAY
*Mar 10 16:07:08.274: OSPF: Send DBD to 10.121.139.253 on Serial2/0 seq 0x2573 opt 0x42 flag 0x7 len 32
*Mar 10 16:07:08.278: OSPF: End of hello processing
*Mar 10 16:07:08.294: OSPF: Rcv DBD from 10.121.139.253 on Serial2/0 seq 0x14AF opt 0x42 flag 0x7 len 32  mtu 1500 state EXSTART
*Mar 10 16:07:08.294: OSPF: NBR Negotiation Done. We are the SLAVE
*Mar 10 16:07:08.294: OSPF: Send DBD to 10.121.139.253 on Serial2/0 seq 0x14AF opt 0x42 flag 0x2 len 72
*Mar 10 16:07:08.334: OSPF: Rcv DBD from 10.121.139.253 on Serial2/0 seq 0x14B0
opt 0x42 flag 0x3 len 1472  mtu 1500 state EXCHANGE
*Mar 10 16:07:08.334: OSPF: Send DBD to 10.121.139.253 on Serial2/0 seq 0x14B0 opt 0x42 flag 0x0 len 32
*Mar 10 16:07:08.338: OSPF: Database request to 10.121.139.253
*Mar 10 16:07:08.338: OSPF: sent LS REQ packet to 10.121.139.90, length 864

#
#NOTARE L'INVIO DELLA MTU:
#
Note:Cisco IOS ® Software Release 12.0(3) introduced interface MTU mismatch detection. This detection involves OSPF advertising the interface
#MTU in the #DBD packets, which is in accordance with the OSPF RFC 2178 , appendix G.9. When a router receives a DBD packet advertising
#a MTU larger than the router can receive, the router ignores the DBD packet and the neighbor state remains in exstart. This prevents an adjacency
#from forming. To fix this problem, make sure the MTU are the same on both ends of a link.
#
#

*Mar 10 16:07:08.370: OSPF: Rcv DBD from 10.121.139.253 on Serial2/0 seq 0x14B1 opt 0x42 flag 0x3 len 1472  mtu 1500 state EXCHANGE
*Mar 10 16:07:08.374: OSPF: Send DBD to 10.121.139.253 on Serial2/0 seq 0x14B1 opt 0x42 flag 0x0 len 32
*Mar 10 16:07:08.390: OSPF: received update from 10.121.139.253, Serial2/0
*Mar 10 16:07:08.390: OSPF: Rcv Update Type 1, LSID 192.13.21.241, Adv rtr 192.13.21.241, age 1656, seq 0x80000879
*Mar 10 16:07:08.390: OSPF: Rcv Update Type 1, LSID 192.13.21.209, Adv rtr 192.13.21.209, age 958, seq 0x80001220
*Mar 10 16:07:08.390: OSPF: Rcv Update Type 1, LSID 192.13.21.197, Adv rtr 192.13.21.197, age 497, seq 0x80000FE3
*Mar 10 16:07:08.394: OSPF: Rcv Update Type 1, LSID 192.13.21.194, Adv rtr 192.13.21.194, age 1133, seq 0x8000017E
*Mar 10 16:07:08.394: OSPF: Rcv Update Type 1, LSID 192.13.21.189, Adv rtr 192.13.21.189, age 304, seq 0x80000E57

 ...

*Mar 10 16:07:08.546: OSPF: Received same lsa
*Mar 10 16:07:08.546: OSPF: Sending direct ACK on Serial2/0 to 10.121.139.253
*Mar 10 16:07:08.546: OSPF: Ack Type 1, LSID 192.13.21.209, Adv rtr 192.13.21.209, age 959, seq 0x80001220

 ...

*Mar 10 16:07:08.558: OSPF: Rcv Update Type 1, LSID 192.13.2.166, Adv rtr 192.13.2.166, age 1801, seq 0x800034BC
*Mar 10 16:07:08.558: OSPF: Received same lsa
*Mar 10 16:07:08.558: OSPF: Rcv Update Type 1, LSID 192.13.2.100, Adv rtr 192.13.2.100, age 237, seq 0x800060DA
*Mar 10 16:07:08.558: OSPF: Received same lsa
*Mar 10 16:07:08.558: OSPF: Rcv Update Type 1, LSID 192.13.2.15, Adv rtr 192.13.2.15, age 350, seq 0x800003DA

#
#  router che formano un loop si inviano LSA tra loro finche' non c'e' un
#  "Received same lsa"
#

*Mar 10 16:07:08.562: OSPF: Received same lsa
*Mar 10 16:07:08.562: OSPF: Rcv Update Type 1, LSID 192.13.2.8, Adv rtr 192.13.2.8, age 1076, seq 0x80001805

 ...

*Mar 10 16:08:01.894: OSPF: Rcv Update Type 3, LSID 10.121.131.4, Adv rtr 10.121.131.2, age 7, seq 0x80000679
*Mar 10 16:08:01.894:       Mask /30
*Mar 10 16:08:01.894: OSPF: Rcv Update Type 3, LSID 10.121.131.8, Adv rtr 10.121.131.2, age 7, seq 0x80000EDC
*Mar 10 16:08:01.894:       Mask /30
*Mar 10 16:08:01.894: OSPF: Rcv Update Type 3, LSID 10.121.131.12, Adv rtr 10.221.131.2, age 7, seq 0x800002F8

 ...

*Mar 10 16:08:04.410: OSPF: Ack Type 3, LSID 192.13.21.237, Adv rtr 10.121.131.2, age 7, seq 0x80000B01
*Mar 10 16:08:04.410: OSPF: Ack Type 4, LSID 192.13.21.237, Adv rtr 10.121.131.2, age 7, seq 0x80000B83
*Mar 10 16:08:04.410: OSPF: Ack Type 5, LSID 10.121.156.39, Adv rtr 10.121.136.252, age 5, seq 0x80000080
*Mar 10 16:08:07.238: OSPF: received update from 10.121.139.253, Serial2/0
*Mar 10 16:08:07.238: OSPF: Rcv Update Type 1, LSID 192.13.29.94, Adv rtr 192.13.29.94, age 6, seq 0x80000623
*Mar 10 16:08:08.274: OSPF: Rcv hello from 10.121.139.253 area 0 from Serial2/0 10.121.139.90
*Mar 10 16:08:08.274: OSPF: End of hello processing
*Mar 10 16:08:09.738: OSPF: Sending delayed ACK on Serial2/0
*Mar 10 16:08:09.738: OSPF: Ack Type 1, LSID 192.13.29.94, Adv rtr 192.13.29.94, age 6, seq 0x80000623

prova-ct#undebug all



Articolo versione beta 0.9 - ultima revisione 16/3/03

Aggiornamento Dicembre 2014:

OSPF SU ASR9000:

RP/0/RSP0/CPU0:ASR9001-A# sh run router ospf
Thu Dec  4 14:25:31.871 UTC

!  IOS-XR PLATFORM
router ospf 10
 router-id 192.168.168.10         <--- questa e' una interfaccia di loopback
 area 0
    interface GigabitEthernet0/0/0/0.1     <--- OSPF e' attivo su questa interfaccia
  !
    interface Loopback1   <--- OSPF e' attivo su questa interfaccia
  !
 !
!

RP/0/RSP0/CPU0:ASR9001-A#show ospf neighbor
Thu Dec  4 14:26:08.006 UTC

* Indicates MADJ interface

Neighbors for OSPF 10

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.69.69.9      1     FULL/BDR        00:00:35    217.27.118.166  GigabitEthernet0/0/0/0.1
    Neighbor is up for 00:32:26

Total neighbor count: 1


OSPF manda multicast sulle interfacce dove e' attivo alla ricerca dei neighbor. Quindi due router completamente isolati come layer 3 ma con OSPF attivo si troveranno e si scambieranno le righe di routing abilitandosi al layer 3.
E' cosi' che noi mettiamo una interfaccia di loopback per router come router-id di OSPF. A quel punto abilitiamo OSPF nelle interfacce che mettono in comunicazione i router tra di loro. Ci garantiamo l'annuncio delle classi configurate nelle interfacce dove OSPF e abilitato.
Non ha senso usare come router-id interfacce fisiche perche' potrebbero diventare down e quindi bloccare OSPF dal funzionare correttamente.

! IOS platform
router ospf 10100
  router-id 10.69.69.4
  redistribute connected subnets   <--- distribuiamo le classi su tutte le ethernet
  network 10.100.100.0 0.0.0.255 area 0  <--- OSPF e' attivo sulle interfacce che cadono in questa network
  maximum-paths 1   <--- evitiamo load-balancing non voluti


RP/0/RSP0/CPU0:ASR9001-A#show ospf summary
Tue Jan 20 16:53:48.484 MET

Routing process "ospf 10"
Number of OSPF interfaces 6         <--- INTERFACCE SU CUI E' ATTIVO OSPF
Number of OSPF interfaces up 6      <--- INTERFACCE nello stato di UP
Number of OSPF virtual interfaces up 0
Number of OSPF sham-link interfaces up 0
Number of neighbors 5           <--- una interfaccia e' una loopback che non ha neighbor
Number of neighbors adjacent 5
Number of areas 1         <--- abbiamo solo area 0 in uso
 LSA Type       Count
 Router        : 11   <--- router lsa, ovvero LSA Type 1. LSA relativi ad una singola area.
 Network       : 10   <--- LSA Type 2. Un router DR indica i router collegati in un segmento broadcast
 Summary Net   : 0
 Summary ASBR  : 0
 Type-7 Ext    : 0
 Opaque Link   : 0
 Opaque Area   : 0
 Type-5 Ext    : 80    <--- importate in OSPF da altri processi di routing
 Opaque AS     : 0


RP/0/RSP0/CPU0:ASR9001-A#show ospf neighbor
Tue Jan 20 17:17:30.136 MET

* Indicates MADJ interface

Neighbors for OSPF 10

Neighbor ID     Pri   State           Dead Time   Address         Interface
217.27.118.189  1     FULL/DR         00:00:33    217.27.118.7    Bundle-Ether2.1
    Neighbor is up for 6w4d
10.69.69.9      1     FULL/BDR        00:00:31    217.27.118.166  GigabitEthernet0/0/0/0.1
    Neighbor is up for 02:27:28
10.69.69.10     1     FULL/BDR        00:00:38    217.27.118.162  GigabitEthernet0/0/0/1.1
    Neighbor is up for 00:23:50
10.69.69.11     1     FULL/BDR        00:00:37    217.27.118.170  GigabitEthernet0/0/0/6.1
    Neighbor is up for 04:31:31
10.69.69.8      1     FULL/DR         00:00:33    217.27.118.174  GigabitEthernet0/0/0/7.1
    Neighbor is up for 5d03h

Total neighbor count: 5


-------




RP/0/RSP0/CPU0:ASR9001-A#traceroute 10.69.69.14    PANCALI
    217.27.118.186 29 msec  29 msec
 2  10.100.100.26 32 msec  *  30 msec   da  lentini

RP/0/RSP0/CPU0:ASR9001-A#traceroute 10.69.69.13  AUGUSTA
 217.27.118.186 30 msec  32 msec
 2  10.100.100.26 [MPLS: Label 137 Exp 0] 31 msec  32 msec  29 msec   da lentini
 3  10.100.100.22 31 msec  *  31 msec

RP/0/RSP0/CPU0:ASR9001-A#traceroute 10.69.69.15  PALAGONIA
    217.27.118.186 32 msec  31 msec
 2  10.100.100.26 [MPLS: Label 136 Exp 0] 30 msec  34 msec  32 msec  da lentini
 3  10.100.100.30 32 msec  *  30 msec

RP/0/RSP0/CPU0:ASR9001-A#traceroute 10.69.69.4   SANDEMETRIO
    217.27.118.174 31 msec  32 msec
 2  10.100.100.14 [MPLS: Label 153 Exp 0] 31 msec  30 msec  30 msec   da montepo
 3  10.100.100.9 32 msec  *  31 msec

Appesantiamo Sandemetrio-sandemetrio2 in modo che sandemetrio vada verso lentini invece che montepo

GEALINE->montepo-sandemetrio2-sandemetrio->lentini->GEALINE
                                                      ->pancali - palagonia -ramacca
                                                             -> augusta

RP/0/RSP0/CPU0:ASR9001-A#traceroute 10.69.69.14
    217.27.118.186 29 msec  30 msec     lentini
 2  10.100.100.26 30 msec  *  30 msec  lentini-pancali


Ora augusta fa lentini-sandemetrio-pancali
 
RP/0/RSP0/CPU0:ASR9001-A#traceroute 10.69.69.13

    217.27.118.186 30 msec  31 msec
 2  10.100.100.6 [MPLS: Label 184 Exp 0] 31 msec  31 msec  30 msec
 3  10.100.100.53 [MPLS: Label 137 Exp 0] 30 msec  31 msec  30 msec
 4  10.100.100.22 31 msec  *  31 msec


Vediamo tutto cio’ che annuncia il router 10.69.69.13 e che arriva all’ASR. Quindi abbiamo l’elenco delle reti gestite da 10.69.69.13 nelle sue vlan:

RP/0/RSP0/CPU0:ASR9001-A#show ospf database adv-router 10.69.69.13
Wed Apr  8 14:52:37.580 MEDT


            OSPF Router with ID (217.27.118.130) (Process ID 10)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.69.69.13     10.69.69.13     1469        0x800005cd 0x0088c2 1

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.69.69.13     10.69.69.13     1469        0x800005b7 0x00752c 0
172.17.6.0      10.69.69.13     1469        0x8000035a 0x00a03e 0
172.18.24.0     10.69.69.13     1469        0x8000035b 0x00bc11 0
172.20.96.0     10.69.69.13     1469        0x800002aa 0x00ed47 0
172.26.5.0      10.69.69.13     1469        0x8000035b 0x003d98 0
RP/0/RSP0/CPU0:ASR9001-A#

Vediamo la route corrente per raggiungere 10.69.69.4 che ha due strade possibili:

RP/0/RSP0/CPU0:ASR9001-A#show ospf routes 10.69.69.4/32
Wed Apr  8 17:03:58.844 MEDT

Topology Table for ospf 10 with ID 217.27.118.130

Codes: O - Intra area, O IA - Inter area
       O E1 - External type 1, O E2 - External type 2
       O N1 - NSSA external type 1, O N2 - NSSA external type 2

O E2 10.69.69.4/32, metric 20 area 0.0.0.0
       217.27.118.186, from 10.69.69.4, via GigabitEthernet0/0/0/5.1



RP/0/RSP0/CPU0:ASR9001-A#show ospf database router 10.69.69.14
Wed Apr  8 17:19:02.454 MEDT


            OSPF Router with ID (217.27.118.130) (Process ID 10)

                Router Link States (Area 0)

  Routing Bit Set on this LSA
  LS age: 1047
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 10.69.69.14
  Advertising Router: 10.69.69.14
  LS Seq Number: 80000624
  Checksum: 0xd908
  Length: 60
  AS Boundary Router
   Number of Links: 3     <— 10.69.69.14 difatti ha tre vicini di cui il primo che naviga
                              e gli altri due a reti remote che alimenta

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.100.100.54
     (Link Data) Router Interface address: 10.100.100.53
      Number of TOS metrics: 0
       TOS 0 Metrics: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.100.100.29
     (Link Data) Router Interface address: 10.100.100.29
      Number of TOS metrics: 0
       TOS 0 Metrics: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.100.100.21  
     (Link Data) Router Interface address: 10.100.100.21
      Number of TOS metrics: 0
       TOS 0 Metrics: 1

Invece 10.69.69.13 e’ l’ultimo nodo della rete quindi ha un solo link:

RP/0/RSP0/CPU0:ASR9001-A#show ospf database router 10.69.69.13
Wed Apr  8 17:22:29.927 MEDT


            OSPF Router with ID (217.27.118.130) (Process ID 10)

                Router Link States (Area 0)

  Routing Bit Set on this LSA
  LS age: 457
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 10.69.69.13
  Advertising Router: 10.69.69.13
  LS Seq Number: 800005d2
  Checksum: 0x7ec7
  Length: 36
  AS Boundary Router
   Number of Links: 1  <— un vicino perche’ e’ foglia

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.100.100.21  <- punto-punto a cui e’ collegato
     (Link Data) Router Interface address: 10.100.100.22 <— lato suo
      Number of TOS metrics: 0
       TOS 0 Metrics: 1





———
OSPF non tiene in memoria i path di backup:
This is because ospf re-runs the spf algorithm each time there's a topology change like say a link going down. This is where EIGRP trumps ospf cos it stores the backup links.

Pero’ con i comandi di cui sopra si hanno alcune informazioni utili.
First of all, OSPF has no backup path concept like we can find in EIGRP. If a link fails in the area the router(s) connected to the failed link generate a new Router LSA stating the state of the link as down. The LSA(s) is flooded in the area all routers run SPF and eventually make changes to the IP routint table for one or more destinations.
——————
Route di default in ASR 9000

Ci vuole 1) default-information originate    2) una statica per la 0.0.0.0

router ospf 10
 router-id 217.27.118.130
 default-information originate
 area 0
  interface Bundle-Ether2.1
  !
  interface Loopback1
  !
  interface GigabitEthernet0/0/0/0.1
  !
!
router static
 address-family ipv4 unicast
  0.0.0.0/0 100.126.0.1

Per verificare che annuncia:

RP/0/RSP0/CPU0:ASR9001-A#show ospf database | include 0.0.0.0
Thu Apr 30 12:14:13.505 MEDT
0.0.0.0         217.27.118.130  422         0x80000001 0x0010ab 10
RP/0/RSP0/CPU0:ASR9001-A#

In un router della rete per verificare la ricezione:

ASR901-8-AUGUSTA#show ip route 0.0.0.0
Routing entry for 0.0.0.0/0, supernet
  Known via "ospf 10110", distance 110, metric 1, candidate default path
  Tag 10, type extern 2, forward metric 2
  Last update from 10.100.100.18 on Vlan500, 00:08:13 ago
  Routing Descriptor Blocks:
  * 10.100.100.18, from 217.27.118.130, 00:08:13 ago, via Vlan500
      Route metric is 1, traffic share count is 1
      Route tag 10
ASR901-8-AUGUSTA#
——————





















 

Altre letture

  Consiglio di consultare l’enorme documentazione disponibile on-line nel sito della cisco http://www.cisco.com/ . E’ possibile trovare sempre tutto cio’ che si cerca.

 

Copyright 2002-2004 Gianrico Fichera – ITESYS srl –

Il materiale di questa pagina non e’ sponsorizzato o sottoscritto da Cisco Systems, Inc. Ciscoâ e’ un trademark di Cisco Systems, Inc. negli Stati Uniti e in altri stati. L’autore di questa pagina non si assume nessuna responsabilita’ e non da nessuna garanzia riguardante l’accuratezza e la completezza delle informazioni presenti nonche’ da conseguenze sull’uso delle informazioni presenti in questa pagina.
Il sito web ufficiale della Cisco e’
http://www.cisco.com. Nel caso si volesse utilizzare il contenuto di questa pagina nella forma in cui e’ presentato rivolgersi all’autore scrivendo a gianrico.fichera itesys.it.