Tuesday, December 13, 2011

OSPF Network Types

OSPF was originally designed for computer networks interconnected with point-to-point links. OSPF has evolved to support broadcast (eg: Ethernet) and non-broadcast multi-access (NBMA) (eg: ATM, Frame Relay) networks. The OSPF operation is different for each network type; therefore OSPF must be properly configured to function correctly over certain network types.
Note: There are 5 OSPF operation modes available for NBMA networks.

A point-to-point network often being used to connect 2 routers via a serial leased-line with HDLC or PPP as the data link layer encapsulation. Both routers dynamically discover each other via Hello packets destined to the 224.0.0.5 multicast IP address, exchange database information, and establish full adjacency between them. No DR and BDR election is performed; as there are only 2 routers reside in a point-to-point network, in which there is no requirement for DR/BDR.

Usually the source IP address of an OSPF packet is set to the IP address of the outgoing interface. OSPF supports the use of IP unnumbered interfaces, in which the source IP address is set to the IP address of another interface.

A number of n routers reside on a broadcast multi-access network could have been modeled as n(n-1)/2 point-to-point connections (one for each pair of routers) and followed by performing the point-to-point LSA flooding process over each connection. Although this approach is simple, it would consume unnecessary bandwidth resources over the network. Instead, the network is modeled as a star network with n point-to-point connections. A special router called the Designated Router (DR) is elected on the network, in which all other routers on the network only required to flood or receive LSAs to/from the DR in order to conserve bandwidth resources. The DR manages the LSA flooding process on a broadcast multi-access network.

The main benefit of having DR and BDR for broadcast multi-access networks (eg: Ethernet) is reducing routing update traffic. The DR and BDR act as the central point of contact for link-state database exchange between routers on a broadcast multi-access network, in which each router establishes full adjacency and sends its link-state information to the DR and BDR only (using the AllDRouters IP multicast address), instead of all routers on the network. The DR will then flood the link-state information received from a router to all other routers on the network. If the BDR does not see the LSU from the DR within the LSA retransmission interval (typically 5 seconds), it will step in and flood the LSA back into the broadcast network (using the AllSPFRouters IP multicast address) in order to keep the reliable database synchronization running smoothly over the broadcast network, even before noticing the failure of the DR.

OSPF LSA Flooding on Broadcast Network

The DR performs the LSA flooding and LSDB synchronization tasks; whereas the BDR does not perform any of the DR functions when the DR is operating, it just receives all the information. The BDR acts as the hot standby and performs the mentioned tasks in case the DR fails. If the DR fails, the BDR automatically becomes the DR, and another new BDR will be elected.

The formula for calculating the number of adjacencies on a LAN with the use of DR and BDR is 2(n – 1) – 1, where n is the number of routers on the LAN.
Ex: There are 5 OSPF adjacencies between 4 routers on a LAN; 2 between DR and DROTHERs, 2 between BDR and DROTHERs, and 1 between DR and BDR.

The DR and BDR represents all routers on a broadcast network and will pass their LSDBs to a new router that joins the network; as it is inefficient to allow all routers on the network to pass the same information to the new router. Note: There are chances where a new router that joins a broadcast network may first form an adjacency with the BDR instead of the DR. The BDR would exchange link-state information with the new router but it won’t flood any LSU sent by the new router to all other routers on the network. The flooding of LSUs from the new router will be performed by the DR when the new router form an adjacency and exchange LSDBs with the DR.

The DR election occurs when 2 neighboring OSPF routers have entered into the 2-WAY state. If the Hello packets indicate a DR of 0.0.0.0, it means that the DR has not been elected yet; the routers would wait for a period known as the OSPF wait time before attempt to elect the DR. The purpose is to allocate enough time for all routers reside on a broadcast network to complete their initialization process upon a power failure before participate in the DR election. Otherwise, the 1st router that became active would always be elected as the DR. The OSPF Wait timer is set to the same value as the OSPF Dead timer.

If the received Hello packets already specified a Router ID for the DR, it means that the DR has already been elected and a new router that joins the broadcast network does not have to wait to elect a DR and will accept the DR specified in the received Hello packet as the current DR.

During the DR election process, the routers with the highest and second-highest OSPF priority interfaces are elected as the DR and BDR respectively. The default OSPF interface priority is 1. In case of a tie in the OSPF interface priority, the routers with the highest and second-highest Router IDs are elected as the DR and BDR respectively. A router with an OSPF interface priority of 0 is not intended to be elected as a DR or BDR. This technique is often used to prevent certain routers to consume additional resources for becoming the DR or BDR. A router that is neither a DR nor BDR is designated as a DROTHER. The ip ospf priority {priority} interface subcommand changes the OSPF priority for a particular interface.
Note: The BDR is always elected first. It is then being promoted to become the DR, and a new BDR is then elected. This order is important because the process must be repeatable when the DR is lost – the BDR is promoted, and a new BDR is elected.

When a router with a higher priority or Router ID joins a broadcast network, it does not preempt the existing DR and BDR. The DR or BDR changes only when one of them is out of service. If the DR is out of service, the BDR becomes the DR, and a new BDR will be elected; if the BDR is out of service, a new BDR will be elected. The newly elected BDR would perform the time-consuming database synchronization process with all DROTHERs on the network.
Note: Changing the priority on a DROTHER does not preempt the existing DR and BDR and does not affect the normal operation of the DR and BDR. However, changing the priority to 0 on a DR or BDR takes effect immediately in which the DR or BDR will become a DROTHER, the BDR becomes the DR, and a new BDR will be elected.

Different sets of DR and BDR will be elected for each multi-access broadcast network. A router can be a DR on a network and a DROTHER on another network.

The operation of OSPF over NBMA networks is almost same as the operation of OSPF over broadcast networks. The flooding mechanism with the DR; and the representation of networks with network-LSAs in the LSDB are identical for both broadcast and NBMA networks. The only difference is the discovery of neighboring routers. On broadcast networks, an OSPF router can dynamically discover its neighbors with multicast OSPF Hello packets; whereas on NBMA networks, OSPF neighbors must be configured manually and unicast OSPF Hello packets will be used instead. Frame Relay, X.25, and ATM are examples of NBMA networks.

The non-broadcast nature of NBMA creates reachability issues for the operation of OSPF. NBMA networks support more than 2 routers on a network, but have no broadcast capability. In order to implement broadcasting or multicasting, a router replicates the packets to be broadcast or multicast and sends them individually on every PVC to all destinations; however, this process is CPU and bandwidth intensive. If an NBMA network topology is not fully meshed, a broadcast or multicast sent by a router would not reach all other routers.

The hub-and-spoke or star topology is the most common NBMA topology in which remotes sites connect to a central site that provides an application service. The hub-and-spoke partial mesh physical topology does not provide the multi-access capability in which OSPF relies on. The election of DR and BDR is an issue in NBMA networks as the DR and BDR require full physical connectivity with all routers in the NBMA networks.

By default, OSPF unable to automatically establish adjacencies with neighboring routers over NBMA interfaces. Several OSPF configuration options are available for NBMA networks depending upon the type of network topology.

RFC 2328 – OSPFv2 defines the following official OSPF operation modes for NBMA networks:
Non-broadcast Simulates the OSPF operation on broadcast networks. OSPF neighbors must be configured manually and will elect a DR and BDR. Typically used for full-mesh topologies.
Point-to-multipoint Treats an NBMA network as a collection of point-to-point links. The routers automatically identify their neighboring routers but do not elect a DR and BDR. Typically used for partial-mesh topologies.
Note: The choice between the above operation modes determine how the Hello and LSA flooding mechanisms work over an NBMA network. The main advantage of point-to-multipoint mode is requires less manual configuration; while the main advantage of non-broadcast mode is less overhead traffic compared to point-to-multipoint mode.
Note: Cisco offers 3 more OSPF operations modes for NBMA networks – non-broadcast point-to-multipoint, broadcast, and point-to-point.

The DR resides on a broadcast or non-broadcast NBMA network would generate Type-2 Network-LSA for the NBMA network.

The ip ospf network {broadcast | non-broadcast | point-to-multipoint [non-broadcast] | point-to-point} interface subcommand select the OSPF operation mode for an interface.
Parameter
Description
broadcast
(Cisco-specific)
For full-mesh or partial-mesh NBMA topology.
One IP subnet. 10-sec/40-sec Hello/Dead timers.
Makes the WAN to be appeared as a LAN.
Uses multicast Hello packets to automatically discover the neighbors.
Performs DR/BDR election (after the OSPF Wait timer elapsed).
Note: Manually determine the DR using OSPF interface priority and ensure the DR has full connectivity with all other routers.
non-broadcast
(RFC-compliant)
For full-mesh or partial-mesh NBMA topology.
One IP subnet. 30-sec/120-sec Hello/Dead timer.
Neighbors are manually configured.
Performs DR/BDR election (after the OSPF Wait timer elapsed).
Note: Manually determine the DR using OSPF interface priority and ensure the DR has full connectivity with all other routers.
point-to-multipoint
(RFC-compliant)
For full-mesh or partial-mesh NBMA topology.
One IP subnet. 30-sec/120-sec Hello/Dead timer.
Uses multicast Hello packets to automatically discover the neighbors.
Does not perform DR/BDR election. Neighboring routers enter into the EXSTART state as soon as they entered into the 2-WAY state.
Treats a NBMA network as a collection of point-to-point links rather than a multi-access network.
point-to-multipoint non-broadcast
(Cisco-specific)
For full-mesh or partial-mesh NBMA topology.
One IP subnet. 30-sec/120-sec Hello/Dead timer.
Neighbors are manually configured.
Does not perform DR/BDR election. Neighboring routers enter into the EXSTART state as soon as they entered into the 2-WAY state.
Uses when the network has many dynamic connections, in which SVCs are being used instead of PVCs.
point-to-point
(Cisco-specific)
For point-to-point subinterfaces partial-mesh NBMA topology.
Different IP subnet for each subinterface. Supports IP Unnumbered.
10-sec/40-sec Hello/Dead timer.
Uses multicast Hello packets to automatically discover the neighbors.
Does not perform DR/BDR election. Neighboring routers enter into the EXSTART state as soon as they entered into the 2-WAY state.
Used when only 2 routers need to form an adjacency over a single link.
The default OSPF operation mode on a main Frame Relay interface is non-broadcast.
The default OSPF operation mode on a Frame Relay multipoint subinterface is non-broadcast.
The default OSPF operation mode on a Frame Relay point-to-point subinterface is point-to-point.

Not all link layer technologies are able to be mapped directly to the point-to-point leased lines, broadcast networks, and NBMA networks as discussed earlier. Ex: The OSPF Demand Circuit Extension which suppress the Hello and LSA refresh functions has been developed to support OSPF over demand circuits (eg: dial-up telephone lines). With the OSPF Demand Circuit option configured on an interface, OSPF establish an adjacency and perform database synchronization, the adjacency remains active even after Layer 2 of the demand circuit goes down.

OSPF Multicast Extension (MOSPF) is an enhancement to the OSPF unicast routing protocol that supports IP multicast routing within an administrative domain.

1 comment: