Tuesday, August 6, 2013

Yet more OSPF

Picking up where we left off yesterday...

The router ID is determined by selecting the highest IP address of a loopback interface on the router, and if no loopback interface is defined, OSPF selects the highest IP address on a physical interface.  The loopback, or virtual interface is used because it can not go down due to L1 issues and will always be in an up/up state unless the router is not functioning correctly or powered off - in which case it won't participate in the OSPF process anyway...

OSPF may operate in one of three topologies, affecting the dead timers, hello packets and bandwidth conservation.  The topolgies are:

  1. Broadcast, Multi-Access - several devices on a shared medium (such as ethernet).  Hello is sent every 10 seconds, dead-timer is 40 seconds
  2. Non-Broadcast Multi-Access - several devices sharing medium, but clients are not privy to each others' broadcast and multicast traffic.  Frame Relay is an example, and hello packets are sent every 30 seconds, with dead timers being every 120 seconds.  NOTE:  Dead timers are 4 times the hello by default.
  3. Point-to-point - only two devices share the medium, so there is no need to update hello and dead timers as often.  Consider an ISP connection or WAN link using a /30 subnet mask.
Designated Router and Backup Designated Router (DR/BDR) is an OSPF function designed to minimize multicast traffic on BMA and NBMA networks (there is no need for updates on point-to-point networks because there are only two devices).  When a link state changes on one interface, OSPF will send an LSU to all its neighbors.  In a broadcast multi access topology with several routers, each router will get an update, then send updates to all its neighbors.  Once those routers get the LSU, they send updates - this floods the network with updates that all these routers likely have anyhow.

To deter multicast storms, a DR and BDR are elected using first the router with the highest priority, which is an arbitrarily- assigned number with a default of 1, and if there is a tie the highest router ID. When there is a link state change, the DR and BDR are notified, and they update the other routers in the area.  If a router is assigned a priority of 0, it is ineligible for DR/BDR election.  In practice, however, the first router in an area to come online becomes the DR and the second becomes the BDR.  To change the DR/BDR election results, the preferred router must be brought online and the existing DR/BDR rebooted.  (NOTE:  In my humble opinion, that defeats the purpose of an "election.") 

This information is multicast to two different IP addresses.  The DR/BDR listen for LSUs on 224.0.0.6, then multicast to the remaining routers on 224.0.0.5.

OSPF initialization takes place by the following steps:
  1. A router comes online and sends a hello packet out all interfaces participating in the OSPF process.  The hello packet contains the router ID, hello/dead intervals, authentication password and area as well as DR and BDR addresses, as well as known neighbors and stub flags.
  2. Any router that receives the hello packet checks its configuration to make sure the area, password, hello/dead intervals and stub flags match  exactly (if one of these parameters is different, the router will not form an adjacency).  If the criteria is all identical, it will add that router to its topology table and respond with a hello and its information
  3. Once the first router receives a hello from the second, it adds the second to its topology table along with its neighbors
  4. Once all neighbor information is accumulated, the OSPF process runs the Dijkstra algorithm on its topology table to determine the shortest paths to the discovered networks
  5. If the topology has a DR elected, it queries the DR for the topology table and enters it into its own
It is best practice to configure a loopback interface on all routers participating in the OSPF autonomous system to use as the router ID.  Because this IP address connects to noghing and is simply used as an identifier, it is customary practice to assign a host mask, or 255.255.255.255 (/32).


No comments:

Post a Comment