Professional Documents
Culture Documents
``
Chapter 11
OSPF
Topics Covered
Basics of OSPF
Configuration of OSPF
Troubleshooting OSPF
Features of OSPF
• Industry standard routing protocol.
• Support only for Internet Protocol (IP).
• AS is divided into multiple areas for easy and efficient routing.
• Fast convergence using link state routing method.
• Does not send period and full update.
• Uses bandwidth i.e. cost as metric.
• Used in large enterprise network environment.
• RIP has a limit of 15 hops. A RIP network that spans more than 15 hops (15 routers) is considered
unreachable where as OSPF does not have hop limit
• RIP V1 cannot handle Variable Length Subnet Masks (VLSM) whereas OSPF supports VLSM.
• Periodic broadcasts of the full routing table will consume a large amount of bandwidth which
creates congestion and traffic problem for large network and slow WAN links. This issue is
resolved by OSPF using trigger update technology.
• RIP converges slower than OSPF. In large networks convergence gets to be in the order of
minutes. RIP routers will go through a period of a hold-down and garbage collection and will
slowly time-out information that has not been received recently. This is inappropriate in large
environments and could cause routing inconsistencies.
• RIP has no concept of network delays and link costs. Routing decisions are based on hop counts.
The path with the lowest hop count to the destination is always preferred even if the longer path
has a better aggregate link bandwidth and slower delays.
• RIP networks are flat networks. There is no concept of areas or boundaries. With the introduction
of classless routing and the intelligent use of aggregation and summarization, RIP networks seem
to have fallen behind.
• Some enhancements were introduced in a new version of RIP called RIP2. RIP2 addresses the
issues of VLSM, authentication, and multicast routing updates. RIP2 is not a big improvement
over RIP (now called RIP 1) because it still has the limitations of hop counts and slow
convergence which are essential in todays large networks.
Vision Infosystems (VIS)
• OSPF allows for a logical definition of networks where routers can be divided into areas. This will
limit the explosion of link state updates over the whole network. This also provides a mechanism
for aggregating routes and cutting down on the unnecessary propagation of subnet information.
• OSPF allows for routing authentication by using different methods of password authentication.
Before understanding how OSPF works lets under what does link state means to OSPF. Link can be
defined as an interface of the router. The state of the link is a description of that interface and of its
relationship to its neighboring routers. A description of the interface would include, for example, the IP
address of the interface, the mask, the type of network it is connected to, the routers connected to that
network and so on. The collection of all these link-states would form a link-state database. So the method
of collecting link state information and find the appropriate path to destination network is called as link-
state algorithm. The algorithm of link-state routing is called as Dijkstra.
OSPF Metric
In OSPF metric is called as Cost. The cost is calculated cost of interface is inversely proportional to the
bandwidth of that interface. A higher bandwidth indicates a lower cost.
For example,
In OSPF each area is given a number called as area ID or area number. The area ID can be decimal
number between 1 to 4,294,967,296 or an IP address like format. The backbone area is always identified
as area 0 or area 0.0.0.0. All areas must be connected to area 0. We can create up 232 areas in an OSPF
network.
Ordinary/Standard Area : Ordinary or standard area are areas that connects to the backbone. In ordinary
area every router knows about every network in the area, and each router has the same topological
database. However, the routing tables will be unique from the perspective of the router and its position
within the area.
Vision Infosystems (VIS)
Stub Area : This is an area that will not accept external summary routes. This area prevents or blocks
LSA type 4 and 5. This area has only default route to connect to router areas or external network. Every
router within the area can see every network within the area and the networks within other areas. Stub
area is normally used in hub and spoke topology.
Totally Stubby Area : Totally stubby area is a special type of stub area which does not accept LSA type
3, 4, and 5. This area communicate with other areas via default route i.e. 0.0.0.0. This area is normally
used for small branches or network area or isolated area with few routers and routes.
Not So Stubby Area (NSSA) : This is also a special type of area which is connected to OSPF area and
also to external network via redistribution. This area is a type of stub area but accept external router. This
area does not accept LSA type 4 and 5.
The Backbone Area : This area is called to as Area 0 or Area 0.0.0.0, and it connects all the other areas.
This area accepts all types of LSA and helps to connect each areas. This area can be called as heart or
center point of OSPF network topology.
So we can conclude that OSPF uses 3 types of table in the entire routing process.
Neighbor table : This table maintains information about neighboring routers. This table is created with
the help of hello protocol. This table is the building block of OSPF routing process.
Topology or link state table : Topology table or link state table is exchange of link states, networks,
address, etc to each other by neighboring routers which helps every OSPF router to create a network
diagram called as link state table.
Routing Table : After creating link state table each OSPF router creates a routing table based on SPF
algorithm for path determination and packet forwarding.
Every OSPF router send hello packet periodically (10 seconds is the default on broadcast multi-access
media) to neighboring routers. It has a source address of the sending router and a multicast destination
address set to AllSPFRouters (224.0.0.5). All routers running OSPF listen to the protocol and send their
Vision Infosystems (VIS)
own hello packets periodically. Hello protocol works different based on network type. Hello packet helps
to establish neighbor relationship between OSPF routers.
Router ID
Hello and Dead interval
Area ID
DR and BDR IP address
Authentication
Stub flag, etc
Each OSPF router sends hello packets every 10 sends on multi-access broadcast network with dead
interval of 40 seconds. Based on hello packet each OSPF router maintains and Neighbor table. If no hello
packets are received within 40 seconds the neighbor is declared as dead and according changes are made
in topology table and routing table. So we can conclude that if there is any change in network topology
the first thing to effect is neighbor table then comes topology and routing table. After hello packets are
send, each OSPF router exchange link state table. When both neighbors are synchronized they are called
as adjacent.
The down state : Every new router added to an OSPF network is in down state at the beginning. The
router transmits its own hello packets to introduce itself to the segment and to find any other OSPF
enabled routers. The hello packets are send to multicast address 224.0.0.5 (AllSPFRouters).
The init state : The new router waits for a reply from other OSPF configured routers. The router is in the
init state. When other router hears about the hello packets, they too start sending hello packet. Based on
this hello packet a election is done and an DR and BDR is elected.
The two-way state : The two-way is state in which the new router find its own router ID neighbor list of
other router. Two-way state represent two way synchronization of hello packet.
The exstart state : In this state one of the routers will take seniority, becoming the master router. The two
neighbors determine a master/slave relationship based on highest IP interface address. This master/slave
relationship is only used to determine who starts the communication.
The exchange state : After the exstart state both routers sends out database description packets(DDP)
(i.e. the DDP contains a summary of links rather the entire link state table), changing the state to the
exchange state.
The loading state : If the receiving router, requires more information, it will request that particular link in
more detail using the link-state request packet (LSR). The LSR will prompt the master router to send the
link-state update packet (LSU). This is the same as a link-state advertisement (LSA) used to flood the
network with routing information. While the router is awaiting the LSUs from its neighbor, it is in the
loading state.
Vision Infosystems (VIS)
The full state : When these LSRs are received and the databases are updated and synchronized, the
neighbors are fully adjacent.
• Broadcast Multi-access network : All types of LAN based network are covered under this
category. Like Ethernet, Fast Ethernet, Token Ring, FDDI, etc. This type of network have
broadcast and multicast capabilities. All devices or physical media uses in this topology has
broadcast and multicast feature. OSPF uses multicast to send packets on this network type.
Designated routers (DR) and Backup Designated routers (BDR) are elected in order to avoid
flooding of LSAs. The DR and BDR are elected based on various criteria.
• Point-to-point : This topology is used where there are two devices connected to each other in
point to point fashion. There is only one sending and one receiving router. A typical example of
this is a serial line. PPP and HDLC is the most widely protocol used in such topology. Such point
to point topology usually does not requires layer 2 addressing so this type of network also support
broadcast and multicast traffic. OSPF does not require designated or backup designated router in
this scenario. Network traffic is send using the multicast address for OSPF AllSPFRouters,
224.0.0.5.
• Point-to-Multipoint : This topology is used when a single device is connected to multiple devices
or networks. There is no requirement for DR or BDR election. This technology uses one IP subnet.
Physically, some point-to-multipoint networks cannot support multicast or broadcast traffic. In
Vision Infosystems (VIS)
these cases, special configuration is required. This type of network is called as NBMA (Non
Broadcast Multi-Access network).
• Nonbroadcast multiaccess (NBMA) : This topology creates multiple point-to-point line with
many destinations networks. Topologies like X.25, ATM, Frame Relay, are examples of this
technology. NBMA uses a fully meshed or partially meshed network OSPF sees it as a broadcast
network, and it will be represented by one IP subnet. This technology requires manual
configuration of the neighbors and the DR and BDR selection. DR and BDR routers are elected.
The DR and BDR must be directly connected to their neighbors. All network traffic sent between
neighbors will be replicated for each physical circuit using Unicast addresses because multicast
and broadcast addresses are not supported by NBMA network.
Designated Router
The designated router is used multi-access broadcast network to avoid flooding of LSA in a physical
segment. If multiple routers is available in a multi-access network then there will be a mesh of neighbor
relationship and flooding of LSA between each neighbors. The designated router is responsible for
Vision Infosystems (VIS)
maintaining the topology table for the segment. If routers are connected to a broadcast segment, one
router on the segment is assigned the duty of maintaining adjacencies with all the routers on the segment.
This router is known as the designated router and is elected by the use of the Hello protocol. The election
is determined by either the highest IP address or this command:
ip ospf priority number (the priority number can be between 0 to 255)
By default each router interface has priority of 1. If we set the priority to 0 then that router will not
participate in DR election. The router highest IP address is called as Router-ID or router identification
address. The highest IP of loopback interface is first preferred. If no loopback interface is configured the
highest IP of any interface is selected.
Configuration of R1 router
Router ospf 10
Network 10.1.1.0 0.0.0.255 area 0
Network 20.0.0.1 0.0.0.0 area 0
Configuration of R2 router
Router ospf 20
Network 10.2.2.0 0.0.0.255 area 0
Network 20.0.0.2 0.0.0.0 area 0
• Networks to publish and Area configuration : After configuration of process ID the next step is
configuration interface or network that should be included in OSPF process using network
command and define the network to be included in an area.
• Router ID : The optional part of configuration of RouterID which act as router Identification
number. This routerID is used for many reasons in OSPF like master/slave relationship, DR and
BDR election, etc.
• Optional Parameters : The other parameters depends on configuration of your OSPF and
topology type.
A lower cost increases the likelihood that the interface will be selected as the best or shortest
path. The range of values configurable for the cost of a link is 1 to 65535. In general, the path cost in
Cisco routers is calculated using the formula 108/ bandwidth. 5
Configuration of R1 router
Router ospf 10
Network 10.1.1.0 0.0.0.255 area 0
Network 20.1.1.1 0.0.0.7 area 0
Configuration of R2 router
Router ospf 10
Network 10.1.2.0 0.0.0.255 area 0
Network 20.1.1.2 0.0.0.7 area 0
Configuration of R3 router
Router ospf 10
Network 10.1.1.0 0.0.0.255 area 0
Network 20.1.1.9 0.0.0.3 area 0
Network 20.1.1.3 0.0.0.7 area 0
Configuration of R4 router
Router ospf 10
Network 10.1.3.0 0.0.0.255 area 0
Network 20.1.1.14 0.0.0.3 area 0
Configuration of R5 router
Router ospf 10
Network 10.1.4.0 0.0.0.255 area 0
Network 20.1.1.10 0.0.0.3 area 0
Network 20.1.1.17 0.0.0.3 area 0
Configuration of R6 router
Router ospf 10
Network 10.1.5.0 0.0.0.255 area 0
Network 20.1.1.18 0.0.0.3 area 0
In the above scenario router R3 is elected as DR and router R2 is elected as BDR based on highest router
ID (highest IP of any interface) on a single broadcast network i.e. Ethernet. The router R4, R5 and R6
does not required DR and BDR election as they form a point to point network topology.
• Show ip protocols : Enables you to view the IP configuration on the router. This command is
useful because it shows not only the interfaces, but the configuration of the IP routing protocols as
well.