Configure and Verify Single Area OSPFv2 Part-1 PDF
Configure and Verify Single Area OSPFv2 Part-1 PDF
Router ID:
o Every Router in Open Shortest Path First network, needs the unique OSPF Router ID.
o The OSPF Router ID is used to provide & give a unique identity to the OSPF Router.
o There are different ways in Open Shortest Path First protocol which it can be identified.
o The highest IP address of the active Physical interface of the router becomes the Router ID.
o If a logical interface is configured , then highest IP address of logical interface becomes RID.
o If specify the Router-ID manually then it takes priority over all and become the Router-ID.
Link:
o Link is an interface running Open Shortest Path First (OSPF) routing protocol.
o When we add an interface in OSPF process, it will be considered as a link.
State:
o In Open Shortest Path First (OSPF), State is the information associated with an interface.
o A link or Interface contains several information such as IP address, up/down status, subnet.
o A link also have subnet mask, type of interface, type of network , bandwidth and delay etc.
o Open Shortest Path First (OSPF) dynamic protocols consider this information as the state.
LSA:
o Link State Advertisement (LSA) is data packet, it contains Link-State & routing information.
o Open Shortest Path First dynamic protocol uses it to share & learn network information.
LSDB:
o Every Open Shortest Path First (OSPF) router maintains a Link State Database (LSDB).
o Link State Database (LSDB) is collection of all Link State Advertisement received by router.
o Every LSA has unique sequence number, OSPF stores LSA in LADB with sequence number.
Internal Router:
o It is a router that has only OSPF neighbor relationships with routers in the same area.
o In Open Shortest Path First (OSPF) Internal Router has all of its interfaces in single area.
Backbone Router:
o The area 0 is known as backbone area & routers in area 0 are known as backbone routers.
Designated Router (DR) and Backup Designated Router (BDR):
o Designated Router is router interface elected among all routers on network segment.
o And Backup designated (BDR) is a backup for the Designated Router (DR) in OSPF.
o DRs are used for reducing network traffic by providing a source for routing updates.
o The Designated Router (DR) maintains a complete topology table of the network.
o The Designated Router (DR) sends the updates to the other routers via multicast.
o All routers in an area will form slave/master relationship with Designated Router (DR).
Router Priority:
o It is used to determine who will become Designated or Backup Designated Router.
o In Open Shortest Path First (OSPF) Dynamic Protocols The default priority is one (1).
o In Open Shortest Path First (OSPF) Router Priority, value range is between 0 to 255.
o The range of priority values that allow a router to be a candidate are 1 to through 255.
o A priority setting of (0) zero means that the router does not participate in the election.
o Changing the priority setting to zero (0) means router can never become the DR or BDR.
Area Border Router (ABR):
o ABR is router that connects one or more OSPF areas to the main backbone network.
o Area Border Router (ABR) is considered a member of all areas it is connected to.
Autonomous System Boundary Router (ASBR):
o If it is one interface is in OSPF Domain & other interface in any other routing protocol.
o It requires redistribution in order to make router as Autonomous System Boundary Router.
o To check the Autonomous System Boundary Router run the command: show ip protocols.
OSPF Tables:
Each OSPF router stores routing and topology information in three tables: Neighbor table,
Topology table and Routing Table.
OSPF Routing Table:
OSPF stores single best route for each destination in this table. Router uses this table to
forward the packet. There is a separate routing table for each routed protocol.
OSPF Router This router OSPF router ID that is 192.168.2.1 highest interface IP.
With ID
(192.168.2.1)
Process ID 1 Process ID of the OSPF configured by Network Administrator.
Link ID The IDs of the routers in the area. There are three routers in Area 0.
ADV Router Router ID of the routers who is advertising the LSA.
Age Maximum age counter in seconds. The maximum is 3600 seconds or 1 hour
Seq# It starts from 0x80000001 and will increase by 1 for each update.
Checksum This is check sum of each LSA.
Link Number of interfaces detected per router. Every router has 2 links in Area.
OSPF Metric:
OSPF uses a metric called cost, which is based on the bandwidth of an interface.
Cost = Reference Bandwidth / Interface Bandwidth
the reference bandwidth is a default value on Cisco routers which is a 100Mbit (108) interface.
Divide the reference bandwidth by the bandwidth of the interface and get the cost. The lower
the cost the better the path is. In route, that has lowest cumulative cost value between source
and destination will be selected for routing table. If two path is equal cost, OSPF will use both
paths and will load balance among them 50/50.
Default Cost of Interfaces
Interface Type Bandwidth Metric Calculation Cost
Ethernet Link 10Mbps 100000000/10000000 = 10 10
FastEthernet Link 100Mbps 100000000/100000000 = 1 1
Serial Link 1544Kbps 100000000/1544000 = 64.76 64
Gigabyte Link 1 Gbps 1
10 Gigabit Link 10 Gbps 1
40 Gigabit Link 40 Gbps 1
100 Gigabit Link 100 Gbps 1
From PC1 to PC2 total OSPF cost is 12 because in the way one Ethernet link which is connected
between R3 to PC2. Cost is counting from outgoing interfaces to reach destination. Therefore,
from PC1 to PC2 OSPF total cost is cost is 12 of R1, R2 and R3 outgoing interfaces.
From PC2 to PC1 total OSPF cost is 3 as all link are FasEthernet. Cost is counting from outgoing
interfaces to reach destination. Therefore, from PC2 to PC1 OSPF total cost is cost is 3 of R3, R2
and R1 outgoing interfaces.
OSPF Basic Configuration:
OSPF Protocols use wildcard mask, which is 32 bits long. It is inverted of subnet masks, with the
zero bits indicating that the corresponding bit position must match the same bit position in the
IP address. The one bits indicate that the corresponding bit position does not have to match the
bit position in the IP address.
Neighbor Configuration:
To make two OSPF routers neighbors, simple enable OSPF on the connected interfaces. There
are two ways, by using the network command or by enabling the OSPF process on the interface
directly. OSPF Neighbor Requirements are mention below:
o The devices must be on the same subnet.
o Must not be passive on connected interface.
o The devices must be in the same area.
o The devices hello and dead intervals must match.
o Router IDs must be unique.
o The devices must have the same authentication configuration.
Commands Description
R1(config)#router ospf 1 Enter OSPF mode choose Process ID 1
R1(config-router)#network 192.168.12.0 Enable OSPF by using network command,
0.0.0.255 area 0 wildcard and area 0
R2(config)#interface FastEthernet 0/0 Enter interface mode of R2
R2(config-if)#ip ospf 1 area 0 Enable OSPF on this interface area 0
R2(config-if)#exit Exit from interface mode
R2(config)#interface loopback 2 Enter loopback interface mode of R2
R2(config-if)#ip ospf 1 area 0 Enable OPSP on this interface area 0
R1# show ip ospf neighbor Verify ospf neighbor relationship
R1# show ip ospf interface f0/0 Verify OSPF neighbor relationship
R1# show ip ospf Verify OSPF process
R1# show ip ospf database Verify OSPF database
R1# show ip protocols Verify running protocols on Router
R1# debug ip ospf packet On debug for OSPF packets
R1# debug ip ospf hello On Debug for OSPF hello packet
OSPF Neighbor Adjacencies :
Before establishing a neighbor relationship, OSPF routers go through several state changes.
Down State, Init State, 2-Way State, Exstart State, Exchange State, Loading State and Full State.
State Description
Down State No hello have been received. All OSPF routers begin in this state.
Init State The interface has detected a Hello packet coming from a neighbor, but
bi-directional communication has not yet been established.
2-Way State When hello is exchanged between two OSPF routers that is called 2 way.
Designated Router (DR) and BDR is elected in this stage.
Exstart State Beginning of the LSDB exchange between both routers. Routers will start
to exchange link state information. Master & slave is elected in this stage.
Exchange State Routers will describe their entire link-state database by sending database
description packets. At this state, packets could be flooded to other
interfaces on the router.
Loading State In this state actual database is exchanged means that LS-Request, LS-
Update, LS Acknowledgement are also exchanged.
Full State At this state, the adjacency is complete. The neighboring routers are fully
adjacent. Adjacent routers will have a similar link-state database.
Point-to-Point Network:
This is the simplest form of the network types. Point-to-Point network types are intended to be
used between two directly connected routers. An example of a point-to-point link is a serial link
connecting just two routers using HDLC or PPP. With point-to-point links, OSPF does not select
a DR or BDR. In addition, hello packets are sent to the multicast address 224.0.0.5. The Point-to-
Point network type has a 10-second hello and 40-second dead timer. Discovers neighbors
dynamically.
R1 Configuration R2 Configuration
R1(config)#interface s1/0 R2(config)#interface s1/0
R1(config-if)#ip address 192.168.12.1 R2(config-if)#ip address 192.168.12.2
255.255.255.0 255.255.255.0
R1(config-if)#no shutdown R2(config-if)#no shutdown
R1(config)#router ospf 1 R2(config)#router ospf 1
R1(config-router)#network 192.168.12.0 R2(config-router)#network 192.168.12.0
0.0.0.255 area 0 0.0.0.255 area 0
R1#show ip ospf interface s1/0 R2#show ip ospf interface s1/0
R1#show ip ospf neighbor R2#show ip ospf neighbor
Capture packets of one of the serial interfaces, which will enable to look into the details of the
hello packet sent by the routers. The packet is sent to the multicast address of 224.0.0.5. In
addition, notice that the ‘Designated Router’ and ‘Backup Designated Router’ fields are set to
0.0.0.0 meaning there is no DR or BDR. 10-second hello and 40-second dead timer.
Broadcast Networks:
A network type that connects two or more OSPF routers over a broadcast media such as
Ethernet. The Broadcast network type requires that a link support Layer 2 Broadcast
capabilities. On broadcast networks, neighbors are dynamically discovered by the hellos that
sent to the multicast address of 224.0.0.5. In addition, DR and BDR are elected on these
networks. The Broadcast network type has a 10 second hello and 40 second dead timer.
Routers Configurations
R3(config)#interface FastEthernet0/0 R4(config)#interface FastEthernet0/0
R3(config-if)#ip address 192.168.1.3 R4(config-if)#ip add 192.168.1.4
255.255.255.0 255.255.255.0
R3(config-if)#no shutdown R4(config-if)#no shutdown
R5(config)#interface FastEthernet0/0 R3(config)#router ospf 1
R5(config-if)#ip add 192.168.1.5 R3(config-router)#network 192.168.1.0
255.255.255.0 0.0.0.255 area 0
R5(config-if)#no shutdown
A packet capture of the hello packet shown below. Notice that a DR and a BDR have been
elected on this network. The packet is sent to the multicast address of 224.0.0.5.