3.
5 OSPF Routing
•OSPF- Open Shortest Path First
•OSPF use Dijkstra’s Algorithm/Shortest Path First(SPF) Algorithm
•OSPF Versions:
OSPFv1 (1989): Old, not in use anymore
om
OSPFv2 (1998): Used for IPv4
OSPFv3 (2008): Used for IPv6
il.c
•LSA - Link State Advertisement
•LSDB - Link State Database
•An OSPF area is a set of routers and links that share the same
LSDB. The Backbone Area (area 0) is an area that all others area must
ma
connect to.
•Routers with all interfaces in the same area are called Internal Routers.
Routers with interfaces in multiple areas are called Area Border Routers(ABR).
@g
Routers connected to the backbone area(area 0) are called Backbone
Routers.
•An intra-area route is a route to a destination inside the same OSPF
45
area. And inter-area route is a route to a destination in a different
OSPF area.
k
•OSPF interfaces in the same subnet must be in the same area. The
fse
"passive-interface g0/2" command tells the router to stop sending OSPF
hello message out of the interface.
•ASBR - Autonomous System Boundary Router.
ali
ASBR is an OSPF router that connects the OSPF network to an ex-
ternal network. By using default-information originate command a router
becomes an ASBR.
27
•R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.2
•R1(config)# router ospf 1
•R1(config-router)# default-information originate
om
il.c
ma
@g
k 45
fse
ali
28
OSPF Cost
•OSPF metric is called cost. It is automatically calculated based
on bandwidth of the interface.
cost = reference bandwidth / interface’s bandwidth
The default reference bandwidth is 100 Mbps. And Ethernet(10
om
Mbps), FastEthernet(100 Mbps), GigabitEthernet(1000 Mbps) etc.
All values of cost less than 1 will be converted to 1.
•Change the reference bandwidth:
R1(config-router)# auto-cost reference-bandwidth value
il.c
•Change the cost of an interface manually:
R1(config)# interface g0/0 ma
R1(config-if)# ip ospf cost 1000
R1# show ip ospf interface g0/0
•Bandwidth: The bandwidth is just a value that is used to cal-
@g
culate OSPF cost, EIGRP metric etc. By default the bandwidth
matches the interface speed. But changing the interface bandwidth
doesn’t actually change the speed at which the interface operates.
45
R1(config-if)# bandwidth value
Three ways to modify the OSPF Cost
k
1. Change the reference bandwidth:
auto-cost reference-bandwidth value
fse
R1(config-router)#
2. Manual configuration:
R1(config-if)# ip ospf cost 1000
ali
3. Change the interface bandwidth:
R1(config-if)# bandwidth value
N.B. The OSPF cost to a destination is the total cost of the outgo-
29
ing/exit interface.
om
il.c
ma
@g
k 45
fse
ali
30
OSPF Message Type
1. Hello
It is used for neighbor discovery and maintenance. Hello
message are multicast to 224.0.0.5
2. Database Description(DBD)
om
It contains the summary of the LSDB of the router.
3. Link-State Request(LSR)
Request for specific LSAs from the neighbor.
il.c
4. Link-State Update(LSU)
Sends specific LSAs to the neighbour.
ma
5. Link-State Acknowledgment(LSAck
Used to acknowledge that the router received a message.
@g
OSPF Neighbor States
1. Down State
Router doesn’t know about any OSPF neighbors yet. It
sends an OSPF Hello message to 224.0.0.5
45
2. Init State
Hello packet received.
k
3. 2-Way State
fse
This state means, the router has received a Hello packet
with it’s own RID in it. And they are ready to share LSAs
to build a same LSDB.
ali
4. Exstart State
They decide which router will start the exchange. They
elect master and slave. The router with higher RID will
31
become the master and thher will slave.
5. Exchange State
In this state the routers exchange DBDs which contain a
list of LSAs
om
il.c
ma
@g
k 45
fse
ali
32
6. Loading State
Router send LSR message. Then it receive LSU message
and finally it send LSAck message.
7. Full State
In this state the routers have a full OSPF adjacency and
om
identical LSDBs. They continue to send and listen for
Hello packets every (10 seconds) to maintain neighbor
adjacency.
Every time a hello packet is received the Dead timer(40
il.c
seconds) is reset. If the dead timer counts down to 0 and
no Hello message is received , the neighbor is removed.
ma
OSPF DR BDR
•Show OSPF neighbor
R1# show ip ospf neighbor
@g
•Change the priority of the interface
R1(config-if)# ip ospf priority 40
45
R1# clear ip ospf process
N.B. If priority value is zero the router will not be elected as DR/BDR.
Zero is the lowest priority.
k
fse
ali
33
3.6 FHRP
Basics of FHRP
•FHRP - First Hop Redundancy Protocols
•FHRP is a computer networking protocol which is designed to pro-
tect the default gateway used on a subnetwork by allowing two or
om
more routers to provide backup for that address; in the event of fail-
ure of an active router, the backup router will take over the address,
usually within a few seconds.
•A virtual IP is configured on the two routers and a virtual MAC
il.c
is generated for the virtual IP
•End hosts in the network are configured to use the virtual IP as
their default gateway
•Gratuitous ARP: ARP reply sent without being requested
ma
Types of FHRP
@g
1. HSRP
•Hot Standby Router Protocol
•Cisco Proprietary
•An active and Standby router are elected
45
•IPv4 multicast address:
→v1: 224.0.0.2
→v2: 224.0.0.102
k
•Virtual MAC address:
fse
→v1: 0000:0c07:acXX
→v2: 0000:0c9f:f XXX
N.B. XX=HSRP group number
ali
34
2. VRRP
•Virtual Router Redundancy Protocol
•Industry Standard
•A master and backup router are elected
•IPv4 multicast: 224.0.0.18
om
•Virtual MAC address: 0000:5e00:01XX
N.B. XX=VRRP Group Number
3. GLBP
il.c
•Gateway Load Balancing Protocol
•Cisco Proprietary
•Load balances among multiple routers in a singe subnet.
ma
•An AVG(Active Virtual Gateway) is elected.
•Up to 4 AVF are assigned by the AVG. Each AVF acts as
the default gateway for a portion of the hosts in the subnet.
•AVF - Active Virtual Forwarders
@g
•IPv4 multicast address: 224.0.0.102
•Virtual MAC address: 0007:b400:XXYY
N.B. XX= GLBP group number, YY= AVF number.
45
HSRP Configuration
R1(config)# int g0/0
k
R1(config-if)# standby 5 ip 192.168.1.254
R1(config-if)# standby 5 priority 150
fse
R1(config-if)# standby 5 preempt
R1# show standby
N.B. Higher value of priority will be Active router.
ali
35