052 OSPF Dynamic Routing
052 OSPF Dynamic Routing
com
Dynamic Routing
There are various routing protocols that are designed to exchange route
information with neighbors. The most popular currently include OSPF and
EIGRP. The network administrator does not configure dynamic routes. They
are learned so that each router installs and selects routes for best path
selection. The distinction between each routing protocol is how they learn,
update and advertise routes between neighbors.
OSPF Characteristics
Link-state routing protocol
Metric = link cost (bandwidth)
Global view database topology table
Shortest path to destination calculated
Event-triggered routing updates
Auto-summary disabled (default)
Scalable to large enterprise domains
Fast convergence when there is link failure
Load balancing across four equal paths
Adjacency States
The following describe the sequence of OSPF states required to establish
neighbor adjacency and exchange routing tables.
2. Attempt - NBMA routers only. Hello packet has not been received from
NBMA neighbor. Hello packet is sent to neighbor.
3. Init - Hello packet is received from neighbor without the router ID listed.
There are settings such as timers verified to match.
Subnet mismatch
Network type mismatch
Timers mismatch
MTU mismatch
Area ID mismatch
Metric Calculation
Each routing protocol has a unique method for calculating route metric
(cost). OSPF calculates cost based on interface bandwidth. The default cost
of an OSPF enabled interface = 1 (100 Mbps / 100 Mbps).
Each link is comprised of the local interface and a neighbor interface. The
lowest cost assignable to a link is 1 even though calculation could arrive at a
lower number. The reference bandwidth of OSPF is configurable to account
for faster Ethernet interfaces that start at Gigabit (1000 Mbps) speed today.
The reference bandwidth is a global configuration command that must
match for all routers in the same OSPF routing domain.
router ospf 1
auto-cost reference-bandwidth 1000
The alternative to reference bandwidth method is ip ospf cost command. It
allows you to configure the cost directly on a network interface. The third
option is to manually configure interface speed with the IOS interface
bandwidth command. That would affect how OSPF calculates metric for
that specific link. You would have to configure the bandwidth command on
both local and neighbor interfaces.
OSPF Router ID
OSPF routers must be assigned a router ID that is a unique identifier to all
connected OSPF neighbors. The router ID is advertised in routing updates
to identify where updates originated. Cisco default OSPF configuration has
no router ID assigned. The following commands configure a router ID from
router configuration mode.
router ospf 1
router-id 192.168.255.1
Example: Router ID
All OSPF routers send routing updates via 224.0.0.6 multicast address to
DR and BDR routers. The Cisco OSPF priority setting on a default router
configuration has a value of 1. That is assigned to an OSPF enabled
interface. The router priority is configurable to influence DR election.
Answer
Ethernet interfaces within an OSPF broadcast domain are assigned to the
same VLAN. There is a default configuration with the same priority on each
router. The router with highest configured router ID (RID) is elected as DR
for all routers connected to switch-1.
www.cisconetsolutions.com
192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4 = Router-4
Example: DR Priority
Refer to the network topology drawing. What router is elected DR based on
the configuration?
OSPF Operation
OSPF is based on a hierarchical network topology where there is a
backbone area. Any new area must be connected to the backbone area
or have a virtual transit link through a connected area.
Single-Area OSPF has only a single area where all routers are connected
with at least one network interface.
All OSPF routers send hello packets to neighbors on the same segment
(subnet) using multicast 224.0.0.5 destination IP address.
SPF algorithm calculates best path to each destination and loops are
prevented with topology database.
www.cisconetsolutions.com
OSPF Configuration
OSPF is a classless routing protocol and wildcard masks are required to
define subnets for route advertisements. OSPF network area command
enables OSPF routing on all local interfaces that are assigned an address
within the subnet range specified. The routes are advertised to the area
assigned and all neighbor/s assigned to that area.
router ospf 1
router-id 172.16.255.1
network 192.168.0.0 0.0.255.255 area 0
network 172.16.1.0 0.0.0.255 area 0
Default-Information Originate
The purpose of default-information originate is to advertise a default route to
connected OSPF neighbors. There is a single route configured under a
dynamic routing protocol. The traditional default route is configured locally
on a router and used as a gateway of last resort. It is deployed as a backup
to a primary link.
www.cisconetsolutions.com
The network topology and path cost for each link is considered as part of the
calculation. The routing table is updated with the destination subnet and
preferred next hop address.
Wildcard Masks
An often overlooked topic on the CCNA exam is wildcard masks. The
wildcard mask is a technique for matching specific IP address or range of IP
addresses. It is used by OSPF routing protocol to advertise routes to
neighbors. In addition access control lists (ACL) filter based on the IP
address range configured from a wildcard mask. The wildcard mask of
255.255.255.255 translates to any network address that can be advertised.
As a result all/any network addresses assigned to an IP address are
advertised to area 0.
192 . 168 . 3 . 0
11000000.10101000.00000011.00000000
00000000.00000000.00000000.11111111 = 0.0.0.255
10 . 10 . 1 . 0
00001010.00001010.00000001.000000 00
00000000.00000000.00000000.000000 11 = 0.0.0.3
10.10.1.0 0.0.0.3 = match 10.10.1.1 and 10.10.1.2
Question 1
Configure OSPF wildcard mask to advertise only 172.16.1.0 subnet to
neighbor (zeros mask off subnet)
network 172.16.1.0 0.0.0.255 area 0
Question 2
Configure OSPF wildcard mask to advertise only 192.168.1.0 subnet for
advertising to neighbor (zeros mask off subnet)
network 192.168.1.0 0.0.0.255 area 0
Question 3
Configure OSPF wildcard mask to advertise all 172.16.0.0 subnets for
advertising to neighbor (zeros mask off subnet)
network 172.16.0.0 0.0.255.255 area 0
www.cisconetsolutions.com
Router-1
This is OSPF global configuration instead of per interface. In this example
the first network command advertises all 192.168.0.0/16 subnets from
router-1 to area 0. Subnet connecting router-1 and router-2 (192.168.1.0/24)
is called a connected route. It is automatically added to the routing table.
Router-2
This is OSPF global configuration instead of per interface as well. In this
example, the first network command advertises all 192.168.0.0/16 subnets
from router-2 to area 0.
Router-1
This is OSPF global configuration instead of per interface. The first network
command enables only 192.168.1.0/24 subnet based on the wildcard mask.
That prevents OSPF from advertising 192.168.2.0/24 subnet since it is out
of range. The second network command enables OSPF on all interfaces
configured with 172.16.0.0/16 as a subnet. Any network interface that starts
with 172.16.x.x will be enabled for OSPF.
Router-2
This is OSPF global configuration instead of per interface. The first network
command enables all 192.0.0.0/8 subnets based on the wildcard mask. Any
network interface that starts with 192.x.x.x will be enabled for OSPF routing.
As a result, interface 192.168.1.2/24 (Gi1/0) on router-2 is enabled for
OSPF. That interface will advertise 192.168.1.0/24 and 192.168.3.0/24
subnets to area 0. The second network command only enables
172.16.2.0/24 subnet from router-2 to area 0.
www.cisconetsolutions.com
Router-1
This OSPF configuration is both global and per interface. The network
command enables only 172.16.1.0/24 subnet based on the wildcard mask.
The interface commands enable OSPF directly on router-1 interface Gi1/0.
OSPF will advertise 192.168.1.0/24 subnet to area 0 for process ID 1. There
is no global configuration or interface configuration for 192.168.2.0 subnet.
That subnet is not enabled for OSPF or advertised to area 0.
www.cisconetsolutions.com
Router-2
This OSPF configuration is both global and per interface. The network
command enables only 172.16.2.0/24 subnet based on the wildcard mask.
The interface commands enable OSPF directly on router-2 interface Gi1/0.
OSPF will advertise 192.168.1.0/24 subnet to area 0 for process ID 1. There
is no global configuration or interface configuration for 192.168.3.0 subnet.
That subnet is not enabled for OSPF or advertised to area 0.
Answer
The OSPF network area command specifies a subnet/s for an OSPF
process and area. Any router interface assigned an IP address within that
range is included in the OSPF process. There is support for multiple OSPF
process numbers per router. Each OSPF process ID is assigned a number
and becomes a separate OSPF instance.
www.cisconetsolutions.com
The wildcard mask zeros match on the first 3 octets (172.16.1) of the
network address. The 15 causes a match on the leftmost 4 bits of the 4th
octet. In addition it masks (1s) off the rightmost 4 bits of the 4th octet. It does
the opposite of what a subnet mask does.
www.cisconetsolutions.com
Answer
OSPF selects a path based on interface cost (bandwidth) from source to
destination. The cost of each link is calculated and added for a cumulative
metric (path cost). The minimum cost assignable to any link is 1. The default
OSPF reference bandwidth is 100 Mbps.
Example: 25 Mbps
Cost = 100 Mbps / 25 Mbps = 4
There are two equal lowest cost (highest bandwidth) paths to Router-5.
The cost for Path 2 and Path 3 is 3. OSPF will load balance packets across
each path as a result. There is no support for unequal-cost load balancing of
OSPF routes.
The default OSPF hello timer interval for a point-to-point network type is 10
seconds. The dead timer is a default of 4 times the hello interval. Ethernet is
an example of a broadcast network type that has the same timer settings.