OSPF – Link-State Routing Protocol

Open Shortest Path First (OSPF) is a link-state routing protocol for Internet Protocol (IP) networks. It uses a link state routing algorithm, OSPF is perhaps the most widely used interior gateway protocol (IGP) in large enterprise networks.

Comparison of Link-State Routing Protocols
The most common link-state routing protocols used for routing IP is OSPF:

Open Shortest Path First (OSPF): OSPF was designed by the IETF (Internet Engineering Task Force) OSPF Working Group, which still exists today. The development of OSPF began in 1987, and there are two current versions in use:

OSPFv2: OSPF for IPv4 networks (RFC 1247 and RFC 2328)

OSPFv3: OSPF for IPv6 networks (RFC 2740)

Configuring OSPF
The following command is needed in order to enable OSPF routing protocol on the router:

Router(config)#router ospf process-number

The process-number is nothing more than a number local to the router. It’s only used to distinguish processes within a router and can be given an arbitrary value. This value does not have to be the same on every router within the area. However, it is always good practice to keep this number the same for better administration.

Defining OSPF Networks
Enabling OSPF is not enough to activate it. The OSPF process needs to know the networks that are going to be advertised (i.e. the interfaces on which OSPF will run) and the area they reside in. Therefore the following command is needed to make OSPF operational:

Router(config-router)#network address wildcard-mask area area-number

The address can be the network address, subnet, or the address of a specific interface.

The network command is used to identify the interfaces on the router that are going to participate in the OSPF process. Adjacencies will be created with these interfaces and LSAs will be received and transmitted on these interfaces.

Therefore the wildcard-mask parameter needs to be defined for accurately identifying the necessary interfaces.

The wildcard-mask consists of 4 groups of 8-bits each. Each 0 bit indicates a bit that must match (is checked) and each 1 bit indicates an ignore or any bit. For standard subnets this can be thought of as the opposite of a subnet mask.  But be careful the wildcard mask is not always the inverse of the subnet mask.

The area-number specifies the area to be associated with the specific address and consequently the interfaces to be grouped within that area.

By default, area 0 is used; if more than one area is to be created in a network, area 0 is the first one that needs to be defined.

Example of use
Lets say you wanted to configure your router to use OSPF to advertise two directly connected networks of 10.0.0.0/8 and 192.168.1.0/24 the following commands would be used.

Router(config)#router OSPF 1
Router(config-router)network 10.0.0.0 0.255.255.255 area 0
Router(config-router)network 192.168.1.0  0.0.0.255 area 0

Next – Router Configuration