Home Network Layer OSPF Version 2 OSPF Network Types Explained with Examples on Cisco IOS

OSPF Network Types Explained with Examples on Cisco IOS

Cisco’s implementation of the Open Shortest Path First protocol supports six types of OSPF network types:

  • Broadcast
  • Non-broadcast
  • Point-to-Multipoint (Broadcast/Non-Broadcast)
  • Point-to-Point
  • Loopback
  • Virtual link

This tutorial explains the characteristics of each type and illustrates them with examples.

What is Network Type in OSPF?

An OSPF network type is a way to tell how OSPF should behave on a particular network segment. For example, what Hello and Dead interval to use, whether to elect a DR, how many adjacencies can be formed, how router and network LSAs are constructed, and how to manage the next-hop IP address.

By default, OSPF sets the network type of the interface based on its layer 2 capabilities and characteristics. For instance, Ethernet interfaces get assigned the broadcast OSPF network, while PPP-enabled interfaces get assigned the point-to-point network type.

In a nutshell, OSPF tries to choose the network type that best fit with the interface’s layer 2 configurations.

OSPF Point-to-Point Network Type

The point-to-point OSPF network type best fits point-to-point network segments where the underlying layer 2 protocol’s settings allow communication between two endpoints and do not support muti-access media. Figure 1 shows an example of a point-to-point network segment. Layer 2 frames sent by R1 can reach only one destination, which is R2, and vice versa. Both routers do not need to know each other’s Layer 2 address.

 

Figure 1 – Example of a point-to-point network

On a point-to-point link, OSPF expects that routers cannot form more than one adjacency. Note that the number of devices on a network segment does not determine that the link is point-to-point. However, the layer 2 configuration of the interface is what tells OSPF the type of transmission medium the interface is connected to.

For example, Frame Relay subinterfaces configured with the frame-relay interface-dlci command, HDLC, and PPP are considered point-to-point links.

On the point-to-point OSFP network type links, Hello packets got sent every 10 seconds, there is no DR/BDR election, and each router can build at most one OSPF adjacency. Additionally, the dead interval is set to 0, and the DR and BDR fields are set to 0.0.0.0 (Figure 2).

Figure 2 – Hello packet captured over a point-to-point network

OSPF Point-to-Multipoint Network Type

The OSPF point-to-multipoint network type is not active by default on any OSPF-enabled interface, and it is most suitable for hub-and-spoke topologies (Figure 3). It can be also useful if all routers connected to a link need to form  OSPF adjacencies with each other.

Figure 3 – Hub and spoke topology

When you enable the OSPF point-to-multipoint network type on an interface, OSPF advertises the interface’s IP address with the /32 subnet mask into OSPF instead of advertising the interface’s subnet. This way, OSPF routers in the routing domain get aware of that IP address.

This example illustrates a router LSA’s entry that shows how OSPF describes an interface’s IP address as /32 route.

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 10.0.0.1
     (Link Data) Network Mask: 255.255.255.255
      Number of MTID metrics: 0
       TOS 0 Metrics: 0

Moreover, Hello packets are generated every 30 seconds and forwarded to the 224.0.0.5 multicast IP address. The dead interval is set to 120 seconds, and the DR/BDR process does not occur (Figure 4).

Figure 4 – Hello packet captured over a point-to-multipoint network

OSPF Broadcast Network Type

Broadcast media is a multi-access network that supports Layer 2 broadcasts. That means a device can send a frame to a particular Layer 2 address (FFFF.FFFF.FFFF for Ethernet networks) to get it reaches all hosts on the broadcast network.

The broadcast OSPF network type is enabled by default on broadcast media such as Ethernet. When this network type is active, OSPF sends Hello packets every 10 seconds with a dead interval of 40 seconds (Figure 5), and routers on the broadcast link elect a DR and a BDR.

Figure 5 – Hello packet captured over a broadcast network

OSPF Non-Broadcast Network Type

A non-broadcast media is a multi-access network that does not support Layer 2 broadcast frames such as X.25, Frame Relay, and ATM.

By default, OSPF sets the network type of Frame Relay interfaces to non-broadcast. When that network type is used, Hello packets get generated every 30 seconds with a dead interval of 120 seconds (Figure 6) and sent as unicast IP packets. Additionally, OSPF nodes on a non-broadcast link elect a DR and BDR.

OSPF Loopback Network Type

The loopback OSPF network type is used on loopback interfaces only. You cannot set it to a non-loopback interface/link. By default, it is the OSPF network type for loopback interfaces, and OSPFv2 advertises a loopback interface using its IP address and the /32 subnet mask, regardless of its IP configuration since OSPF considers those interfaces as isolated hosts as you can see in the show ip ospf interface command output below.

R1# show ip ospf interface loopback 0
Loopback0 is up, line protocol is up 
  Internet Address 10.0.1.1/24, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Enabled by interface config, including secondary ip addresses
  Loopback interface is treated as a stub Host

To change this behavior, set the network type of the loopback interface to Point-to-Point, which is the only allowed network type choice for loopback interfaces.

OSPF Virtual Link Network Type

The backbone area (area 0) cannot be discontinuous across an OSPF routing domain. This means each router attached to area 0 must have at least one OSPF adjacency with a router in that area. Routers in the backbone area can share LSAs between OSPF areas.

if a router is connected to multiple areas, not including area 0, then it cannot share LSAs between areas because if it is not connected to area 0. Here comes the concept of OSPF virtual link, which is a tool used to connect an OSPF-enabled router to area 0 across a particular transit area.

By default, Hello packets get sent over a virtual link every 10 seconds with a dead interval of 40.

Configuring and Verifying OSPF Network Types

the ip ospf network nt command allows configuring the OSPF network type of an interface to a value different from the default one, where nt can take one of these values: broadcast, non-broadcast, point-to-multipoint, point-to-multipoint non-broadcast, or point-to-point.

To create a virtual link, we use the area virtual-link command in router configuration mode.

In this section, I will be using the following network diagram. The routing domain consists of three OSPF areas: 0, 45, and 56.

How to configure The Point-to-Point OSPF Network Type

To set the OSPF network type of a particular interface to point-to-point, issue the ip ospf network point-to-point command in interface configuration mode. In these examples, we change the OSPF network type of interfaces connected to subnet 10.0.56.0/24 from broadcast (default) to point-to-point.
Router R5

R5(config)# interface gigabitethernet 0/6
R5(config-if)# ip ospf network point-to-point

Router R6

R6(config)# interface gigabitethernet 0/5
R6(config-if)# ip ospf network point-to-point

To verify the configuration, we issue the show ip ospf interface command in enable mode, as shown below.

R6# show ip ospf interface gigabitEthernet 0/5
GigabitEthernet0/5 is up, line protocol is up 
  Internet Address 10.0.56.6/24, Area 56, Attached via Network Statement
  Process ID 1, Router ID 6.6.6.6, Network Type POINT_TO_POINT, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  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:03
  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 1 msec, maximum is 1 msec
  Neighbor Count is 1, Adjacent neighbor count is 1 
    Adjacent with neighbor 5.5.5.5
  Suppress hello for 0 neighbor(s)

How to configure The Point-to-Multipoint OSPF Network Type

Imagine that we want OSFP nodes in subnet 10.0.0.0/24 to form adjacencies with each other. As a result, we have to set the OSPF network type of the interfaces in that subnet to point-to-multipoint instead of the default type, which is set to broadcast since all interfaces use Ethernet.

In a broadcast network, OSPF nodes build adjacencies with the Dr and BDR only, and thus leaving the default network type untouched won’t let us achieve our goal.

These examples configure the G0/0 interfaces of routers R1, R2, R3, and R4 to point-to-multipoint.
Router R1

R1(config)# interface gigabitEthernet 0/0
R1(config-if)# ip ospf network point-to-multipoint

Router R2

R2(config)# interface gigabitEthernet 0/0
R2(config-if)# ip ospf network point-to-multipoint

Router R3

R3(config)# interface gigabitEthernet 0/0
R3(config-if)# ip ospf network point-to-multipoint

Router R4

R4(config)# interface gigabitEthernet 0/0
R4(config-if)# ip ospf network point-to-multipoint

To verify our configuration, we use the show ip ospf interface command.

R1# show ip ospf interface gigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up 
  Internet Address 10.0.0.1/24, Area 0, Attached via Network Statement
  Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_MULTIPOINT, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
    oob-resync timeout 120
    Hello due in 00:00:11
  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 2 msec, maximum is 2 msec
  Neighbor Count is 3, Adjacent neighbor count is 3 
    Adjacent with neighbor 4.4.4.4
    Adjacent with neighbor 3.3.3.3
    Adjacent with neighbor 2.2.2.2
  Suppress hello for 0 neighbor(s)

Note that the routers are building full OSPF neighbor relationships with each other in subnet 10.0.0.0/24 as stated in the following show ip ospf neighbor command outputs.

Router R1

R1# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
4.4.4.4           0   FULL/  -        00:01:42    10.0.0.4        GigabitEthernet0/0
3.3.3.3           0   FULL/  -        00:01:57    10.0.0.3        GigabitEthernet0/0
2.2.2.2           0   FULL/  -        00:01:50    10.0.0.2        GigabitEthernet0/0

Router R2

R2# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
4.4.4.4           0   FULL/  -        00:01:37    10.0.0.4        GigabitEthernet0/0
3.3.3.3           0   FULL/  -        00:01:53    10.0.0.3        GigabitEthernet0/0
1.1.1.1           0   FULL/  -        00:01:52    10.0.0.1        GigabitEthernet0/0

Router R3

R3# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
4.4.4.4           0   FULL/  -        00:01:46    10.0.0.4        GigabitEthernet0/0
2.2.2.2           0   FULL/  -        00:01:55    10.0.0.2        GigabitEthernet0/0
1.1.1.1           0   FULL/  -        00:01:34    10.0.0.1        GigabitEthernet0/0

Router R4

R4# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           0   FULL/  -        00:01:47    10.0.0.1        GigabitEthernet0/0
3.3.3.3           0   FULL/  -        00:01:48    10.0.0.3        GigabitEthernet0/0
2.2.2.2           0   FULL/  -        00:01:41    10.0.0.2        GigabitEthernet0/0
5.5.5.5           1   FULL/DR         00:00:33    10.0.45.5       GigabitEthernet0/5

How to configure The Point-to-Multipoint Non-Broadcast OSPF Network Type

To set the OSPF network type of a particular interface to point-to-multipoint non-broadcast, use the ip ospf network point-to-multipoint non-broadcast command. Using this command requires using the neighbor command in order to tell the router the IP addresses of the neighbor with which it has to try to build OSPF adjacencies; otherwise, the router could not build OSPF relationships.

In these examples, we configure routers in subnet 10.0.0.0/24 based on the following policy:

  • R1 should build OSPF adjacencies with R2, R3, and R4.
  • R2 should build OSPF adjacencies with R1, and R4.
  • R3 should build OSPF adjacencies with R1, and R4.

Router R1

R1(config)# interface gigabitethernet 0/0
R1(config-if)# ip ospf network point-to-multipoint non-broadcast
R1(config-if)# exit
R1(config)# 
R1(config)# router ospf 1
R1(config-router)# neighbor 10.0.0.2
R1(config-router)# neighbor 10.0.0.3
R1(config-router)# neighbor 10.0.0.4

Router R2

R2(config)# interface gigabitethernet 0/0
R2(config-if)# ip ospf network point-to-multipoint non-broadcast
R2(config-if)# exit
R2(config)# 
R2(config)# router ospf 1
R2(config-router)# neighbor 10.0.0.1
R2(config-router)# neighbor 10.0.0.4

Router R3

R3(config)# interface gigabitethernet 0/0
R3(config-if)# ip ospf network point-to-multipoint non-broadcast
R3(config-if)# exit
R3(config)# 
R3(config)# router ospf 1
R3(config-router)# neighbor 10.0.0.1
R3(config-router)# neighbor 10.0.0.4

Router R4

R4(config)# interface gigabitethernet 0/0
R4(config-if)# ip ospf network point-to-multipoint non-broadcast
R4(config-if)# exit
R4(config)# 
R4(config)# router ospf 1
R4(config-router)# neighbor 10.0.0.1
R4(config-router)# neighbor 10.0.0.2
R4(config-router)# neighbor 10.0.0.3

To check that our configuration, we need to use the show ip ospf interface and show ip ospf neighbor commands.

How to configure The Non-Broadcast OSPF Network Type

The ip ospf network non-broadcast command allows you to set the OSPF network type of an interface to non-broadcast. The command requires using the neighbor command in order to manually form OSPF adjacencies since multicast Hellos are disabled with that network type. Instead, Hello packets are sent to unicast IP addresses configured under each OSPF process, and this adds a bit of security to OSPF traffic.

In these examples, we configure routers in subnet 10.0.0.0/24 to build OSPF adjacencies using unicast Hello packets while electing a DR and a BDR.

Router R1

R1(config)# interface gigabitethernet 0/0
R1(config-if)# ip ospf network non-broadcast
R1(config-if)# exit
R1(config)# 
R1(config)# router ospf 1
R1(config-router)# neighbor 10.0.0.2
R1(config-router)# neighbor 10.0.0.3
R1(config-router)# neighbor 10.0.0.4

Router R2

R2(config)# interface gigabitethernet 0/0
R2(config-if)# ip ospf network non-broadcast
R2(config-if)# exit
R2(config)# 
R2(config)# router ospf 1
R2(config-router)# neighbor 10.0.0.1
R2(config-router)# neighbor 10.0.0.3
R2(config-router)# neighbor 10.0.0.4

Router R3

R3(config)# interface gigabitethernet 0/0
R3(config-if)# ip ospf network non-broadcast
R3(config-if)# exit
R3(config)# 
R3(config)# router ospf 1
R3(config-router)# neighbor 10.0.0.1
R3(config-router)# neighbor 10.0.0.2
R3(config-router)# neighbor 10.0.0.4

Router R4

R4(config)# interface gigabitethernet 0/0
R4(config-if)# ip ospf network non-broadcast
R4(config-if)# exit
R4(config)# 
R4(config)# router ospf 1
R4(config-router)# neighbor 10.0.0.1
R4(config-router)# neighbor 10.0.0.2
R4(config-router)# neighbor 10.0.0.3

How to configure The Broadcast OSPF Network Type

The ip ospf network broadcast command lets you define the OSPF network type of an interface to non-broadcast. Using that network type, Hello packets are sent to multicast IP address 224.0.0.5 in order to let OSPF nodes form adjacencies automatically.

How to configure The Virtual Link OSPF Network Type

To configure an OSPF virtual link, use the area area_number virtual-link router_id command in router configuration mode. area_number is the identifier of the transit area (non-stub area) that connects the two routers. You can type in area_number as a decimal value between 0 and 4,294,967,295 or as an IP address between 0.0.0.0 and 255.255.255.255.

router_id is the OSPF router ID of the router with which you want to form the virtual link. To get the router ID of an OSPF node, use the show ip ospf command.

In this example, we create a virtual link between routers R4 and R5.
Router R4

R4(config)# router ospf 1
R4(config-router)# area 45 virtual-link 5.5.5.5

Router R5

R5(config)# router ospf 1
R5(config-router)# area 45 virtual-link 4.4.4.4

To verify our configuration, we use the show ip ospf virtual-links command.

The following show ip ospf virtual-links command output states that the virtual link across area 45 between R4 and R5 is up.

R5# show ip ospf virtual-links
Virtual Link OSPF_VL0 to router 4.4.4.4 is up
  Run as demand circuit
  DoNotAge LSA allowed.
  Transit area 45, via interface GigabitEthernet0/4
 Topology-MTID    Cost    Disabled     Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:03
    Adjacency State FULL (Hello suppressed)
    Index 1/1/3, retransmission queue length 0, number of retransmission 0
    First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
    Last retransmission scan length is 0, maximum is 0
    Last retransmission scan time is 0 msec, maximum is 0 msec

Related Lessons to OSPF Network Types

Conclusion

I hope this blog post helps you learn something.
Now I’d like to turn it over to you:
What did you like about this tutorial?
Or maybe you have an excellent idea that you think I need to add.
Either way, let me know by leaving a comment below right now.

Mohamed Ouamer is a computer science teacher and a self-published author. He taught networking technologies and programming for more than fifteen years. While he loves to share knowledge and write, Mohamed's best passions include spending time with his family, visiting his parents, and learning new things.

Exit mobile version