Thursday, December 15, 2011

OSPF in a Single Area Lab

The router ospf {process-id} global configuration command enables an OSPF process and enters into the OSPF configuration mode. It requires a parameter called the OSPF Process ID. When a router runs multiple OSPF processes, the process IDs are used to distinguish the processes and databases. Unlink the autonomous system number in EIGRP router configuration, the OSPF process ID is locally significant and does not need to match the process IDs on other routers in order for the OSPF routers to establish adjacency and exchange routing information.

Running multiple OSPF processes on a router is not recommended, as it creates multiple independent database instances that add extra overhead to the router.
Note: Running multiple OSPF processes on a router is not the same as running multiarea OSPF.

The network {ip-addr} {wildcard-mask} area {area-id} router subcommand identifies the interfaces that belong to an OSPF process, the interfaces to transmit and receive routing updates, the OSPF area that the interfaces reside on, and the networks to be included in the routing updates.

The combination of ip-addr 0.0.0.0 exactly matches an interface address; while the combination of 0.0.0.0 255.255.255.255 matches all interfaces on a router.
Note: Configuring the combination of 0.0.0.0 0.0.0.0 will be automatically changed to 0.0.0.0 255.255.255.255.

The area-id parameter can be specified as either a decimal value in the range of 0 to 4294967295, or in dotted-decimal notation similar to an IP address – A.B.C.D, which allows the association of OSPF areas with IP subnets, in which a subnet address is specified as the area-id.
Note: The OSPF Area ID field is 32-bit in length, which is the same as an IP address. Therefore its value ranges from 0 to 232 - 1, which is 4294967295. An OSPF Area ID of 10.10.10.0 is equivalent to 168430080 (0x0A0A0A00).

Beginning with Cisco IOS Release 12.3(11)T, OSPF can be enabled directly on an interface with the ip ospf {process-id} area {area-id} [secondaries none] interface subcommand. This command simplifies the configuration of unnumbered interfaces. The secondaries none keyword prevents secondary IP addresses on an interface from being advertised.

Loopback interface IP addresses are advertised as /32 host routes in Router-LSAs, as IP packets (eg: ICMP, SNMP) may still be destined to them even they are unavailable for regular traffic flow. A loopback interface may be looped back either in hardware or software.

The log-adjacency-changes [detail] router subcommand configures a router to send a Syslog message upon an OSPF neighbor adjacency state change. The log-adjacency-changes router subcommand is enabled by default, but only OSPF neighbor up and down events are reported. The detail keyword configures a router to send a Syslog message upon each OSPF state change, not just when a neighbor goes up or down.

The ip ospf hello-interval {sec} and ip ospf dead-interval {sec} interface subcommands change the OSPF Hello and Dead interval timers for a particular interface respectively.
Note: Both timer values must be the same for all routers reside on a network to form adjacencies.

Sample OSPF Multiarea Network

The show ip ospf EXEC command displays the OSPF Router ID (RID), OSPF timer values, the number of times the SPF algorithm has been executed, authentication, and LSA information.
RT3#sh ip ospf
 Routing Process "ospf 100" with ID 11.11.11.1
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 It is an area border router
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs
 Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
 LSA group pacing timer 240 secs
 Interface flood pacing timer 33 msecs
 Retransmission pacing timer 66 msecs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 2. 2 normal 0 stub 0 nssa
 External flood list length 0
    Area BACKBONE(0)
        Number of interfaces in this area is 1
        Area has no authentication
        SPF algorithm last executed 00:08:26.588 ago
        SPF algorithm executed 4 times
        Area ranges are
        Number of LSA 6. Checksum Sum 0x042E4D
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0
    Area 1
        Number of interfaces in this area is 1
        Area has no authentication
        SPF algorithm last executed 00:08:46.616 ago
        SPF algorithm executed 4 times
        Area ranges are
        Number of LSA 5. Checksum Sum 0x036393
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0

The OSPF Router ID set using the router-id {rid-ip-addr} router subcommand overrides the use of the IP address of a physical or loopback interface as the Router ID. It is recommended to set the Router ID of an OSPF router using the router-id router subcommand to ensure that the Router ID does not change when there is any change upon the interface IP address.

Router IDs must be unique. The OSPF database uses the Router IDs to uniquely identify and describe every router in a network, and every router would keep a complete topology database of all routers and links in the network. Therefore, Router IDs must be unique throughout an OSPF routing domain in order for OSPF to operate correctly.

Note: Each OSPF process running on a router requires a unique Router ID.
Ex: When there is a single loopback interface and 2 OSPF processes running on a router, the 2nd OSPF process must select the IP address of a physical interface as its Router ID. Therefore, the IP address of a loopback interface will not always be used as the Router ID!

The show ip ospf interface [intf-type intf-num | brief] EXEC command displays the OSPF areas associates with the interfaces, network type, cost, interface state, priority, timer values, the numbers of neighbors and adjacent neighbors along with the corresponding adjacency states.
RT3#sh ip ospf interface
FastEthernet0/0 is up, line protocol is up
  Internet Address 10.10.10.3/24, Area 0
  Process ID 100, Router ID 11.11.11.1, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DROTHER, Priority 1
  Designated Router (ID) 172.16.2.1, Interface address 10.10.10.2
  Backup Designated router (ID) 172.16.1.1, Interface address 10.10.10.1
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:05
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 172.16.1.1  (Backup Designated Router)
    Adjacent with neighbor 172.16.2.1  (Designated Router)
  Suppress hello for 0 neighbor(s)
Serial1/0 is up, line protocol is up
  Internet Address 11.11.11.1/30, Area 1
  Process ID 100, Router ID 11.11.11.1, Network Type POINT_TO_POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:07
  Index 1/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 2
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 172.16.3.1
  Suppress hello for 0 neighbor(s)
RT3#
RT3#sh ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Fa0/0        100   0               10.10.10.3/24      1     DROTH 2/2
Se1/0        100   1               11.11.11.1/30      64    P2P   1/1
RT3#

The show ip ospf neighbor [intf-type intf-num] [neighbor-id] [detail] EXEC command displays the information of OSPF neighbors on a per-interface basis.
RT3#sh ip ospf neighbor

Neighbor ID     Pri   State         Dead Time   Address      Interface
172.16.1.1        1   FULL/BDR      00:00:39    10.10.10.1   FastEthernet0/0
172.16.2.1        1   FULL/DR       00:00:32    10.10.10.2   FastEthernet0/0
172.16.3.1        0   FULL/  -      00:00:31    11.11.11.2   Serial1/0
RT3#
RT3#sh ip ospf neighbor detail
 Neighbor 172.16.1.1, interface address 10.10.10.1
    In the area 0 via interface FastEthernet0/0
    Neighbor priority is 1, State is FULL, 6 state changes
    DR is 10.10.10.2 BDR is 10.10.10.1
    Options is 0x52
    LLS Options is 0x1 (LR)
    Dead timer due in 00:00:39
    Neighbor is up for 00:09:10
    Index 2/3, retransmission queue length 0, number of retransmission 1
    First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
    Last retransmission scan length is 1, maximum is 1
    Last retransmission scan time is 0 msec, maximum is 0 msec
 Neighbor 172.16.2.1, interface address 10.10.10.2
    In the area 0 via interface FastEthernet0/0
    Neighbor priority is 1, State is FULL, 6 state changes
    DR is 10.10.10.2 BDR is 10.10.10.1
    Options is 0x52
    LLS Options is 0x1 (LR)
    Dead timer due in 00:00:32
    Neighbor is up for 00:09:07
    Index 1/2, retransmission queue length 0, number of retransmission 1
    First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
    Last retransmission scan length is 1, maximum is 1
    Last retransmission scan time is 0 msec, maximum is 0 msec
 Neighbor 172.16.3.1, interface address 11.11.11.2
    In the area 1 via interface Serial1/0
    Neighbor priority is 0, State is FULL, 6 state changes
    DR is 0.0.0.0 BDR is 0.0.0.0
    Options is 0x52
    LLS Options is 0x1 (LR)
    Dead timer due in 00:00:31
    Neighbor is up for 00:08:58
    Index 1/1, retransmission queue length 0, number of retransmission 1
    First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
    Last retransmission scan length is 1, maximum is 1
    Last retransmission scan time is 0 msec, maximum is 0 msec
RT3#

The show ip ospf database EXEC command consists of many arguments that display the overview, summary, and detail information of the OSPF LSDB on a router.
RT3#sh ip ospf database

            OSPF Router with ID (11.11.11.1) (Process ID 100)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
11.11.11.1      11.11.11.1      516         0x80000003 0x00DCCD 1
172.16.1.1      172.16.1.1      528         0x80000002 0x00E6BF 2
172.16.2.1      172.16.2.1      527         0x80000002 0x00F7AA 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.10.2      172.16.2.1      516         0x80000002 0x00B4FF

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
11.11.11.0      11.11.11.1      546         0x80000001 0x005D5F
172.16.3.0      11.11.11.1      526         0x80000001 0x0060B9

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
11.11.11.1      11.11.11.1      536         0x80000003 0x00E07B 2
172.16.3.1      172.16.3.1      535         0x80000002 0x007B72 3

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.10.0      11.11.11.1      501         0x80000003 0x0017E2
172.16.1.0      11.11.11.1      506         0x80000001 0x00FD5D
172.16.2.0      11.11.11.1      506         0x80000001 0x00F267
RT3#

2 comments:

  1. Hi, one question, for run currently ospf in a frame relay topology (hub-and-spoke), i need to disable split-horizon? I've a 3 routers, R1 s0/0/0.201 and s0/0/0.301, and R2 s0/0/0 to dlci 201, and R3 s0/0/0 to dlci 301, the config work fine, but no work ospf.
    Thanks from Argentina!

    ReplyDelete
  2. hi pablo, try to find the answer here: http://www.itcertnotes.com/2011/12/ospf-configuration-over-nbma.html. Thanks. :-)

    ReplyDelete