Share 'OSPF Fundamental Terminology Explained
Share 'OSPF Fundamental Terminology Explained
AS
An AS is a group of networks running under a single administrative control. This could be our company
or a branch of company. Just like Subnetting AS is also used to break a large network in smaller
networks.
AS creates a boundary for routing protocol which allow us to control how far routing information should
be propagated. Beside this we can also filter the routing information before sharing it with other AS
system. These features enhance security and scalability of overall network.
Basically AS concept was developed for large networks. Routing protocols which were developed for
small networks such as RIP do not understand the concept of AS systems.
There are two types of routing protocols IGP and EGP.
IGP (Interior Gateway Protocol) is a routing protocol that runs in a single AS such as RIP, IGRP, EIGRP,
OSPF and IS-IS.
EGP (Exterior Gateway Protocol) is a routing protocol that performs routing between different AS
systems. Nowadays only BGP (Border Gateway Protocol) is an active EGP protocol.
To keep distinguish between different autonomous systems, AS numbers are used. An AS number starts
from 1 and goes up to 65535. Same as IP addresses, AS numbers are divided in two types; Private and
public.
Public AS Numbers: - We only need to use public numbers if we are going to connect our AS with
Internet backbone through the BGP routes from Internet. IANA (Numbers Authority) controls the public
AS numbers.
Private AS Numbers: - Private AS numbers are used to break our internal network into the smaller
networks. We can use any valid AS number in our network unless we connect it with public network. In
above example we used two AS numbers 10 and 20 to divide our company network.
In OSPF implementation, routers which connect two different ASes are known as autonomous system
boundary router (ASBR). In an OSPF network any router can become ASBR.
Area
OSPF implements two levels hierarchy with areas: backbone and area off backbone.
Backbone
Backbone is the central point of this implementation. Routers running in this area required to maintain a
complete database of entire network. All areas need to connect with this area through a physical link or
via a virtual link if physical link is not possible.
Area off backbone
Area off backbone is the extension of backbone. Routes running in this area required to maintain an
area specific database instead of complete database. This is a cool feature. It will speed-up the
convergence time.
OSPF area types
OSPF uses an hierarchical architecture and build OSPF network with different Areas. There are many
specific Area types that are used with OSPF and these Area types has specific characteristics. So, what
are these areas? General OSPF Area types are:
OSPF relies on several types of Link State Advertisements (LSAs) to communicate link state information
between neighbors. A brief review of the most applicable LSA types:
Stub Area
Stub Area is the first specific Area. They are generally used to reduce LSA flooding, the LSDB and routing
table size. So, this type of Area is used for the places that is a little sensitive to high traffic.
To configure an Area as “Stub“, all routers in these Area must be configured as “Stub”.
Stub Area accepts Intra Area LSAs, Type 1,Type 2 LSAs. It also accepts, summary routes(Type 3, Type 4)
and external routes (Type 5) advertised only by a Default Route. Stub area does not accept external
routes(Type 5), it is replaced by Default Route.
5
Not-so-stubby Areas
An NSSA makes use of type 7 LSAs, which are essentially type 5 LSAs in disguise. This allows an ASBR to
advertise external links to an ABR, which converts the type 7 LSAs into type 5 before flooding them to
the rest of the OSPF domain.
An NSSA can function as either a stub or totally stubby area. To designate a normal (stub) NSSA, all
routers in the area must be so configured:
Router(config-router)# area 10 nssa
Summary
Standard areas can contain LSAs of type 1, 2, 3, 4, and 5, and may contain an ASBR. The
backbone is considered a standard area.
Stub areas can contain type 1, 2, and 3 LSAs. A default route is substituted for external routes.
Totally stubby areas can only contain type 1 and 2 LSAs, and a single type 3 LSA. The type 3 LSA
describes a default route, substituted for all external and inter-area routes.
Not-so-stubby areas implement stub or totally stubby functionality yet contain an ASBR. Type 7
LSAs generated by the ASBR are converted to type 5 by ABRs to be flooded to the rest of the
OSPF domain.
ABR
Area Border Router (ABR) is a bridge between Backbone and Area off backbone. With correct IP
addressing we can summarize routes information on this router.
IR
IR (Internal Router) is a router running in area off backbone. IR only needs to maintain an area centric
local database.
6
Link
Link is an interface running OSPF routing protocol. When we add an interface in OSPF process, it will be
considered as a link.
State
State is the information associated with a link (interface). A link (interface) contains several information
such as IP address, up/down status, subnet mask, type of interface, type of network , bandwidth and
delay. OSFP consider this information as state.
LSA
Link state advertisement (LSA) is data packet. It contains link-state and routing information. OSPF uses it
to share and learn network information.
LSDB
Every OSPF router maintains a Link state database (LSDB). LSDB is collection of all LSAs received by a
router. Every LSA has a unique sequence number. OSPF stores LSA in LADB with this sequence number.
OSPF neighbor discovery
Routers running OSPF need to establish a neighbor relationship before exchanging routing updates.
OSPF neighbors are dynamically discovered by sending Hello packets out each OSPF-enabled interface
on a router. Hello packets are sent to the multicast IP address of 224.0.0.5. If the two neighbors have
compatible OSPF parameters listed in the Hello packets, the neighbor relationship will be formed.
By default, Hello packets are sent out every 10 second on an Ethernet network (this interval is known as
the Hello interval). A Dead interval is four times the value of the Hello interval, so if a router on an
Ethernet network doesn’t receive at least one Hello packet from an OSFP neighbor for 40 seconds, the
routers will declares that neighbor to be down.
The following fields in the OSPF Hello packets must be the same on both routers in order for routers to
become neighbors:
subnet
area id
hello and dead interval timers
authentication
area stub flag
MTU
The neighnbor discovery process is explained in the following example:
7
Routers R1 and R2 are directly connected and run OSPF. Both routers will start sending Hellos to each
other in order to establish a neighbor relationship. If the routers have compatible OSPF parameters, the
neighbor relationship will be formed.
Each OSPF router is assigned a router ID. A router ID is determined by using one of the following
methods:
Area ID
OSPF areas create a logical boundary for routing information. By default routers do not share routing
information beyond the area. So in order to become neighbor, two routers must belong to same area.
Here one confusing fact needs to clear. Area is associated with specific interface, not with entire router.
This allows us to configure the router in multiple areas. For example a router that has two interfaces;
Serial interface and FastEthernet interface, can run Serial interface in one area and FastEthernet in
another area. It means link which connects two routers need be in same area including its both ends
interface. Beside this interfaces should have same network ID and subnet mask.
RID
RID is a unique identifier of Router in OSPF network. It must be unique within the autonomous system.
Routers identify each other through the RID in AS.
8
1. Manual configuration
2. Loopback interface IP configuration
3. Active interfaces IP configuration
Manual configuration
Because RID plays a significant role in network, OSPF allows us to configure it manually. RID is 32 bit
long. IP address is also 32 bit in length. We can use IP address as a RID. This gives us more flexibility over
RID. For example we can use a simple and sequential IP scheme such as 1.1.1.1 for R1, 1.1.1.2 for R2,
1.1.1.3 for R3, 1.1.1.4 for R4, 1.1.1.5 for R5 and so on.
We can assign RID from OSPF sub command mode.
Router(config)#router ospf 1
Router(config-router)#router-id ip_address
If we have assigned RID manually, OSPF will not look in next two options. Suppose we did not assign it
through the command. In this situation OSPF will look in next option to find the RID.
Loopback interface IP configuration
If loopback interface is configured, OSPF will choose its IP address as RID. If multiple loopback interfaces
are configured, highest IP address will be chosen from all loopback interfaces configuration.
If loopback interface is not configured, OSPF will look in next and last possible place to choose the RID.
Key points
OSPF will follow the sequence (Manual configuration => Loopback interface => Active interface) of
options while selecting RID. If RID is found, it will not look in next option.
OSPF will choose IP address only from operational IP interface. Operational means interface should be
listed as line is up and line protocol is up in the output of show ip interface brief command.
When multiple IP addresses are available, OSPF will always pick highest IP address for RID.
For network stability we should always set RID from either router-id command or by using loopback
interfaces.
By default Router chooses OSPF RID when it initialized. Once RID is selected it will use that RID until next
reboot.
OSPF will not consider any change in RID which we make after initialization. We have two options to
implement new RID. Either reboots the router or clear the OPSF process with clear ip ospf process
command.
If OSPF fails to select the RID, it will halt the OSPF process. We cannot use OSPF process without RID.
All DROTHERs share routing information with DR. DR will share this information back to all DROTHERs.
BDR is a backup router. In case DR is down, BDR will immediately take place the DR and would elect new
BDR for itself.
Main reason behind this mechanism is that routers have a central point for routing information
exchange. Thus they need not to update each other’s. A DROTHER only need to update the central point
(DR) and other DROTHERs will receive this update from DR.
Practically this will cut the numbers of routing information exchange from O(n*n) to O(n) where n is the
number of routers in a multi-access segment.
For example following figure illustrates a simple OSPF network. In this network R4 is selected as DR and
R5 is selected as BDR. DROTHERs (R1, R2 and R3) will share routing information with R4 (DR) and R5
(BDR), but they will not share routing information with each other. Later DR will share this information
back to all DROTHERs.
OSPF uses a DR (Designated Router) and BDR (Backup Designated Router) on each multi-access network.
Most students think that this DR/BDR election is done per area but this is incorrect. I’ll show you how
the election is done and how you can influence it. This is the topology we’ll use:
Here’s an example of a network with 3 OSPF routers on a FastEthernet network. They are connected to
the same switch (multi-access network) so there will be a DR/BDR election. OSPF has been configure so
all routers have become OSPF neighbors, let’s take a look:
When a router is not the DR or BDR it’s called a DROTHER. I have no idea if we have to pronounce it like
You change the priority if you like by using the ip ospf priority command:
As you can see R3 is still the DR, we need to reset the OSPF neighbor adjacencies so that we’ll elect the
new DR and BDR.
Now you can see R1 is the DR because the other routers are DROTHER and BDR.
Or we can confirm it from R3, you’ll see that R1 is the DR and that the priority is 200.
As we know upon initialization or due to any change in routing information an OSPF router generates a
LSA. This LSA (Link State Advertisement) contains the collection of all link-states on that router. Router
propagates this LSA in network. Each router that receives this LSA would store a copy of it in its LSA
database then flood this LSA to other routers.
After database is updated, router selects a single best route for each destination from all available
routes. Router uses SPF algorithm to select the best route.
Just like other routing algorithm SPF also uses a metric component called cost to select the best route
for routing table.
R2(config-router)#exit
R1(config)#
OSPF on R3
R3(config)#router ospf 3
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 10.3.3.0 0.0.0.255 area 0
R3(config-router)#network 59.152.100.0 0.0.0.3 area 0
R2(config-router)#exit
R1(config)#
If we configure correctly, we will see log messages just like below –
Terminal log on R1
*Jul 30 19:12:25.214: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on GigabitEthernet0/1 from LOADING to
FULL, Loading Done
*Jul 30 19:19:01.444: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on GigabitEthernet0/0 from LOADING to
FULL, Loading Done
log on R2
*Jul 30 19:19:01.871: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from LOADING to
FULL, Loading Done
Terminal log on R3
*Jul 30 19:12:30.940: %OSPF-5-ADJCHG: Process 3, Nbr 1.1.1.1 on GigabitEthernet0/1 from LOADING to
FULL, Loading Done
Finally, we will verify OSPF on each router.
Router – R1
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 1 FULL/DR 00:00:32 59.152.100.2 GigabitEthernet0/1
2.2.2.2 1 FULL/BDR 00:00:34 103.21.40.2 GigabitEthernet0/0
R1#
Seems like, we are doing great. Now verify other two.
Router – R2
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/DR 00:00:33 103.21.40.1 GigabitEthernet0/0
R2#
Router – R3
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/BDR 00:00:39 59.152.100.1 GigabitEthernet0/1
R3#
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
16
R1
interface GigabitEthernet0/1
ip address 192.168.12.1 255.255.255.0
!
interface GigabitEthernet0/2
ip address 192.168.13.1 255.255.255.0
!
router ospf 1
network 192.168.12.0 0.0.0.255 area 0
network 192.168.13.0 0.0.0.255 area 1
!
R2
18
interface GigabitEthernet0/1
ip address 192.168.12.2 255.255.255.0
!
interface GigabitEthernet0/2
ip address 192.168.24.2 255.255.255.0
!
router ospf 1
network 192.168.12.0 0.0.0.255 area 0
network 192.168.24.0 0.0.0.255 area 2
!
R3
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface GigabitEthernet0/1
ip address 192.168.13.3 255.255.255.0
!
router ospf 1
network 3.3.3.3 0.0.0.0 area 1
network 192.168.13.0 0.0.0.255 area 1
!
R4
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface GigabitEthernet0/1
ip address 192.168.24.4 255.255.255.0
!
router ospf 1
network 4.4.4.4 0.0.0.0 area 2
network 192.168.24.0 0.0.0.255 area 2
!
R2 has formed a neighbor adjacency with R2 and R3. Let’s check R2:
R3 has formed neighbor adjacencies with R1 and R4. The show ip ospf neighbor command however,
doesn’t tell me anything about the areas that are used. If you want to see this, you could add
the detail parameter like this:
Above you can see that interface GigabitEthernet0/1 is in area 0 and interface GigabitEthernet0/2 is in
area 2. Another good command to find area information is show ip protocols:
20
R2#show ip protocols
*** IP Routing is NSF aware ***
Above we see three OSPF entries. The first one is for 3.3.3.3/32, the loopback interface of R3. It shows
up with an O since this is an intra-area route. R1 has also learned about 4.4.4.4/32 and 192.168.24.0/24.
These two entries show up as O IA since they are inter-area routes.
R2 has a similar output:
Above we see that R2 has learned about 3.3.3.3/32 and 192.168.13.0/24 which area inter-area routes.
4.4.4.4/32 is an intra-area route.
Let’s check R3:
Everything that R3 has learned is from another area, that’s why we only see inter-area routes here. The
same thing applies to R4:
Just to be sure, let’s try a quick ping between R3 and R4 to prove that our multi-area OSPF configuration
is working: