Concepts

Link State Routing Protocol Concepts

Two types:

  • IS-IS
  • OSPF

Maintain 3 tables

  • Neighbor Table (the same as EIGRP)
  • Topology Table : contrairement à EIGRP, ici tous les chemins vers toutes les destinations sont enregistrés. Tous les routeurs du réseau possèdent la même table. Avec EIGRP par exemple, un routeur ne connait que les meilleurs routes de ses voisins.
  • Routing Table

Use Dijkstra's shortest path first (SPF) Algorithm.
Send Triggered Updates To Announce network changes.
Send Periodic Updates (LS Refresh) on long intervals (30 minutes).

OSPF Area Design and Terms

All Areas must connect to Area 0 (backbone area)

  • ABR : Area Border Routers (limite entre 2 zones)
  • ASBR : Autonomous System Boundary Router (limite de l'AS, toutes les zones sont dans un même AS)

All routers in an area have the same topology table.
Goal : localise updates within an area.
Requires a Hierarchical Design.

Understanding OSPF Neighbor Relationship

1. Determine your own router ID
  • The router ID is like the Router's name in the OSPF Process
  • Highest active interface IP address when OSPF starts (loopbacks beat physical interfaces)
  • Can be hard-coded using the router-id command.
    • hard-coded router ID > loopbacks IP > interfaces IP
2. Add interfaces to the Link State Database (network command)
3. Send a HELLO message on chosen Interface(s).

A ce moment là, le router a envoyé un message HELLO mais n'a encore rien reçu en retour, le routeur est en Down State.
Hello Message:

  • Once every 10 seconds on broadcast / P2P networks
  • Once every 30 seconds on NBMA networks (Frame Relay, ATM)
    • Dead Timer = 4 x Hello timer
  • Contains all sorts if information
    • Router ID
    • Neighbors
    • Hello and Dead Timers (*)
    • Router Priority
    • Network Mask (*)
    • DR/BDR IP Address
    • Area ID (*)
    • Authentication Password (*)

(*) : ces valeurs doivent être les même sur tous les routeurs.

4. Receive HELLO

Le routeur entre en mode : Init State.

  • Check Hello / Dead Interval
  • Check Netmasks
  • Check Area ID
  • Check Authentication Passwords
5. Send Reply HELLO

On parle maintenant de 2-Way State.

  • Am I listed as a neighbord in your Hello packet ?
    • If YES : reset Dead Timer. OSPF Neighbor Relationship stops here.
    • If NO : add a new neighbor. OSPF Neighbor Relationship continues to step 6.
6. Master - Slave Relationship determined

Dialogue pour négocier qui est le master et qui est le slave dans leur liaison. On parle de Exstart State (exchange start state).

  • Determined by "Priority", Router ID breaks tie (high).

Exchange State : envoie des informations qui décrivent leur base de donnée d'état de lien.

  • Master send Database Description (DBD) packet first
    • DBD = summary of Link-State Database (list of networks)
  • Slave Sends its BDB Packet
7. DBDs are Acknowledged and Reviewed

On parle de Loading State.

  • Slave Requests Details (Link State Requests - LSR)
  • Master Sends Updates (Link State Updates - LSU)
  • Master Requests Details (LSR)
  • Slave Sends Updates (LSU)
8. Neighbors are Synchronized !

On parle de Full State.

Now

It's time to run the Dijkstra SPF Algorithm to figure out what to do with all this data.

Avec EIGRP, la reconnaissance des voisins se fait juste avec un message HELLO. Il faut simplement que les valeurs K de metrics soient identiques pour avoir un lien validé.

OSPF's cost

Cost = 100 / BW-in-Mbps

Common costs:

  • 64k = 1562
  • T1 (1.544) = 65
  • E1 (2.048) = 48
  • Ethernet = 10
  • Fast Ethernet = 1
  • /!\ Gigabit Ethernet = 10 Gigabit Ethernet = 1

Pas de backup path en OPSF comme avec EIGRP.

Understandinf the DR and BDR

The DR (Designated Router) is the controler of a shared network. Il est élu en fonction du Router Priority émis dans les Hello packets.

  • DR and BDR are listening the multicast address : 224.0.0.6.
  • All routers on a shared network are listening the multicast address : 224.0.0.5.

Au moins un DR doit être utilisé sur tous les liens, sauf sur les liaisons point-à-point.

Dans la construction du voisinage, un routeur restera à l'état 2-way avec un routeur non DR. Il ira jusqu'à l'état Full avec le DR et le BDR.

Sur un lien partagé, on aura donc un maximum de 2 liaisons Full State.

The Flurry of OSPF packet types

  • Hello
  • Database Description (DBD)
  • Link-State Request (LSR)
  • Link-State Advertisement (LSA) : update about an individual route
  • Link-State Update (LSU) : contains many LSA.
  • Link-State Acknowledgement (LSACK) : makes OSPF a reliable protocol.

Implementation and Verification

Getting OPSF Working

R1(config)# router ospf 1
R1(config-router)# network 172.30.49.0 0.0.0.255 area 0

Sur les nouveau routers il est possible de faire participer une interface dans le process OSPF directement depuis la configuration de l'interface, sans configurer de wildmask...

R1(config-if)# ip ospf 1 area 0

où 1est le process ID de OSPF.

En IPv6, il n'existe plus la commande network, il faut donc obligatoirement utiliser la méthode précédente.

OSPF Routes Types

In the routing table, the following types of routes could be find:

  • O : OPSF intra-area (router LSA)
    • Networks from within the area of the router
    • Advertised by way of router LSAs
  • O IA : OSPF inter-area (summary LSA)
    • Networks from outside the area of the router, but within the OSPF autonomous system
    • Advertised by way of summary LSAs
  • O E1 : Type-1 external routes
  • O E2 : Type-2 external routes
    • Networks from outside of the autonomous system of the router
    • Advertised by way of external LSAs

Router-ID and Priority Options

Configurer le router-id de façon statique:

R1(config-router)# router-id 1.1.1.1

Pour pouvoir faire un ping sur le router-id:

  • créer une loopback avec cette adresse
  • déclarer cette interface avec network...

Pour choisir la priorité dans l'élection des DR/BDR

R1(config-if)# ip ospf priority 255
  • 0 ne jamais être DR
  • 1 valeur par défaut
  • 255 toujours être DR

OSPF Timers

  • The OSPF timers must be identical to establish adjacencies, for each 2 facing interfaces
  • Current OSPF timers can been seen with: show ip ospf interface
  • All routers in area must have the same OSPF timer values
R1(config)# interface Serial0/1
R1(config-if)# ip address 10.108.1.2 255.255.255.0
R1(config-if)# ip ospf hello-interval 1
R1(config-if)# ip ospf dead-interval 5
R1(config-if)# ip ospf retransmit-interval 10

The OSPF Support for Fast Hello Packets feature provides a way to configure the sending of hello packets in intervals less than 1 second. Such a configuration would result in faster convergence in an Open Shortest Path First (OSPF) network. This feature was integrated into Cisco IOS Release 12.2(15)T. Lien sur Cisco.com : OSPF Support for Fast Hellos.

Dans l'exemple ci-dessous, le routeur envoie 5 messages par seconde. Si aucun paquet n'est reçu en une seconde, le voisin est considéré comme mort.

R1(config)# interface ethernet 1
R1(config-if)# ip ospf dead-interval minimal hello-multiplier 5

Clearing and Verifying the OSPF Process

Redémarrer le process

R1# clear ip ospf process

Vérifier les timer (hello, dead)

R1#show ip ospf interface
GigabitEthernet1/1 is up, line protocol is up (connected)
  Internet Address 10.10.11.1/30, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT_TO_POINT
  Timer intervals configured, Hello 1, Dead 5, Wait 5, Retransmit 10
    oob-resync timeout 40
    Hello due in 00:00:00
  Supports Link-local Signaling (LLS)
  Index 2/3, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 2, maximum is 9
  Last flood scan time is 0 msec, maximum is 4 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 2.2.2.2
  Suppress hello for 0 neighbor(s)
  Message digest authentication enabled
    Youngest key id is 1

Vérifier les relations de voisinage

R1#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/  -        00:00:04    10.10.11.2     GigabitEthernet1/1
3.3.3.3           0   FULL/  -        00:00:04    10.10.12.2     GigabitEthernet2/1
2.1.1.2           1   FULL/DR         00:00:38    10.10.13.2     Vlan12

Voir toute la topologie

R1# show ip ospf database

Voir les routeurs ABR et ASBR

R1#sh ip ospf border-routers

OSPF Process 1 internal Routing Table

Codes: i - Intra-area route, I - Inter-area route

i 10.2.0.1 [10] via 10.0.0.1, FastEthernet0/0, ABR, Area 0, SPF 4

Pour debugger l'élection de DR et regarder la détection du voisinage:

R1#debug ip ospf event
OSPF events debugging is on
R1#debug ip ospf adj
OSPF adjacency events debugging is on

Vérifier les debug activés:

R1#sh debugging
IP routing:
  OSPF adjacency events debugging is on
  OSPF events debugging is on

Understanding Network Types

OSPF Network Types

Broadcast, Multi-access networks
  • example : ethernet, token ring
  • single operation mode
  • DR/BDR Election, 10sec. Hellos, Dual Multicast Address (224.0.0.5 and 224.0.0.6)
Point-to-point Networks
  • example: T1 cas, ISDN BRI/PRI
  • single operation mode
  • no DR/BDR, 10sec. Hellos, Single Multicast Address (224.0.0.5)
Non-Broadcast Multi-Access (NBMA) Networks
  • example: Frame Relay, ATM, X25
  • 5 modes of operation

NBMA Topologies

  • Full Mesh : cost a lot
  • Partial Mesh
  • Hub-and-Spoke (star) : most common use

OSPF over NBMA : 5 modes

1. Non-Broadcast (NBMA) - RFC Standard
  • Default Mode for X25, FR, ATM
  • Neighbors statically configurer
  • Must be one subnet
  • Acts like a LAN Environment
  • DR/BDR elected (must have full connectivity !!)
R2(config)# interface s1
R2(config-if)# frame-relay map ip 10.1.1.4 204 broadcast

Ajouter un voisin manuellement. Il suffit de le faire sur un seul routeur et pas seulement des 2 côtés.

R4(config-router)# neighbor 10.1.1.2 priority 0
2. Point-to-Multipoint - RFC Standard
  • Fixes Issues with NBMA Networks
  • requires single subnet
  • no DR/BDR elected
  • Neighbors Automatically form
R2(config)# interface s1
R2(config-if)# ip ospf network point-to-multipoint
3. Point-to-Point - Cisco Proprietary (the best method)
  • Uses seperate sub-interfaces
  • Requires Different subnets
  • no DR/BDR elected
  • Neighbors automatically form
4. Broadcast - Cisco Proprietary
  • Treats the NBMA cloud like a LAN
  • one subnet required
  • Full Mesh Required
  • DR/BDR Election; Automatic Discovery
5. Point-to-Multipoint, Non-Broadcast - Cisco Proprietary
  • Fixes Isssues with NBMA Networks
  • Requires single subnet
  • no DR/BDR Elected
  • Neighbors Statically Configured
R2(config-if)# ip ospf network point-to-multipoint non-broadcast

Router LSAs And Summarization Options

OSPF Areas and Router Types

How to summarize in OSPF

Internal Router + Backbone Router Area Border Routers (ABR)

R1(config-router)# network 10.0.1.0 0.0.0.255 area 1
R1(config-router)# network 10.0.2.0 0.0.0.255 area 0
R1# show ip ospf
R1(config-router)# area 1 range 10.0.0.0 255.255.0.0

Autonomous System Boundary Router (ASBR)

R1(config-router)# summary-address 10.0.0.0 255.255.0.0
R1(config-router)# redistribute rip subnets

Understanding OSPF LSA Types

LSAs are the building blocks of OSPF; Many types exist:

  • LSA Type 1: Router LSA
    • Describes the collective states of the directly connected links of the router.
  • LSA Type 2: Network LSA (DR Generated)
    • Lists each of the attached routers that make up the transit network.
  • LSA Type 3: Summary LSA (ABR Summary Route)
    • Floods network information to areas outside the originating area.
  • LSA Type 4: Summary LSA (ASBR Location)
    • Advertises an ASBR to all other areas in the AS
  • LSA Type 5: External LSA (ASBR Summary Route)
    • Advertises networks from other autonomous systems.
  • LSA Type 6 : Multicast OSPF LSA
  • LSA Type 7 : Defined for Not-So-Stubby Areas
  • LSA Type 8 : External Attributes LSA for Border Gateway Protocol (BGP)
  • LSA Type 9,10,11 : Opaque LSAs

Area Types and Options

The place of Virtual Links

Breakin' the rule

Connect an area not directly to area 0. Area 2 is connected to area area 1 which is connected to area 0. On the ABR between area 0 and area 1:

R3(config-router)# area 1 virtual-link 2.2.2.2

2.2.2.2 correspondant au router-id du router R2 situé entre la zone 1 et 2. On the ABR between area 1 and area 2:

R2(config-router)# area 1 virtual-link 3.3.3.3

2.2.2.2 correspondant au router-id du router R3 situé entre la zone 0 et 1.

Vérifier

R2#show ip ospf virtual-links

Understanding the special OSPF area types and OSPF Area Implementation

  • Standard Area : Accepts link updates, route summaries, and external routes.
  • Backbone Area : All other areas connect to this area to exchange and route information.
  • Stubby Area : Does not accept information about routes external to the AS and cannot contain ASBRs. Blocks type 5 LSA from entering.

industry standard.

Command to use on the ABR (router between area 0 and area 2), and on all the routers of the stub area:

R1(config)# router ospf 1
R1(config-router)# area 2 stub

Check the routing table of the internal area router.:

R1# show ip route
...
0*IA   0.0.0.0/0 [110/65] via 10.1.12.2, 00:00:59, Serial0.2

There is no E2 routes (OSPF external type 2), just a default route.

  • Totally Stub Area : Does not accept external AS routes or summary routes from other areas internal to the AS. Blocks type 3, 4 and 5 LSA from entering.

cisco proprietary option. Command to use on the ABR and on the internal routers of the totally stub area.

R1(config)# router ospf 1
R1(config-router)# area 1 stub no-summary

Checking the routing table, the internal router have only a default route to the ABR.

  • Not-so-stubby Area : Defines a special LSA type 7, and allows ASBRs. Passes external routes through via type 7 LSAs; these convert back to type 5 once they reach the backbone.

A router in a Totally stub Area could be an ASBR. Router with a RIP link and an OSPF link. Command to use on the ABR and on the internal routers of the area.

R1(config)# router ospf 1
R1(config-router)# no area 1 stub no-summary
R1(config-router)# area 1 nssa no-summary

It is possible to check the LSA type-7 in the ospf database:

R1# show ip ospf database

Authentication and other Miscellaneous Options

Authentication

ClearText
interface Tunnel0
 ip ospf authentication
 ip ospf authentication-key MyPassword04
MD5
interface Tunnel0
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 MyPassword04

Understanding OSPF External Route Types

  • E1 : Cost of route increments as it passes through the autonomous system
  • E2 (Default) : Cost of the route remains the same as it passes through the autonomous system

Most of the time, the type 2 is recommended because there is only one router to go to that external route.

R1(config-router)# redistribure rip subnets metric 100 metric-type 1

Adjusting the OSPF Cost

Static Cost

R1(config-if)#  ip ospf cost mycost

Adapt Cost for BW > 100Mbps : that number must be the same on all routers

R1(config-router)# auto-cost reference-bandwith 1000

Preventing Link-State Database Overload

Specify the maximum number of non self-generated LSAs per minute. This commande is quite dangerous.

R1(config-router)# max-lsa

Default-Information Originate

The command default-information originate causes an ospf router to generate a default route for the network.... If one's exists in its routing table. Add The keyword always to generate a default route even if one does not exist.

FAQ

Q. What do the states DR, BDR, and DROTHER mean in show ip ospf interface command output?

A. DR means designated router. BDR means backup designated router. DROTHER indicates a router that is neither the DR or the BDR. The DR generates a Network Link-State Advertisement, which lists all the routers on that network.

Q. When I issue the show ip ospf neighbor command, why do I only see FULL/DR and FULL/BDR, with all other neighbors showing 2-WAY/DROTHER?

A. To reduce the amount of flooding on broadcast media, such as Ethernet, FDDI, and Token Ring, the router becomes full with only designated router (DR) and backup designated router (BDR), and it shows 2-WAY for all other routers.

Q. What is the difference between OSPF E2 Routes and E1 Routes ?

A. E2 is the default route type for routes learned via redistribution. The key with E2 routes is that the cost of these routes reflects only the cost of the path from the ASBR to the final destination the cost of the path from the internal router to the ASBR is not reflected in this cost. If we want the cost of the routes to reflect the entire path, not just the path between the ASBR and the destination network, the routes must be redistributed into OSPF as E1 routes on the ASBR.

Liens