Single Area OSPF - Lecture

3,344 views

Published on

  • Be the first to comment

Single Area OSPF - Lecture

  1. 1. <ul><li>Single Area OSPF </li></ul><ul><li>Joanne Wagner </li></ul><ul><li>CCAI, CCNP, CSSP </li></ul>
  2. 2. Reference Material <ul><li>Jeff Doyle’s “Routing TCP/IP Vol. I,” </li></ul><ul><li>John Moy’s book on OSPF </li></ul><ul><li>OSPF RFC 2328 (2740) </li></ul>
  3. 3. OSPF Objectives <ul><li>Describe OSPF </li></ul><ul><li>Describe the designated router election process </li></ul><ul><li>List OSPF network types </li></ul><ul><li>Configure OSPF in a single area </li></ul><ul><li>Verify and troubleshoot OSPF </li></ul>
  4. 4. OSPF History <ul><li>Open Shortest Path First (OSPF) was developed by the Internet Engineering Task Force (IETF) as a replacement for the problematic RIP and is now the IETF-recommended Interior Gateway Protocol (IGP). </li></ul><ul><li>OSPF is a link state protocol that, as it’s name implies, uses Dijkstra’s Shortest Path First (SPF) algorithm and that is open – that is, it isn’t proprietary to any vendor or organization. </li></ul>
  5. 5. OSPF History (cont) <ul><li>OSPF has evolved through several RFCs. </li></ul><ul><li>Version 1 of the protocol was specified in RFC 1131; this version never progressed beyond the experimental stage. </li></ul><ul><li>Version 2 was first specified in RFC 1247, and the most recent specification is RFC 2328. </li></ul><ul><li>Version 3, which is described in RFC 2740, provides support for IPv6 routing prefixes and the larger size of IPv6 addresses. </li></ul>
  6. 6. Notes on OSPF v3 <ul><li>IPv6 requires modifications to a protocol; primarily, the protocol messages must be modified to carry addresses four times as long as IPv4 addresses. </li></ul><ul><li>OSPFv3 uses the same fundamental mechanisms as OSPFv2—the SPF algorithm, flooding, DR election, areas, and so on. Constants and variables such as timers and metrics are also the same. </li></ul><ul><li>OSPFv3 is not backward-compatible with OSPFv2. So if you want to use OSPF to route both IPv4 and IPv6, you must run both OSPFv2 and OSPFv3. </li></ul>
  7. 7. OSPF Overview <ul><li>Link-state protocols flood link-state information and allow every router to have a complete view of the network topology. </li></ul><ul><li>In OSPF, the shortest path first algorithm (discovered by Dijkstra) determines the best path – the lowest cost path to a link </li></ul>
  8. 8. OSPF Advantages <ul><li>Like all link state protocols, OSPF’s major advantages over distance vector protocols are: </li></ul><ul><ul><li>fast reconvergence </li></ul></ul><ul><ul><li>support for much larger interetworks </li></ul></ul><ul><ul><li>less susceptibility to bad routing information </li></ul></ul>
  9. 9. Other Features of OSPF <ul><li>The use of areas, which reduces the protocol’s impact on CPU and memory, contains the flow of routing protocol traffic, and makes possible the construction of hierarchical internetwork topologies. </li></ul><ul><li>Fully classless behavior, eliminating such classful problems as discontinuous subnets. </li></ul><ul><li>Support of classless route table lookups, VLSM, and supernetting for efficient address management. </li></ul><ul><li>A dimensionless, arbitrary metric. </li></ul><ul><li>Equal-cost load balancing for more efficient use of multiple paths. </li></ul><ul><li>The use of reserved multicast addresses to reduce the impact on non-OSPF speaking devices. </li></ul><ul><li>Support of authentication for more secure routing. </li></ul><ul><li>The use of route tagging for the tracking of external routes. </li></ul>
  10. 10. OSPF vs RIP <ul><li>OSPF is link-state , where RIP is distance-vector . </li></ul><ul><li>OSPF has faster convergence - Because of RIP’s hold-down timer , RIP can be quite slow to converge. </li></ul><ul><li>OSPF has no hop restriction (used for small and large networks - RIP to limited to 15 hops (small networks). </li></ul><ul><li>OSPF supports VLSM ; RIPv1 doesn’t </li></ul><ul><li>Cisco’s OSPF metric is based on bandwidth , RIP’s is based on hop count </li></ul><ul><li>Update efficiency - RIP sends entire routing table every 30 seconds , where OSPF only sends out changes when they occur . </li></ul><ul><li>OSPF also uses the concept of area to implement hierarchical routing </li></ul>
  11. 11. OSPF Metric Based on Cost <ul><li>Cost : The outgoing cost for packets transmitted from this interface. </li></ul><ul><li>Cost is an OSPF metric expressed as an unsigned 16-bit integer, from 1 to 65,535. </li></ul>
  12. 12. Cisco’s OSPF’s Metric is Based on Bandwidth <ul><li>Cisco uses a default cost of 10 8 /BW, where BW is the configured bandwidth (bandwidth command) of the interface and 10 8 (100,000,000) as the reference bandwidth . </li></ul><ul><li>Example: A serial link with a configured bandwidth of 128K would have a cost of: 100,000,000/128,000 = 781 </li></ul><ul><li>Note: Bay and some other vendors use a default cost of 1 on all interfaces, essentially making the OSPF cost reflect hop counts. </li></ul>
  13. 13. OSPF Areas <ul><li>Every OSPF router must belong to at least one area </li></ul><ul><li>Every OSPF network must have an Area 0 (backbone area) </li></ul><ul><li>All other Areas should “touch” Area 0 </li></ul><ul><ul><li>There are exceptions to this rule </li></ul></ul><ul><li>Routers in the same area have the same link-state information </li></ul>
  14. 14. OSPF Neighbor Relationships <ul><li>OSPF is capable of sophisticated communication between neighbors. </li></ul><ul><li>OSPF uses 5 different types of packets to communicate. </li></ul>
  15. 15. OSPF Packet Header
  16. 16. The OSPF Hello Protocol – Broadcast Networks <ul><li>OSPF routers send Hellos, usually every 10 seconds by default. </li></ul><ul><li>HelloInterval - Cisco default = 10 seconds and can be changed with the command ip ospf hello-interval . </li></ul><ul><li>RouterDeadInterval - The period in seconds that the router will wait to hear a Hello from a neighbor before declaring the neighbor down. Cisco uses a default of four-times the HelloInterval (4 x 10 sec. = 40 seconds) and can be changed with the command ip ospf dead-interval . </li></ul><ul><li>For routers to become adjacent, the Hello , DeadInterval and network types must be identical! </li></ul>
  17. 17. The OSPF Hello Protocol – NonBroadcast Networks <ul><li>OSPF routers send Hellos, usually every 30 seconds by default. </li></ul><ul><li>HelloInterval - Cisco default = 30 seconds and can be changed with the command ip ospf hello-interval . </li></ul><ul><li>RouterDeadInterval - The period in seconds that the router will wait to hear a Hello from a neighbor before declaring the neighbor down. Cisco uses a default of four-times the HelloInterval (4 x 30 sec. = 120 seconds) and can be changed with the command ip ospf dead-interval . </li></ul><ul><li>For routers to become adjacent, the Hello , DeadInterval and network types must be identical! </li></ul>
  18. 18. The Hello Packet
  19. 19. A Type-1 Hello Packet
  20. 20. OSPF Packet Types OSPF Type-2 (DBD) OSPF Type-3 (LSR) OSPF Type-4 (LSU) OSPF Type-5 (LSAck)
  21. 21. OSPF packet types OSPF Type-4 packets have 7 LSA packets (later)
  22. 22. Router Types
  23. 23. Route Types
  24. 24. Area Types
  25. 25. Steps to OSPF Operation <ul><li>1. Establishing router adjacencies </li></ul><ul><li>2. Electing DR and BDR </li></ul><ul><li>3. Discovering Routes </li></ul><ul><li>4. Choosing Routes </li></ul><ul><li>5. Maintaining Routing Information </li></ul>
  26. 26. OSPF States <ul><li>Down State </li></ul><ul><li>Init State </li></ul><ul><li>Two-way State </li></ul><ul><li>ExStart State </li></ul><ul><li>Exchange State </li></ul><ul><li>Loading State </li></ul><ul><li>Full Adjacency State </li></ul>
  27. 27. Steps to OSPF Operation with OSPF States <ul><li>1. Establishing router adjacencies </li></ul><ul><ul><li>Down State </li></ul></ul><ul><ul><li>Init State </li></ul></ul><ul><ul><li>Two-way State </li></ul></ul><ul><ul><li>(ExStart State unless DR/BDR election needed) </li></ul></ul><ul><li>2. Electing DR and BDR </li></ul><ul><ul><li>ExStart State with DR and BDR </li></ul></ul><ul><ul><li>Two-way State with all other routers </li></ul></ul><ul><li>3. Discovering Routes </li></ul><ul><ul><li>ExStart State </li></ul></ul><ul><ul><li>Exchange State </li></ul></ul><ul><ul><li>Loading State </li></ul></ul><ul><ul><li>Full State </li></ul></ul><ul><li>4. Choosing Routes </li></ul><ul><li>5. Maintaining Routing Information </li></ul>
  28. 28. 1. Establishing Adjacencies – Down State <ul><li>The new OSPF router is in the down state . </li></ul><ul><li>The router transmits its own hello packets to introduce itself to the segment and to find any other OSPF configured routers. </li></ul><ul><li>Sets the DR and BDR in the hello to be 0.0.0.0 </li></ul>
  29. 29. 1. Establishing Adjacencies – Down State <ul><li>RTB begins multicasts OSPF Hello packets (224.0.0.5, AllSPFRouters), advertising its own Router ID . </li></ul><ul><li>224.0.0.5: All OSPF routers should be able to transmit and listen to this address. </li></ul>
  30. 30. 1. Establishing Adjacencies – Down State <ul><li>Router ID = Highest loopback address; highest active IP address. </li></ul><ul><li>Loopback address has the advantage of never going down, thus diminishing the possibility of having to re-establish adjacencies. (more in a moment) </li></ul><ul><li>Use private ip addresses for loopbacks, so you do not inadvertently advertise a route to a real network that does not exist on your router. </li></ul>
  31. 31. 1. Establishing Adjacencies – Init State <ul><li>RTA and RTC receive Hello packets from RTB </li></ul><ul><li>RTA and RTC add RTB’s Router ID to the Neighbor ID field of the Hello packet its sends back to RTB, at the same time entering the init state . </li></ul>
  32. 32. 1. Establishing Adjacencies – Init State <ul><li>Init State </li></ul><ul><li>Specifies that the router (RTA and RTC) has received a hello packet from its neighbor (RTB), but the receiving router’s ID (RTA and RTC) was not included in the hello packet (of RTB). </li></ul><ul><li>When a router (RTA and RTC) receives a hello packet from a neighbor (RTB), the router (RTA and RTC) will list the sender’s router ID (RTB) in its hello packet as an acknowledgement that it received a valid packet. </li></ul><ul><li>It also includes a list of any other routed IDs it knows about in the hello packet before sending it out on the segment as a multicast. </li></ul>
  33. 33. 1. Establishing Adjacencies – Two-Way State <ul><li>From init state to the two-way state </li></ul><ul><li>RTB receives Hello packets from RTA and RTC (its neighbors), and sees its own Router ID (10.6.0.1) in the Neighbor ID field. </li></ul><ul><li>RTB declares takes the relationship to a new level, and declares a two-way state between itself and RTA, and itself and RTC. </li></ul>
  34. 34. 1. Establishing Adjacencies – Two-Way State <ul><li>Two-way state </li></ul><ul><li>Using Type-1 Hello packets every OSPF router tries to establish a two-way state or bi-directional communication with every neighbor router on the same IP network. </li></ul><ul><li>Among other information, these Hello packets include a list of the sender’s known OSPF neighbors. </li></ul><ul><li>A router enters the two-way state when it sees itself in a neighbor’s Hello packet. </li></ul><ul><li>To learn about other routers’ link states and eventually build a routing table, every OSPF router must form at least one adjacency and involve a series of progressions that will not just rely just on hellos, but the other four kinds of OSPF packets. </li></ul>
  35. 35. 1. Establishing Adjacencies – ExStart State <ul><li>Two-way state to ExStart state (maybe) </li></ul><ul><li>RTB now decides who to establish a full adjacency with depending upon the type of network that the particular interfaces resides on. </li></ul><ul><li>If the interface is on a point-to-point link, the routers becomes adjacent with its sole link partner and take the relationship to the next level by entering the ExStart state . </li></ul><ul><li>If the interface is on a multi-access link RTB must enter an election process to see who it will establish a full adjacency with, and, who will remain in the two-way state . </li></ul>
  36. 36. Steps to OSPF Operation with OSPF States <ul><li>1. Establishing router adjacencies </li></ul><ul><ul><li>Down State </li></ul></ul><ul><ul><li>Init State </li></ul></ul><ul><ul><li>Two-way State </li></ul></ul><ul><ul><li>(ExStart State unless DR/BDR election needed) </li></ul></ul><ul><li>2. Electing DR and BDR </li></ul><ul><ul><li>ExStart State with DR and BDR </li></ul></ul><ul><ul><li>Two-way State with all other routers </li></ul></ul><ul><li>3. Discovering Routes </li></ul><ul><ul><li>ExStart State </li></ul></ul><ul><ul><li>Exchange State </li></ul></ul><ul><ul><li>Loading State </li></ul></ul><ul><ul><li>Full State </li></ul></ul><ul><li>4. Choosing Routes </li></ul><ul><li>5. Maintaining Routing Information </li></ul>
  37. 37. 2. Electing a DR and BDR <ul><li>On point-to-point links adjacencies (don’t get this confused with being “fully adjacent” or the full state ) are established with all neighbors, because there is only one neighbor. </li></ul><ul><li>On multi-access networks,OSPF elects a DR and BDR to limit the number of adjacencies. </li></ul><ul><ul><li>Reduce routing update traffic </li></ul></ul>
  38. 38. <ul><li>DR - Designated Router </li></ul><ul><li>BDR – Backup Designated Router </li></ul><ul><li>DR’s serve as collection points for Link State Advertisements (LSAs) </li></ul><ul><li>A BDR back ups the DR. </li></ul><ul><li>If the IP network is multi-access , the OSPF routers will elect 1 DR and 1 BDR (unless there is only 1 router on the network). </li></ul>2. Electing a DR and BDR
  39. 39. 2. Electing a DR and BDR <ul><li>The formation of an adjacency between every attached router would create many unnecessary LSA (Link State Advertisements), n(n-1)/2 adjacencies. </li></ul><ul><li>Flooding on the network itself would be chaotic. </li></ul><ul><li>A router would flood an LSA to all its adjacent neighbors, which in turn would flood it to all their adjacent neighbors, and so on, creating many copies of the same LSA on the same network. </li></ul><ul><li>To prevent this problem, a Designate Router is elected on multi-access networks. </li></ul>
  40. 40. 2. Electing a DR/BDR <ul><li>Designated Router </li></ul><ul><li>A DR (Designated Router) and perhaps a BDR (Backup Designated Router) is elected for every multi-access network, using Hello packets as “ballots.” </li></ul><ul><li>Router with the highest Router ID is elected the DR. </li></ul><ul><li>But like other elections, this one can be rigged. </li></ul><ul><li>The router’s priority field can be set to either ensure that it becomes the DR or prevent it from being the DR. </li></ul><ul><li>The router can be assigned a priority between 0 and 255, with 0 preventing this router from becoming the DR (or BDR) and 255 ensuring at least a tie. (The highest Router ID would break the tie.) </li></ul>
  41. 41. 2. Electing a DR/BDR <ul><li>Backup Designated Router </li></ul><ul><li>BDR (Backup Designated Router) is elected in addition to the DR in case the DR fails. </li></ul><ul><li>The BDR is the router that wins second place in the previous process. </li></ul><ul><li>If a multi-access network only has one router, it will be the DR and there will be no BDR. </li></ul>
  42. 42. 2. DR/BDR Election Process <ul><li>The DR election process works as follows, using data transmitted in Hello Packets. </li></ul><ul><li>The first OSPF router on an IP subnet ALWAYS becomes DR. When a second router is added, it becomes BDR. </li></ul><ul><li>Additional routers added to the segment become “DROthers”. </li></ul>
  43. 43. <ul><li>All other routers, “DRother”, establish adjacencies with only the DR and BDR. </li></ul><ul><li>DRother routers multicast LSAs to only the DR and BDR </li></ul><ul><ul><li>(224.0.0.6 - all DR routers) </li></ul></ul><ul><li>DR sends LSA to all adjacent neighbors </li></ul><ul><ul><li>( 224.0.0.5 - all OSPF routers) </li></ul></ul>2. Electing a DR/BDR DRother Routers
  44. 44. <ul><li>Backup Designated Router (BDR) </li></ul><ul><li>Listens, but doesn’t act. </li></ul><ul><li>If LSA is sent, BDR sets a timer. </li></ul><ul><li>If timer expires before it sees the reply from the DR, it becomes the DR and takes over the update process. </li></ul><ul><li>The process for a new BDR begins. </li></ul>2. Electing a DR/BDR
  45. 45. <ul><li>Once a DR is established, a new router that enters the network with a higher priority or router id will NOT become the DR or BDR. </li></ul><ul><li>If DR fails, BDR takes over as DR and selection process for new BDR begins. </li></ul><ul><li>State of the relationship </li></ul><ul><ul><li>DRothers enter ExStart state with DR and BDR and two-way state with all other routers </li></ul></ul>2. Electing a DR/BDR
  46. 46. <ul><li>DR Election </li></ul><ul><li>Router with the highest interface priority (0 = cannot become DR or BDR) </li></ul><ul><li>Router with the highest router ID. BDR is the second highest </li></ul><ul><li>Adjacencies and multicasting </li></ul><ul><li>All other routers, DRother, establish adjacencies with only the DR and BDR. </li></ul><ul><li>All routers continue to multicast Hello packets to AllSPFRouters (224.0.0.5) so they can track neighbors. </li></ul><ul><li>But updates (LSAs) are multicast to DR and BDR only (224.0.0.6 - AllDRrouters) and in turn </li></ul><ul><li>DR floods updates (LSAs) to all adjacent neighbors (224.0.0.5 - AllSPFRrouters) </li></ul>2. Electing a DR/BDR SUMMARY
  47. 47. <ul><li>● Real DR and BDR election process </li></ul><ul><li> ● The first router up on the network is the DR. </li></ul><ul><ul><li>● The second router up on the network is the BDR. </li></ul></ul><ul><ul><li>● If the DR fails then the BDR becomes DR and another router is elected the BDR. </li></ul></ul><ul><ul><li>● The DR does not change just because another router comes on line with a higher priority or a higher router id. </li></ul></ul><ul><ul><li>● If both the existing DR and BDR fail and a new DR must be elected, the router with the highest priority is elected DR. </li></ul></ul><ul><ul><li>● If there's a tie, the router with the highest router id is elected DR. </li></ul></ul>Summary of – Real World!!!!
  48. 48. Steps to OSPF Operation with OSPF States <ul><li>1. Establishing router adjacencies </li></ul><ul><ul><li>Down State </li></ul></ul><ul><ul><li>Init State </li></ul></ul><ul><ul><li>Two-way State </li></ul></ul><ul><ul><li>(ExStart State unless DR/BDR election needed) </li></ul></ul><ul><li>2. Electing DR and BDR </li></ul><ul><ul><li>ExStart State with DR and BDR </li></ul></ul><ul><ul><li>Two-way State with all other routers </li></ul></ul><ul><li>3. Discovering Routes </li></ul><ul><ul><li>ExStart State </li></ul></ul><ul><ul><li>Exchange State </li></ul></ul><ul><ul><li>Loading State </li></ul></ul><ul><ul><li>Full State </li></ul></ul><ul><li>4. Choosing Routes </li></ul><ul><li>5. Maintaining Routing Information </li></ul>
  49. 49. 3. Discovering Routes and Reaching Full State “ adjacent” OSPF Type-2 (DBD) OSPF Type-2 (DBD) OSPF Type-2 (DBD) OSPF Type-5 (LSAck) OSPF Type-3 (LSR) OSPF Type-4 (LSU) OSPF Type-5 (LSAck)
  50. 50. 3. Discovering Routes <ul><li>ExStart State </li></ul><ul><li>ExStart state - prepare for initial database exchange </li></ul><ul><li>Routers now ready to exchange routing information. </li></ul><ul><ul><li>Between routers on a point-to-point network </li></ul></ul><ul><ul><li>On a multi-access network between the DRothers and the DR and BDR. </li></ul></ul><ul><li>Routers in ExStart state are characterized as adjacent, but have not yet become full adjacent as they have not exchanged data base information. </li></ul><ul><li>But who goes first in the exchange? </li></ul><ul><li>ExStart is established by exchanging DBD packets. </li></ul><ul><li>Purpose of ExStart is to establish a master/slave relationship between the two routers decided by the higher router id. </li></ul><ul><li>Once the roles are established they enter the exchange state. </li></ul>
  51. 51. Notes on ExStart <ul><li>When the master/slave negotiation begins in the ExStart state, both neighbors will claim to be the master by sending an empty DD packet with the master/slave bit (MS-bit) set to one. </li></ul><ul><li>The DD sequence number in these two packets will be set to the originating router’s idea of what the sequence number should be. </li></ul><ul><li>The neighbor with the lower Router ID will become the slave and will reply with a DD packet in which the MS-bit is zero and the DD sequence number is set to the master’s sequence number. </li></ul><ul><li>This DD packet is the first packet populated with LSA summaries. </li></ul>
  52. 52. 3. Discovering Routes and reaching Full State “ adjacent” OSPF Type-2 (DBD) OSPF Type-2 (DBD) OSPF Type-2 (DBD) OSPF Type-5 (LSAck) OSPF Type-3 (LSR) OSPF Type-4 (LSU) OSPF Type-5 (LSAck)
  53. 53. <ul><li>Exchange State </li></ul><ul><li>Exchange state - routers exchange one or more Type-2 DBDs (Database Description) packets, which is a summary of the link-state database (type field, originating router, advertising router, sequence number, checksum – NOT metric) </li></ul><ul><ul><li>send LSAcks to verify </li></ul></ul><ul><li>Routers compare these DBDs with information in its own database. </li></ul><ul><li>If the router receives information about a link that is not already in its database, the router requests a complete update from its neighbor. </li></ul><ul><li>Complete routing information is exchanged in the loading state . </li></ul>3. Discovering Routes
  54. 54. Notes on ExChange State <ul><li>In the Exchange state, the neighbors will synchronize their link state databases by describing all entries in their respective link state databases. </li></ul><ul><li>The Database Summary List is populated with the headers of all LSAs in the router’s database; Database Description packets containing the listed LSA headers are sent to the neighbor. </li></ul>
  55. 55. Notes on ExChange State (cont) <ul><li>If either router sees that its neighbor has an LSA that is not in its own database, or that the neighbor has a more recent copy of a known LSA, it places the LSA on the Link State Request list and sends a Link State Request packet asking for a complete copy of the LSA in question. </li></ul><ul><li>Link State Update packets convey the requested LSAs. As the requested LSAs are received, they are removed from the Link State Request List. </li></ul>
  56. 56. Notes on ExChange State (cont) <ul><li>The master controls the synchronization process and ensures that only one DD packet is outstanding at a time. </li></ul><ul><li>When the slave receives a DD packet from the master, the slave acknowledges the packet by sending a DD packet with the same sequence number. </li></ul><ul><li>The slave sends DD packets only in response to DD packets it receives from the master. </li></ul>
  57. 57. 3. Discovering Routes and reaching Full State “ adjacent” OSPF Type-2 (DBD) OSPF Type-2 (DBD) OSPF Type-2 (DBD) OSPF Type-5 (LSAck) OSPF Type-3 (LSR) OSPF Type-4 (LSU) OSPF Type-5 (LSAck)
  58. 58. <ul><li>Loading State </li></ul><ul><li>Loading state </li></ul><ul><ul><li>If the other router has more updated information, this router sends a LSR (Link-State Request) packet requesting more information </li></ul></ul><ul><ul><li>Remote router sends the requested information in a LSA Type-4 packet </li></ul></ul><ul><ul><li>Router sends LSAck to acknowledge receipt </li></ul></ul><ul><li>Full State </li></ul><ul><li>Full state - after all LSRs have been updated. </li></ul><ul><li>At this point the routers should have identical link-state databases </li></ul>3. Discovering Routes and reaching Full State
  59. 59. 3. Discovering Routes and reaching Full State “ adjacent” OSPF Type-2 (DBD) OSPF Type-2 (DBD) OSPF Type-2 (DBD) OSPF Type-5 (LSAck) OSPF Type-3 (LSR) OSPF Type-4 (LSU) OSPF Type-5 (LSAck)
  60. 60. 4. Choosing Routes <ul><li>The router now has a complete link-state database </li></ul><ul><li>Now the router is ready to create a routing table, but first needs to run the Shortest Path First Algorithm on the link state database, which will create the SPF tree. </li></ul>
  61. 61. 4. Choosing Routes <ul><li>Dijkstra’s algorithm is used to calculate the Shortest Path Tree from the LSAs in the link state database. </li></ul><ul><li>SPF, Shortest Path First calculations places itself as the root and creating a “tree diagram” of the network </li></ul>
  62. 62. <ul><li>The LSAs that build the database contain three important pieces of generic information: RouterID of the sender of the LSA, the NeighborID , and cost of the link between the Router and the neighbor (I.e the state of the link or link-state). </li></ul><ul><li>Doyle Chapter 4 and Radia Perlman’s book, Interconnections, has some excellent examples on this process. </li></ul>4. Choosing Routes
  63. 63. <ul><li>Cost = 10 8 /BW </li></ul><ul><li>OSPF basis routing metrics on cost. </li></ul><ul><li>Cisco routers, cost = 10 8 /BW </li></ul><ul><li>BW is the configured bandwidth for an interface (See CCNA IGRP information) </li></ul><ul><li>Cisco uses a default cost of 10 8 /BW, where BW is the configured bandwidth (bandwidth command) of the interface and 10 8 (100,000,000) as the reference bandwidth . </li></ul><ul><li>Example: A serial link with a configured bandwidth of 128K would have a cost of: 100,000,000/128,000 = 781 </li></ul><ul><li>The cost of a route is the sum of the costs of all the outgoing interfaces to a destination . </li></ul><ul><li>In general, cost decreases as the speed of the link increases. </li></ul><ul><li>RTB’s 10 Mbps Ethernet interface has a lower cost than its T-1, 1.544 Mbps interface. </li></ul>4. Choosing Routes
  64. 64. <ul><li>Cisco default interface costs: </li></ul><ul><li>56-kbps serial link—Default cost is 1785 </li></ul><ul><li>64-kbps serial link—Default cost is 1562 </li></ul><ul><li>T1 (1.544-Mbps serial link)—Default cost is 65 </li></ul><ul><li>E1 (2.048-Mbps serial link)—Default cost is 48 </li></ul><ul><li>4-Mbps Token Ring—Default cost is 25 </li></ul><ul><li>Ethernet—Default cost is 10 </li></ul><ul><li>16-Mbps Token Ring—Default cost is 6 </li></ul><ul><li>FDDI—Default cost is 1 </li></ul><ul><li>Note : Cisco routers default to T1 (1.544 Mbps) on all serial interfaces and require manual modification with the bandwidth command. </li></ul>4. Choosing Routes
  65. 65. <ul><li>Modifying the cost </li></ul><ul><li>bandwidth command can be used to change the bandwidth metric on an interface and used in the 10 8 /BW calculation: </li></ul><ul><li>RTB(config)# inter s 0 </li></ul><ul><li>RTB(config-if)# bandwidth 56 (in Kbps) </li></ul><ul><li>Note: The metric for this interface is now 1785. </li></ul><ul><li>ip ospf cost is used when converting the metric between routers from different vendors. It overrides the default cost and becomes the metric for that interface. </li></ul><ul><li>RTB(config)# inter s 0 </li></ul><ul><li>RTB(config-if)# ip ospf cost 1000 </li></ul><ul><li>Note: The metric for this interface is now 1000. </li></ul><ul><li>Note : For the Cisco IOS cost formula to be accurate it is important to have appropriate costs on both sides of a link . </li></ul>4. Choosing Routes
  66. 66. <ul><li>SPF Holdtime </li></ul><ul><li>SPF algorithm is CPU intensive and takes some time depending upon the size of the area, the number of routers, the size of the link state database. </li></ul><ul><li>A flapping link can cause an OSPF router to keep on recomputing a new routing table, and never converge. </li></ul><ul><li>To minimize this problem: </li></ul><ul><ul><li>SPF calculations are delayed by 5 seconds after receiving an LSU (Link State Update) </li></ul></ul><ul><ul><li>Delay between consecutive SPF calculations is 10 seconds </li></ul></ul><ul><li>You can configure the delay time between when OSPF receives a topology change and when it starts a shortest path first (SPF) calculation ( spf-delay ). You can also configure the hold time between two consecutive SPF calculations ( spf-holdtime ). </li></ul><ul><li>Router(config-router)# timers spf spf-delay spf-holdtime </li></ul>4. Choosing Routes
  67. 67. 5. Maintaining Routing Info <ul><li>Routes are in the routing table (show ip route) </li></ul><ul><li>Flooding process </li></ul><ul><li>When there is a change in a link-state, (down link, new link information,…) OSPF routers use a flooding process to notify other routers about the change. </li></ul><ul><li>The Hello protocol uses its dead interval timer for declaring a link partner down. </li></ul><ul><li>If a router doesn’t hear from a link state neighbor for a time period exceeding the dead interval (usually 4 x Hello interval = 40 seconds), it declares that neighbor down. </li></ul>
  68. 68. 5. Maintaining Routing Info <ul><li>Flooding Process: Sending out LSUs </li></ul><ul><li>When the router needs to send out an LSU (OSPF Type-4) containing the new link-state information, it sends it to: </li></ul><ul><ul><li>Point-to-point links (No DR/BDR): LSU sent to 224.0.0.5 AllSPFRouters </li></ul></ul><ul><ul><li>Multi-access networks : LSU sent to 224.0.0.6 AllDRrouters (DR/BDR) </li></ul></ul><ul><ul><ul><li>When DR receives and acknowledges LSU, it floods the LSU to 224.0.0.5 AllSPFRouters. </li></ul></ul></ul><ul><ul><ul><li>Each router acknowledges the receipt of the of the LSU with a LSAck back to the DR. </li></ul></ul></ul><ul><li>Receiving router(s) continue with the flooding of the LSU. </li></ul>
  69. 69. <ul><li>Recalculating SPF </li></ul><ul><li>Upon receiving an LSU with new information, OSPF router: </li></ul><ul><ul><li>Updates its link-state database </li></ul></ul><ul><ul><li>After SPF hold timer expires (5 seconds), router runs SPF algorithm and creates a new routing table </li></ul></ul><ul><ul><li>Router uses new routing table </li></ul></ul>5. Maintaining Routing Info
  70. 70. <ul><li>Rtr(config)# router ospf process-id </li></ul><ul><li>Rtr(config-router)# network address wildcard-mask area area-id </li></ul><ul><li>Tells OSPF what interfaces to send and receive updates on. </li></ul><ul><li>Wildcard is necessary because OSPF supports CIDR and VLSM </li></ul><ul><li>See McGregor p.167 Tech Note </li></ul><ul><li>0.0.0.0 255.255.255.255 means all IP interfaces </li></ul><ul><li>Rtr(config)# router ospf 10 </li></ul><ul><li>Rtr(config-router)# network 10.5.1.0 0.0.0.255 area 0 </li></ul>Network Command
  71. 71. <ul><li>Bandwidth command </li></ul><ul><li>Rtr(config-if)# bandwidth 128 (in Kbps) </li></ul><ul><li>Set the bandwidth metric on a specific interface. </li></ul><ul><li>ip ospf cost command </li></ul><ul><li>RTB(config-if)# ip ospf cost 1000 </li></ul><ul><li>Configures the cost metric for a specific interface </li></ul>Bandwidth command and ip ospf cost command
  72. 72. <ul><li>Loopback interface </li></ul><ul><li>Rtr(config)# interface loopback 0 </li></ul><ul><li>Rtr(config-if)# ip add 10.1.1.1 255.255.255.0 </li></ul><ul><li>Very useful in setting Router IDs. </li></ul><ul><li>Configuring OSPF Router Priority (DR/BDR) </li></ul><ul><li>Rtr(config)# interface fastethernet 0 </li></ul><ul><li>Rtr(config-if)# ip ospf priority <0-255> </li></ul><ul><li>Higher priority becomes DR/BDR </li></ul><ul><li>Default = 1 </li></ul><ul><li>0 = Ineligible to become DR/BDR </li></ul>
  73. 73. <ul><li>Rtr(config-if)# ip ospf authentication-key passwd </li></ul><ul><li>or </li></ul><ul><li>Rtr(config-if)# ip ospf message-digest-key key-id md5 [ encryption-type ] password </li></ul><ul><li>password = Clear text unless message-digest is used. </li></ul><ul><li>Key-id = 1 to 255, must match on each router to authenticate. </li></ul><ul><li>Encryption-type = 0 to 7, 0 is default, 7 is Cisco proprietary encryption </li></ul><ul><li>After a password is configured, you enable authentication for the area on all participating area routers with: </li></ul><ul><li>Rtr(config-router)# area area authentication [ message-digest ] </li></ul><ul><li>message-digest option must be used if using message-digest-key </li></ul><ul><li>If optional message-digest is used, a message digest, or hash, of the password is sent. </li></ul>Configuring Authentication
  74. 74. <ul><li>RouterA </li></ul><ul><li>interface Serial1 </li></ul><ul><li>ip address 192.16.64.1 255.255.255.0 </li></ul><ul><li>ip ospf authentication-key secret </li></ul><ul><li>! </li></ul><ul><li>router ospf 10 </li></ul><ul><li>network 192.16.64.0 0.0.0.255 area 0 </li></ul><ul><li>network 70.0.0.0 0.255.255.255 area 0 </li></ul><ul><li>area 0 authentication </li></ul>RouterB interface Serial2 ip address 192.16.64.2 255.255.255.0 ip ospf authentication-key secret ! router ospf 10 network 172.16.0.0 0.0.255.255 area 0 network 192.16.64.0 0.0.0.255 area 0 area 0 authentication s1 s2 192.16.64.1/24 192.16.64.2/24 70.0.0.0/8 172.16.0.0/16 RouterA RouterB Configuring Authentication – Clear Text
  75. 75. <ul><li>RouterA </li></ul><ul><li>interface Serial1 </li></ul><ul><li>ip address 192.16.64.1 255.255.255.0 </li></ul><ul><li>ip ospf message-digest-key 1 md5 secret </li></ul><ul><li>! </li></ul><ul><li>router ospf 10 </li></ul><ul><li>network 192.16.64.0 0.0.0.255 area 0 </li></ul><ul><li>network 70.0.0.0 0.255.255.255 area 0 </li></ul><ul><li>area 0 authentication message-digest </li></ul>RouterB interface Serial2 ip address 192.16.64.2 255.255.255.0 ip ospf message-digest-key 1 md5 secret ! router ospf 10 network 172.16.0.0 0.0.255.255 area 0 network 192.16.64.0 0.0.0.255 area 0 area 0 authentication message-digest s1 s2 192.16.64.1/24 192.16.64.2/24 70.0.0.0/8 172.16.0.0/16 RouterA RouterB Configuring Authentication – MD5 Authentication
  76. 76. <ul><li>Rtr(config-if)# ip ospf hello-interval seconds </li></ul><ul><li>Rtr(config-if)# ip ospf dead-interval seconds </li></ul><ul><li>For OSPF routers to be able to exchange information, the must have the same hello intervals and dead intervals. </li></ul><ul><li>By default, the hello interval is 4 times the dead interval, so the a router has four chances to send a hello packet being declared dead. (not required) </li></ul><ul><li>Defaults </li></ul><ul><li>On broadcast networks hello interval = 10 seconds, dead interval 40 seconds. </li></ul><ul><li>On non-broadcast networks hello interval = 30 seconds, dead interval 120 seconds. </li></ul>Configuring Timers
  77. 77. Configuring OSPF timers - Warning <ul><li>A network administrator is allowed to choose these timer values. </li></ul><ul><ul><li>A justification that OSPF network performance will be improved is needed prior to changing the timers. These timers must be configured to match those of any neighboring router. </li></ul></ul><ul><li>Note : For routers to become adjacent, the Hello , DeadInterval and network types must be identical between routers or Hello packets get dropped! </li></ul>
  78. 78. OSPF, propagating a default route <ul><li>Entrance(config)# ip route 0.0.0.0 0.0.0.0 serial 0 </li></ul><ul><li>Entrance(config)# router ospf 1 </li></ul><ul><li>Entrance(config-router)# network 10.0.0.0 0.0.0.255 area 0 </li></ul><ul><li>Entrance(config-router)# network 11.0.0.0 0.0.0.255 area 0 </li></ul><ul><li>Entrance(config-router)# default-information originate </li></ul>ISP Entrance Engineering Marketing ip route 0.0.0.0/0 Static Route 0.0.0.0/0 0.0.0.0/0 Automatically Propagated s0 10.0.0.0/24 11.0.0.0/24 Engineering and Marketing will have 0.0.0.0/0 default routes forwarding packets to the Entrance router.
  79. 79. <ul><li>OSPF Routing Protocol Information </li></ul><ul><li>Rtr# show ip protocols </li></ul><ul><li>OSPF Specific Information </li></ul><ul><li>Rtr# show ip ospf </li></ul><ul><li>Number of SPF calculations, timers, area information,... </li></ul><ul><li>OSPF Routing Table </li></ul><ul><li>Rtr# show ip route </li></ul>OSPF Show Commands
  80. 80. <ul><li>OSPF Interface Information </li></ul><ul><li>Rtr# show ip ospf interface </li></ul><ul><li>Ethernet0 is up, line protocol is up </li></ul><ul><li>Internet Address 206.202.2.1/24, Area 1 </li></ul><ul><li>Process ID 1 , Router ID 1.2.202.206 , Network Type BROADCAST , Cost: 10 </li></ul><ul><li>Transmit Delay is 1 sec, State BDR, Priority 1 </li></ul><ul><li>Designated Router (ID) 2.2.202.206 , Interface address 206.202.2.2 </li></ul><ul><li>Backup Designated router (ID) 1.2.202.206 , Interface address 206.202.2.1 </li></ul><ul><li>Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 </li></ul><ul><li>Hello due in 00:00:00 </li></ul><ul><li>Neighbor Count is 1, Adjacent neighbor count is 1 </li></ul><ul><li>Adjacent with neighbor 2.2.202.206 (Designated Router) </li></ul><ul><li>Suppress hello for 0 neighbor(s) </li></ul><ul><li>Serial0 is up, line protocol is up </li></ul><ul><li>Internet Address 206.202.1.2/24, Area 1 </li></ul><ul><li>Process ID 1, Router ID 1.2.202.206, Network Type POINT_TO_POINT , Cost: 64 </li></ul><ul><li>Transmit Delay is 1 sec, State POINT_TO_POINT, </li></ul><ul><li>Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 </li></ul><ul><li>Hello due in 00:00:04 </li></ul><ul><li>Neighbor Count is 1, Adjacent neighbor count is 1 </li></ul><ul><li>Adjacent with neighbor 2.0.202.206 </li></ul><ul><li>Suppress hello for 0 neighbor(s) </li></ul>
  81. 81. <ul><li>RouterB# show ip ospf neighbor </li></ul><ul><li>Neighbor ID Pri State Dead Time Address Interface </li></ul><ul><li>1.5.202.206 1 FULL/DROTHER 00:00:33 206.202.0.3 Ethernet0 </li></ul><ul><li>1.10.202.206 1 FULL/BDR 00:00:32 206.202.0.4 Ethernet0 </li></ul><ul><li>1.0.202.206 1 FULL/DROTHER 00:00:30 206.202.0.1 Ethernet0 </li></ul><ul><li>1.2.202.206 1 FULL/ - 00:00:32 206.202.1.2 Serial0 </li></ul><ul><li>OSPF routers keep a list of all neighbors that they have established bi-directional communication with. </li></ul>Displaying Adjacencies
  82. 82. <ul><li>Rtr# show ip ospf database </li></ul><ul><li>Displays the link state database </li></ul><ul><li>OSPF routers keep track of all other routers in the internetwork. </li></ul>Displaying the Link State Database
  83. 83. NBMA <ul><li>Non-Broadcast Multi-access Access Networks. </li></ul><ul><ul><li>Frame Relay </li></ul></ul><ul><ul><li>X.25 </li></ul></ul><ul><li>Without broadcasts and multicasts, DR/BDR election is problematic </li></ul>
  84. 84. NBMA Networks and OSPF
  85. 85. <ul><li>Router# show ip ospf interface interface number </li></ul><ul><li>Router(config-if)# ip ospf network ? </li></ul><ul><ul><li>Broadcast </li></ul></ul><ul><ul><li>nonbroadcast </li></ul></ul><ul><ul><li>point-to-point </li></ul></ul><ul><ul><li>point-to-mulitpoint </li></ul></ul>Network Types
  86. 86. Full mesh
  87. 87. Point-to-point uses subinterfaces
  88. 88. Point-to-multipoint
  89. 89. <ul><li>NBMA (Frame Relay, X.25) </li></ul><ul><li>non-broadcast - (default on Frame Relay) Uses DR/BDR. Treats network more like an Ethernet network. Must have either a full-mesh network or frame relay map statements , so that every router on the subnet can communicate with each other. </li></ul><ul><li>point-to-multipoint - Works like a collection of point-to-point networks. Routers advertise individual links to other routers, no matter how complicated the frame relay network. Increased bandwidth requirements due to router LSAs and no DR/BDR </li></ul><ul><li>point-to-point - Does not scale well for large networks </li></ul>
  90. 90. Issues with large OSPF nets <ul><li>Frequent SPF calculations </li></ul><ul><li>Large routing table </li></ul><ul><li>Large link-state table </li></ul>
  91. 91. <ul><li>Labs: </li></ul><ul><ul><li>2.3.1 Configuring the OSPF Routing Process </li></ul></ul><ul><ul><li>2.3.2 Configuring OSPF with Loopback Addresses </li></ul></ul><ul><ul><li>2.3.3 Modifying OSPF Cost Metric </li></ul></ul><ul><ul><li>2.3.4 Configuring OSPF Authentication </li></ul></ul><ul><ul><li>2.3.5 Configuring OSPF Timers </li></ul></ul><ul><ul><li>2.3.6 Propagating Default Routes in an OSPF Domain </li></ul></ul><ul><li>e-Labs: </li></ul><ul><ul><li>2.3.1 Configuring OSPF </li></ul></ul><ul><ul><li>2.3.2 Configuring OSPF with Loopback Addresses </li></ul></ul><ul><ul><li>2.3.3 Modifying OSPF Cost Metric </li></ul></ul><ul><ul><li>2.3.4 Configuring OSPF Authentication </li></ul></ul><ul><ul><li>2.3.5 Configuring OSPF Timers </li></ul></ul><ul><ul><li>2.3.6 Propagate Default Route Information in an OSPF Domain </li></ul></ul>Correct the typo in the lab book
  92. 92. Labs <ul><li>2.3.1 Configuring the OSPF Routing Process </li></ul><ul><ul><li>Pay attention on the bits of the mask on each interfaces </li></ul></ul><ul><ul><li>When configuring the OSPF one should use wildcard mask but not subnet mask. </li></ul></ul><ul><li>2.3.2 Configuring OSPF with Loopback Addresses </li></ul><ul><ul><li>Please remember what we covered in the lecture about the DR/BDR election process. </li></ul></ul><ul><li>2.3.3 Modifying OSPF Cost Metric </li></ul><ul><ul><li>Modify the cost will change the SPF process </li></ul></ul><ul><ul><ul><li>COD has 2 different types of serial cards installed on the router. Please check the label of your serial card. </li></ul></ul></ul><ul><ul><ul><li>If you have the card labeled “ 2T ”, it is a T1 card and the speed is 1.544 Mb and the OSPF cost is 64 . </li></ul></ul></ul><ul><ul><ul><li>If you have the card labeled “ 2A/S ”, it is a Two-Port Asynchronous/Synchronous WIC card and the speed is 128 Kb and the OSPF cost is 781 . </li></ul></ul></ul>
  93. 93. Labs <ul><li>2.3.4 Configuring OSPF Authentication </li></ul><ul><ul><li>Step 7 Setup up OSPF authentication </li></ul></ul><ul><ul><li>b. In the interface configuration mode on Serial 0, enter the command </li></ul></ul><ul><ul><ul><li>ip ospf messagedigest-key 1 md5 7 asecret . </li></ul></ul></ul><ul><ul><ul><li>If you receive message such as “%OSPF-3-INVALID_ENCR_PASSWORD : Invalid encrypted password [chars]. “ It is telling you that you are suppose to provide encrypted password, but not clear text password. For the purpose of this lab, just remove the word “7” and move on with the rest of the lab. </li></ul></ul></ul><ul><ul><ul><li>Explanation    The user-specified encrypted password is invalid. If the specified encrypted password is invalid, an error message will be printed during configuration. </li></ul></ul></ul><ul><ul><ul><li>Recommended Action    Perform one of the following actions: </li></ul></ul></ul><ul><ul><ul><li>– Ensure that a clear text password is used and that the service password-encryption command is entered for password encryption. </li></ul></ul></ul><ul><ul><ul><li>– Ensure that the specified encrypted password is valid. </li></ul></ul></ul><ul><li>2.3.5 Configuring OSPF Timers </li></ul><ul><ul><li>This lab shows you how to change timer, but don’t do this on the real operational network unless you talk to your boos why do you want to change the timer. </li></ul></ul><ul><li>2.3.6 Propagating Default Routes in an OSPF Domain </li></ul>
  94. 94. Labs <ul><li>2.3.4 Configuring OSPF Authentication </li></ul><ul><ul><li>Step 7 Setup up OSPF authentication </li></ul></ul><ul><ul><li>b. In the interface configuration mode on Serial 0, enter the command: ip ospf messagedigest-key 1 md5 7 asecret . </li></ul></ul>This is how it really works No 7 encryption type Now you see the 7 Service password-encryption
  95. 95. Labs Errata
  96. 96. The End <ul><li>Questions? </li></ul>What will be the result of the DR and BDR elections for this single area OSPF network? (Choose three.) HQ will be DR for 10.4.0.0/16. Router A will be DR for 10.4.0.0/16. HQ will be BDR for 10.4.0.0/16. Router A will be DR for 10.5.0.0/16. Remote will be DR for 10.5.0.0/16 . Remote will be BDR for 10.5.0.0/16. <ul><li>*. Decision process: </li></ul><ul><li>Which segment will have election? </li></ul><ul><li>Priority? </li></ul><ul><li>Router ID (each router will only has 1 ID)? </li></ul><ul><ul><li>Highest Loopback IP address? </li></ul></ul><ul><ul><li>Highest physical IP address (include serial interface)? </li></ul></ul>
  97. 97. The End <ul><li>Questions? </li></ul>The routers in the diagram are configured as shown. The loopback interface on router R1 is labeled as lo0 . All OSPF priorities are set to the default except for Ethernet0 of router R2, which has an OSPF priority of 2. What will be the result of the OSPF DR/BDR elections on the 192.1.1.0 network? (Choose two.) R1 will be the DR R1 will be the BDR R2 will be the DR R2 will be the BDR R3 will be the DR R3 will be the BDR <ul><li>*. Decision process: </li></ul><ul><li>Which segment will have election? </li></ul><ul><li>Priority? </li></ul><ul><li>Router ID (each router will only has 1 ID)? </li></ul><ul><ul><li>Highest Loopback IP address? </li></ul></ul><ul><ul><li>Highest physical IP address (include serial interface)? </li></ul></ul>
  98. 98. Lesson you should have learned from this module <ul><li>What is link state routing protocol? </li></ul><ul><li>Know how to setup OSPF route and network statement with wildcard mask and area ID </li></ul><ul><li>How to setup and calculate “cost” </li></ul><ul><li>What are the show commands and what do they do? </li></ul><ul><li>DR and BDR election process </li></ul><ul><li>Setup default route </li></ul><ul><li>Setup authentication </li></ul>

×