Sunday, September 2, 2012

OSPF Theory

Intro:

Why Link State?
  1. Drawbacks of Distance Vector Protocols:
    1. Slow convergence
    2. Send full routing table, at a regularly scheduled interval
  2. Not typically used on WAN’s due to this.
OSPF:

  1. Link-state protocol
  2. Does not exchange routes and metrics
  3. Exchange the state of their links
  4. OSPF refers metric as cost
  5. LSA- Link State Advertisements arrive from OSPF neighbors
  6. Gives the router a picture of the network
  7. Uses the Shortest Path First (SPF) algorithm (or Dijkstra)
  8. OSPF is a Link State Protocol
  9. OSPF routers do no need to form adjacencies with every other router; instead, OSPF networks elect a designated router and a backup designated router.
  10. If the DR fails, the BDR takes over as the DR and a new election is held.
  11. The value to elect the DR and BDR is the OSPF interface priority. (By default this is 1)
  12. Setting his value to 0 will prevent it from becoming a DR or BDR
  13. OSPF network statements use wildcard masks (REQUIRED in OSPF)
  14. Hello timer – defines how often Hello packets are sent
  15. Dead timer – how long OSPF will wait for Hello packets (40s Ethernet, 120s Non-broadcast links) (The dead time is 4x the Hello time, and OSPF will adjust this dynamically)
Process:

  1. Neighbor adjacencies must be formed
  2. OSPF Hello packets are sent to allow neighbors to dynamically discover each other
  3. OSPF Hello packets allow the neighbors to remind each other that they are still there (keep alive)
  4. Default Hello packet broadcast is 10 seconds on a broadcast segment such as Ethernet, and 30 seconds on non-broadcast links such as serial connections
  5. Hellos have a destination IP of 224.0.0.5 (reserved class D “multicast” range)
  6. Getting Hellos does no guarantee a neighbor relationship
  7. Link State Update (LSU) contains multiple Link State Advertisements
  8. Designated router (DR) and backup designated router (BDR) are elected
  9. The designated router is the router that will receive the LSAs from other routers in the area, and flood the LSA indicating he network change to all non-DR and non-BDR

Commands


  1. Debug ip ospf adjacency
  2. Show ip ospf neighbor
  3. Router ospf <area #>
  4. Network <network #> <wildcard mask>
  5. Show ip ospf interface <cr or int name>
  6. Ip ospf hello-interval (allows you to change the hello interval timer, in seconds).
Stages of OSPF Adjacencies

  1. DOWN– No Hellos from neighbors
  2. ATTEMPT – Unicast hello packets are sent to the neighbor (you will only see these in NBMA networks)
  3. INIT – First Hello packet has been received from neighbor
  4. 2-WAY Communication – each router has received a Hello packet containing its own Router ID Number
  5. EXSTART – Following DR/BRD election, the exchange of link state database information can begin. Router with the highest OSPF RID # will begin the exchange and increment the initial sequence number
  6. EXCHANGE – Database descriptor packets (DBD) are exchanged; these packets contain a description of the link state database
  7. LOADING – Routers now send Link State Request (LSR) packets to their potential neighbor
  8. FULL – Router databases are synchronized and the adjacency has been formed.
Loop Prevention

  1. OSPF does not rely on distance vector loop prevention methods such as split horizon or poison reverse. Those would not work with link-state because they are not exchanging routes.
  2. The OSPF Algorithm recalculates so quick that routing looks literally have no time to form.

No comments:

Post a Comment