1 / 41

OSPF Overview

OSPF Overview. Open Shortest Path First (OSPF) is a link-state routing protocol based on open standards , most recently describes in the RFC 2328 . The Open in OSPF means that it is open to the public and is nonproprietary.

oriana
Download Presentation

OSPF Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OSPF Overview Open Shortest Path First (OSPF) is a link-state routing protocol based on open standards, most recently describes in the RFC 2328. The Open in OSPF means that it is open to the public and is nonproprietary. OSPF’s considerable capability to scale is achieved through hierarchical design. This is done by sectioning off an OSPF network into multiple areas. By defining areas in a properly designed network, an administrator can reduce routing overhead & improve performance.

  2. OSPF Overview The information gathered from OSPF neighbors is not a complete routing table. Instead, OSPF routers tell each other about the status of their connections, or links, to the internetwork. That is, OSPF routers advertise their link states. The routers build a link-state database, which is essentially a picture of which device is connected to what. Then the routers run the Shortest Path First (SPF) algorithm, Dijkstra algorithm, on the link-state database to determine the best routes to a destination. The SPF algorithm adds up the cost (usually based on bandwidth) of each link between the particular router and its destination. The router then chooses the lowest-cost path to be added to its routing table, know as the forwarding database. In general, cost decreases as the speed of the link increases. Less the cost, better the route.

  3. OSPFPacket Types OSPF routers rely on 5 different types of packets to identify their neighbors and to update link-state routing information: OSPF Packet TypeDescription Establishes & maintains adjacency information with neighbors Describes the content of an OSPF router’s link-state database Requests specific pieces of a router’s link-state database Transports link-state advertisements (LSAs) to neighbor routers Acknowledge receipt of a neighbor’s LSA Type 1 – Hello Type 2 – Database description packet Type 3 – Link-state request (LSR) Type 4 – Link-state update (LSU) Type 5 – Link-state acknowledgement (LSAck)

  4. OSPF 7 States • The key to effectively designing & trouble shooting OSPF is to understand the 7states that OSPF transitions to: • Down • Init • Two-way • ExStart • Exchange • Loading • Full adjacency

  5. Down State Down State OSPF process has not exchanged information with any neighbors, and is waiting to enter the Init state

  6. Init State Init State OSPF routers send Type 1 (hello) packets at regular intervals (usually 10 seconds) to establish special relationships with neighbor routers. When an interface receives its 1st hello packet, the router enters the Init state. Generally there are 2 kinds of relationships: 1. 2-way state 2. adjacency The router MUST receive a hello from a neighbor before it establishes any relationship.

  7. Two-Way State Two-Way State Using hello packets, every OSPF router tries to establish a two-way state with every neighbor router on the same IP network. A router enters the two-way state when it sees itself in a neighbor’s hello packet. Two-state is most basic relationship, but routing information is not shared between routers in this relationship. To learn about other routers’ link states & eventually build a routing table, every OSPF router must form at least one adjacency.

  8. ExStart State ExStart State The 1st state to full adjacency is this state. Technically, when a router & its neighbor enter the ExStart state, their conversation is characterized as an adjacency, but the routers haven’t become fully adjacent yet. ExStart is established using Type 1 Data Base Description packets (DBD). The 2 neighbor routers use these DBD packets to negotiate who is the master& who is the slave. To see this process -- use <debug ip ospf events> The router with highest OSPF router ID (IP address) is the master

  9. Exchange State Exchange State In this state, neighbor routers use Type 2 DBD packets to send each other their link-state information. If either of the routers receives information about a link that is not already in its database, the router requests a complete update from its neighbor. Complete routing information is exchanged in the loading state.

  10. Loading State Loading State After the database has been described to each router, more complete information must be request by using Type 3 packets (LSR). When a router receives an LSR, it responds with an update by using a Type 4 link-state update (LSU) packet. These Type 4 LSU packets contain the actual LSAs.

  11. Full Adjacency Full Adjacency With the loading state complete, the routers are fully adjacent. Each router keeps a list of adjacent neighbors called the adjacency database. Because adjacency is required for OSPF routers to share routing information, a router tries to become adjacent to at least one other router on each IP network to which it is connected.

  12. OSPF Router Databases Adjacency database List of all the neighbor routers to which a router has established bi-directional communication. Link-state database List of information about all other routers in the network. This database shows the network topology. Forwarding database (the routing table) A list of routes generated when an algorithm is run on the link-state database.

  13. Selecting Routes OSPF selects routes based on cost, which is related to bandwidth. The higher the bandwidth, the lower the OSPF cost for the link. OSPF selects the fastest loop free path and the shortest path first as the best path in the network. OSPF guarantees loop-free routing, whereas distance vector protocols can cause routing loops.

  14. OSPF Network Types • OSPF interfaces automatically recognize 4 types of networks: • broadcast multiaccess • non-broadcast multiaccess (NBMA) • point-to-point • point-to-multipoint (which is configured by an administrator)

  15. OSPF Network Types Network TypeDetermining CharacteristicDR Election? Broadcast multiaccess Ethernet, Token Ring or FDDI Yes Nonbroadcast multiaccess Frame relay, X.25, SMDS Yes Point-to-point PPP, HDLC No Point-to-multipoint Configured by an administrator No

  16. DR and BDR Because a significant number of routers can exist on a multiaccess network, OSPF’s designers developed a system to avoid the overhead that would be created if every router established full adjacency with every other router. Designated router (DR) Backup designated router (BDR)

  17. DR and BDR • Designated router (DR) • For every multiaccess IP network, one router will be elected the DR. This DR has 2 main functions: • to become adjacent to all other routers on the network • to act as a spokesperson for the network • Because the DR becomes adjacent to all other routers on the IP network, it is the focal point for collecting routing information (LSAs).

  18. DR and BDR Backup designated router (BDR) Because the DR could become a single point of failure, a 2nd router is elected as the BDR to provide fault tolerance. Hence the BDR must become adjacent to all router on the network & serves as the the 2nd focal point for LSAs. However, the BDR is not responsible for updating the other routers or sending network LSAs. The BDR keeps a timer on the DR’s update activity to ensure that it is operational.

  19. DR and BDR NOTE: Since there are only 2 nodes in a point-to-point network, no DR or BDR is elected.

  20. OSPF Hello Protocol At layer 3, all OSPF routers send hello packets to the multicast address 224.0.0.5. OSPF routers use hello packets to initiate new adjacencies and to ensure that adjacent neighbors haven’t disappeared. Hellos are sent every 10 seconds by default for multiaccess and point-to-point networks. For NBMA networks, such as Frame Relay, hellos are sent ever 30 seconds. Hello interval is the number of seconds that an OSPF router waits to send the next hello packet (10 sec for multi-access and P-P, but 30 sec for NBMA). Dead interval is the number of seconds that a router waits before it declares a neighbor down if the neighbor’s hello packets are no longer being received. The dead interval is 4 times the hello interval by default, 40 seconds or 120 seconds in this example.

  21. OSPF Router ID Router ID is a 32-bit number used to identify the router to the OSPF protocol. A router uses its IP address as its ID because both the router ID address must be unique within a network, as it the IP address. Because routers support multiple IP address, the highest value IP address is used as the router ID. When a router’s ID changes for any reason (interface goes down), the router must reintroduce itself to its neighbors on all links. To avoid the unnecessary overhead caused by reestablishing adjacency & re-advertising link states, an administrator assigns an IP address to a loopback interface. If a loopback interface is configured with an IP address, the Cisco IOS will use that IP address (loopback) as the router’s ID, even if the other interfaces have higher addresses.

  22. OSPF Area ID In CCNP course on routing protocols, we will learn about creating different areas for OSPF. Note that 32 bits are used to represent the area ID, and that number can be written in either decimal and dotted-decimal notation. However, you will always have an Area 0 which is defined as the backbone area.

  23. Steps in the Operation of OSPF • OSPF routers progress through five distinct steps of operation: • Establish router adjacencies • Elect a DR and BDR (if necessary) • Discover routes • Select the appropriate routes to use • Maintain routing information

  24. Electing a DR and a BDR The election process is done by the hello packets which contains router’s ID and priority value. The router with the highest priority value among adjacent neighbors is the DR, and the router with the 2nd highest priority is elected the BDR. After the DR & BDR are elected, they keep their roles until one of them fails, even if additional routers with higher priorities show up on the network. By default, OSPF routers have the same priority value of 1. An administrator can assign a priority of between 0 and 255 on any given OSPF interface. A priority of 0prevents the router from winning any election on that interface. A priority of 255 ensures at least a tie. If two routers have the same priority, then the tie breaker is who has the highest ID.

  25. 10.5.0.0/16 10.6.0.0/16 10.4.0.0/16 S1 10.6.0.1 DR E0 10.4.0.1 E1 10.5.0.1 C A B S0 10.6.0.2 BDR E0 10.5.0.2 Pt-to-pt Broadcast multiaccess Broadcast multiaccess For network 10.5.0.0, who is the DR and who is the BDR? For network 10.4.0.0, who is the DR and who is the BDR? No election of BDR, yet. For network 10.6.0.0, who is the DR and who is the BDR? No DR or BDR, because it is a point-to-point network!

  26. Discover Routes On a multiaccess network, the exchange of routing information occurs between the DR or BDR and every other router on the network. For point-to-point & point-to-multipoint network, the link partners also exchange information. But who goes first? This is determined in the ExStart state which establish a master/salve relationship between the two routers. The router with the highest ID acts as the master.

  27. Select Appropriate Routes After a router has a complete link-state database, it is ready to create its routing table so that it can forward traffic. OSPF uses the metric value cost to determine the best path to a destination. The default cost metric is based on media bandwidth. In general, cost decreases as the speed of the link increases. To calculate the lowest cost to a destination, a router uses the SPF algorithm which adds up the total costs between the local router and each destination network. If there are multiple paths to a destination, the lowest-cost path is preferred. But note that OSPF can keep up to 4 equal-cost route entries in the routing table for load balancing.

  28. Cisco IOS Default OSPF Path Costs The Cisco IOS automatically determines cost based on the bandwidth of an interface using the formula: 108 / bps (bandwidth value). MediumCost 56kbps serial link 1785 T1 (1.544Mbps) 64 E1 (2.048Mbps) 48 4-Mbps Token Ring 25 Ethernet 10 16-Mbps Token Ring 6 100-Mbps Fast Ethernet, FDDI 1

  29. Maintain Routing Information • When there is a change in a link-state, OSPF routers use a flooding process to notify other routers on the network about the change. LSU packet containing the new link-state information is sent. • point-to-point • New link-state information is sent to the 224.0.0.5 multicast address. • Multiaccess networks • If the DR or BDR needs to send information, it will be sent to all OSPF routers via 224.0.0.5. However, the other routers on a multiaccess network are adjacent only to the DR & BDR and thus can send LSUs only to them. Therefore DR & BDR have their own multicast address, 224.0.0.6. • Non-DR/BDR routers send their LSUs via 224.0.0.6. • When the DR receives and acknowledges the LSU destined for 224.0.0.6, it floods the LSU to all OSPF router on the network via 224.0.0.5.

  30. Configuring OSPF on Routers within a Single Area We will cover the commands necessary to configure the OSPF process ID, loopback IP address (router ID), OSPF priority, link cost, authentication, and hello timers. The process ID is any number between 1 and 65,535 to identify multiple OSPF processes on the same router. Router(config)# router ospfprocess-id Router(config-router)# networkaddress wildcard-mask area area-id

  31. 10.5.0.0/16 10.6.0.0/16 S1 10.6.0.1 E0 10.4.0.1 E1 10.5.0.1 C A B S0 10.6.0.2 10.4.0.0/16 E0 10.5.0.2 Area 0 RTB(config)# router ospf 1 RTB(config-router)# network 10.5.0.0 255.255.0.0 area 0 RTB(config-router)# network 10.6.0.0 255.255.0.0 area 0 OR RTB(config-router)# network 10.5.0.2 0.0.0.0 area 0 RTB(config-router)# network 10.6.0.1 0.0.0.0 area 0

  32. OSPF Verification Commands • Verification commands for OSPF: • Router# show ip protocols ; verifies routing information • Router# show ip ospf ; verifies router ID & SPF holdtime

  33. Configuring a Loopback Address for Stability When the OSPF process starts, the Cisco IOS uses the highest local IP address as its OSPF router ID, unless a loopback interface is configured for IP, in which case that address is used, regardless of its value. Though remember, the loopback interface must be configured first, and then the OSPF process configuration to override the highest interface IP address. **You must be careful in configuring the loopback. Router(config)# interface loopback0 Router(config-if)# ip address 1.1.1.1 255.255.255.255 OR Router(config)# int lo0 Router(config-if)# ip address 1.1.1.1 255.255.255.255

  34. Modifying OSPF Router Priority Administrators manipulate the DR/BDR elections by configuring the priority value to a number other than the default value of one (1). A value of 0guarantees that the router will not be elected as DR or BDR. Remember that OSPF is defined to the interface, so to configure an interface, and hence the network, NOT to be a DR or BDR, do the following: Router(config)# interface e0 Router(config-if)# ip ospf priority 0 • The verification command, show ip ospf interface, gives the following info: • which router has been elected DR and/or BDR • network type (broadcast multiaccess, etc.) • cost of link • timer intervals specific to the interface

  35. Modifying Cost For OSPF to calculate routers properly, all interfaces connected to the same linkmust agree on the cost of that link. Again, remember, the cost is per interface. Router(config)# int e0 Router(config-if)# ip ospf cost 10000 To calculate the cost for OSPF, 108 / bandwidth value

  36. Configuring Authentication Authentication is interface specific configuration. Use the following command: Router(config-if)# ip ospf authentication-key password After a password is configured, you can enable authentication on an area-wide basis by: Router(config-router)# area number authentication [message-digest] By default, authentication passwords will be sent in clear text. It is recommended that one uses the option, message-digest, so the password is hashed when it is sent over the wire. If you use message-digest, you must use the command: Router(config-if)# ip ospf message-digest-key key-id md5 [encryption-type] password

  37. Configuring Authentication Router(config-if)# ip ospf message-digest-key key-id md5 [encryption-type] password Command ParameterDescription key-id Key ID on each router must match to authenticate Md5 Required value specifying MD5 algorithm encryption-type Optional. From 0-7. Type 0 is default. 7 Cisco encryption password alphanumeric

  38. Configuring OSPF Timers For OSPF routers to exchange information, they must have the same hello intervals & same dead intervals on the interface. By default, hello interval is 10 seconds, and dead interval is 4 times hello interval, 40 seconds. However, if the intervals must be changed for efficient issues, then use the commands: Router(config-if)# ip ospf hello-interval seconds Router(config-if)# ip ospf dead-interval seconds

  39. OSPF over Nonbroadcast Networks • NBMA, such as Frame Relay, includes more than two nodes, and hence will try to elect DR & BDR. • But NBMA networks follow layer 2 rules which prevents the delivery of broadcast and multicasts messages needed to elect DR & BDR. • Cisco presents methods in CCNA4 to get around this ( illustrated in a lab assignment ): • Full-mesh Frame Relay, use the ‘network’ command to identify the nodes, or use subinterfaces • Partial-mesh Frame Relay (hub & spoke), manually configure a point-to-multipoint network

  40. Propagating Default Route in OSPF To gain access to networks that are not in the routing table, a default gateway must be set at a border router. To propagate the default route, 0.0.0.0 /0, to all the routers in a normal OSPF area, use the following configuration: Router(config-router)# default-information originate

  41. END

More Related