Professional Documents
Culture Documents
Understanding OSPF Operation: Implement OSPF in The Service Provider Network
Understanding OSPF Operation: Implement OSPF in The Service Provider Network
Understanding OSPF Operation: Implement OSPF in The Service Provider Network
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-1
Objectives
• Describe the functions performed by OSPF
• Describe the OSPF Packet Format
• Describe each of the OSPF packet types
• Describe OSPF neighbor adjacencies establishment, LSDB exchange,
and synchronization
• Describe the link-state flooding process
• Describe how to debug OSPF packets
• Describe OSPF network types
• Describe how the designated router (DR) and backup designated router
(BDR) are elected
• Describe OSPF in nonbroadcast multiaccess (NBMA) networks
• Describe OSPF in Metro Ethernet and EoMPLS networks
• Describe OSPF in MPLS VPN networks
• Describe implementation steps when enabling OSPF on point-to-point,
point-to-multipoint, nonbroadcast multiaccess, and broadcast links
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-2
OSPF Functions
High-level functions of OSPF include the following:
• Discover neighbors and form adjacencies
• Flood link-state database (LSDB) information
• Compute the shortest path
• Install routes in the route-forwarding table
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-3
OSPF Packet Format
CE1#debug ip ospf packet
OSPF packet debugging is on Type Packet Description
*Aug 16 09:18:53.974: OSPF: rcv. v:2 t:1 l:48 rid:10.1.1.1
Discovers
aid:0.0.0.11 chk:8224 aut:0 auk: from GigabitEthernet0/0 neighbors and
1 Hello
builds adjacencies
between them
Checks for
database
2 DBD
synchronization
between routers
Requests specific
3 LSR link-state records
from another router
Link IP OSPF Link
Sends specifically
Header Header Packet Trailer 4 LSU requested link-state
records
Acknowledges the
5 LSAck
Protocol ID Number 89 other packet types
OSPF Packet
Authen-
Version Packet Router Check- Authen-
Type Area ID tication Data
Number Length ID sum tication
Type
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-4
OSPF Packets
Hello
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-5
OSPF Neighbor Adjacency
R1 R2 R2
172.16.6.0/24
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-6
OSPF Neighbor Adjacency (Cont.)
R1 R2 R2
172.16.6.0/24
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-7
Link-State Flooding
The SPF algorithm is triggered in these cases:
• The LSA Options field changes.
• The age of the LSA instance is set to MaxAge.
• The length field in the LSA header changes.
• The contents of the LSA (excluding the LSA header) changes.
3. LSU: The DR notifies
others on 224.0.0.5.
DR
R3
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-8
Debug OSPF Packets
Cisco IOS XR: debug ospf 1 packet
ospf[1010]: Recv: HLO l:48 rid:10.2.1.1 aut:0 auk: from 192.168.112.20 to 224.0.0.5 on
GigabitEthernet0/0/0/1, vrf default vrfid 0x60000000
OSPF: rcv. v:2 t:1 l:48 rid:10.1.1.1 aid:0.0.0.11 chk:8224 aut:0 auk: from GigabitEthernet0/0
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-9
OSPF Network Types
Point-to-point:
A network that joins a single pair of routers
Does not require DR or BDR election
Neighbor is automatically detected
Sends OSPF packets using multicast 224.0.0.5
Default OSPF hello interval is 10 seconds
Default OSPF dead interval is 40 seconds
Broadcast:
DR and BDR selection is required
Other routers form adjacencies with the DR and BDR only
Packets to the DR and BDR use 224.0.0.6
Packets from DR to all other routers use 224.0.0.5
Default OSPF hello interval is 10 seconds
Default OSPF dead interval is 40 seconds
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-10
Cisco IP NGN Infrastructure Layer
• Broadcast OSPF network type is used in service provider environments
and focuses on IP edge devices.
• Point-to-point OSPF network type is used in service provider
environments and focuses on core devices.
Access
Aggregation
IP Edge
Core
Residential
Broadcast Point-to-point
Mobile Users
Business
IP Infrastructure Layer
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-11
Electing the DR and BDR
Hello packets are exchanged via IP Broadcast
multicast.
DROTHER DROTHER DROTHER
DR: The router with the highest OSPF
priority
BDR: The router with the second- P=1 P=1 P=0
highest priority value P=3 P=2
OSPF router ID is used as the tie-
breaker.
DR BDR
DR election is nonpre-emptive.
OSPF considers NBMA to be like other Nonbroadcast
broadcast media.
DR and BDR need to have fully meshed DROTHER
connectivity with all other routers, but
DR
NBMA networks are not always fully
meshed. DROTHER
DR and BDR each need a list of neighbors.
OSPF neighbors are not automatically DROTHER
discovered by the router.
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-12
Setting the Priority
• Different interfaces on a router may be assigned different values.
• The default priority is 1. The range is from 0 to 255.
• “0” means the router cannot be the DR or BDR.
• A router that is not the DR or BDR is DROTHER.
• The priority takes effect when the existing DR goes down.
router ospf 1
area 11
interface GigabitEthernet0/0 interface GigabitEthernet0/0/0/0
ip ospf priority 2 priority 3
CE1 PE1
OSPF Area 11 OSPF Area 1
Gi 0/0 Gi 0/0/0/0
Lo 0 Lo 0
Gi 0/0/0/1
OSPF Area 0
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-13
OSPF over NBMA Network Types
Nonbroadcast (NBMA)
compliant modes
RFC 2328-
Point-to-multipoint
Hello timer: Automatic
Partial-mesh/star One subnet Generates /32
30 seconds No DR and BDR
Point-to-multipoint nonbroadcast
Hello timer: Manual
Partial-mesh/star One subnet Generates /32
30 seconds No DR and BDR
Cisco modes
Broadcast
Full-mesh Hello timer: Automatic
One subnet Original subnet
partial-mesh 10 seconds DR and BDR
Point-to-point
Partial-mesh/star, Hello timer: Automatic
Different subnets Original subnet
using subinterface 10 seconds No DR and BDR
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-14
OSPF Adjacency over Metro Ethernet and
EoMPLS
• EoMPLS and Metro Ethernet service does not participate in STP, nor
does it learn MAC addresses.
• Customer routers R1 and R2 exchange Ethernet frames via an interface
or VLAN subinterfaces.
• OSPF behaves the same as on Ethernet.
- OSPF network type = multiaccess broadcast network
- DR and BDR are elected
- Routers form full adjacencies with DR and BDR only
Ethernet
interface or
VLAN
subinterface
L2 MPLS VPN OSPF
backbone
R1 PE1 PE2 R2
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-15
OSPF Adjacency Over MPLS VPN
• Customer routers run OSPF and exchange routing updates with the PE
routers.
- PE routers appear as another router in the customer’s network.
- Service provider routers are hidden from the customer.
- Customer routers are unaware of MPLS VPN.
- Customer and service provider must agree on OSPF parameters.
• Customer routers-to-PE connection can be of any type.
- OSPF behaves per the connection type (point-to-point, broadcast, NBMA)
P2P,
Broadcast,
or NBMA
R1 PE1 PE2 R2
OSPF OSPF
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-16
Steps to Configure NBMA Mode
interface type number router ospf 1
ip ospf priority 0 Define the OSPF area 11
ip ospf network non-broadcast network type interface type number
! network non-broadcast
router ospf 1 Statically define a neighbor 192.168.101.11 priority 0
neighbor 192.168.101.10 neighbor relationship neighbor 192.168.101.21 priority 0
CE1
OSPF
Lo 0 PE1
10.1.10.1 192.168.101.11
CE2 Lo 0
192.168.101.10 10.1.1.1
Lo 0
192.168.101.21
10.2.10.1
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-17
Subinterfaces
• Several logical subinterfaces can be created over all multiaccess WAN
networks:
- point-to-point interface Serial0.1 point-to-point Point-to-point
Automatic
No DR and BDR
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-18
Point-to-Point Mode
Leased-line Automatic
Single subnet
emulation No DR and BDR
router ospf 1
area 11
interface GigabitEthernet0/0 interface GigabitEthernet0/0/0/0
ip ospf network point-to-point network point-to-point
CE1
OSPF
Lo 0 Gi 0/0 PE1
10.1.10.1 192.168.101.11
Gi 0/0/0/0 Lo 0
192.168.101.10 10.1.1.1
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-19
Point-to-Multipoint Mode
Automatic
Partial-mesh/star Single subnet
No DR and BDR
router ospf 1
area 11
interface type number interface type number
ip ospf network point-to-multipoint network point-to-multipoint
CE1
OSPF
Lo 0 PE1
10.1.10.1 192.168.101.11
CE2 Lo 0
Lo 0 192.168.101.10
10.1.1.1
10.2.10.1 192.168.101.21
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-20
Point-to-Multipoint Non-Broadcast Mode
Manual
Partial-mesh/star Single subnet
No DR and BDR
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-21
IPv6 Support for OSPF Modes
CE1(config-if)#ipv6 ospf network ?
broadcast Specify OSPF broadcast multi-access network
non-broadcast Specify OSPF NBMA network
point-to-multipoint Specify OSPF point-to-multipoint network
point-to-point Specify OSPF point-to-point network
CE1
OSPFv3
PE1
CE2
RP/0/RSP0/CPU0:PE1(config)#router ospfv3 1
RP/0/RSP0/CPU0:PE1(config-ospfv3)#area 11
RP/0/RSP0/CPU0:PE1(config-ospfv3-ar)#interface type number
RP/0/RSP0/CPU0:PE1(config-ospfv3-ar-if)#network ?
broadcast Specify OSPFv3 broadcast multi-access network
non-broadcast Specify OSPFv3 NBMA network
point-to-multipoint Specify OSPFv3 point-to-multipoint network
point-to-point Specify OSPFv3 point-to-point network
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-22
Summary
• OSPF uses several types of packets to operate properly.
• OSPF packets are encapsulated directly into an IP payload.
• There are five OSPF packet types: hello, DBD, LSU, LSR, and LSAck.
• The Hello protocol forms logical neighbor adjacency relationships.
• A topology change triggers link-state flooding.
• You can use the debug ospf packets Cisco IOS XR command to
debug OSPF packets.
• Cisco routers support two RFC-compliant OSPF network types: NBMA
and point-to-multipoint; and three Cisco defined OSPF network types:
point-to-multipoint nonbroadcast, broadcast, and point-to-point.
• A router with the highest priority becomes a DR. In case of a tie, a router
with the highest router ID becomes a DR.
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-23
Summary (Cont.)
• It is important that adjacent routers agree on the media type. OSPF
network type selection depends on the topology, available subnets, and
multicast or broadcast supported.
• OSPF over Metro Ethernet and EoMPLS behaves the same as on the
Ethernet.
• OSPF over MPLS VPN behaves as per the connection type between a
CE and PE router.
• Both adjacent routers must agree on a the media type. Otherwise,
adjacencies may not form due to different hello intervals.
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-24
© 2012 Cisco and/or its affiliates. All rights reserved. SPROUTE v1.01—2-25