a. What is it? i. It is an open standard routing protocol b. How does it work? i. Uses Dijkstra algorithm to initially construct a shortest path tree ii. Then populates the routing table with the resulting best paths c. What are some of its advantages? i. Quick convergence, but slower than EIGRP ii. Supports multiple, equal-cost routes to same destination iii. Supports IPv4 and IPv6 d. What are some of its features? i. Allows for creation of areas and autonomous systems ii. Minimizes routing update traffic iii. Is highly flexible, scalable and versatile iv. Supports VLSM/CIDR v. Offers unlimited hop count vi. Open standard and supports multi-vendor deployment e. Comparison to RIPv1 & RIPv2 i. Characteristic OSPF RIPv2 RIPv1 Protocol Type Link state Distance vector Distance vector Classless support Yes Yes No VLSM support Yes Yes No Auto-summarization No Yes Yes Manual summarization Yes Yes No Noncontiguous support Yes Yes No Route propagation Multicast on change Periodic multicast Periodic broadcast Path metric Bandwidth Hops Hops Hop count limit None 15 15 Convergence Fast Slow Slow Peer authentication Yes Yes No Hierarchical network requirements Yes (using areas) No (flat only) No (flat only) Updates Event triggered Periodic Periodic Route computation Dijkstra Bellman-Ford Bellman-Ford ii. Note: 1) Classless: router will advertise subnet mask along with updates for routing protocols 2) Classful: router will not advertise subnet mask info (does not support VLSM) f. What is meant by "hierarchical network requirements"? i. OSPF allows us to subdivide the larger internetwork into smaller subnetworks called areas ii. Three reasons to use areas: 1) Decrease routing overhead 2) Speed up convergence 3) Confine network instability to single areas of the network iii. General idea: 1) All OSPF designs include a "backbone area" a) Area 0 2) ABRs (area border routers) connect other routers to the backbone a) At least one interface within area 0 and at least one outside b) Outside routers connected to ABRs would be Area 1, 2, 3, .... 3) This single OSPF design would be an AS (autonomous system) 4) This AS can connect to multiple other AS via an ASBR (autonomous system boundary router) 5) The ASBR exists within the backbone area and connects to a router in an external routing domain 2. OSPF Terminology a. Link i. It is a network or router interface assigned to any given network ii. It includes any interfaces added to the OSPF process iii. It is associated with: 1) An up or down status 2) One or more IP addresses b. Router ID i. It is an IP address used to identify the router ii. Default (loopback exists) - Highest IP address of all configured loopback interfaces iii. Default (no loopback exists) - Highest IP address our of all active physical interfaces iv. It can be considered the "name" of the router c. Neighbors i. Are two or more routers that have an interface on a common network 1) Example: Two routers connected on a point-to-point serial link ii. OSPF neighbors must have the following matching settings in order to establish a neighbor relationship: 1) Area ID 2) Stub area flag 3) Authentication password (if using one) 4) Hello and Dead intervals d. Adjacency i. Is a relationship between two OSPF routers that permits the direct exchange of route updates ii. OSPF will only directly share routes with neighbors that have also established adjacencies 1) Difference from EIGRP: a) EIGRP will directly share routes with all neighbors iii. Not all routers will become adjacent 1) Multi-Access Network Example: a) Routers will form adjacencies with designated and backup designated routers 2) Point to point & point to multipoint Network example: a) Routers will form adjacencies with routers on the opposite end of each connection e. Designated Router (DR) i. Is elected whenever OSPF routers are connected to the same broadcast network ii. Purpose: 1) To minimize number of adjacencies formed 2) To publicise received routing information to and from remaining routers on broadcast network or link iii. Elections: 1) Won based on router's priority level: Highest wins 2) (If priority level is tied): Router ID used as tiebreaker iv. All routers on shared network will establish adjacencies with DR and BDR 1) Ensures all router's topology tables are synchronized f. Backup Designated Router (BDR) i. Hot standby router for DR on broadcast or multicast links ii. Receives all routing updates from OSPF adjacent routers iii. Does not dispense LSA (Link State Advertisements) g. Hello protocol i. Used to provide dynamic neighbor discovery ii. Used to maintain neighbor relationships iii. Used along with LSAs to build and maintain topological database iv. Sent to multicast address: 224.0.0.5 h. Neighborship database i. Is a list of all OSPF routers for which Hello packets have been seen ii. Some of the details included and maintained: 1) Router ID 2) State i. Topological database i. Contains information from all LSA packets that have been received in one area ii. Router uses information from topological database to compute shortest path to every network 1) Information is used as input to Dijkstra algorithm j. Link State Advertisement (LSA) i. Is an OSPF data packet that contains link-state and routing information ii. It is shared among OSPF routers iii. An OSPF router will only exchange LSA packets with other routers that has established an adjacency with it k. OSPF areas i. Is a grouping or contiguous networks and routers that share: 1) Common area ID ii. Each router can be a member of more than one area at a time 1) Area ID is associated with specific interfaces on the router 2) Example: Some interfaces can be part of area 1 and others can be part of area 0 iii. All routers in an area have the same topology table iv. Note: There must be an area 0 in each OSPF network 1) Area 0 is considered the "backbone area" l. Broadcast (multi-access) i. These networks allow multiple devices to connect to or access the same network 1) Example: Ethernet ii. Enables the ability to broadcast: 1) Deliver a single packet to all nodes on a network iii. OSPF: DR and BDR must be elected for each broadcast multi access network m. Nonbroadcast multi-access (NBMA) i. These networks allow for multi-access without broadcast ability 1) Example: Frame Relay, X.25, Asynchronous Transfer Mode (ATM) ii. Need special configuration to function in OSPF n. Point-to-point i. Is a type of network topology that involves a single communication path between two routers 1) Performed using direct connection: a) Can be a physical connection like a serial cable b) Can be a logical connection like a circuit in a Frame Relay Network ii. There is no need for DRs or BDRs in a point-to-point network o. Point-to-multipoint i. Is a type of network topology where multiple destination routers connect to a single router interface ii. All interfaces on routers that the point-to-multipoint connection are in the same network iii. Can be further classified depending on whether the network supports broadcasts 3. OSPF Operation a. Three primary processes: i. Neighbor and adjacency initialization 1) General steps: a) OSPF is initialized on a router b) Router allocations memory for OSPF, neighbor and topology tables c) Router determines which interfaces are configured for OSPF d) Router checks to see if those interfaces are active e) Router sends Hello packets to OSPF multicast address: 224.0.0.5 i) Hello packets are used to: One. Discover neighbors Two. Establish adjacencies Three. Maintain relationships with other OSPF routers ii) Hello packets are: One. Periodically sent out of all OSPF enabled interfaces Two. Sent in environments that support multicast iii) Hello packets are sent at the following intervals: One. Every 10 seconds - broadcast & point-to-point networks Two. Every 30 seconds - nonbroadcast and point-to-multipoint networks ii. LSA flooding 1) Is the method that OSPF uses to share routing information 2) LSA information is shared to all OSPF routers in an area a) Information is shared via LSU (Link State Update) packets b) LSU packets contain link-state data 3) Flooding is used so that all OSPF routers have the same topology map a) Can make SPF calculations using the same data 4) Network topology is created using LSA updates 5) Flooding is used via the multicast address: 224.0.0.5 (AllSPFRouters) a) Link local multicast 6) LSA updates are sent to the below multicast addresses: 7) Network type Multicast Address Description Point-to-point 224.0.0.5 AllSPFRouters Broadcast 224.0.0.6 AllDRouters Point-to-multipoint NA NA 8) Note: a) LSA Updates indicate that something in the topology has changed b) Point-to-multipoint networks send LSA updates to the adjacent router's unicast address c) Recipients must acknowledge that update has been received after they are flooded iii. SPF tree calculation 1) In each area, each router calculates best/shortest path to every network within that area 2) Router uses information from the topology database to perform SPF calculation 3) SPF tree: a) Router is root b) Shortest path to all other networks arranged as branches c) Separate trees are constructed for each area i) Even if its the same router with interfaces in multiple areas 4) Important factor in route selection: a) Metric or cost of each potential path to a network b) Only factors to route selection with an area, does not apply to outside areas iv. OSPF metrics 1) Metric = cost a) There is a cost associated with every outgoing interface in an SPF tree 2) Cost of path = sum of costs of all outgoing interfaces along a path a) The actual value of the cost is arbitrarily defined (RF 2238) i) 108/(bandwidth configured for the interface) 3) Cost value can be changed with "ip ospf cost" command a) Value must be changed on specific interfaces i) Reason: cost is assigned to each link b) Cost can be changed from 1 - 65,535 4) Note: a) For links between routers from different vendors, cost must match for OSPF to work properly 4. Enabling OSPF a. Broad goal: Enable OSPF & configure OSPF Areas b. Enabling OSPF i. Minimum of two commands (1 for enable and 1 for area config) ii. Steps: 1) Activate OSPF & initialize with process value of 1-65535 a) R1 (config)# router ospf 1 c. Notes: i. It is possible to have more than one OSPF process running simultaneously on the same router 1) Not the same as running multi-area OSPF ii. A second OSPF process will: 1) Maintain a separate topology table 2) Manage its communication independently from the first one iii. A second OSPF process is used to connect multiple AS together 1) Only single OSPF process is covered in the CCNA 5. Configuring OSPF Areas a. Broad goals: i. Identify interfaces that should be enabled for OSPF communication ii. Identify areas in which those interfaces should reside iii. Configure the networks that will be advertised to others b. Steps: i. Enable OSPF on the router, declaring process 1 1) Router (config)# router ospf 1 ii. Define network that OSPF will operate on, and the area on which the network resides 1) Router (config-router)# network 10.0.0.0 0.255.255.255 area 0 c. Notes: i. The "network" command is configured using a wildcard mask ii. The network and associated area: 1) Will be the ones that OSPF operates on 2) Will by included in that area's OSPF LSA advertisements iii. For the example configuration: 1) OSPF will place any interface configured for the 10.0.0.0 network into area 0 iv. Areas can also be labelled using an IP address format v. Areas can be configured to be any number from 0 to 4.2 billion 6. Wildcard Example a. Configure router with four subnets connected to four different interfaces: i. 192.168.10.64/28 ii. 192.168.10.80/28 iii. 192.168.10.96/28 iv. 192.168.10.8/30 b. All interfaces need to be in area 0 c. Configuration (simple): i. R1 (config)# router ospf 1 ii. R1 (config-router)# network 192.168.10.0 0.0.0.255 area 0 iii. Notes: 1) This enables all interfaces that have an IP address assigned within the following range: a) 192.168.10.0 - 192.168.10.255 d. Configuration (advertise by subnet): i. R1 (config)# router ospf 1 ii. R1 (config-router)# network 192.168.10.64 0.0.0.15 area 0 iii. R1 (config-router)# network 192.168.10.80 0.0.0.15 area 0 iv. R1 (config-router)# network 192.168.10.96 0.0.0.15 area 0 v. R1 (config-router)# network 192.168.10.8 0.0.0.3 area 0 vi. Notes: 1) This method will work the same as the simple configuration 2) There will be more clarity in the configuration for what subnets are being advertised e. Configuration of example topology: i. ii. From Right to Left: R1, R2, R3 iii. R1 (config)# router ospf 1 iv. R1 (config-router)# network 192.168.10.64 0.0.0.7 area 0 v. R1 (config-router)# network 10.255.255.80 0.0.0.3 area 0 vi. R2 (config)# router ospf 1 vii. R2 (config-router)# network 192.168.10.48 0.0.0.7 area 0 viii. R2 (config-router)# network 10.255.255.80 0.0.0.3 area 0 ix. R2 (config-router)# network 10.255.255.8 0.0.0.3 area 0 x. R3 (config)# router ospf 1 xi. R3 (config-router)# network 192.168.10.17 0.0.0.7 area 0 xii. R3 (config-router)# network 10.255.255.10 0.0.0.3 area 0 7. Configuring Our Network With OSPF a. Notes: i. Protocol Admin Distance RIP 120 OSPF 110 Internal EIGRP 90 b. Example configuration (RIP has been enabled before config in this example) i. ii. Steps: 1) Corp router configuration: a) Corp (config)# no router rip b) Corp (config)# router ospf 132 c) Corp(config-router)# network 10.10.10.1 0.0.0.0 area 0 d) Corp(config-router)# network 172.16.10.1 0.0.0.0 area 0 e) Corp(config-router)# network 172.16.10.5 0.0.0.0 area 0 2) Note: a) For Corp, we are advertising the exact IP addresses of the interfaces to be enabled b) Alternative for D and E commands i) Corp(config-router)# network 172.16.10.0 0.0.0.255 area 0 3) SF router configuration a) SF (config)# no router rip b) SF (config)# router ospf 300 c) SF (config-router)# network 192.168.10.1 0.0.0.0 d) SF (config-router)# network 172.16.10.2 0.0.0.0 4) LA router configuration a) LA (config)# no router rip b) LA (config)# router ospf 100 c) LA (config-router)# network 192.168.20.0 0.0.0.255 area 0 d) LA (config-router)# network 172.16.0.0 0.0.255.255 area 0 5) Note: a) Hypothetical: Fa0/1 interface is connected to a link that we don't need OSPF running on i) LA (config-router)# passive-interface fastEthernet 0/1 6) Corp router config (assume it is connected to the internet using Fa0/0) a) Corp (config)#: ip route 0.0.0.0 0.0.0.0 Fa0/0 b) Corp (config)# router ospf 1 c) Corp (config-router)# default-information originate 7) Note: a) Above example shows how to configure a static route to a default gateway (gateway of last resort) b) Advertise default gateway via OSPF c) Route will be advertised as i) O*E2 - OSPF, external type 2 One. External type 1: First. Cost of an E1 route is the cost of the external metric plus the internal cost for OSPF to reach that network Two. External type 2: First. Only includes external cost d) In this example, Corp would be considered and ASBR i) ABR (area border router): One. a router with at least one interface in area 0 and other interfaces within any other area ii) ASBR (autonomous system boundary router): One. A router with one interface in an OSPF domain an another interface in any other routing protocol domain Two. External routes must be redistributed into OSPF 8) Boulder router config (from scratch): a) Router# conf t b) Router (config)#hostname boulder c) Boulder (config)# int f0/0 d) Boulder (config-if)# ip address 10.10.10.2 255.255.255.0 e) Boulder (config-if)# no shut f) Boulder (config-if)# router ospf 2 g) Boulder (config-router)# network 10.0.0.0 0.255.255.255 area 0 8. OSPF and Loopback Interfaces a. Cisco recommends: Configure loopback interfaces whenever configuring OSPF i. Used for stability purposes b. Loopback interfaces: logical interfaces i. Reason for use with OSPF: ensure there is always an active interface available for OSPF processes ii. Also useful for diagnostic purposes iii. The highest loopback interface will be selected as the OSPF router ID 1) If none are configured, then the highest IP address on an active interface is used c. Router ID i. Necessary: Router will place RIDs into its neighbor table ii. Used to advertise routes iii. Used to elect DR (designated router) and BDR (backup designated router) 1) Designated routers will create adjancencies with new routers 2) DR will exchange LSA with adjacent routers to build a topological database 9. Configuring Loopback Interface a. Steps: i. Corp (config)# int loopback 0 ii. Corp (config-if)# ip address 172.31.1.1 255.255.255.255 1) Configure using /32 mask - host mask a) Can also use 255.255.255.0, but is wasteful b) With a host mask, you can configure other loopbacks to use .2, .3, etc c) Without host mask, you'd need to configure a separate subnet per router 2) Cannot reuse this IP address for any other router iii. Repeat process for SF and LA routers, using a unique IP address for each loopback interface iv. Note: 1) OSPF will retain its current router ID until the OSPF command is deleted or the router is reloaded or interfaces are overriden 2) If a logical (loopback) interface is configured after OSPF is enabled, then it will retain the highest IPv4 address of an interface 3) It is best to configure the loopback interface before enabling OSPF 4) You can override the current RID with the router-id command b. Override Router ID i. Steps: 1) Corp (config)# router ospf 1 2) Corp (config-router)# router-id 223.255.255.254 3) Corp (config-router)# do clear ip ospf processes 4) Reset ALL OSPF processes? [no]: yes ii. Notes: 1) RID selection hierarchy: a) Default - Highest active interface b) Override A - Highest logical interface if exists c) Override A & B - router-id command c. Verification commands: i. Corp# show ip ospf 1) Shows currently running OSPF instance, process number and RID a) If RID is set to an interface IP address, then implication is no loopback is configured 10. Verifying OSPF Configuration a. Corp# show ip ospf b. Corp# show ip ospf database i. Information about number of OSPF routers in the AS ii. Neighboring router's ID iii. Comparison to EIGRP (show ip eigrp topology) 1) OSPF will reveal OSPF routers but not every link in the AS 2) EIGRP will reveal every link in the AS iv. Output is separated by area 1) Adv router - router that sent advertisement c. Corp# show ip ospf interface i. Example: 1) Corp: sh ip ospf int f0/0 ii. Displays all interface-related OSPF information iii. Includes: 1) Interface IP address 2) Area assignment 3) Process ID 4) Router ID 5) Network type 6) Cost 7) Priority 8) DR/BDR election information (if applicable) 9) Hello/Dead timer intervals 10) Adjacent neighbor information d. Corp# show ip ospf neighbor i. Displays DR or BDR if they exist ii. Neighbor Ids and priority 1) Priority = used to determine DR and BDR a) Highest priority wins iii. Displays state information, dead time, address & interface e. Note: i. Hello/dead timers and cost must match for adjacency to be formed ii. Cisco routers calculate costs differently than other vendors iii. Adjacency vs neighbor clarification: 1) Routers are neighbors if the are connected to the same subnet (maybe not) and share: a) Area ID b) Area type c) Subnet mask d) Hello/Dead interval timers e) Authentication f) See their own OSPF RID in each other's Hello packet 2) Neighbors see and understand each other but do not exchange routing information 3) Adjacencies are formed between select neighbors, which allow routing info exchanges 4) Adjacencies are formed when: a) (multi-access network) At least one is DR or BDR b) Interconnected by a point-to-point or point-to- multipoint network iv. Default - Elections don't happen on a point-to-point link 1) They will show as FULL in the neighbor table 2) FULL stands for fully adjacent f. Corp# show ip protocols i. Shows: 1) OSPF process ID 2) OSPF router ID 3) Maximum path 4) Advertised networks & area they are in 5) Bandwidth 6) Routing information sources, AD and last update 11. Exam Rundown a. Compare OSPF and RIPv1 i. OSPF - Link-state protocol that supports VLSM and classless routing ii. RIPv1 - distance-vector protocol that does not support VLSM and supports only classful routing b. Know how OSPF routers become neighbors and/or adjacent i. Neighbors: 1) Each router sees the other's Hello packets 2) Timers match between routers c. Be able to configure single-area OSPF i. Two command minimum: 1) router ospf process [id] 2) Network [address] [wildcard mask] area [#] d. Be able to verify the operation of OSPF i. show ip ospf ii. show ip ospf database iii. show ip ospf interface iv. show ip ospf neighbor