Designing OSPF Networks 284_045/c2 1
Consulting Engineer akhan@cisco.com Amir Khan Consulting Engineer akhan@cisco.com 284_045/c2 2
Agenda Technical Overview Protocol Functionality Design Considerations Case Studies
OSPF Technical Overview Background Features Hierarchical Organization
Why OSPF: Advantages Fast re-routing Minimizes routing protocol traffic Multi-vendor
Why OSPF: Disadvantages Topology restrictive Not easily centrally controlled Security transmitted in clear No route filtering
Link State Technology Z’s Link States A B C Q Z X 2 13 Y Q’s Link State Topology information is kept in a database separate from the routing table X’s Link State
OSPF Background Dynamic routing protocol Link state or SPF technology Developed by OSPF Working Group of IETF Intra-autonomous system (IGP) Designed expressly for TCP/IP Internet environment
OSPF Background (Cont.) Runs directly over IP (Protocol 89) Each router maintains an identical database (within areas) Each router constructs a tree of shortest paths by running SPF algorithm on the database Tree provides route to each known destination Cisco’s implementation is fully compliant with the specification as of software release 9.1 (November, 1992)
OSPF Technical Overview Background Features Hierarchical Organization
X Fast Convergence Detection Plus LSA/SPF R2 Alternate Path N1 N2 R1 Time it takes to start using a new route when a link fails and alternates routes are available X N1 N2 R1 R3 Primary Path
Load Balancing Equal cost multiple paths R2 T1 T1 N2 N1 R1 T1 R4 T1 R3 Time it takes to start using a new route when a link fails and alternates routes are available T1 T1 N2 N1 R1 T1 R4 T1 R3
Low Bandwidth Utilization FDDI Dual Ring LSA X R1 LSA Only changes propagated Multicast on multi-access broadcast networks
Low Bandwidth Utilization ? FDDI Dual Ring LSA Remote Site R1 X LSA R2 LSA Database synchronization
Optimal Path Utilization The optimal path is determined by the sum of the interface costs Cost = 1 Cost = 1 N2 N3 R2 R3 N1 R1 N5 Cost = 10 R4 N4 Cost = 10
IP Subneting Support Network number, mask pair Variable length subnet mask (VLSM) Discontiguous subnets Supernets/subnet prefixes
Route Summarization Prefix or all subnets Prefix or all networks ‘Area range’ command R2 FDDI Dual Ring Backbone Area 0 With summarization Network 1 Next Hop R1 R1 (ABR) Area 1 Without summarization Network 1.A 1.B 1.C Next Hop R1 1.A 1.B 1.C
Authenticated Routing Updates AuType 0: No authentication AuType 1: Simple password Password is transmitted in clear
External Routes Redistributed into OSPF Flooded unaltered throughout the AS OSPF supports two types of external metrics Type 1 external metrics Type 2 external metrics (Default) RIP IGRP EIGRP BGP etc. OSPF Redistribute
External Routes Type 1 external metric Cost = 10 to N1 External Cost = 1 External Cost = 2 R2 R3 R1 Cost = 8 Network N1 Type 1 11 10 Next Hop R1 R2 Selected Route
External Routes Type 2 external metric Cost = 10 to N1 External Cost = 1 External Cost = 2 R2 R3 R1 Cost = 8 Network N1 Type 2 1 2 Next Hop R1 R2 Selected Route
External Routes Forwarding Address on shared/common network (Field in AS external links advertisement) R1 N1 AS#2 AS#1 BGP FDDI Dual Ring OSPF N3 N2 R3 R2 Network N3 Next Hop R3
Route Tagging Autonomous System B wants to C D Autonomous System B wants to Propagate routes from A —> D, but NOT propagate routes from C —> D OSPF tags routes with AS input This info can be used when redistributing routes
TOS Based Routing IP header supports 3 bit priority field IP header supports 4 special types of service Bandwidth Delay MTU Cost Currently only TOS 0 supported
Utilizes IP Multicast for Sending/Receiving Updates Broadcast networks DR and BDR —> AllSPFRouters (224.0.0.5) All other routers —> AllDRRouters (224.0.0.6) Hello packets sent to AllSPFRouters (Unicast on point-to-point and virtual links)
OSPF Technical Overview Background Features Hierarchical Organization
Hierarchical Structure Backbone Area #0 Area #1 Area #2 Area #3 Structure must exist or created Structure must exist or be created Explicit topology has precedence over addressing
OSPF Areas OSPF areas Group of contiguous hosts and networks Per area topological database Backbone area (contiguous) Virtual links Inter-area routing Area 2 Area 3 Router ID: A 32-bit number assigned to each router running the OSPF protocol. This number uniquely identifies the router within an Autonomous System. Router use this number to identify themselves when generating updates. Neighboring routers: Two routers that have interfaces to a common network. On multi-access networks, neighbors are dynamically discovered by OSPFs Hello Protocol. Adjacency: A relationship formed between selected neighboring routers for the purpose of exchanging routing information. Not every pair of neighboring routers become adjacent. Link state advertisement: Describes the local state of the router or network. This includes the state of the router’s interfaces and adjacencies. Each link state advertisement is flooded throughout the routing domain. The collected link state advertisements of all routers and networks forms the protocol’s topological database. Hello protocol: The part of the OSPF protocol used to establish and maintain neighboring relationships. On multi-access networks the Hello Protocol can also dynamically discover neighboring routers. Designated router: Each multi-access network that has at least two attached routers has a Designated Router. The Designated Router generates a link state advertisement for the multi-access network and has other special responsibilities in the running of the protocol. The Designated Router is elected by the Hello Protocol. Area 0 Area 1 Area 4
OSPF Areas Rules Backbone area must be present All other areas must have connection to backbone Backbone must be contiguous
Why Areas Topology of an area is invisible from outside of the area Backbone Area #0 Area #1 Area #2 Area #3 Topology of an area is invisible from outside of the area Results in marked reduction in routing traffic
Topology/Link State Database A router has a separate LS database for each area to which it belongs All routers belonging to the same area have identical database SPF calculation is performed separately for each area LSA flooding is bounded by area
Area Link State Database Area database is composed of: Router links advertisements Network links advertisements Summary links advertisements (IP network, ASBR) AS external advertisements (in non-stub areas)
Classification of Routers IR Area 2 Area 3 ABR/BR Area 0 IR/BR Area 1 ASBR Internal Router (IR) Area Border Router (ABR) Backbone Router (BR) Autonomous System Border Router (ASBR) To other AS
OSPF Address to Area Mapping Area can be one or more networks Area can be one or more subnets Any combination of networks and subnets possible (But bad in practice) For summarization subnets must be grouped Mask in area...range command consolidates
Virtual Links Area 3 Backbone Area 0 Backbone Area 0 Area 1 Virtual links configured between any two backbone routers that have an interface to a common non-backbone area A router connected to two or more areas is considered to be a backbone router Area 2
Agenda Technical Overview Protocol Functionality Design Considerations Case Studies
Protocol Functionality Bringing up adjacencies Convergence Subneting Route summarization Area classification
OSPF Terminology Hello protocol Designated router Router ID Neighboring routers Adjacency Link state advertisement Router ID: A 32-bit number assigned to each router running the OSPF protocol. This number uniquely identifies the router within an Autonomous System. Router use this number to identify themselves when generating updates. Neighboring routers: Two routers that have interfaces to a common network. On multi-access networks, neighbors are dynamically discovered by OSPFs Hello Protocol. Adjacency: A relationship formed between selected neighboring routers for the purpose of exchanging routing information. Not every pair of neighboring routers become adjacent. Link state advertisement: Describes the local state of the router or network. This includes the state of the router’s interfaces and adjacencies. Each link state advertisement is flooded throughout the routing domain. The collected link state advertisement of all routers and networks forms the protocol’s topological database. Hello protocol: The part of the OSPF protocol used to establish and maintain neighboring relationships. On multi-access networks the Hello Protocol can also dynamically discover neighboring routers. Designated router: Each multi-access network that has at least two attached routers has a Designated Router. The Designated Router generates a link state advertisement for the multi-access network and has other special responsibilities in the running of the protocol. The Designated Router is elected by the Hello Protocol.
The Hello Protocol Responsible for establishing and maintaining neighbor relationships Elects designated router on multi-access networks Hello FDDI Dual Ring Hello Hello
The Hello Packet Router priority Hello interval Router dead interval Network mask Options: T-bit, E-bit List of neighbors FDDI Dual Ring Hello Hello
Designated Router One per multi-access network Generates network links advertisements Assists in database synchronization Backup Designated Router Designated Router Designated Router Backup Designated Router 284_045/c2 41
Designated Router by Priority Configured priority (per interface) Else determined by highest router ID Router ID is the highest IP address on the box 131.108.3.2 131.108.3.3 DR R1 Router ID = 144.254.3.5 R2 Router ID = 131.108.3.3 144.254.3.5
Neighboring States 2-way Router sees itself in other Hello packets DR selected from neighbors in state 2-way or greater 2-way DR BDR
Neighboring States Full Routers are fully adjacent Databases synchronized Relationship to DR and BDR Full DR BDR
When to Become Adjacent Underlying network is point to point Underlying network type is virtual link The router itself is the designated router The router itself is the backup designated router The neighboring router is the designated router The neighboring router is the backup designated router
LSAs Propagate Along Adjacencies DR BDR LSAs acknowledged along adjacencies
X Convergence Detection Plus LSA/SPF R2 Alternate Path N1 N2 R1 R3 Time it takes to start using a new route when a link fails and alternates routes are available X N1 N2 R1 R3 Primary Path
X Convergence Fault detection Serial lines Detection immediate for carrier loss 2 to 3 times keepalive otherwise keepalive 10 seconds by default Token Ring and FDDI immediate Ethernet 2 to 3 times keepalive Hello can supersede keepalive Dead timer is 40 sec by default Alternate Path X N1 R1 Primary Path
X Convergence Finding a new route LSA flooded throughout area Acknowledgment based Topology database synchronized Each router derives routing table Tree to each destination network LSA X N1 R1
Convergence Finding a new route Load balancing provides immediate convergence Equal cost paths only R2 T1 T1 N2 N1 R1 T1 R4 T1 R3
Variable Length Subneting (IP) .5 .50. Serial Addresses 131.108.254.5 .6 .9 .10 .13 .14 . .13 B .6 .10. .9 .14 .254. .60. .10 C ‘Sub-subnet’ subnet .254. for serial links Use mask 255.255.255.252 for serial links ‘Sub-subnet’ Mask Boundary 131.108.254.XXXXXX YY Subnet Hosts 1 00 4 01 5 10 6 11
VLSM Concerns Pick one regular subnet Further subnet that with extended mask Keep sub-subnets together in same area 131.108.0.0 255.255.255.0 255.255.255.252 Class B 254 subnets 62 extra subnets
Discontiguous Subnets Area 0 network 192.117.49.0 range 255.255.255.0 Area 1 network 131.108.0.0 subnets 17-31 range 255.255.240.0 Area 2 network 131.108.0.0 subnets 33-47 range 255.255.240.0 Area 3 network 131.108.0.0 subnets 49-63 range 255.255.240.0
OSPF Link Summarization Backbone Area #0 Area #1 Area #2 Area #3
Not Summarized: Specific Links Specific link LSA advertised out Link state changes propagate out External links ASBR Backbone Area #0 1.A 1.B 1.C 1.D 3.A 3.B 3.C 3.D 2.A 2.B 2.C 3.B 1.B 1.A 3.A 2.B 3.D 1.D 3.C 1.C 2.A 2.C
Summarized: Summary Links Only summary LSA advertised out Link state changes do not propagate External links ASBR Backbone Area #0 1 3 2 1.B 1.A 3.B 3.A 2.B 1.D 3.C 3.D 1.C 2.A
Not Summarized: Specific Links Specific link LSA advertised in Link state changes propagate in External links ASBR 1.A 1.B 1.C 1.D 2.A 2.B 2.C 2.A 2.B 2.C 3.A 3.B 3.C 3.D Backbone Area #0 1.A 1.B 1.C 1.D 3.A 3.B 3.C 3.D 3.B 1.B 1.A 3.A 2.B 3.D 1.D 3.C 1.C 2.A 2.C
Summarized: Summary Links Only summary LSA advertised out Link state changes do not propagate External links ASBR Backbone Area #0 2,3 1,2 1,3 1.B 1.A 3.B 3.A 2.B 1.D 3.D 1.C 3.C 2.A
Regular Area (Not a Stub) Summary LSA from other areas injected Specific links from other areas injected Can cause routing trouble—link flaps Solution: configure area range Default external injected Configure default-info originate on AS border External links injected AS border not default-info originate
Normal Stub Area Summary LSAs from other areas injected Default LSA injected into area Represents external links Represents non-summarized internal links Default path to closest area border router Define all routers in area as stub (area x stub) Specific link flaps will not be injected
Totally Stubby Area Configure ‘area x stub no-summary’ Default LSA injected into area Represents all external links Represents all summarized internal links Represents non-sumarized internal links Default path to closest area border router Define all routers totally stubby Specific link flaps will not be injected
Agenda Technical Overview Protocol Functionality Design Considerations Case Studies
Design Considerations Network hierarchy Addressing
Hierarchical Network Structure Core Distribution Optimal Transport Between Sites Access Policy Based Connectivity Local/Remote Workgroup Access
Hierarchical Network Structure Core Distribution Access
OSPF Network Topology Backbone Area 0 Area 1 Area 2
Addressing Area 0 network 192.117.49.0 range 255.255.255.0 Area 1 network 131.108.0.0 subnets 17-31 range 255.255.240.0 Area 2 network 131.108.0.0 subnets 33-47 range 255.255.240.0 Area 3 network 131.108.0.0 subnets 49-63 range 255.255.240.0 Assign contiguous ranges of subnets per area to facilitate summarization
Route Redistribution Transferring routes between routing protocols OSPF RIP Structure must exist or created Redistribute OSPF routes into RIP and vice versa Transferring routes between routing protocols
Route Redistribution Example Structure must exist or created OSPF Domain UNIX host running routed Cisco router redistributes RIP into OSPF and vice versa
Good OSPF Backbone Design Avoid large mesh backbones Best—collapsed LAN backbone
Scalable OSPF Network Design Area hierarchy Stub areas Addressing Route summarization
Agenda Technical Overview Protocol Functionality Design Considerations Case Studies
Case Study Area 1 Area 2 Add site to an existing network Backbone Area #0 1.B 1.A 2.B 1.D Area 1 1.C 2.A Area 2 2.C Add site to an existing network Minimize impact on existing network Topology and addressing considerations
Case Study Option 1: Place in the backbone Jeopardize backbone stability Increase non-transit traffic Option 2: Place in existing area 2 Adjust area 2’s address space Increase traffic in Europe
Case Study Option 3: Create new area Requires unique address space Logically easy Optimizes routing
Case Study Option 3: Create new area Area 1 Area 2 Area 3 Backbone Area #0 1.B 1.A 2.B 1.D Area 1 1.C 2.A Area 2 2.C Area 3 Option 3: Create new area Requires unique address space Logically easy, optimizes routing
OSPF Configuration Commands Router command Router subcommand Interface subcommands
Router Command router ospf {as} Multiple OSPF processes can be configured Autonomous system must be on unique interfaces as# not transmitted
Router Sub-commands NETWORK <n.n.n.n> <mask> AREA <area-id> AREA <area-id> STUB {no-summary} AREA <area-id> AUTHENTICATION AREA <area-id> DEFAULT_COST <cost> AREA <area-id> VIRTUAL-LINK <router-id>... AREA <area-id> RANGE <address mask>
Interface Subcommands IP OSPF COST <cost> IP OSPF PRIORITY <8-bit-number> IP OSPF HELLO-INTERVAL <number-of-seconds> IP OSPF DEAD-INTERVAL <number-of-seconds> IP OSPF AUTHENTICATION-KEY <8-bytes-of-passwd>
Redistributing Routes into OSPF ROUTER OSPF <as#x> REDISTRIBUTE {protocol} <as#y> <metric> <metric-type (1 ro 2) <tag> <subnets> <default>
Interface Subcommands IP OSPF COST <cost> IP OSPF PRIORITY <8-bit-number> IP OSPF HELLO-INTERVAL <number-of-seconds> IP OSPF DEAD-INTERVAL <number-of-seconds> IP OSPF AUTHENTICATION-KEY <8-bytes-of-passwd>
Supporting Nonbroadcast Multiaccess Environments X.25, Frame Relay, ATM etc. ROUTER OSPF <as#> NEIGHBOR n.n.n.n INTERFACE <x> <y>