Single-Area OSPF Concepts

Copyright 2003

www.ciscopress.com

Single-Area OSPF Concepts

OSPF would choose the faster route with three T3 links, and two routers between the source and destination routers. RIP would choose the slower route with two 64kbps links, but only one router between source and destination.
Copyright 2003

www.ciscopress.com

1

Single-Area OSPF Concepts
Open Shortest Path First (OSPF) is a link-state routing protocol based on open standards. “Open”in OSPF means open to the public and non-proprietary. OSPF is becoming the preferred IGP protocol when compared with RIP v1 and v2 because it is scalable (permitting growth with minimal design change.) OSPF can be used and configured as a single area for small networks, or for large networks if hierarchical network design principles are followed.
Copyright 2003

www.ciscopress.com

Single-Area OSPF Concepts In large OSPF networks, multiple areas connect to a distribution area, area 0, also called the backbone. Defining areas –  reduces routing overhead, –  speeds up convergence, –  confines network instability to an area, –  improves performance.
Copyright 2003

www.ciscopress.com

2

Copyright 2003 www.com Large OSPF Network Copyright 2003 www.ciscopress.com 3 .ciscopress.OSPF Overview OSPF is becoming the preferred IGP protocol when compared with RIPv1 and RIPv2 because it is scalable.

ciscopress.OSPF Terminology Copyright 2003 www.ciscopress.com 4 . OSPF routers elect a Designated Router (DR) and a Backup Designated Router (BDR) that serve as focal points for routing information exchange.com Designated Routers To reduce the number of exchanges of routing information among several neighbors on the same network. Copyright 2003 www.

Distance vector protocols may cause routing loops.ciscopress.com Comparing OSPF with Distance Vector Routing Protocols •  Link-state routers do not broadcast their routing tables periodically as distance vector protocols do. The higher the speed. the lower the OSPF cost of the link. link-state routers use less bandwidth for routing table maintenance.ciscopress. which is related to speed (bandwidth). •  RIP is appropriate for small networks. •  OSPF guarantees loop-free routing.com 5 . and the best path is based on the lowest number of hops Copyright 2003 www. Therefore. Copyright 2003 www. overall consumption of bandwidth can be reduced. •  OSPF selects routes based on cost.Designated Routers Since all routers in an area have the same view of the network. •  OSPF selects the fastest loop-free path from the shortest-path first tree as the best path in the network. if only one router in that area floods updates to all other routers.

The shortest path algorithm then calculates a loop-free topology using the node (on which it is running) as the starting point and examining. •  Each node has a name. RIP v2 does support VLSMs. a Dutch computer scientist. This algorithm is simple and does not require a powerful router or a lot of memory.ciscopress.ciscopress. a metric based on bandwidth. •  Each node has a complete database of all the links ( so complete information about the physical topology is known). This limits RIP to small topologies. All OSPF routers must obtain complete information about the networks of every router to calculate the shortest path. •  Each link has a cost. however. It compares the hop counts to a destination and selects the path with the smallest distance or hops. OSPF requires more powerful routers with more memory than RIP. •  RIP selects a path to a network by adding one to the hop count reported by a neighbor. RIP v1 does not support VLSMs. OSPF has no size limits and is suitable for intermediate to large networks. Therefore. the best path is the lowest cost path. •  RIP considers a network that is more than 15 routers away to be unreachable because the number of hops is limited to 15. information it has about adjacent nodes. The algorithm considers a network to be a set of nodes connected by point-to-point links. •  OSPF selects a path using cost.in turn.com 6 . and was explained in 1959. This is a complex algorithm.com Shortest Path Algorithm In this algorithm. •  All router link-state databases are identical. RIP does not take into account the available bandwidth in best path determination. The algorithm was discovered by Dijkstra.Comparing OSPF with Distance Vector Routing Protocols •  OSPF supports VLSMs and therefore is referred to as a classless protocol. Copyright 2003 www. Copyright 2003 www.

Copyright 2003 www.ciscopress.ciscopress.com OSPF Network Types Copyright 2003 www.Shortest Path Algorithm The best path is the lowest-cost path.com 7 .

it consists of the OSPF packet header.com Hello Packets When a router starts an OSPF routing process on an interface.com Copyright 2003 8 . and link-state information is exchanged.5. This address is “all OSPF routers”. On multi-access (broadcast and non-broadcast) networks. At Layer 3 of the OSI model.ciscopress.0.DR/BDR vs Network Type Copyright 2003 www. the Hello protocol elects a designated router (DR) and a backup designated router (BDR).ciscopress. –  ensure that neighbor routers are still functioning. Hellos are sent every 10 seconds by default on broadcast multi-access and point-to-point networks.0. OSPF routers use hello packets to –  initiate new adjacencies. www. such as Frame Relay. On interfaces that connect to NBMA (non-broadcast multi-access) networks. Although the hello packet is small. The hello packet carries information that all neighbors must agree upon before an adjacency is formed. it sends a hello packet and continues to send hellos at regular intervals. For the hello packet the type field is set to 1. the default time is 30 seconds. the hello packets are addressed to the multicast address 224.

ciscopress.OSPF Hello Protocol Copyright 2003 www.ciscopress.com Steps in the Operation of OSPF Copyright 2003 www.com 9 .

com 10 .0.Maintaining Routing Information When an OSPF router notices a change in a link state. Copyright 2003 www.com Single-Area OSPF Configuration Copyright 2003 www.ciscopress.0.ciscopress. the “all OSPF DR (and BDR)” address. it multicasts an LSU packet that includes the updated LSA entry to 224.6.

called the backbone area.com Single-Area OSPF Configuration To enable OSPF routing. However a single area is assigned the number 0 and is known as area 0. may be assigned any number from 0 to 65. The wildcard mask represents the links or host addresses that can be present in this segment. OSPF configuration requires that network addresses are configured with a wildcard mask and not a subnet mask. Multiple OSPF processes can be started on the same router.535. It is rarely necessary to run more than one OSPF process on a router. Copyright 2003 www. In multi-area OSPF networks. Copyright 2003 www. Router(config)#router ospf process-id The process ID is a number that is used to identify an OSPF routing process on the router.ciscopress.Single-Area OSPF Configuration An area in the OSPF network.ciscopress. The number can be any value between 1 and 65.535.com 11 . all areas are required to connect to an area 0.

com 12 . –  the address of the interface. As with distance vector.Single-Area OSPF Configuration IP networks are advertised as follows: Router(config-router)#network address wildcard-mask area area-id The network address can be –  a whole network. OSPF uses a subnet mask when configuring IP addresses on interfaces. Copyright 2003 www.ciscopress.com Configuring the OSPF Routing Process Copyright 2003 www. The wildcard mask represents the set of host addresses that the segment supports.ciscopress. –  a subnet.

which is a logical interface. A loopback interface. When a loopback interface is configured. others on this interface. Copyright 2003 www.ciscopress.com 13 . can be configured for this purpose. regardless of the value. Higher number = higher priority. OSPF takes the highest loopback IP address as its router ID.com Configuring OSPF Loopback Address and Router Priority To create and assign an IP address to a loopback interface: Router(config)#interface loopback number Router(config-if)#ip address ip-address subnet-mask Number distinguishes this loopback from others. Copyright 2003 www. On a router that has more than one loopback interface. the Cisco IOS uses the highest local active IP address as its OSPF router ID.Configuring OSPF Loopback Address and Router Priority When the OSPF process starts. OSPF uses this address as the router ID. [If the active interface goes down.] To ensure OSPF stability there should be an active interface for the OSPF process at all times. the OSPF process has no router ID and therefore ceases to function until the interface comes up again.ciscopress. and sets the priority of this loopback vs. in the event more than one is created on this interface.

Configuring OSPF Loopback Address and Router Priority This loopback interface should be configured with an address using a 32-bit subnet mask of 255.255.com 14 .ciscopress.com Configuring OSPF Loopback Address and Router Priority Copyright 2003 www. A 32-bit (all 1s) subnet mask is called a host mask because the subnet mask specifies a network of one host.255. Copyright 2003 www.ciscopress.255.

ciscopress. the default OSPF priority is 1. Router(config-if)#ip ospf priority Number can be between 0 and 255. Because the DR role is critical.com 15 . When OSPF priorities are the same.Configuring OSPF Loopback Address and Router Priority In multi-access networks. A router with the highest OSPF priority will be selected as the DR. A router with the second highest priority will be the BDR. Copyright 2003 www. If the network type of an interface is broadcast (e. Ethernet). OSPF elects a designated router (DR) to be the focal point of all link-state updates and link-state advertisements.g. the DR and BDR retain their roles even if routers are added to the network with higher OSPF priority values. The command number show ip ospf interface will display the interface priority value as well as other key information. Note: After the election process.. A value of 0 prevents that router from being elected. the OSPF election for DR is decided on the router ID. The highest router ID is selected. Router#show ip ospf interface type number See next slide for examples.ciscopress.com Configuring OSPF Loopback Address and Router Priority To modify the OSPF priority use the ip ospf priority command on an interface that is participating in OSPF. a backup designated router (BDR) is elected to take over if the DR fails. The priorities can be set to any value from 0 to 255. Copyright 2003 www.

or 100. Copyright 2003 www.com 16 .Configuring Router Priority The priorities can be set to any value from 0 to 255.000. Router(config)#interface serial 0/0 Router(config-if)#bandwidth 64 Copyright 2003 www. To assign bandwidth to an interface: assigned. It is essential for proper OSPF operation that the correct interface bandwidth is set. where “bandwidth” is expressed in bps. Cost is calculated using the formula 108/bandwidth.com Modifying OSPF Cost Metric OSPF uses cost as the metric for determining the best route.ciscopress.ciscopress.000 bps ( 100 Mbps ) / bandwidth. A value of 0 prevents that router from being elected. and represents the bandwidth of the link to which the cost will be The Cisco IOS automatically determines cost based on the bandwidth assigned to the interface. A router with the highest OSPF priority will win the election for DR.

com 17 . You can change the cost. For 100-Mbps and Gigabit Ethernet links.com Modifying OSPF Cost Metric Copyright 2003 www. the default cost assigns the lowest cost value. to a 100 Mbps link (100 Mbps / 100 Mbps). 1.ciscopress. Use the following interface configuration command to set the link cost: Router(config-if)#ip ospf cost number Copyright 2003 www. the default cost values could cause routing to a less than desirable path.ciscopress. For example.535. The cost value can be between 1 and 65.544 Mbps.Modifying OSPF Cost Metric The default bandwidth for Cisco serial interfaces is 1. or 1544 kbps.

Routers in a specific area can be configured to authenticate each other.com Configuring OSPF Authentication By default.ciscopress. –  This key is used to generate the authentication data in the OSPF packet header. –  The password can be up to eight characters. a router trusts that –  information is coming from the correct router.ciscopress. Each OSPF interface can be assigned an authentication key for use by routers sending it information. Copyright 2003 www. –  information has not been tampered with.Modifying OSPF Cost Metric auto-cost reference-bandwidth bandwidth Copyright 2003 www. The authentication key. is a shared between the routers. known as a password.com 18 .

To encrypt authentication information: Router(config-if)#ip ospf message-digest-key key-id md5 encryption-type key The MD5 keyword specifies the type of message-digest hashing algorithm to use.com Plain Text vs. where 0 means none and 7 means proprietary.ciscopress.com 19 . Encrypted Authentication With simple authentication. authentication must be enabled: Router(config-router)#area areanumber authentication Copyright 2003 www. Neighbor routers must use the same key identifier with the same key value. The password could be easily decoded if a packet sniffer captures an OSPF packet. Copyright 2003 www. The encryption type field refers to the type of encryption. It is recommended that authentication information be encrypted.Configuring OSPF Authentication To configure OSPF authentication: Router(config-if)#ip ospf authentication-key password After the password is configured. the password is sent as plain text.ciscopress. The key is an alphanumeric password up to sixteen characters. The key-id is an identifier and takes the value in the range of 1 through 255.

•  If the digests match. scrambled data. the router believes that the source and contents of the packet have not been tampered with. The receiving router uses the shared password and the packet to recalculate the digest.ciscopress.] Copyright 2003 www.Plain Text vs. •  In the case of message-digest authentication. if any.com 20 . •  The authentication type identifies which authentication. based on the password and the packet contents. Encrypted Authentication To enable encrypted authentication:: Router(config-router)#area area-id authentication message-digest MD5 authentication creates a message digest. the authentication data field contains the key-id and the length of the message digest that is appended to the packet.ciscopress. [The message digest is like a watermark that cannot be counterfeited. is being used.com Configuring OSPF Authentication Copyright 2003 www.

On nonbroadcast networks. Copyright 2003 www.ciscopress. On broadcast OSPF networks. the network administrator should consider: – Whether there is justification that OSPF network performance will be improved. the default hello interval is 10 seconds and the default dead interval is 40 seconds. By default. – That these timers must be configured to match those of any neighboring router (because all neighboring routers must have the same timer interval values).ciscopress.Configuring OSPF Timers OSPF routers must have the same hello intervals and the same dead intervals to exchange information.] Copyright 2003 www.com 21 . This ratio can be changed. [These default values result in efficient OSPF operation and seldom need to be modified.com Configuring OSPF Timers Before changing these default values. the default hello interval is 30 seconds and the default dead interval is 120 seconds. the dead interval is four times the value of the hello interval.

Configuring OSPF Timers To configure the hello and dead intervals on an interface.com 22 .ciscopress.com Configuring OSPF Timers Copyright 2003 www. use the following commands: Router(config-if)#ip ospf hello-interval seconds Router(config-if)#ip ospf dead-interval seconds Note: Changes made on one router do not automatically apply to other routers.ciscopress. Copyright 2003 www.

Propagating a Default Route in OSPF To configure a default route: Router(config)#ip route 0.ciscopress.0.0 0. Propagating a Default Route Copyright 2003 www.0.0.ciscopress.com OSPF.0.com 23 .0 [interface | next-hop address] The following configuration statement will propagate this route to all the routers in a normal OSPF area: Router(config-router)#default-information originate Copyright 2003 www.

ciscopress. •  Authentication passwords or keys are different (inconsistent authentication configuration). Copyright 2003 www.Propagating a Default Route in OSPF An OSPF router must establish a neighbor or adjacency relationship with another OSPF router to exchange routing information.com 24 . •  Interfaces are on different network types.com Common OSPF Configuration Issues Copyright 2003 www.ciscopress. Failure to establish a neighbor relationship is caused by any of the following reasons: •  Hellos are not sent from both neighbors. •  Hello and dead interval timers are not the same (timer mismatch).

ciscopress. exstart. •  show ip route Displays contents of the routing table: routes known to router and how they were learned. their priorities. metrics and networks.com 25 . Copyright 2003 www. •  show ip ospf database Displays the contents of the topological database.ciscopress.com Verifying OSPF Configuration •  shop ip ospf Displays the number of times that the shortest path first (SPF) algorithm has been executed. including the router ID and the OSPF process ID.or full).g. filters. Copyright 2003 www.. Shows timer intervals (hello & dead). maintained by the router.Verifying OSPF Configuration •  show ip protocol Displays parameters about timers. •  show ip ospf interface Verifies that interfaces have been configured in the intended area. •  show ip ospf neighbor detail Displays list of neighbors. and their state (e. init. and the neighbor adjacencies.

com 26 .Cisco IOS Debug and Clear Commands Copyright 2003 www.ciscopress.

Sign up to vote on this title
UsefulNot useful