OSPF
OSPF
• An interface on Router
Links
Token
Ring
5
`OSPF terminology: Link state
• The status of a link between two routers. Also a
router’s interface and its relationship to its
neighboring routers.
Neighbors
Links
Token
Ring
6
`OSPF terminology: Area
• A collection of networks and routers that have the
same area identification.
• Each router within an area has the same link-state
information.
• A router within an area is an “internal” router
Area 1
Area 0
Token
Ring
7
`OSPF Areas—Example
Area 3
Area 0
Area 2
Area 1
8
`OSPF terminology: Link Cost
Token
Ring
Cost = 1785 Cost = 6
9
`OSPF terminology: Adjacency database
Neighbors
Token
Ring
Adjacency
database
10
`OSPF terminology: Link-state database
• Also known as a topological database
• A list of link-state entries of all other routers in the
internetwork
Token
Ring
Adjacency Topological
database Database
11
`OSPF terminology: Routing table
• The routing table (also known as forwarding
database) generated when an algorithm is run on
the link-state database.
• Each router’s routing table is unique
Token
Ring
DR
Token
Ring BDR
13
`Comparing OSPF with distance vector routing protocols
1 4
C B A
4
E F G
2 2
1 4
(1, B)
C A
(4, B)
2 2
D
(4, E)
1
E F G
2 2
(3, C) (5, E) (6, A)
16
`OSPF network types
17
`OSPF network types: Fourth type
18
`DR and BDR receive LSAs
5 steps of operation:
1. Establish router adjacencies.
2. Elect a DR and BDR (if necessary).
3. Discover routes.
4. Select the appropriate routes to use.
5. Maintain routing information.
23
`OSPF Topologies
Broadcast
Multiaccess
Point-to-Point
NBMA X.25
Frame Relay
24
`OSPF Operation in a
Broadcast Multiaccess Topology
Broadcast
Multiaccess
25
Hello
Router ID
*
B A C
Hello/dead intervals
afadjfjorqpoeru
39547439070713 Neighbors
Area-ID*
Router priority
Hello DR IP address
BDR IP address
Authentication password *
*
Stub area flag
DR BDR
Hello
172.16.5.1/24 172.16.5.2/24
A E0 E1 B
Down State
I am router ID 172.16.5.1 and I see no one.
Init State
Router B
Neighbors List
172.16.5.1/24, int E1
Router A
Neighbors List
172.16.5.2/24, int E0
Two-way State
30
`Step 3: Discover routes (cont.)
DR
E0 E0
172.16.5.1 172.16.5.3
afadjfjorqpoeru
39547439070713
Exstart State
afadjfjorqpoeru
39547439070713
Exchange State
afadjfjorqpoeru
39547439070713
DR
E0 E0
172.16.5.1 172.16.5.3
afadjfjorqpoeru
39547439070713
afadjfjorqpoeru
39547439070713
afadjfjorqpoeru
39547439070713
Loading State
Cost=10
10.4.4.0/24
Topology Table
Net Cost Out Interface
10.2.2.0 6 To0
10.3.3.0 7 To0 This is the best route to 10.3.3.0.
10.3.3.0 10 E0
33
`Step 5: Maintaining Routing Information
Link-State Change
DR
1 LSU
x A
B
2
Link-State Change
DR
LSU
1 LSU
x A
B
2
Link-State Change
DR
LSU
1 LSU
3
x A
B
LSU
2
Link-State Change
DR
LSU
4 I need to update
my routing table.
1 LSU
3
x A
B
LSU
• Point-to-Point Neighborship
– Router dynamically detects its neighboring router
using the Hello protocol
– No election: Adjacency is automatic as soon as
the two routers can communicate
– OSPF packets are always sent as multicast
224.0.0.5
38
`OSPF Operation in an NBMA
X.25
Frame Relay
ATM
• NBMA Topology
– Single interface interconnects multiple sites
– NBMA topologies support multiple routers but
without broadcasting capabilities
39
SINGLE AREA OSPF Configuration
40
`Basic OSPF Configuration
<Output Omitted>
<Output Omitted> interface Ethernet0
interface Ethernet0 ip address 10.64.0.2 255.255.255.0
ip address 10.64.0.1 255.255.255.0 !
! interface Serial0
<Output Omitted> ip address 10.2.1.2 255.255.255.0
router ospf 1 <Output Omitted>
network 10.0.0.0 0.255.255.255 area 0 router ospf 50
network 10.2.1.2 0.0.0.0 area 0
network 10.64.0.2 0.0.0.0 area 0
Can Assign Network or
Interface Address.
41
`Configuring OSPF loopback address
•Router ID:
–Number by which the router is known to OSPF
–Default: The highest IP address on an active
interface at the moment of OSPF process startup
–Can be overridden by a loopback interface: Highest
IP address of any active loopback interface
! Create the loopback 0 interface
Router(configf)#Interface loopback 0
Router(configf-if)#ip address 192.168.31.33 255.255.255.255
! Remove loopback 0 interface
Router#
show ip protocols
show ip route
Router#
show ip ospf
Router#
clear ip route *
Router#