OSPF Notes Basics – Part 1

Part 2

  • OSPF is a link-state routing protocol
  • OSPF maintains active adjacencies
  • OSPF uses its own transport protocol
    • IP protocol 89
  • OSPF process ID is locally significant
  • There must be a UP/UP interface running IP
  • The router-ID is NOT an IP address:
    • The OSPF router ID is a 32-bit value and can be “represented” in one of the following ways:
    • 32-bit IPv4 Address: The OSPF router ID can be set to the IP address of one of the router’s interfaces. If multiple interfaces have IP addresses configured, OSPF will select the highest IP address as the router ID by default.
    • 32-bit Decimal: It can also be manually configured as a 32-bit decimal value.
    • 32-bit Dotted Decimal: Alternatively, it can be manually configured in dotted-decimal notation, similar to an IPv4 address.
    • If a router’s OSPF router ID is not explicitly configured, OSPF will select the router ID based on the following criteria in the specified order:
      • The router ID is configured manually using the router-id command in OSPF configuration mode.
      • The highest IP address of any loopback interface configured on the router.
      • The highest IP address of any active physical interface on the router.
      • Having a stable and unique router ID is important for OSPF routing because it ensures consistent identification of routers in the OSPF network and contributes to the stability and predictability of the OSPF database.
  • The network command indicates what interface OSPF is running on and the respective area.
    • By using the network command with appropriate parameters, you can control which interfaces and networks participate in OSPF routing on your router.
  • The wildcard mask does NOT equate to a subnet mask.
    • The most specific matches win.

Forming OSPF Adjacencies

Must match items:

  • Area
  • Hello/dead timers (based on OSPF network types)
  • MTU (optional)
  • Compatible network types
  • Stub flags
  • Authentication
Must be unique items:
  • IP address
  • OSPF Router-ID
  • Manually assigned > Use valid 32-bit values that are unique. This will allow the OSPF database to be more consistent.
    • The highest IP address of any loopback interface configured on the router.
    • The highest IP address of any active physical interface on the router.

OSPF Network Types

  • Broadcast
  • Non-broadcast
  • Point-to-Point
  • Point-to-Multipoint
  • Point-to-Multipoint Non-broadcast
  • Loopback

Broadcast

  • Default on Ethernet
  • Sends hellos as multicast
    • 224.0.0.5
      • The IPv4 multicast addresses used for OSPF are 224.0.0.5 to send information to all OSPF routers
    • 224.0.0.6
      • 224.0.0.6 to send information to DR/BDR routers
    • . The IPv6 multicast addresses are FF02::5 for all OSPFv3 routers and FF02::6 for all DR/BDR routers.

DR/BDR Election

  • Used to minimize LSA replication
  • Election based on priority and Router-ID
    • Priority (Interface)
      • 0-255 Higher is better
      • 0 = never participate in OSPF election

There is no concept of preemption if a router claims to be a better DR


OSPF Packet Types – 5 Packet types exist

1HelloUsed for discovery and maintaining neighbors.
2Database Description (DBD)Used to summarize the contents of the database. Packets are exchanged when an OSPF adjacency is first formed. The packets are used to describe the contents of the LSDB.
3Link-state request (LSR)Used for database downloads. When a router believes that part of its LSDB is stale, it can request a portion of a neighbor’s database by using this packet type.
4Link-state update (LSU)Used for database updates. This is an explicit LSA for a specific network link and is normally sent in direct response to an LSR.
5Link-State ackUsed for flooding acknowledgments. These packets are sent in response to the flooding of LSAs, thus making flooding a reliable transport feature.

Hello

Database Description DBD

Link-state request

Link-state update

Link-State ack


OSPF Basic Configuration

R1

interface Ethernet0/0.146
 encapsulation dot1Q 146
 ip address 155.1.146.1 255.255.255.0
 ip ospf 1 area 0
end

R4

interface Ethernet0/1.146
 encapsulation dot1Q 146
 ip address 155.1.146.4 255.255.255.0
 ip ospf 1 area 0
end

R6

interface Ethernet0/1.146
 encapsulation dot1Q 146
 ip address 155.1.146.6 255.255.255.0
 ip ospf 1 area 0
end

Verify OSPF Basics

From R1’s point of view > R4 is the DR, and R6 is the BDR

R1#show ip ospf neighbor  
R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
150.1.4.4       255   FULL/DR         00:00:35    155.1.146.4     Ethernet0/0.146
150.1.6.6         1   FULL/BDR        00:00:34    155.1.146.6     Ethernet0/0.146
R1#

From R4’s point of view > R1 is NOT the DR or BDR. It is DROTHER, and R6 is the BDR

R4#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
150.1.1.1         1   FULL/DROTHER    00:00:37    155.1.146.1     Ethernet0/1.146
150.1.6.6         1   FULL/BDR        00:00:37    155.1.146.6     Ethernet0/1.146

From R6’s point of view > R1 is NOT the DR or BDR. It is DROTHER, and R4 is the DR.

R6#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
150.1.1.1         1   FULL/DROTHER    00:00:36    155.1.146.1     Ethernet0/1.146
150.1.4.4       255   FULL/DR         00:00:36    155.1.146.4     Ethernet0/1.146
R6#

R1#show ip ospf interface 
Ethernet0/0.146 is up, line protocol is up 
  Internet Address 155.1.146.1/24, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 150.1.1.1, Network Type BROADCAST, Cost: 10
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           10        no          no            Base
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State DROTHER, Priority 1
  Designated Router (ID) 150.1.4.4, Interface address 155.1.146.4
  Backup Designated router (ID) 150.1.6.6, Interface address 155.1.146.6
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:02
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 1/1/1, flood queue length 0
  Next 0x0(0)/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 2, Adjacent neighbor count is 2 
    Adjacent with neighbor 150.1.4.4  (Designated Router)
    Adjacent with neighbor 150.1.6.6  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)
R1#
R4#show ip ospf interface
Ethernet0/1.146 is up, line protocol is up 
  Internet Address 155.1.146.4/24, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 150.1.4.4, Network Type BROADCAST, Cost: 10
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           10        no          no            Base
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State DR, Priority 255
  Designated Router (ID) 150.1.4.4, Interface address 155.1.146.4
  Backup Designated router (ID) 150.1.6.6, Interface address 155.1.146.6
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:02
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 1/1/1, flood queue length 0
  Next 0x0(0)/0x0(0)/0x0(0)
  Last flood scan length is 2, maximum is 2
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 2, Adjacent neighbor count is 2 
    Adjacent with neighbor 150.1.1.1
    Adjacent with neighbor 150.1.6.6  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)
R4#
R6#show ip ospf interface
Ethernet0/1.146 is up, line protocol is up 
  Internet Address 155.1.146.6/24, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 150.1.6.6, Network Type BROADCAST, Cost: 10
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           10        no          no            Base
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 150.1.4.4, Interface address 155.1.146.4
  Backup Designated router (ID) 150.1.6.6, Interface address 155.1.146.6
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:05
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 1/1/1, flood queue length 0
  Next 0x0(0)/0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 1 msec, maximum is 1 msec
  Neighbor Count is 2, Adjacent neighbor count is 2 
    Adjacent with neighbor 150.1.1.1
    Adjacent with neighbor 150.1.4.4  (Designated Router)
  Suppress hello for 0 neighbor(s)
R6#

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.