Distance Vector only knows what neighbors have told it. Link state has the whole network.
OSPF Neighbor Relationships
- Determine your Router ID
Routers name in the OSPF process
- Hard-coded using the router-id command
- Highest active loopback IP address
- Highest active interface IP address
- Add interfaces to the link state databases (network command)
- Send hello message on chosen interfaces
- sends HELLO packet to multicast address 224.0.0.5 (All OSPF Routers)
- Once every 10 seconds on broadcast/p-2-p networks
- Once every 30 seconds on NBMA networks
- Receive Hello
- Check hello / dead interval
- check netmasks
- check area id
- check authentication password
- Send reply hello
- If listed as a neighbour in hello packet, reset dead timer
- if not, add as new neighbor
- Master - Slave relationship determined
- Determined by priority, router-id breaks tie
- Master sends database description (DBD) first
- Slave sends DBD second
- DBD are acknowledged and reviewed
- Slave requests details (link state requests LSR)
- Master sends updates (link state updates LSU)
- Master requests details (LSR)
- Slave sends updates (LSU)
- Neighbors are synchronized
- Full State
- Now run Dijkstra SPF Algorithm
Router ID
The router is known in the LSDB by the 32-bit router ID.
Can’t have duplicates in the same area.
Using a loopback interface address and the router ID command is highly recommended.
Used as the endpoints for Virtual Links
BGP and OSPF router IDs must match per RFC 1403
Router ID selection
- Statically configured with router-id x.x.x.x command
- Highest IP address on any active loopback interface
- Highest IP address on any active physical interface
Router Types
- Internal Router - All interfaces in the same area
- Backbone Router - All interfaces in area zero
- Area Border Router (ABR) - At least one interface in area zero and one interface in another area
- Only place that can summarize internal routes
- Generates a default route for certain area types
- Autonomous system boundary router (ASBR) - Any router redistributing into OSPF
- Only place that can summarize external routes
OSPF Packets
- Type 1: Hello packet - This is used to establish and maintain adjacency with other OSPF routers.
- Type 2: Database Description (DBD) packet - This contains an abbreviated list of the LSDB of the sending router and is used by receiving routers to check against the local LSDB. The LSDB must be identical on all link-state routers within an area to construct an accurate SPF tree.
- Type 3: Link-State Request (LSR) packet - Receiving routers can then request more information about any entry in the DBD by sending an LSR.
- Type 4: Link-State Update (LSU) packet - This is used to reply to LSRs and to announce new information. LSUs contain several different types of LSAs.
- Type 5: Link-State Acknowledgment (LSAck) packet - When an LSU is received, the router sends an LSAck to confirm receipt of the LSU. The LSAck data field is empty.
Hello Packet
- Router ID
- Area ID *
- Address of originating interface
- Authentication Information *
- Hello Interval *
- Dead Interval *
- Priority
- DR/BDR/ IDs
- Neigbour Router IDs
*Must Match
OSPF Metric
cost = 100 / bandwidth in Mbps
Rescale to fastest link in the network:
auto-cost reference-bandwidth #
Common costs
56K = 1785
64K = 1562
T1 (1.544) = 65
E1 (2.048) = 48
Ethernet = 10
Fast Ethernet = 1
Single-area OSPF configuration
Network commands turns on hello packets and advertises networks that match wild card bits.
Traditional way
router ospf 1 router-id 1.1.1.1 network 192.168.1.0 0.0.0.255 area 0 # Best practice is an exact match network 192.168.1.1 0.0.0.0 area 0 #add everything, not recommended network 0.0.0.0 255.255.255.255 area 0
New way (only way supported on IPv6)
router ospf 1 router-id 1.1.1.1 int fa1/0 ip ospf 1 area 0
IOS-XR Configuration
router ospf 1 area 0 interface gi 0/1/0/1 commit
Verify
show ip ospf neighbor show ip route show ip ospf show ip ospf interface
Authentication
Enabled on a per interface basics
int Fa1/0 ip ospf authentication message-digest ip ospf message-digest-key 1 md5 cisco
IOS-XR Configuration
router ospf 1 area 0 interface gi 0/1/0/1 authentication message-digest message-digest-key 1 md5 cisco commit
OSPF Networks
Point-to-point
Broadcast
NBMA Network
Point-to-multipoint
STUB - Blocks external routes
Totally SUBBY - blocks external routes and other areas
Routers in the same area all have the same link state database.
LSA Type 1 - (Router) Normal Update
LSA Type 2 - (Network) Normal Update send out
LSA Type 3 - ABR Summary
LSA Type 4 - ABR Summary
LSA Type 5 - ASBR External Route (Blocked by STUB)
LSA Type 7 - NSSA (STUB with ASBR inside)
LSA Type 8 - External Attributes LSA for BGP
LSA Type 9 - Intra-Area Prefix LSAs
LDAT Type 10,11 - Opaque